/* ================================================================
   She Holds The Reins — custom styles
   Layered on top of Bootstrap 5 dark theme.
   ================================================================ */

/* ── Tokens ── */
:root {
    --clr-bg:        #0a0708;
    --clr-surface:   #140e10;
    --clr-card:      #1a1214;
    --clr-accent:    #dc2626;
    --clr-accent-hover: #ef4444;
    --clr-rose:      #b91c1c;
    --clr-text:      #e8e0e0;
    --clr-text-muted:#9a8a8a;
    --clr-border:    #2a1e1e;
    --font-display:  'Playfair Display', Georgia, serif;
    --font-body:     'Inter', system-ui, sans-serif;
    --radius:        8px;
    --transition:    .25s ease;
}

/* ── Reset / Global ── */
html { scroll-behavior: smooth; overflow-y: scroll; }
body {
    background: var(--clr-bg) !important;
    color: var(--clr-text);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.65;
    overflow-x: hidden;
    padding-top: 60px;
}

::selection {
    background: var(--clr-accent);
    color: #fff;
}

/* ── Navigation ── */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(12, 10, 16, .8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--clr-border);
}
.site-nav__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: .9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-nav__brand {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--clr-text);
    text-decoration: none;
    letter-spacing: .02em;
}
.site-nav__brand:hover { color: var(--clr-accent); }
.site-nav__links {
    display: flex;
    gap: 1.6rem;
    align-items: center;
}
.site-nav__links a {
    color: var(--clr-text-muted);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 400;
    letter-spacing: .03em;
    text-transform: uppercase;
    transition: color var(--transition);
}
.site-nav__links a:hover { color: var(--clr-accent); }

/* Hamburger toggle */
.site-nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.site-nav__toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--clr-text);
    transition: var(--transition);
}

/* Nav separator between link groups */
.site-nav__sep {
    width: 1px;
    height: 16px;
    background: var(--clr-border);
    display: block;
}

/* Unread badge — red dot next to link text */
.nav-with-badge {
    position: relative;
}
.nav-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--clr-accent);
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
    box-shadow: 0 0 6px rgba(220, 38, 38, .6);
    animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 6px rgba(220, 38, 38, .6); }
    50%      { box-shadow: 0 0 12px rgba(220, 38, 38, .9); }
}

/* Numbered unread badge for admin thread list */
.thread-unread-badge {
    display: inline-block;
    background: var(--clr-accent);
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: 6px;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .site-nav__toggle { display: flex; }
    .site-nav__links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(12, 10, 16, .95);
        padding: 1rem 1.5rem 1.5rem;
        gap: .8rem;
        border-bottom: 1px solid var(--clr-border);
    }
    .site-nav.is-open .site-nav__links { display: flex; }
    .site-nav__sep {
        width: 100%;
        height: 1px;
    }
}

/* ── Landing page — characters as background ── */
.landing {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    margin-top: -60px;
}

/* 5-column character portrait grid behind everything */
.characters {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 6px;
    z-index: 0;
}
.characters__col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.characters__col--center {
    /* Empty center column — text content sits over this gap */
}
.characters__col img {
    width: 100%;
    border-radius: 6px;
    object-fit: cover;
    aspect-ratio: 3/4;
    filter: brightness(.3) saturate(.6);
    transition: filter .4s ease;
}
.characters__col img:hover {
    filter: brightness(.45) saturate(.8);
}

/* Dark vignette over portraits so text pops */
.landing__vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        /* Strong center fade for readability */
        radial-gradient(ellipse 60% 70% at 50% 45%, rgba(10, 7, 8, .92) 0%, transparent 100%),
        /* Top fade for navbar */
        linear-gradient(180deg, rgba(10, 7, 8, .8) 0%, transparent 25%),
        /* Bottom fade */
        linear-gradient(0deg, rgba(10, 7, 8, .85) 0%, transparent 35%);
}

/* Content floats above everything */
.landing__content {
    position: relative;
    z-index: 2;
    max-width: 640px;
    margin: 0 auto;
    padding: 8rem 1.5rem 4rem;
    text-align: center;
}

.landing__hero {
    padding-bottom: 5rem;
}

.landing__title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.02em;
    margin-bottom: 1.5rem;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.landing__desc {
    font-size: 1.15rem;
    color: var(--clr-text);
    line-height: 1.75;
    margin-bottom: 1rem;
}

/* Inline highlight for key phrases inside landing copy. */
.landing__highlight {
    color: var(--clr-accent);
    font-weight: 500;
    font-style: italic;
}

/* Reusable inline keyword highlight (theme keywords, etc.). */
.text-highlight {
    color: var(--clr-accent);
    font-weight: 500;
}

/* Access explainer block — sits below the welcome paragraphs. */
.landing__access {
    margin: 2.5rem auto 0;
    padding: 1.75rem 1.5rem;
    max-width: 560px;
    background: rgba(20, 14, 16, .7);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    text-align: left;
}
.landing__access-heading {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--clr-accent);
    margin: 0 0 1rem;
    text-align: center;
}
.landing__access .landing__desc {
    font-size: 1rem;
    margin-bottom: .85rem;
}
.landing__access .landing__desc:last-child { margin-bottom: 0; }
.landing__access a { color: var(--clr-accent); }
.landing__access a:hover { color: var(--clr-accent-hover); }

/* Socials block — sits below the primary Patreon CTA. */
.landing__socials {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--clr-border);
}
.landing__socials-heading {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--clr-text-muted);
    margin: 0 0 1rem;
}
.landing__actions--socials {
    margin-top: 0;
}

.landing__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Features section */
.landing__features {
    padding: 3rem 0 2rem;
    border-top: 1px solid var(--clr-border);
}
.landing__features-heading {
    font-family: var(--font-display);
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    color: var(--clr-text);
}
.landing__features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    text-align: left;
    display: inline-block;
}
.landing__features-list li {
    padding: .5rem 0 .5rem 1.6rem;
    position: relative;
    color: var(--clr-text);
    font-size: 1.05rem;
}
.landing__features-list li::before {
    content: '\2727';
    position: absolute;
    left: 0;
    color: var(--clr-accent);
}

@media (max-width: 1024px) {
    .characters { grid-template-columns: repeat(4, 1fr); }
    .characters__col--center { display: none; }
}
@media (max-width: 768px) {
    .characters { grid-template-columns: repeat(3, 1fr); }
    .characters__col:nth-child(4),
    .characters__col:nth-child(5) { display: none; }
    .landing__content { padding-top: 6rem; }
}
@media (max-width: 480px) {
    .characters { grid-template-columns: repeat(2, 1fr); }
    .characters__col:nth-child(3) { display: none; }
}

/* ── CTA Buttons ── */
.btn-cta {
    display: inline-block;
    padding: .85rem 2.2rem;
    font-size: .9rem;
    font-weight: 500;
    font-family: var(--font-body);
    letter-spacing: .05em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 50px;
    transition: all var(--transition);
    cursor: pointer;
    background: var(--clr-accent);
    color: #fff;
    border: 2px solid var(--clr-accent);
}
.btn-cta:hover {
    background: var(--clr-accent-hover);
    border-color: var(--clr-accent-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, .35);
}
.btn-cta--outline {
    background: transparent;
    color: var(--clr-accent);
}
.btn-cta--outline:hover {
    background: var(--clr-accent);
    color: #fff;
}

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--clr-text-muted);
    font-size: .8rem;
    letter-spacing: .04em;
    border-top: 1px solid var(--clr-border);
    margin-top: 3rem;
}
.site-footer p { margin: 0 0 .5rem; }
.site-footer p:last-child { margin-bottom: 0; }
.site-footer__contact a {
    color: var(--clr-accent);
    text-decoration: none;
}
.site-footer__contact a:hover {
    color: var(--clr-accent-hover);
    text-decoration: underline;
}

/* ── FAQ page ── */
.faq {
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem 1rem 3rem;
}
.faq__header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.faq__title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3rem);
    color: #fff;
    margin-bottom: .75rem;
}
.faq__lede {
    font-size: 1.1rem;
    color: var(--clr-text-muted);
}
.faq__section {
    margin-bottom: 2.25rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--clr-border);
}
.faq__section:last-of-type { border-bottom: 0; }
.faq__section h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--clr-accent);
    margin-bottom: .9rem;
}
.faq__section p {
    color: var(--clr-text);
    line-height: 1.75;
    margin-bottom: .85rem;
}
.faq__section ul {
    color: var(--clr-text);
    line-height: 1.75;
    padding-left: 1.25rem;
}
.faq__section a {
    color: var(--clr-accent);
}
.faq__section a:hover { color: var(--clr-accent-hover); }
.faq__contact {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(20, 14, 16, .55);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
}
.faq__contact h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--clr-accent);
    margin-bottom: .75rem;
}
.faq__contact a { color: var(--clr-accent); }
.faq__contact a:hover { color: var(--clr-accent-hover); }

/* ── Contact page ── */
.contact {
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem 1rem 3rem;
}
.contact__header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.contact__title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3rem);
    color: #fff;
    margin-bottom: .75rem;
}
.contact__lede {
    font-size: 1.1rem;
    color: var(--clr-text-muted);
}
.contact__options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.contact__option {
    background: rgba(20, 14, 16, .55);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-align: center;
    /* Make sure long content can never push past the card edge. */
    overflow-wrap: anywhere;
}
.contact__option-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--clr-accent);
    margin-bottom: .9rem;
}
.contact__option p {
    color: var(--clr-text);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}
.contact__option .btn-cta {
    /* Cap the button width so it can't out-grow a narrow card and let
       any future long label wrap instead of overflowing. */
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}
.contact__email {
    margin: 1rem 0 0;
    font-size: .9rem;
    color: var(--clr-text-muted);
}
.contact__email a {
    color: var(--clr-accent);
    text-decoration: none;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.contact__email a:hover {
    color: var(--clr-accent-hover);
    text-decoration: underline;
}
.contact__note {
    text-align: center;
    color: var(--clr-text-muted);
    font-size: .95rem;
    font-style: italic;
}

/* ── Utility overrides for inner pages (Bootstrap still works) ── */
.container {
    font-family: var(--font-body);
}

/* Soften Bootstrap alerts */
.alert {
    border-radius: var(--radius);
    font-size: .9rem;
}

/* Make Bootstrap cards match our palette on inner pages */
.card {
    background: var(--clr-card) !important;
    border-color: var(--clr-border) !important;
    border-radius: var(--radius);
}

/* Override Bootstrap blue buttons with our red accent */
.btn-primary {
    background-color: var(--clr-accent) !important;
    border-color: var(--clr-accent) !important;
    color: #fff !important;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--clr-accent-hover) !important;
    border-color: var(--clr-accent-hover) !important;
    box-shadow: 0 0 0 .2rem rgba(220, 38, 38, .35) !important;
}
.btn-primary:active {
    background-color: var(--clr-rose) !important;
    border-color: var(--clr-rose) !important;
}

.btn-outline-primary {
    color: var(--clr-accent) !important;
    border-color: var(--clr-accent) !important;
    background: transparent !important;
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--clr-accent) !important;
    border-color: var(--clr-accent) !important;
    color: #fff !important;
    box-shadow: 0 0 0 .2rem rgba(220, 38, 38, .35) !important;
}

.btn-outline-secondary {
    color: var(--clr-text-muted) !important;
    border-color: var(--clr-border) !important;
    background: transparent !important;
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background-color: var(--clr-surface) !important;
    border-color: var(--clr-accent) !important;
    color: var(--clr-text) !important;
}

/* Form inputs — darken to match theme */
.form-control, .form-select {
    background-color: var(--clr-surface) !important;
    border-color: var(--clr-border) !important;
    color: var(--clr-text) !important;
}
.form-control:focus, .form-select:focus {
    border-color: var(--clr-accent) !important;
    box-shadow: 0 0 0 .2rem rgba(220, 38, 38, .2) !important;
}

/* ── Gallery thumbnails (post detail) ── */
.gallery-thumb {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    background: none;
    border: 0;
    cursor: zoom-in;
}
.gallery-thumb img {
    width: 100%;
    height: auto;
    transition: opacity var(--transition);
}
.gallery-thumb:hover img,
.gallery-thumb:focus-visible img {
    opacity: .85;
}
.gallery-thumb:focus-visible {
    outline: 2px solid var(--clr-accent);
    outline-offset: 2px;
    border-radius: var(--radius);
}

/* Hero (first) image — full width, capped height so tall images don't dominate. */
.gallery-thumb--hero {
    background: var(--clr-surface);
    border-radius: var(--radius);
    overflow: hidden;
    text-align: center;
}
.gallery-thumb--hero img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 75vh;
    margin: 0 auto;
    display: block;
}

/* Trailing thumbnails — square grid below the hero. */
.gallery-thumb--small img {
    aspect-ratio: 1 / 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video tile — a placeholder with a play icon, since videos don't carry
   a thumbnail. Uses the same hero/small modifiers as image tiles. */
.gallery-thumb--video {
    position: relative;
    background: linear-gradient(135deg, #1f1418 0%, #2a1c20 100%);
    color: var(--clr-text);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    text-align: center;
    padding: 1rem;
}
.gallery-thumb--video.gallery-thumb--hero {
    aspect-ratio: 16 / 9;
    max-height: 75vh;
}
.gallery-thumb--video.gallery-thumb--small {
    aspect-ratio: 1 / 1;
}
.gallery-thumb__video-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    transition: transform var(--transition), background var(--transition);
}
.gallery-thumb__video-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    margin-left: 2px; /* visually centre the play triangle */
}
.gallery-thumb--video:hover .gallery-thumb__video-icon,
.gallery-thumb--video:focus-visible .gallery-thumb__video-icon {
    background: var(--clr-accent);
    transform: scale(1.05);
}
.gallery-thumb__video-label {
    font-size: .85rem;
    color: var(--clr-text);
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ── Lightbox / fullscreen image viewer ── */
body.lightbox-open { overflow: hidden; }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(0, 0, 0, .96);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}
.lightbox[hidden] { display: none; }

.lightbox-stage {
    flex: 1;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: pan-y;
    padding: 3.5rem 1rem;
}
.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}
.lightbox-video {
    /* Enough room for controls without overflowing the stage; iframe and
       <video> share these constraints so layout is consistent across
       backends. */
    width: min(100%, 1280px);
    max-height: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    background: #000;
    display: block;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(20, 14, 16, .7);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .15);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    font-size: 1.75rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    padding: 0;
}
.lightbox-close:hover, .lightbox-close:focus-visible,
.lightbox-prev:hover, .lightbox-prev:focus-visible,
.lightbox-next:hover, .lightbox-next:focus-visible {
    background: var(--clr-accent);
    border-color: var(--clr-accent);
    outline: none;
}
.lightbox-close { top: 1rem; right: 1rem; font-size: 1.5rem; }
.lightbox-prev  { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover, .lightbox-prev:focus-visible { transform: translateY(-50%) scale(1.05); }
.lightbox-next:hover, .lightbox-next:focus-visible { transform: translateY(-50%) scale(1.05); }

.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--clr-text);
    font-size: .85rem;
    background: rgba(20, 14, 16, .7);
    padding: .35rem .9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .1);
}

@media (max-width: 576px) {
    .lightbox-stage { padding: 3rem .25rem; }
    .lightbox-prev, .lightbox-next {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.5rem;
    }
    .lightbox-prev { left: .5rem; }
    .lightbox-next { right: .5rem; }
    .lightbox-close { top: .5rem; right: .5rem; }
}
