/* ==========================================================================
   Klaw Link-in-Bio — Front-end Styles
   < 15KB target | Mobile-first | Theme-inherited
   ========================================================================== */

/* --- Reset & Base --- */
.klaw-bio-body {
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.klaw-bio-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

/* --- Action Bar (Subscribe + Share) --- */
.klaw-bio-action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.klaw-bio-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(128, 128, 128, 0.15);
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}

.klaw-bio-action-btn:hover {
    background: rgba(128, 128, 128, 0.3);
}

.klaw-bio-action-btn svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* --- Modal Base --- */
.klaw-bio-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.klaw-bio-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.klaw-bio-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 420px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    color: #222;
}

.klaw-bio-modal-content h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.klaw-bio-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 4px;
}

.klaw-bio-modal-close:hover {
    color: #000;
}

/* --- Subscribe Modal --- */
#klaw-bio-subscribe-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

#klaw-bio-subscribe-email {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

.klaw-bio-subscribe-submit {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #222;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    white-space: nowrap;
}

.klaw-bio-subscribe-submit:hover {
    background: #444;
}

.klaw-bio-subscribe-success {
    color: #16a34a;
    margin-top: 10px;
    font-size: 0.9rem;
}

.klaw-bio-subscribe-error {
    color: #dc2626;
    margin-top: 10px;
    font-size: 0.9rem;
}

/* Subscribe alignment */
.klaw-bio-subscribe-left { text-align: left; }
.klaw-bio-subscribe-center { text-align: center; }
.klaw-bio-subscribe-right { text-align: right; }

.klaw-bio-subscribe-center #klaw-bio-subscribe-form {
    justify-content: center;
}

.klaw-bio-subscribe-right #klaw-bio-subscribe-form {
    justify-content: flex-end;
}

/* --- Share Modal --- */
.klaw-bio-share-card {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin: 12px 0 16px;
}

.klaw-bio-share-card-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
}

.klaw-bio-share-card-logo {
    max-width: 200px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.klaw-bio-share-card strong {
    display: block;
    font-size: 1rem;
}

.klaw-bio-share-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 4px 0;
}

.klaw-bio-share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border: none;
    border-radius: 12px;
    background: #f0f0f0;
    color: #222;
    text-decoration: none;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.2s;
}

.klaw-bio-share-btn:hover {
    background: #e0e0e0;
}

.klaw-bio-share-btn svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* --- Profile Header --- */
.klaw-bio-header {
    text-align: center;
    margin-bottom: 24px;
}

.klaw-bio-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
}

.klaw-bio-logo {
    display: block;
    max-width: 240px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto 12px;
}

.klaw-bio-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.2;
}

.klaw-bio-bio {
    font-size: 0.95rem;
    opacity: 0.8;
    margin: 0 0 16px;
    line-height: 1.5;
}

/* --- Social Icons --- */
.klaw-bio-socials {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}

.klaw-bio-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--klaw-bio-social-color, inherit);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.klaw-bio-social-icon:hover {
    opacity: 1;
}

.klaw-bio-social-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* --- Link Buttons --- */
.klaw-bio-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.klaw-bio-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border: 2px solid var(--klaw-bio-link-text, currentColor);
    border-radius: var(--klaw-bio-btn-radius, 8px);
    background: var(--klaw-bio-link-bg, transparent);
    color: var(--klaw-bio-link-text, inherit);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    box-sizing: border-box;
    min-height: 48px;
}

.klaw-bio-link-btn:hover {
    background: var(--klaw-bio-link-hover-bg, var(--klaw-bio-accent, currentColor));
    color: var(--klaw-bio-bg, #fff);
    border-color: var(--klaw-bio-link-hover-bg, var(--klaw-bio-accent, currentColor));
}

.klaw-bio-link-featured {
    background: var(--klaw-bio-accent, currentColor);
    color: var(--klaw-bio-bg, #fff);
    border-color: var(--klaw-bio-accent, currentColor);
}

.klaw-bio-link-featured:hover {
    opacity: 0.9;
}

.klaw-bio-link-icon {
    font-size: 1.2em;
}

/* --- Timeline Sections --- */
.klaw-bio-timeline-section {
    margin-bottom: 20px;
}

.klaw-bio-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 8px;
    padding: 4px 0;
    position: sticky;
    top: 0;
    background: var(--klaw-bio-bg, #fff);
    z-index: 5;
}

/* --- Thumbnail Grid --- */
.klaw-bio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--klaw-bio-gap, 4px);
}

.klaw-bio-tile {
    position: relative;
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    background: #f0f0f0;
}

.klaw-bio-tile-upcoming {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 2;
}

.klaw-bio-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.klaw-bio-tile:hover img {
    transform: scale(1.05);
}

/* Hover overlay */
.klaw-bio-tile-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 12px 8px 8px;
    background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.6));
    opacity: 0;
    transition: opacity 0.2s;
}

.klaw-bio-tile:hover .klaw-bio-tile-overlay {
    opacity: 1;
}

.klaw-bio-tile-title {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* --- Loader / Spinner --- */
.klaw-bio-sentinel {
    height: 1px;
}

.klaw-bio-loader {
    display: flex;
    justify-content: center;
    padding: 24px;
}

.klaw-bio-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(128, 128, 128, 0.2);
    border-top-color: var(--klaw-bio-accent, #666);
    border-radius: 50%;
    animation: klaw-bio-spin 0.8s linear infinite;
}

@keyframes klaw-bio-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Responsive — Mobile (< 480px)
   ========================================================================== */
@media (max-width: 480px) {
    .klaw-bio-container {
        padding: 16px 12px 60px;
    }

    .klaw-bio-name {
        font-size: 1.25rem;
    }

    .klaw-bio-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .klaw-bio-tile img {
        width: 125px;
        height: 125px;
    }

    .klaw-bio-link-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    /* Subscribe form stacks vertically on mobile */
    #klaw-bio-subscribe-form {
        flex-direction: column;
    }

    .klaw-bio-subscribe-submit {
        width: 100%;
    }
}

/* Tablets */
@media (min-width: 481px) and (max-width: 768px) {
    .klaw-bio-container {
        padding: 20px 16px 60px;
    }
}
