/* com_gmstudio v1.3.0 — Biographie Django Reinhardt (Ébène & Ambre / Papier Crème) */

.gm-bio-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: var(--gm-surface);
    border: 1px solid var(--gm-border);
    border-radius: var(--gm-radius);
    padding: 22px 26px;
    margin-bottom: 14px;
    box-shadow: var(--gm-shadow);
}
.gm-bio-edition {
    font-size: 0.86rem;
    color: var(--gm-text-muted);
    margin-bottom: 10px;
}
.gm-bio-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.gm-bio-hero-portrait {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--gm-border-strong);
}
.gm-bio-hero-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    filter: grayscale(85%) contrast(1.06);
}

/* Chapter navigation ribbon */
.gm-bio-chapters-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.gm-bio-ch-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: var(--gm-radius-sm);
    background: var(--gm-surface);
    border: 1px solid var(--gm-border);
    color: var(--gm-text);
    text-decoration: none;
    font-size: 0.8rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.gm-bio-ch-pill:hover {
    border-color: var(--gm-accent);
    color: var(--gm-text);
    text-decoration: none;
}
.gm-bio-ch-pill.is-active {
    background: var(--gm-accent);
    border-color: var(--gm-accent);
    color: var(--gm-accent-ink) !important;
}
.gm-bio-ch-num {
    font-weight: 700;
    font-family: Georgia, serif;
}
.gm-bio-ch-per {
    opacity: 0.85;
    font-size: 0.74rem;
}

/* Reading toolbar */
.gm-bio-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
    margin-bottom: 16px;
    background: var(--gm-surface);
    border: 1px solid var(--gm-border);
    border-radius: var(--gm-radius-sm);
    font-size: 0.85rem;
}
.gm-bio-ref-modes {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.gm-bio-ref-label {
    font-size: 0.78rem;
    color: var(--gm-text-muted);
    margin-right: 2px;
}

/* 2-column reading layout */
.gm-bio-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}
.gm-bio-layout-single {
    grid-template-columns: minmax(0, 1fr);
}
.gm-bio-sidebar {
    position: sticky;
    top: 18px;
}
.gm-bio-toc-box {
    background: var(--gm-surface);
    border: 1px solid var(--gm-border);
    border-radius: var(--gm-radius);
    padding: 14px 14px 10px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.gm-bio-toc-title {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gm-accent);
    font-weight: 700;
    margin-bottom: 10px;
}
.gm-bio-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.gm-bio-toc-list li {
    margin: 0 0 4px;
}
.gm-bio-toc-list a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--gm-text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.gm-bio-toc-list a:hover,
.gm-bio-toc-list a.is-current {
    color: var(--gm-text);
    background: var(--gm-surface-2);
    border-left-color: var(--gm-accent);
    text-decoration: none;
}
.gm-bio-toc-cam {
    font-size: 0.72rem;
    opacity: 0.8;
    flex-shrink: 0;
}

/* Main article typography */
.gm-bio-article {
    background: var(--gm-surface);
    border: 1px solid var(--gm-border);
    border-radius: var(--gm-radius);
    padding: 28px 34px;
    box-shadow: var(--gm-shadow);
    min-width: 0;
}
.gm-bio-article-head {
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--gm-border);
}
.gm-bio-ch-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.68rem;
    line-height: 1.25;
    margin: 4px 0 0;
    color: var(--gm-text);
}
.gm-bio-lead {
    margin: 14px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.08rem;
    line-height: 1.65;
    color: var(--gm-text-muted);
    font-style: italic;
}
.gm-bio-body {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.03rem;
    line-height: 1.78;
    color: var(--gm-text);
}
.gm-bio-h3 {
    clear: both;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.28rem;
    line-height: 1.32;
    color: var(--gm-accent);
    margin: 30px 0 14px;
    padding-top: 14px;
    border-top: 1px solid var(--gm-border);
    scroll-margin-top: 24px;
}
.gm-bio-body > .gm-bio-h3:first-child {
    margin-top: 4px;
    padding-top: 0;
    border-top: none;
}
.gm-bio-para-wrap {
    margin-bottom: 16px;
}
.gm-bio-para-wrap p {
    margin: 0 0 6px;
    text-align: left;
}
.gm-bio-para-wrap a {
    color: var(--gm-accent);
}

/* Collapsible scholarly sources & archives */
.gm-bio-refs {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--gm-text-muted);
    margin: 4px 0 8px;
}
.gm-bio-refs summary {
    display: inline-block;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--gm-border);
    background: var(--gm-surface-2);
    color: var(--gm-text-muted);
    font-size: 0.72rem;
    list-style: none;
    user-select: none;
}
.gm-bio-refs summary::-webkit-details-marker { display: none; }
.gm-bio-refs summary:hover {
    border-color: var(--gm-accent);
    color: var(--gm-text);
}
.gm-bio-refs[open] summary {
    border-color: var(--gm-accent);
    color: var(--gm-accent);
    margin-bottom: 6px;
}
.gm-bio-refs-body {
    padding: 8px 12px;
    border-left: 2px solid var(--gm-accent);
    background: var(--gm-surface-2);
    border-radius: 0 6px 6px 0;
}
.gm-bio-refs-body a {
    color: var(--gm-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.gm-bio-page.gm-bio-hide-refs .gm-bio-refs {
    display: none;
}

/* Editorial anchored figures */
.gm-bio-fig {
    margin: 6px 0 18px;
    background: var(--gm-surface-2);
    border: 1px solid var(--gm-border-strong);
    border-radius: 10px;
    overflow: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.gm-bio-fig-right {
    float: right;
    width: 280px;
    max-width: 44%;
    margin: 4px 0 16px 22px;
}
.gm-bio-fig-left {
    float: left;
    width: 280px;
    max-width: 44%;
    margin: 4px 22px 16px 0;
}
.gm-bio-fig-wide {
    clear: both;
    width: 100%;
    max-width: 680px;
    margin: 14px auto 22px;
}
.gm-bio-fig-btn {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: #111;
    cursor: zoom-in;
    overflow: hidden;
}
.gm-bio-fig-btn img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 440px;
    object-fit: contain;
    background: #141210;
    filter: grayscale(30%) sepia(8%) contrast(1.03);
    transition: transform 0.25s ease, filter 0.25s ease;
}
.gm-bio-sec-clear {
    clear: both;
    height: 1px;
}
.gm-bio-inline-strip {
    clear: both;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 16px 0 22px;
}
.gm-bio-inline-strip .gm-bio-fig {
    float: none !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
}
.gm-bio-inline-strip .gm-bio-fig-btn {
    background: #141210;
    height: 225px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gm-bio-inline-strip .gm-bio-fig-btn img {
    max-height: 225px;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.gm-bio-fig-btn:hover img {
    transform: scale(1.02);
    filter: grayscale(0%) sepia(0%) contrast(1.05);
}
.gm-bio-zoom-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(15, 13, 11, 0.78);
    color: #f4d38c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border: 1px solid rgba(244, 211, 140, 0.45);
}
.gm-bio-fig figcaption {
    padding: 10px 12px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--gm-text);
}
.gm-bio-fig-head {
    margin-bottom: 4px;
}
.gm-bio-fig-year {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--gm-accent);
    color: var(--gm-accent-ink);
    font-size: 0.68rem;
    font-weight: 700;
    vertical-align: middle;
}
.gm-bio-fig-cap {
    margin: 0 0 4px;
    color: var(--gm-text-muted);
}
.gm-bio-fig-credit {
    font-size: 0.7rem;
    color: var(--gm-text-muted);
    opacity: 0.85;
    font-style: italic;
}

/* Gallery grid */
.gm-bio-gallery-section {
    clear: both;
    margin-top: 28px;
}
.gm-bio-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}
.gm-bio-gallery-grid .gm-bio-fig {
    float: none;
    width: auto;
    max-width: none;
    margin: 0;
}

/* Markdown bibliography tables */
.gm-bio-table-wrap {
    overflow-x: auto;
    margin: 18px 0;
}
.gm-bio-table {
    width: 100%;
    border-collapse: collapse;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.86rem;
}
.gm-bio-table th,
.gm-bio-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gm-border);
    text-align: left;
    vertical-align: top;
}
.gm-bio-table th {
    background: var(--gm-surface-2);
    color: var(--gm-accent);
    font-weight: 700;
}
.gm-bio-table td:first-child {
    white-space: nowrap;
    font-weight: 700;
    color: var(--gm-accent);
}

/* Catalog bridge */
.gm-bio-catalog-bridge {
    clear: both;
    margin-top: 32px;
    padding: 18px 20px;
    background: var(--gm-surface-2);
    border: 1px solid var(--gm-border-strong);
    border-radius: var(--gm-radius);
}
.gm-bio-bridge-title {
    font-family: Georgia, serif;
    font-size: 1.15rem;
    margin: 4px 0 12px;
}
.gm-bio-bridge-group {
    margin-bottom: 12px;
}
.gm-bio-bridge-group:last-child {
    margin-bottom: 0;
}
.gm-bio-bridge-sub {
    font-size: 0.78rem;
    color: var(--gm-text-muted);
    margin-bottom: 7px;
    font-weight: 600;
}
.gm-bio-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.gm-bio-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--gm-border-strong);
    background: var(--gm-surface);
    color: var(--gm-text);
    font-size: 0.78rem;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.gm-bio-chip:hover {
    border-color: var(--gm-accent);
    color: var(--gm-accent);
    text-decoration: none;
}
.gm-bio-chip-work {
    border-color: rgba(212, 162, 76, 0.45);
}

/* Prev / Next chapter pager */
.gm-bio-pager {
    clear: both;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--gm-border);
}
.gm-bio-pager-btn {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 16px;
    border-radius: var(--gm-radius-sm);
    background: var(--gm-surface-2);
    border: 1px solid var(--gm-border-strong);
    color: var(--gm-text);
    text-decoration: none;
    transition: border-color 0.15s ease;
}
.gm-bio-pager-btn:hover {
    border-color: var(--gm-accent);
    color: var(--gm-text);
    text-decoration: none;
}
.gm-bio-pager-next {
    text-align: right;
}
.gm-bio-pager-dir {
    font-size: 0.74rem;
    color: var(--gm-accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Lightbox modal */
.gm-bio-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.gm-bio-lightbox[hidden] {
    display: none;
}
.gm-bio-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 7, 6, 0.88);
    backdrop-filter: blur(4px);
}
.gm-bio-lb-dialog {
    position: relative;
    z-index: 2;
    max-width: 960px;
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: #171513;
    border: 1px solid rgba(212, 162, 76, 0.35);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
    color: #f3efe6;
}
.gm-bio-lb-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d0c0b;
    padding: 16px 48px;
    max-height: 68vh;
    overflow: hidden;
}
.gm-bio-lb-img-wrap img {
    max-width: 100%;
    max-height: 64vh;
    object-fit: contain;
    border-radius: 4px;
}
.gm-bio-lb-meta {
    padding: 14px 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.gm-bio-lb-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.gm-bio-lb-count {
    margin-left: auto;
    font-size: 0.78rem;
    color: #b7ae9e;
}
.gm-bio-lb-cap {
    margin: 0 0 4px;
    font-size: 0.88rem;
    color: #e4ddd0;
    line-height: 1.5;
}
.gm-bio-lb-credit {
    font-size: 0.75rem;
    color: #a99f8d;
    font-style: italic;
}
.gm-bio-lb-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(20, 18, 16, 0.82);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}
.gm-bio-lb-nav {
    position: absolute;
    top: 38%;
    z-index: 5;
    width: 38px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(20, 18, 16, 0.75);
    color: #f4d38c;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}
.gm-bio-lb-prev { left: 10px; }
.gm-bio-lb-next { right: 10px; }

@media (max-width: 960px) {
    .gm-bio-layout {
        grid-template-columns: 1fr;
    }
    .gm-bio-sidebar {
        position: static;
    }
    .gm-bio-toc-box {
        max-height: 220px;
    }
    .gm-bio-article {
        padding: 20px 18px;
    }
}
@media (max-width: 640px) {
    .gm-bio-hero {
        flex-direction: column;
        align-items: flex-start;
    }
    .gm-bio-fig-right,
    .gm-bio-fig-left {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 10px 0 18px;
    }
    .gm-bio-pager {
        grid-template-columns: 1fr;
    }
}


/* Archives photo gallery tab (v1.3.2) */
.gm-bio-arch-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 14px;
    background: var(--gm-surface-2);
    border: 1px solid var(--gm-border);
    border-radius: var(--gm-radius-sm);
}
.gm-bio-arch-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.gm-bio-arch-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 260px;
    justify-content: flex-end;
}
.gm-bio-arch-search {
    max-width: 300px;
    padding: 6px 10px;
    font-size: 0.84rem;
}
.gm-bio-arch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
    gap: 14px;
}
.gm-bio-arch-card {
    float: none;
    width: auto;
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.gm-bio-arch-card[hidden] {
    display: none !important;
}
.gm-bio-arch-card .gm-bio-fig-btn img {
    height: 195px;
    object-fit: cover;
    object-position: center 22%;
}
.gm-bio-arch-chlink {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--gm-accent);
    text-decoration: none;
}
.gm-bio-arch-chlink:hover {
    text-decoration: underline;
}
.gm-bio-arch-more-wrap {
    text-align: center;
    margin-top: 22px;
}
