:root {
    --bg:           #0d0d0d;
    --surface:      #161616;
    --surface-2:    #1f1f1f;
    --border:       #2a2a2a;
    --accent:       #8b0000;
    --accent-hover: #a80000;
    --gold:         #c9a84c;
    --text:         #ddd;
    --text-muted:   #888;
    --radius:       4px;
    --max-w:        1100px;
    --font:         system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: #fff; }

img { max-width: 100%; height: auto; display: block; }

/* ---------------------------------------------------------------------------
   Layout
--------------------------------------------------------------------------- */

.wrapper {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.25rem;
    width: 100%;
}

main {
    flex: 1;
    padding: 2rem 0;
}

/* ---------------------------------------------------------------------------
   Header / Nav
--------------------------------------------------------------------------- */

header {
    background: #000;
    border-bottom: 1px solid var(--border);
    padding: 0;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    max-width: var(--max-w);
    margin: 0 auto;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.site-title a {
    color: #fff;
}

.site-title span {
    color: var(--accent);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: var(--text);
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: .25rem 0;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}

nav a:hover,
nav a.active {
    color: #fff;
    border-bottom-color: var(--accent);
}

nav .join-link {
    background: var(--accent);
    color: #fff;
    padding: .35rem .9rem;
    border-radius: var(--radius);
    border-bottom: none;
}

nav .join-link:hover {
    background: var(--accent-hover);
    color: #fff;
}

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */

footer {
    background: #000;
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    font-size: .8rem;
    color: var(--text-muted);
}

footer .wrapper {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: center;
    text-align: center;
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ---------------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------------- */

.btn {
    display: inline-block;
    padding: .65rem 1.5rem;
    border-radius: var(--radius);
    font-size: .95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    cursor: pointer;
    border: none;
    transition: background .15s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-outline {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
}

.btn-outline:hover { background: var(--gold); color: #000; }

.btn-sm { padding: .4rem .9rem; font-size: .85rem; }

/* ---------------------------------------------------------------------------
   Hero (landing page)
--------------------------------------------------------------------------- */

.hero {
    background: linear-gradient(to bottom, #1a0000, var(--bg));
    padding: 5rem 1.25rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 1rem;
    color: #fff;
}

.hero h1 span { color: var(--accent); }

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------------------------------------------------------------------------
   Section headings
--------------------------------------------------------------------------- */

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #fff;
    margin-bottom: 1.5rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}

.section-title span { color: var(--accent); }

/* ---------------------------------------------------------------------------
   Update grid
--------------------------------------------------------------------------- */

.updates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.update-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .15s, transform .15s;
}

.update-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.update-card a { display: block; color: inherit; }
.update-card a:hover { color: inherit; }

.card-thumb {
    position: relative;
    aspect-ratio: 4/3;
    background: #111;
    overflow: hidden;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.card-thumb-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform .3s;
}

.update-card:hover .card-thumb img,
.update-card:hover .card-thumb-bg { transform: scale(1.04); }

.card-type {
    position: absolute;
    top: .5rem;
    right: .5rem;
    background: rgba(0,0,0,.8);
    color: var(--gold);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: .2rem .5rem;
    border-radius: var(--radius);
}

.card-type.clip { color: #4fc; }

.card-lock-badge {
    position: absolute;
    top: .5rem;
    left: .5rem;
    background: rgba(0,0,0,.78);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .22rem .45rem;
    border-radius: var(--radius);
    pointer-events: none;
    z-index: 2;
}

.card-info {
    padding: .75rem 1rem;
}

.card-date {
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: .25rem;
}

.card-title {
    font-size: .95rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.card-desc {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: .35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Locked state badge is rendered via explicit markup for consistent behavior */

/* ---------------------------------------------------------------------------
   Pagination
--------------------------------------------------------------------------- */

.pagination {
    display: flex;
    gap: .4rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.pagination a {
    display: inline-block;
    padding: .4rem .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .85rem;
    transition: background .15s, border-color .15s;
}

.pagination a:hover,
.pagination a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ---------------------------------------------------------------------------
   Member area
--------------------------------------------------------------------------- */

.member-header {
    background: #000;
    border-bottom: 2px solid var(--accent);
    padding: 0;
}

.member-nav ul { gap: 1rem; }

.member-sections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.25rem;
    text-align: center;
    transition: border-color .15s;
}

.section-card:hover { border-color: var(--accent); }

.section-card a { color: #fff; display: block; }

.section-card h3 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .3rem;
}

.section-card p { font-size: .85rem; color: var(--text-muted); }

/* View page — gallery / video */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .75rem;
}

.gallery-grid a img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: opacity .15s;
}

.gallery-grid a:hover img { opacity: .85; }

.video-player {
    max-width: 900px;
    margin: 0 auto;
}

.video-player video {
    width: 100%;
    border-radius: var(--radius);
    background: #000;
}

/* ---------------------------------------------------------------------------
   Admin
--------------------------------------------------------------------------- */

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.admin-table th,
.admin-table td {
    padding: .6rem .9rem;
    border: 1px solid var(--border);
    text-align: left;
}

.admin-table th {
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: .75rem;
    letter-spacing: .06em;
}

.admin-table tr:hover td { background: var(--surface); }

.badge {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 3px;
    font-size: .75rem;
    font-weight: 700;
}

.badge-active { background: #1a3a1a; color: #6f6; }
.badge-inactive { background: #2a1a1a; color: #f66; }
.badge-clip { background: #1a2a3a; color: #6cf; }
.badge-image { background: #2a2a1a; color: var(--gold); }

.form-row {
    display: flex;
    gap: .5rem;
    align-items: center;
}

input[type="date"],
input[type="text"],
input[type="password"] {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .4rem .65rem;
    border-radius: var(--radius);
    font-size: .85rem;
    font-family: var(--font);
}

input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

label { font-size: .85rem; color: var(--text-muted); }

.login-box {
    max-width: 360px;
    margin: 5rem auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.login-box h2 {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 1.5rem;
    color: #fff;
}

.login-box .field { margin-bottom: 1rem; }
.login-box label { display: block; margin-bottom: .35rem; }
.login-box input { width: 100%; }

/* ---------------------------------------------------------------------------
   Static pages (help/terms/privacy/2257)
--------------------------------------------------------------------------- */

.static-page {
    max-width: 900px;
    margin: 0 auto;
}

.static-card {
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.3rem;
    box-shadow: 0 18px 38px rgba(0,0,0,.28);
}

.static-page .section-title {
    margin-bottom: 1rem;
}

.static-page h2 { font-size: 1.3rem; margin: 1.5rem 0 .5rem; color: #fff; }
.static-page h3 { font-size: 1.05rem; margin: 1.2rem 0 .4rem; color: var(--gold); }
.static-page p  { margin-bottom: .9rem; color: var(--text); }
.static-page ul,
.static-page ol {
    margin: .5rem 0 1rem 1.3rem;
    color: var(--text);
}

.static-page li {
    margin-bottom: .45rem;
}

.static-page a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Join page
--------------------------------------------------------------------------- */

.join-split {
    margin-top: 2.1rem;
    margin-bottom: 2.6rem;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 1.15rem;
    background: linear-gradient(145deg, rgba(139,0,0,.26), rgba(26,26,26,.94));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 20px 40px rgba(0,0,0,.34);
}

.join-split-image {
    border-radius: calc(var(--radius) - 2px);
    overflow: hidden;
    min-height: 420px;
    background: #111;
}

.join-split-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.join-split-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 1.15rem;
}

.join-split-copy h1 {
    margin: 0 0 .85rem;
    font-size: clamp(1.85rem, 3.6vw, 2.6rem);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.join-split-copy h1 span {
    color: var(--accent);
}

.join-split-copy p {
    margin: 0;
    color: var(--text);
    line-height: 1.6;
}

.join-cta {
    margin-top: 1.2rem;
    display: inline-block;
    font-size: 1.05rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 1rem 2.2rem;
}

.join-note {
    margin-top: .7rem;
    color: var(--text-muted);
    font-size: .88rem;
}

@media (max-width: 900px) {
    .join-split {
        grid-template-columns: 1fr;
    }

    .join-split-image { min-height: 300px; }
}

@media (max-width: 640px) {
    .join-split {
        padding: .7rem;
    }

    .join-split-image { min-height: 250px; }

    .join-split-copy {
        padding: .35rem .45rem .8rem;
    }
}

/* ---------------------------------------------------------------------------
   Front page sample gallery
--------------------------------------------------------------------------- */

.front-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 220px;
    gap: 6px;
    border-radius: var(--radius);
    overflow: hidden;
}

/* Items 3, 6, 9 are the right-side wide slots — must use landscape images */
.front-gallery-item:nth-child(3)  { grid-column: span 2; }
.front-gallery-item:nth-child(6)  { grid-column: span 2; }
.front-gallery-item:nth-child(9)  { grid-column: span 2; }

.front-gallery-item {
    position: relative;
    overflow: hidden;
    display: block;
    background: #111;
}

.front-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s, filter .3s;
    filter: brightness(.9);
}

.front-gallery-item:hover img {
    transform: scale(1.06);
    filter: brightness(.6);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139,0,0,.55);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    opacity: 0;
    transition: opacity .25s;
}

.front-gallery-item:hover .gallery-overlay {
    opacity: 1;
}

@media (max-width: 700px) {
    .front-gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
    .front-gallery-item:nth-child(3),
    .front-gallery-item:nth-child(6) { grid-column: span 1; }
}

/* ---------------------------------------------------------------------------
   Preview page
--------------------------------------------------------------------------- */

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}

.preview-img-link {
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
    aspect-ratio: 3/4;
    background: #111;
    transition: opacity .2s;
}

.preview-img-link:hover { opacity: .85; }

.preview-img-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-videos {
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Landscape: 2-up grid — wide videos fill nicely */
.preview-videos--landscape {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

/* Portrait: 3-up grid — narrower videos sit side by side */
.preview-videos--portrait {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.preview-video-item video {
    width: 100%;
    border-radius: var(--radius);
    background: #000;
    display: block;
}

@media (max-width: 700px) {
    .preview-grid { grid-template-columns: repeat(2, 1fr); }
    .preview-videos--landscape,
    .preview-videos--portrait { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   Alerts
--------------------------------------------------------------------------- */

.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .9rem;
}

.alert-error { background: #2a0000; border: 1px solid #600; color: #f99; }
.alert-success { background: #001a00; border: 1px solid #060; color: #9f9; }
.alert-info { background: #001a2a; border: 1px solid #036; color: #9cf; }

/* ---------------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------------- */

@media (max-width: 700px) {
    .site-header { flex-direction: column; gap: .75rem; }
    nav ul { flex-wrap: wrap; gap: .75rem; justify-content: center; }
    .hero { padding: 3rem 1rem; }
    .updates-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
