/* ── Sources & Documentation — citation badges ────────────────────────────
   Paste into Simple Custom CSS and JS → Add CSS.
   Matches the existing gw-section pattern used throughout hook reference pages.
────────────────────────────────────────────────────────────────────────── */

/* Section wrapper — inherits gw-section spacing, adds a subtle left accent */
.gw-section--citations {
    border-left: 3px solid #c8a84b;
    padding-left: 18px;
}

.gw-section--citations .gw-section-title {
    color: #c8a84b;
    font-size: 1rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

/* Citation list — no bullets, tight spacing */
.gw-citations-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Individual citation row */
.gw-citation-item {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 6px;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* The linked title + icon + year + page ref cluster */
.gw-citation-link {
    display: inline-flex;
    align-items: center;
    gap: 0;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed rgba(200, 168, 75, 0.4);
    transition: border-color 0.15s, color 0.15s;
}

.gw-citation-link:hover {
    color: #c8a84b;
    border-bottom-color: #c8a84b;
    text-decoration: none;
}

/* Title text within the link */
.gw-citation-title {
    font-weight: 600;
}

/* Year in parentheses — slightly muted */
.gw-citation-year {
    font-weight: 400;
    opacity: 0.75;
    margin-left: 2px;
}

/* Page reference — em-dash separated */
.gw-citation-page {
    font-size: 0.8125rem;
    opacity: 0.7;
    white-space: nowrap;
}

/* Optional inline notes beneath the link */
.gw-citation-notes {
    display: block;
    width: 100%;
    font-size: 0.8125rem;
    opacity: 0.65;
    font-style: italic;
    padding-left: 20px; /* indent under the icon */
    margin-top: 2px;
}

/* SVG icons inside .gw-citation-link inherit current color */
.gw-citation-link svg {
    color: #c8a84b;
    flex-shrink: 0;
}

/* Confidence notation badges sit inline after the page ref */
.gw-citation-item .cn {
    font-size: 0.6875rem;
    vertical-align: middle;
    margin-left: 2px;
}

/* External link chevron icon */
.gw-citation-link > svg:last-child {
    opacity: 0.5;
    margin-left: 3px;
}

/* Responsive — on narrow viewports stack naturally */
@media (max-width: 600px) {
    .gw-citation-item {
        font-size: 0.8125rem;
    }
    .gw-section--citations {
        padding-left: 12px;
    }
}

/* The consolidated template stylesheet uses !important on generic section
   titles. Preserve the supplied citation section's compact gold heading. */
.gw-entry .gw-section.gw-section--citations .gw-section-title {
    color: #c8a84b !important;
    font-size: 1rem !important;
    letter-spacing: .04em !important;
    text-transform: uppercase !important;
    margin-bottom: 14px !important;
}

/* ── Catalog page images ───────────────────────────────────────────────────── */

/* Image strip — sits below the citation link on its own line */
.gw-citation-images {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
    padding-left: 20px; /* align under the icon */
}

/* Thumbnail button — no native button chrome */
.gw-citation-thumb-btn {
    background: none;
    border: 2px solid rgba(200, 168, 75, 0.3);
    border-radius: 3px;
    padding: 2px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
    flex-shrink: 0;
}

.gw-citation-thumb-btn:hover {
    border-color: #c8a84b;
    transform: scale(1.04);
}

/* Thumbnail image */
.gw-citation-thumb {
    display: block;
    height: 64px;
    width: auto;
    max-width: 120px;
    object-fit: cover;
    border-radius: 1px;
    vertical-align: middle;
}

/* "View catalog page" text link beside thumbnails */
.gw-citation-view-page {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    color: #c8a84b;
    text-decoration: none;
    opacity: 0.8;
    white-space: nowrap;
    border-bottom: 1px dashed rgba(200, 168, 75, 0.4);
    transition: opacity 0.15s;
}

.gw-citation-view-page:hover {
    opacity: 1;
    border-bottom-color: #c8a84b;
}

/* ── Lightbox ──────────────────────────────────────────────────────────────── */

/* Full-screen overlay */
.gw-citation-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Semi-transparent backdrop */
.gw-citation-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    cursor: pointer;
}

/* Panel — sits above the backdrop */
.gw-citation-lightbox__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    max-width: min(92vw, 1100px);
    max-height: 92vh;
    background: #18181c;
    border: 1px solid rgba(200, 168, 75, 0.25);
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

/* Header bar — title + close */
.gw-citation-lightbox__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.gw-citation-lightbox__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #c8a84b;
    letter-spacing: 0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 40px);
}

.gw-citation-lightbox__close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.375rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 0 12px;
    flex-shrink: 0;
    transition: color 0.15s;
}

.gw-citation-lightbox__close:hover {
    color: #fff;
}

/* Image area — fills available space, image scales to fit */
.gw-citation-lightbox__img-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 200px;
    padding: 12px 56px; /* room for prev/next buttons */
}

.gw-citation-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 100px);
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

/* Previous / Next navigation buttons */
.gw-citation-lightbox__prev,
.gw-citation-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    width: 40px;
    height: 52px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    padding: 0;
}

.gw-citation-lightbox__prev { left: 8px; }
.gw-citation-lightbox__next { right: 8px; }

.gw-citation-lightbox__prev:hover,
.gw-citation-lightbox__next:hover {
    background: rgba(200, 168, 75, 0.25);
    border-color: rgba(200, 168, 75, 0.5);
}

/* Image counter — "1 / 3" */
.gw-citation-lightbox__counter {
    text-align: center;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.45);
    padding: 6px 0 10px;
    flex-shrink: 0;
    letter-spacing: 0.04em;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .gw-citation-lightbox__img-wrap {
        padding: 8px 44px;
    }

    .gw-citation-lightbox__prev { left: 4px; }
    .gw-citation-lightbox__next { right: 4px; }

    .gw-citation-thumb {
        height: 48px;
    }
}

/* ── Resources index ([hook_resources] shortcode + manufacturer page) ──────────
   Covers both the [hook_resources] shortcode page and the "Catalog archive"
   section on manufacturer index pages (.gw-mfr-resources-section).
────────────────────────────────────────────────────────────────────────────── */

/* Top-level index wrapper */
.gw-resources-index {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* ── Type sections (Catalogs / Websites / References / Articles) ── */

.gw-resources-section {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.gw-resources-section-title {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #c8a84b;
    border-bottom: 2px solid rgba(200, 168, 75, 0.25);
    padding-bottom: 8px;
    margin: 0 0 4px;
}

/* ── Manufacturer sub-groups (inside the Catalogs section) ── */

.gw-resources-mfr-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gw-resources-mfr-heading {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: inherit;
}

/* ── Resource list and items ── */

.gw-resources-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gw-resources-item {
    border-left: 2px solid rgba(200, 168, 75, 0.2);
    padding: 10px 0 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.15s;
}

.gw-resources-item:hover {
    border-left-color: #c8a84b;
}

/* Header row: title link + self-hosted badge */
.gw-resources-item-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

/* Title — the external link */
.gw-resources-item-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed rgba(200, 168, 75, 0.4);
    transition: color 0.15s, border-color 0.15s;
    line-height: 1.4;
}

.gw-resources-item-title:hover {
    color: #c8a84b;
    border-bottom-color: #c8a84b;
    text-decoration: none;
}

/* Meta line: year · N pages · N hooks cited */
.gw-resources-item-meta {
    font-size: 0.75rem;
    opacity: 0.6;
    letter-spacing: 0.01em;
}

/* Public description */
.gw-resources-item-desc {
    font-size: 0.8125rem;
    opacity: 0.75;
    line-height: 1.55;
    max-width: 68ch;
}

/* ── Self-hosted badge ── */

.gw-resources-badge {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    vertical-align: middle;
    flex-shrink: 0;
}

.gw-resources-badge--hosted {
    background: rgba(100, 200, 140, 0.15);
    color: #5ab87a;
    border: 1px solid rgba(100, 200, 140, 0.3);
}

/* ── Catalog page list ── */

.gw-resources-pages-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.gw-resources-page-item {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.75;
}

.gw-resources-page-label {
    font-weight: 600;
}

/* Camera emoji indicator — pages with FileBird photographs */
.gw-resources-page-img-dot {
    font-size: 0.6875rem;
    opacity: 0.9;
    cursor: default;
}

/* Hook citation count beside each page */
.gw-resources-page-citations {
    opacity: 0.65;
    font-size: 0.6875rem;
}

/* ── Manufacturer page surface (.gw-mfr-resources-section) ── */

/* Matches the existing .gw-mfr-history-section / .gw-mfr-cat-section pattern */
.gw-mfr-resources-section {
    margin-top: 28px;
}

/* Reuse the existing section label style from the manufacturer template */
.gw-mfr-resources-section .gw-mfr-section-label {
    /* inherited — no overrides needed, already styled globally */
}

/* Slightly tighter items on the manufacturer page (less vertical space) */
.gw-mfr-resources-section .gw-resources-item {
    padding-top: 8px;
    padding-bottom: 8px;
}

/* ── Responsive ── */

@media (max-width: 600px) {
    .gw-resources-section-title {
        font-size: 0.9375rem;
    }

    .gw-resources-item-title {
        font-size: 0.875rem;
    }

    .gw-resources-pages-list {
        gap: 5px 10px;
    }

    .gw-resources-index {
        gap: 36px;
    }
}
