/* ==========================================================================
   site.css — STRUCTURAL LAYOUT ONLY
   --------------------------------------------------------------------------
   This file controls *where things sit* (grids, columns, spacing, nav bar,
   footer). All colors/fonts live in themes/*.css via CSS variables.
   Edit this when you want to change page structure or column layouts.
   ========================================================================== */

* { box-sizing: border-box; }

:root {
    --font-display: 'Cormorant Garamond', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
    --font-body: 'Segoe UI', 'Verdana', 'DejaVu Sans', Arial, sans-serif;
    --header-h: 218px;
    --header-img-w: 100%;
    --header-img-fit: cover;
    --header-img-x: 50%;
    --header-img-y: 50%;
    --header-extra-w: min(38%, 430px);
    --header-extra-right: 10px;
    --header-extra-bottom: -24px;
}

html { scrollbar-gutter: stable; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-main);
    background-color: var(--site-bg);
    background-image: var(--site-bg-image);
    background-attachment: var(--site-bg-attachment, fixed);
    word-wrap: break-word;
}

/* Prevent zoom-on-focus on phones while keeping text zoomable */
@supports (-webkit-touch-callout: none) {
    body { -webkit-text-size-adjust: 100%; }
}

img { max-width: 100%; height: auto; }

a { color: var(--link-color); }
a:hover { color: var(--link-hover); }

:focus-visible {
    outline: 2px solid var(--accent-secondary);
    outline-offset: 2px;
}

::selection { background: var(--selection-bg); color: var(--selection-text); }

/* --------------------------------------------------------------------------
   Page shell
   -------------------------------------------------------------------------- */

.site-shell {
    width: min(96vw, 1100px);
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px;
}

.site-header { margin-bottom: 10px; position: relative; }

.banner-extra {
    position: absolute;
    right: var(--extra-right, var(--header-extra-right, -6px));
    bottom: var(--extra-bottom, var(--header-extra-bottom, -48px));
    z-index: 3;
    width: var(--extra-w, var(--header-extra-w, min(46%, 560px)));
    height: auto;
    pointer-events: none;
    user-select: none;
}
.site-footer { margin-top: 16px; }

/* --------------------------------------------------------------------------
   Header banner
   -------------------------------------------------------------------------- */

.banner {
    position: relative;
    overflow: hidden;
    min-height: 180px;
    background: var(--panel-bg);
}

.banner--art {
    min-height: var(--header-h, 230px);
    height: var(--header-h, 230px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-art {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: var(--header-img-w, 100%);
    height: 100%;
    object-fit: var(--header-img-fit, cover);
    object-position: var(--header-img-x, 50%) var(--header-img-y, 50%);
}

.banner--art::after {
    display: none;
}

.site-header .banner:not(.banner--art) {
    min-height: var(--header-h, 120px);
}

.header-tools {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 5px;
}

.theme-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px;
    border: 1px solid var(--border-dim);
    background: var(--panel-bg);
    background: color-mix(in srgb, var(--panel-bg) 82%, transparent);
    backdrop-filter: blur(8px);
}

.theme-switcher__button,
.viewer-settings-button {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--nav-link-color);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
}

.theme-switcher__button:hover,
.theme-switcher__button[aria-pressed="true"],
.viewer-settings-button:hover,
.viewer-settings-button[aria-expanded="true"] {
    color: var(--link-hover);
    border-color: var(--border-light);
    background: var(--nav-link-bg-hover);
}

.viewer-settings-button {
    border: 1px solid var(--border-dim);
    background: var(--panel-bg);
    background: color-mix(in srgb, var(--panel-bg) 82%, transparent);
    backdrop-filter: blur(8px);
}

.viewer-settings-button--footer {
    position: absolute;
    top: 8px;
    right: 8px;
    margin: 0;
    color: var(--link-color);
}

.site-nav {
    display: grid;
    grid-template-columns: repeat(var(--nav-count, 1), minmax(0, 1fr));
    gap: 0;
    width: 100%;
    margin-top: 8px;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
    font-size: 0.94rem;
    line-height: 1.2;
    text-decoration: none;
    color: var(--nav-link-color);
    border: 1px solid var(--border-dim);
    background: var(--panel-bg);
}

.site-nav a:hover {
    color: var(--nav-link-hover);
    border-color: var(--border-light);
    background: var(--nav-link-bg-hover);
}

/* --------------------------------------------------------------------------
   Sidebar link buttons (External Links etc.)
   -------------------------------------------------------------------------- */

.link-buttons { display: grid; gap: 7px; }

.link-button {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    text-decoration: none;
    border: 1px solid var(--border-color);
    background: var(--panel-bg-alt);
    color: var(--text-main);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.link-button:hover {
    border-color: var(--border-light);
    color: var(--text-main);
    background: var(--nav-link-bg-hover);
}

.link-button .lb-icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--accent);
    border: 1px solid var(--border-dim);
    background: var(--panel-bg);
}

.link-button .lb-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.link-button .lb-name { font-size: 0.86rem; line-height: 1.25; }
.link-button .lb-desc { font-size: 0.72rem; color: var(--text-muted); line-height: 1.3; }
.link-button .lb-arrow { flex: 0 0 auto; font-size: 0.75rem; color: var(--accent); opacity: 0; transition: opacity 0.15s ease; }
.link-button:hover .lb-arrow { opacity: 1; }/*--------------------------------------------------------------------------
   Homepage portal grid
   -------------------------------------------------------------------------- */

.portal-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr) 250px;
    gap: 12px;
    align-items: start;
}

.portal-col { display: grid; gap: 12px; min-width: 0; }
.portal-col--left, .portal-col--right { position: sticky; top: 10px; }
.portal-col--center { gap: 12px; }

/* --------------------------------------------------------------------------
   Content sections / panels
   -------------------------------------------------------------------------- */

.panel { margin: 0; min-width: 0; }

.panel-inner { padding: 10px 12px 12px; }

.panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px 6px;
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--panel-header-color);
}

.panel-header .ph-deco { color: var(--accent); font-size: 0.75em; }
.panel-header .ph-icon { font-size: 0.9em; color: var(--accent); }
.panel-header .ph-line { flex: 1; }
.entry-title {
    font-family: var(--font-display);
    color: var(--page-title-color, var(--heading-color));
}

/* Ornamental separator */
.ornament {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    color: var(--accent);
    font-size: 0.7rem;
}
.ornament::before,
.ornament::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--border-dim);
}

/* --------------------------------------------------------------------------
   Generic grids for card-type content
   -------------------------------------------------------------------------- */

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.thumb-grid--small { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); }

.thumb-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border-color);
    padding: 5px;
    background: var(--panel-bg-alt);
}

.thumb-card:hover { border-color: var(--border-light); color: var(--link-hover); }

.thumb-card .tc-img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--panel-bg);
}

.thumb-card .tc-title {
    display: block;
    padding-top: 5px;
    font-size: 0.78rem;
    text-align: center;
    line-height: 1.3;
}

.gallery-page {
    display: block;
}

.gallery-page .portal-col--center,
.gallery-page .panel {
    width: 100%;
}

.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 12px;
}

.gallery-masonry--featured {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
}

.gallery-masonry-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--border-color);
    background: var(--panel-bg-alt);
    overflow: hidden;
}

.cw-protected {
    position: relative;
}

.cw-protected.is-cw-hidden {
    display: none !important;
}

.cw-protected.is-cw-blurred img {
    filter: blur(16px);
    transform: scale(1.02);
}

.cw-protected.is-cw-blurred:not(.is-cw-revealed) {
    overflow: hidden;
}

.cw-protected.is-cw-revealed img {
    filter: none;
    transform: none;
}

.cw-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-height: 100%;
    padding: 12px;
    border: 0;
    background: color-mix(in srgb, var(--panel-bg) 76%, transparent);
    color: var(--text-main);
    text-align: center;
    cursor: pointer;
}

.cw-overlay span {
    font-family: var(--font-display);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.cw-overlay small {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.cw-overlay strong {
    display: inline-flex;
    margin-top: 3px;
    padding: 2px 9px;
    border: 1px solid var(--border-light);
    color: var(--link-color);
    background: var(--panel-bg);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cw-overlay--small span {
    font-size: 0.65rem;
}

.cw-protected.is-cw-blurred:not(.is-cw-revealed) .cw-overlay {
    display: flex;
}

.gallery-masonry-card:hover {
    border-color: var(--border-light);
    color: var(--link-hover);
}

.gallery-lightbox-link {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    min-height: 0;
    color: inherit;
    text-decoration: none;
    cursor: zoom-in;
    background: var(--panel-bg);
    overflow: hidden;
}

.gallery-lightbox-link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lightbox-hidden-trigger {
    display: none !important;
}

.gallery-masonry-title {
    display: block;
    min-height: 28px;
    padding: 5px 7px 6px;
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--text-main);
}

.lightbox-open {
    overflow: hidden;
}

.lightbox-viewer {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
    background: rgba(18, 16, 17, 0.9);
}

.lightbox-viewer[hidden] {
    display: none;
}

.lightbox-stage {
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
    gap: 18px;
    align-items: start;
    width: min(1500px, calc(100vw - 48px));
    max-height: calc(100vh - 78px);
}

.lightbox-media {
    min-width: 0;
    min-height: 0;
    display: grid;
    gap: 10px;
}

.lightbox-stage img {
    justify-self: center;
    max-width: 100%;
    max-height: calc(100vh - 142px);
    width: auto;
    height: auto;
    border: 1px solid var(--border-light);
    background: var(--panel-bg);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.lightbox-description,
.lightbox-details__box {
    border: 1px solid var(--border-light);
    background: var(--panel-bg);
    color: var(--text-main);
}

.lightbox-description {
    padding: 10px 12px;
    max-height: 132px;
    overflow: auto;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.lightbox-description[hidden] {
    display: none;
}

.lightbox-details {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.lightbox-details__box {
    padding: 12px;
}

.lightbox-details__title,
.lightbox-details__heading {
    font-family: var(--font-display);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--panel-header-color);
}

.lightbox-details__title {
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.lightbox-details__heading {
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.lightbox-details__meta {
    margin-top: 12px;
    font-size: 0.9rem;
}

.lightbox-details__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.lightbox-details__alts {
    margin-top: 14px;
}

.lightbox-details__subheading {
    margin-bottom: 6px;
    font-size: 0.74rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.lightbox-alt-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lightbox-alt-button {
    cursor: pointer;
}

.lightbox-alt-button.is-active {
    border-color: var(--border-light);
    color: var(--link-hover);
}

.lightbox-details__nav {
    display: grid;
    gap: 5px;
}

.lightbox-details__nav a {
    display: block;
    padding: 4px 0;
    border-bottom: 1px dotted var(--border-dim);
    text-decoration: none;
}

.lightbox-bar {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) repeat(3, 42px);
    gap: 8px;
    align-items: center;
    width: min(760px, 100%);
    margin: 0 auto;
    color: var(--panel-header-color);
}

.lightbox-title {
    min-width: 0;
    text-align: center;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lightbox-button {
    width: 42px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    background: var(--panel-bg);
    color: var(--link-color);
    cursor: pointer;
    text-decoration: none;
}

.lightbox-button:hover {
    background: var(--nav-link-bg-hover);
    color: var(--link-hover);
}

.lightbox-button:disabled {
    opacity: 0.45;
    cursor: default;
}

.no-image-save img {
    -webkit-user-drag: none;
    user-select: none;
}

.shrine-banner img {
    min-height: 220px;
    max-height: 460px;
    object-fit: cover;
}

.shrine-image-wall {
    column-width: 220px;
    column-gap: 10px;
}

.shrine-image-link {
    break-inside: avoid;
    margin: 0 0 10px;
}

.shrine-image-link img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    background: var(--panel-bg);
}

.adult-gate {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(12, 10, 11, 0.78);
}

.adult-gate[hidden] {
    display: none;
}

.adult-gate__dialog {
    width: min(520px, 100%);
    border: 1px solid var(--border-light);
    background: var(--panel-bg);
    color: var(--text-main);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.adult-gate__body {
    padding: 14px 16px 6px;
}

.adult-gate__button {
    display: block;
    width: calc(100% - 32px);
    margin: 8px 16px 16px;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    background: var(--panel-bg-alt);
    color: var(--link-color);
    cursor: pointer;
}

.adult-gate__button:hover {
    color: var(--link-hover);
    background: var(--nav-link-bg-hover);
}

.viewer-settings {
    position: fixed;
    inset: 0;
    z-index: 1150;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(12, 10, 11, 0.58);
}

.viewer-settings[hidden] {
    display: none;
}

.viewer-settings__dialog {
    width: min(560px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    border: 1px solid var(--border-light);
    background: var(--panel-bg);
    color: var(--text-main);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.viewer-settings__body {
    display: grid;
    gap: 14px;
    padding: 14px 16px 4px;
}

.viewer-settings__group {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
}

.viewer-settings__group legend {
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.viewer-settings__group label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.86rem;
}

.viewer-settings__checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
}

.viewer-settings__actions {
    padding-bottom: 2px;
}

/* 88x31 buttons, stamps, blinkies */
.button-rows {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

.button-rows img { display: block; image-rendering: auto; }

.decorative-asset-rows {
    align-items: center;
}

.decorative-asset-img--stamp,
.decorative-asset-img--badge,
.decorative-asset-img--blinkie {
    max-height: 60px;
    max-width: 100%;
}

.decorative-asset-img--banner {
    height: auto;
    max-width: 100%;
}

.link-directory {
    align-items: center;
}

.link-divider {
    flex: 1 0 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 2px;
    font-family: var(--font-display);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--panel-header-color);
}

.link-divider::before,
.link-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--border-dim);
}

/* Text placeholder when an 88x31 button image hasn't been uploaded yet */
.button-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 31px;
    padding: 0 4px;
    font-size: 0.62rem;
    line-height: 1.2;
    text-align: center;
    color: var(--link-color);
    border: 1px solid var(--border-color);
    background: var(--panel-bg-alt);
    overflow: hidden;
}

a:hover .button-fallback { border-color: var(--border-light); color: var(--link-hover); }

/* --------------------------------------------------------------------------
   Sidebar-specific
   -------------------------------------------------------------------------- */

.profile-box { text-align: center; }

.profile-avatar {
    display: block;
    width: 130px;
    height: 130px;
    margin: 2px auto 0;
    object-fit: cover;
    border: 1px solid var(--border-light);
    padding: 3px;
    background: var(--panel-bg);
}

.profile-avatar[hidden],
[data-theme-profile-fallback][hidden],
[data-theme-profile-image][hidden] {
    display: none !important;
}

/* Fallback avatar (no image set): centered icon inside a square frame */
.profile-avatar--fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--accent);
}

.profile-name { font-family: var(--font-display); letter-spacing: 0.1em; font-size: 1.05rem; margin: 8px 0 2px; }
.profile-pronouns { font-size: 0.75rem; color: var(--text-muted); }

.profile-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    padding: 2px 10px;
    font-size: 0.76rem;
    color: var(--text-muted);
    border: 1px dashed var(--border-dim);
}

.profile-status .fa-circle { font-size: 0.42rem; color: var(--accent); }

.profile-bio { font-size: 0.8rem; margin-bottom: 8px; }

.profile-theme-icon {
    margin-top: 8px;
    color: var(--accent);
    font-size: 1.05rem;
}

.icon-row { display: flex; justify-content: center; gap: 8px; font-size: 0.95rem; color: var(--accent); }

.status-list { list-style: none; margin: 0; padding: 0; font-size: 0.82rem; }
.status-list li { display: flex; gap: 6px; padding: 2px 0; border-bottom: 1px dotted var(--border-dim); }
.status-list li:last-child { border-bottom: 0; }
.status-list .st-label { flex: 0 0 96px; color: var(--text-muted); }
.status-list .st-icon {
    display: inline-block;
    width: 1.1em;
    margin-right: 4px;
    color: var(--accent);
    text-align: center;
}

.journal-meta i,
.detail-meta i,
.jsr-label i,
.link-button .lb-icon {
    display: none;
}

.side-nav { list-style: none; margin: 0; padding: 0; }
.side-nav li { border-bottom: 1px dotted var(--border-dim); }
.side-nav li:last-child { border-bottom: 0; }
.side-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 2px;
    font-size: 0.84rem;
    text-decoration: none;
}
.side-nav a:hover { color: var(--link-hover); background: var(--nav-link-bg-hover); }
.side-nav a::before { content: "✦"; color: var(--accent); font-size: 0.7em; }

.updates-list { list-style: none; margin: 0; padding: 0; font-size: 0.8rem; }
.updates-list li { padding: 4px 0; border-bottom: 1px dotted var(--border-dim); }
.updates-list li:last-child { border-bottom: 0; }
.updates-list .u-date { color: var(--text-muted); font-size: 0.72rem; }

/* --------------------------------------------------------------------------
   Journal entries
   -------------------------------------------------------------------------- */

.journal-entry-header { display: flex; gap: 10px; align-items: flex-start; }

.journal-icon {
    flex: 0 0 100px;
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    padding: 3px;
    background: var(--panel-bg);
}

.journal-meta { font-size: 0.74rem; color: var(--text-muted); }

.journal-status-box {
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
    padding: 7px 9px;
    border: 1px dashed var(--border-dim);
    background: var(--panel-bg-alt);
    font-size: 0.8rem;
}

.journal-status-box--compact {
    margin: 8px 0;
    padding: 6px 8px;
    font-size: 0.76rem;
}

.journal-status-row {
    display: grid;
    grid-template-columns: minmax(96px, max-content) minmax(0, 1fr);
    gap: 8px;
    align-items: baseline;
    border-bottom: 1px dotted var(--border-dim);
    padding-bottom: 3px;
}

.journal-status-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.jsr-label {
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.jsr-label i {
    color: var(--accent);
    width: 1.1em;
    text-align: center;
}

.jsr-value {
    color: var(--text-main);
    min-width: 0;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-pill {
    display: inline-block;
    padding: 1px 8px;
    font-size: 0.74rem;
    text-decoration: none;
    border: 1px solid var(--border-color);
    color: var(--link-color);
    background: var(--panel-bg);
}
.tag-pill:hover { border-color: var(--border-light); color: var(--link-hover); }

/* --------------------------------------------------------------------------
   Detail pages, prose
   -------------------------------------------------------------------------- */

.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose img { border: 1px solid var(--border-color); padding: 3px; background: var(--panel-bg); }
.prose h1, .prose h2, .prose h3 { font-family: var(--font-display); color: var(--heading-color); }

.artwork-full {
    display: block;
    margin: 0 auto;
    border: 1px solid var(--border-light);
    padding: 6px;
    background: var(--panel-bg);
    max-height: 80vh;
    width: auto;
}

.detail-main-image {
    max-width: min(100%, 620px);
    max-height: 560px;
    object-fit: contain;
}

.detail-meta { font-size: 0.8rem; color: var(--text-muted); }

.detail-action {
    display: grid;
    gap: 7px;
    margin-top: 10px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    position: relative;
    min-height: 54px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 18px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 16px 46px 18px;
}
.site-footer a { color: var(--link-color); }
.footer-content { min-width: 0; }
.footer-deco { color: var(--accent); letter-spacing: 0.5em; font-size: 0.8rem; }

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 18px;
    margin-top: 8px;
}

.footer-nav a { text-decoration: none; font-size: 0.84rem; letter-spacing: 0.04em; }
.footer-nav a:hover { text-decoration: underline; text-underline-offset: 3px; }

.footer-rule {
    width: 180px;
    max-width: 60%;
    margin: 12px auto 10px;
    border-top: 1px solid var(--border-dim);
}

.footer-text { font-size: 0.78rem; }

.footer-adspace {
    justify-self: end;
    width: 234px;
    max-width: 100%;
    margin-right: 38px;
}

.footer-adspace a,
.footer-adspace img {
    display: block;
}

.footer-adspace a {
    text-decoration: none;
}

.footer-adspace img {
    width: 234px;
    max-width: 100%;
    height: 60px;
    object-fit: contain;
    border: 0;
    background: transparent;
}

@media (max-width: 760px) {
    .lightbox-shell {
        grid-template-columns: minmax(0, 1fr);
        max-height: calc(100vh - 96px);
        overflow: auto;
        width: min(100%, calc(100vw - 24px));
    }

    .lightbox-stage img {
        max-height: 58vh;
    }

    .site-footer {
        grid-template-columns: minmax(0, 1fr);
    }

    .footer-adspace {
        justify-self: center;
        margin-right: 0;
    }
}

/* --------------------------------------------------------------------------
   Pagination (themed by variables)
   -------------------------------------------------------------------------- */

.pagination-wrap { margin: 14px 0; text-align: center; }
.pagination-wrap .page-link {
    background: var(--panel-bg);
    border-color: var(--border-color);
    color: var(--link-color);
    font-size: 0.82rem;
    padding: 4px 10px;
}
.pagination-wrap .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--pagination-active-text);
}
.pagination-wrap .page-link:hover { background: var(--panel-bg-alt); border-color: var(--border-light); color: var(--link-hover); }
.pagination-wrap .page-item.disabled .page-link { background: var(--panel-bg); color: var(--text-muted); border-color: var(--border-dim); }

/* --------------------------------------------------------------------------
   Forms (public contact-ish + shared)
   -------------------------------------------------------------------------- */

.form-control, .form-select {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.88rem;
}
.form-control:focus, .form-select:focus {
    background: var(--panel-bg-alt);
    border-color: var(--accent);
    color: var(--text-main);
    box-shadow: 0 0 0 2px var(--focus-ring);
}
.form-label { font-size: 0.8rem; letter-spacing: 0.06em; color: var(--text-muted); }

.btn-oldweb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--border-light);
    background: var(--panel-bg-alt);
    color: var(--link-color);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    padding: 4px 14px;
    text-decoration: none;
}
.btn-oldweb:hover { background: var(--accent); border-color: var(--accent); color: var(--pagination-active-text); }

.btn-oldweb--primary {
    width: 100%;
    min-height: 36px;
    background: var(--accent);
    border-color: var(--accent);
    color: var(--pagination-active-text);
    font-weight: 700;
    text-transform: uppercase;
}

.btn-oldweb--primary:hover {
    background: var(--link-hover);
    border-color: var(--link-hover);
    color: var(--site-bg);
}

/* --------------------------------------------------------------------------
   Shrine / custom page wrappers (CSS scoping target)
   -------------------------------------------------------------------------- */

.shrine-page, .custom-page { min-width: 0; }

/* --------------------------------------------------------------------------
   Responsive columns
   -------------------------------------------------------------------------- */

@media (max-width: 991px) {
    .portal-layout { grid-template-columns: minmax(0, 1fr) 230px; }
    .portal-col--left { grid-column: 2; grid-row: 1; }
    .portal-col--center { grid-column: 1; grid-row: 1; }
    .portal-col--right { grid-column: 1 / -1; grid-row: 2; position: static; }
}

@media (max-width: 767px) {
    .site-shell { width: 100%; padding: 8px; }
    .site-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-layout { grid-template-columns: minmax(0, 1fr); }
    .portal-col--left, .portal-col--center, .portal-col--right { grid-column: 1; grid-row: auto; position: static; }
    .thumb-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .banner-extra { width: min(var(--extra-w, var(--header-extra-w, 64%)), 64%); right: var(--extra-right, var(--header-extra-right, -4px)); bottom: var(--extra-bottom, var(--header-extra-bottom, -24px)); }
}
