/* ═════════════════════════════════════════════════════════════════
   TDN MAGAZINE v3.4.0 — ARTICLE UPGRADE LAYER
   Author box (E-E-A-T) + native <dialog> image lightbox.
   Loaded on single posts and pages only.

   All surfaces, text, and borders use semantic tokens so dark mode
   works with zero extra rules. Accents use existing brand tokens.
   ═════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────
   1. AUTHOR BOX
   ───────────────────────────────────────────────────────── */

.tdn-author-box {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin: 2.25rem 0;
    padding: 1.35rem 1.5rem;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border, rgba(12, 12, 12, .1));
    border-left: 4px solid var(--tdn-red);
    border-radius: var(--radius-lg, 14px);
}

.tdn-author-box__avatar {
    flex: 0 0 auto;
}

.tdn-author-box__img {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px var(--color-surface), 0 0 0 5px var(--tdn-gold);
}

.tdn-author-box__body {
    min-width: 0;
}

.tdn-author-box__eyebrow {
    display: block;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--tdn-gold);
    margin-bottom: .15rem;
}

.tdn-author-box__name {
    margin: 0 0 .4rem;
    font-size: 1.15rem;
    line-height: 1.25;
}

.tdn-author-box__name a {
    color: var(--color-fg);
    text-decoration: none;
}

.tdn-author-box__name a:hover {
    color: var(--tdn-red);
}

.tdn-author-box__bio {
    margin: 0 0 .65rem;
    font-size: .92rem;
    line-height: 1.55;
    color: var(--color-fg-muted, #5a5a5a);
}

.tdn-author-box__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    font-size: .82rem;
}

.tdn-author-box__archive {
    font-weight: 700;
    color: var(--tdn-red);
    text-decoration: none;
}

.tdn-author-box__archive:hover {
    text-decoration: underline;
}

.tdn-author-box__social {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.tdn-author-box__social-link {
    display: inline-block;
    padding: .2rem .6rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--color-fg);
    background: var(--color-surface);
    border: 1px solid var(--color-border, rgba(12, 12, 12, .12));
    border-radius: var(--radius-full, 999px);
    text-decoration: none;
    transition: border-color var(--dur-fast, .15s) var(--ease-out, ease),
                color var(--dur-fast, .15s) var(--ease-out, ease);
}

.tdn-author-box__social-link:hover {
    border-color: var(--tdn-red);
    color: var(--tdn-red);
}

@media (max-width: 540px) {
    .tdn-author-box {
        flex-direction: column;
        gap: 12px;
    }
}

/* ─────────────────────────────────────────────────────────
   2. IMAGE LIGHTBOX (native <dialog>)
   ───────────────────────────────────────────────────────── */

/* Zoom affordance on lightbox-enabled images */
.tdn-lightboxable {
    cursor: zoom-in;
}

.tdn-lightbox {
    padding: 0;
    border: 0;
    background: transparent;
    max-width: min(94vw, 1400px);
    max-height: 92vh;
    overflow: visible;
}

.tdn-lightbox::backdrop {
    background: rgba(12, 12, 12, .88);
    backdrop-filter: blur(6px);
}

.tdn-lightbox__figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
}

.tdn-lightbox__img {
    display: block;
    max-width: 94vw;
    max-height: 84vh;
    width: auto;
    height: auto;
    border-radius: var(--radius-md, 10px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}

.tdn-lightbox__caption {
    max-width: 80ch;
    font-size: .85rem;
    line-height: 1.5;
    color: var(--tdn-white);
    text-align: center;
    opacity: .85;
}

.tdn-lightbox__caption:empty {
    display: none;
}

.tdn-lightbox__close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--tdn-white);
    background: var(--tdn-red);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
    transition: background var(--dur-fast, .15s) var(--ease-out, ease),
                transform var(--dur-fast, .15s) var(--ease-out, ease);
}

.tdn-lightbox__close:hover {
    background: var(--tdn-red-hover);
    transform: scale(1.06);
}

.tdn-lightbox__close:focus-visible {
    outline: 3px solid var(--tdn-gold);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
    .tdn-lightbox[open] {
        animation: tdn-lightbox-in .18s var(--ease-out, ease) both;
    }

    @keyframes tdn-lightbox-in {
        from { opacity: 0; transform: scale(.96); }
        to   { opacity: 1; transform: scale(1); }
    }
}

@media (max-width: 640px) {
    .tdn-lightbox__close {
        top: 8px;
        right: 8px;
    }
}
