/* ═══════════════════════════════════════════════
   eNatureFilms — Design System
   Pixel-perfect match to NatureSoul mockup
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --color-primary: #2D5A27;
    --color-primary-dark: #1E3D1A;
    --color-primary-light: #E8F0E6;
    --color-bg: #F5F0E8;
    --color-card: #FFFFFF;
    --color-text: #1A1A1A;
    --color-text-secondary: #6B6B6B;
    --color-text-on-dark: #FFFFFF;
    --color-border: #E5E0D8;
    --color-shadow: rgba(0,0,0,0.08);
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;
    --shadow-card: 0 2px 12px var(--color-shadow);
    --shadow-hover: 0 4px 20px var(--color-shadow-hover, rgba(0,0,0,0.12));
    --transition: 0.25s ease;
    /* Gallery thumbnail width; the detail hero is sized at 1.5x this. */
    --gallery-thumb: 104px;
    /* Shared horizontal gutter + max content width so every section lines up. */
    --gutter: 20px;
    --content-max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--color-bg); }

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Centered page column: keeps the layout neat (not edge-to-edge) on wide screens. */
.app-shell {
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ─── Top Bar ─────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px var(--gutter);
    background: var(--color-bg);
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-logo .logo-icon {
    width: 40px;
    height: 40px;
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
}

.topbar-logo .logo-text {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.1;
}

.topbar-logo .logo-tagline {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-primary);
    opacity: 0.8;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-bell {
    font-size: 20px;
    color: var(--color-text-secondary);
    cursor: pointer;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.topbar-user-info {
    font-size: 12px;
    line-height: 1.3;
}

.topbar-user-info .welcome { color: var(--color-text-secondary); }
.topbar-user-info .name { font-weight: 600; color: var(--color-text); }

/* User menu dropdown */
.topbar-menu { position: relative; }

.topbar-menu .topbar-user {
    background: none;
    border: none;
    padding: 6px 8px;
    margin: 0;
    border-radius: var(--radius-md, 8px);
    font-family: inherit;
    text-align: left;
    transition: background 0.15s ease;
}

.topbar-menu .topbar-user:hover { background: rgba(0, 0, 0, 0.04); }

.topbar-caret {
    color: var(--color-text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.topbar-menu.open .topbar-caret { transform: rotate(180deg); }

.topbar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 10px);
    box-shadow: 0 8px 24px var(--color-shadow);
    padding: 6px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.topbar-menu.open .topbar-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.topbar-dropdown a {
    display: block;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-sm, 6px);
}

.topbar-dropdown a:hover { background: var(--color-primary-light, rgba(0, 0, 0, 0.05)); }

.topbar-dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: 6px 4px;
}

.topbar-dropdown-danger { color: #dc2626 !important; }
.topbar-dropdown-danger:hover { background: rgba(220, 38, 38, 0.08) !important; }

/* ─── Search Bar ──────────────────────────── */
/* ─── Main Navigation ─────────────────────── */
.main-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 4px var(--gutter) 16px;
}

.main-nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.main-nav-link {
    flex: 0 0 auto;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-secondary);
    padding: 8px 18px;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
}
.main-nav-link:hover {
    color: var(--color-primary);
    background: var(--color-primary-light);
}
.main-nav-link.active {
    color: var(--color-text-on-dark, #fff);
    background: var(--color-primary);
}

/* Search bar — sits inline in the nav, filling the remaining width. */
.search-bar {
    flex: 1 1 280px;
    min-width: 200px;
    padding: 0;
}

/* On the home page the nav + search sits just under the hero. */
.home-nav-wrap {
    margin-top: 14px;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-secondary);
}

.search-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-card);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text);
    outline: none;
    transition: border var(--transition), box-shadow var(--transition);
}

.search-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.search-input::placeholder { color: var(--color-text-secondary); }

/* ─── Hero Section ────────────────────────── */
.hero {
    position: relative;
    overflow: hidden;
    padding: 60px var(--gutter) 40px;
    background-size: cover;
    background-position: center;
    background-image: linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.4)), url('/media/heroes/hero-main.jpg');
    color: var(--color-text-on-dark);
    border-radius: 0;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Optional masthead video layer (sits over the background image). */
.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-media-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.45));
    z-index: 1;
}

/* Keep hero text above the video/overlay. */
.hero-headline, .hero-subtitle, .hero-buttons { position: relative; z-index: 2; }

/* Respect users who prefer reduced motion — show the still image instead. */
@media (prefers-reduced-motion: reduce) {
    .hero-video { display: none; }
    .hero-media-overlay { display: none; }
}

.hero-headline {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 12px;
    white-space: pre-line;
}

.hero-headline .leaf { font-style: normal; }

/* Brand logo replacement for 🌿 — inline (within text) and block (standalone) variants */
/* `display: inline-block` and `max-height: 1em` are required to overcome the global
   `img { display: block; max-width: 100% }` rule above. */
.brand-mark-inline {
    display: inline-block !important;
    height: 1em !important;
    width: auto !important;
    max-height: 1em !important;
    max-width: 1.6em !important;
    vertical-align: -0.18em;
    margin-right: 0.25em;
    object-fit: contain;
}
.brand-mark-block-md {
    width: 48px; height: 48px;
    max-width: 48px; max-height: 48px;
    object-fit: contain;
    margin: 0 auto 12px;
    display: block;
}
.brand-mark-block-lg {
    width: 64px; height: 64px;
    max-width: 64px; max-height: 64px;
    object-fit: contain;
    margin: 0 auto 12px;
    display: block;
}
.brand-mark-avatar {
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 8px;
    box-sizing: border-box;
}

.hero-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 24px;
    line-height: 1.5;
    max-width: 400px;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--color-primary);
    color: var(--color-text-on-dark);
    border: none;
    border-radius: var(--radius-xl);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-1px); }

/* Global button loading / busy state — shows the user their click registered */
.is-loading {
    cursor: progress !important;
    pointer-events: none;
    filter: brightness(0.9);
    opacity: 0.9;
}
.btn-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.5em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -0.15em;
    animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: transparent;
    color: var(--color-text-on-dark);
    border: 1.5px solid rgba(255,255,255,0.5);
    border-radius: var(--radius-xl);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-outline:hover { border-color: white; background: rgba(255,255,255,0.1); }

/* ─── Five Pillars ────────────────────────── */
.pillars {
    display: flex;
    justify-content: space-between;
    padding: 32px var(--gutter);
    gap: 8px;
    overflow-x: auto;
}

.pillar {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 100px;
    flex: 1;
}

.pillar-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    color: var(--color-primary);
}

.pillar-icon svg { width: 28px; height: 28px; }

.pillar-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.pillar-desc {
    font-size: 10px;
    color: var(--color-text-secondary);
    line-height: 1.3;
}

/* ─── Section Headers ─────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--gutter);
    margin-bottom: 16px;
}

.section-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-bar {
    width: 3px;
    height: 28px;
    background: var(--color-primary);
    border-radius: 2px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
}

.section-subtitle {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.view-all {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: 6px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    transition: all var(--transition);
}

.view-all:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ─── Category Cards Grid ─────────────────── */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 var(--gutter);
    margin-bottom: 32px;
}

.category-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 3/4;
    cursor: pointer;
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(var(--cat-scale, 1));
    transition: transform 0.4s ease;
}

.category-card:hover img { transform: scale(calc(var(--cat-scale, 1) * 1.08)); }

.category-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
}

.category-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.category-card-name {
    color: white;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.category-play {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.25);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-play svg { width: 12px; color: white; }

/* ─── Eco Banner ──────────────────────────── */
.eco-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin: 8px var(--gutter) 24px;
    background: var(--color-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.eco-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: var(--color-primary-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.eco-text { flex: 1; }
.eco-title { font-size: 14px; font-weight: 600; }
.eco-desc { font-size: 11px; color: var(--color-text-secondary); }

.eco-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* ─── Trending / Video Cards Row ──────────── */
.video-row {
    display: flex;
    gap: 12px;
    padding: 0 var(--gutter);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 32px;
    scrollbar-width: none;
}

.video-row::-webkit-scrollbar { display: none; }

.video-card {
    flex: 0 0 170px;
    scroll-snap-align: start;
    cursor: pointer;
}

.video-card-thumb {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16/10;
    margin-bottom: 8px;
}

.video-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .video-card-thumb img { transform: scale(1.05); }

.video-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.video-card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.3;
}

/* ─── Featured Creators ───────────────────── */
.creators-row {
    display: flex;
    gap: 12px;
    padding: 0 var(--gutter);
    overflow-x: auto;
    margin-bottom: 32px;
    scrollbar-width: none;
}

.creators-row::-webkit-scrollbar { display: none; }

.creator-card {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 10px 10px;
    background: var(--color-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}

.creator-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.creator-info { line-height: 1.3; }
.creator-name { font-size: 13px; font-weight: 600; }
.creator-followers { font-size: 11px; color: var(--color-text-secondary); }

.btn-follow {
    padding: 6px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-follow:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ─── Article Body ────────────────────────── */
.article-body p {
    margin: 0 0 1.2em;
}
.article-body p:last-child {
    margin-bottom: 0;
}
.article-body h2 {
    margin: 1.6em 0 0.6em;
    font-family: var(--font-heading);
    font-size: 20px;
}
.article-body h3 {
    margin: 1.3em 0 0.5em;
    font-family: var(--font-heading);
    font-size: 17px;
}
.article-body strong {
    font-weight: 700;
}
.article-body em {
    font-style: italic;
}
.article-body ul,
.article-body ol {
    margin: 0 0 1.2em;
    padding-left: 1.4em;
}
.article-body li {
    margin-bottom: 0.4em;
}

/* ─── Articles Row ────────────────────────── */
.articles-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 0 var(--gutter);
    margin-bottom: 100px;
}

@media (max-width: 900px) {
    .articles-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .articles-row { grid-template-columns: 1fr; }
}

.article-card {
    display: flex;
    flex-direction: column;
    background: var(--color-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition), box-shadow var(--transition);
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.article-thumb-wrap {
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.article-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.article-info { flex: 1; padding: 14px 16px 16px; }
.article-title { font-size: 15px; font-weight: 600; line-height: 1.35; margin-bottom: 8px; }
.article-meta { font-size: 12px; color: var(--color-text-secondary); display: flex; align-items: center; gap: 4px; }

/* ─── Bottom Nav ──────────────────────────── */
.site-footer {
    margin-top: 32px;
    padding: 24px 16px calc(96px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.site-footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 14px;
}

.site-footer-links a {
    font-size: 13px;
    color: var(--color-text-secondary);
    text-decoration: none;
}

.site-footer-links a:hover { color: var(--color-primary); }

.site-footer-copyright {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-secondary);
    letter-spacing: 0.02em;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--color-card);
    border-top: 1px solid var(--color-border);
    z-index: 1000;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    color: var(--color-text-secondary);
    transition: color var(--transition);
    padding: 4px 12px;
}

.bottom-nav a.active { color: var(--color-primary); }
.bottom-nav a svg { width: 22px; height: 22px; }

.bottom-nav .watch-btn {
    width: 52px;
    height: 52px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -20px;
    box-shadow: 0 4px 12px var(--color-primary-glow, rgba(45,90,39,0.3));
}

.bottom-nav .watch-btn svg { width: 24px; height: 24px; color: white; }

/* ─── Purchase & Auth Forms ───────────────── */
.form-container {
    max-width: 480px;
    margin: 40px auto;
    padding: 0 20px;
}

.form-card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-card);
}

.form-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}

.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: border var(--transition);
}

.form-input:focus { border-color: var(--color-primary); }

.form-error {
    background: #FEF2F2;
    color: #B91C1C;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.form-success {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.form-submit {
    width: 100%;
    padding: 14px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.form-submit:hover { background: var(--color-primary-dark); }

.form-link {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.form-link a { color: var(--color-primary); font-weight: 600; }

/* ─── Pricing Tiers ───────────────────────── */
.pricing-tiers {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}

.pricing-tier {
    flex: 1;
    padding: 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.pricing-tier:hover, .pricing-tier.active {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.pricing-tier .price {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
}

.pricing-tier .duration {
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* ─── Video Detail Page ───────────────────── */
.video-detail-hero {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
    /* Keep the poster ~50% larger than a gallery thumb so the low-res
       source isn't stretched to full width. */
    width: 100%;
    max-width: calc(var(--gallery-thumb) * 1.5);
    margin: 16px auto 0;
    border-radius: var(--radius-md);
}

.video-detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

/* Gallery: responsive grid that wraps instead of scrolling off-screen.
   Fixed-width columns (auto-fill) keep thumbs a consistent size at every
   viewport, and the grid is centered so it never overflows on a phone. */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, var(--gallery-thumb));
    justify-content: center;
    gap: 8px;
    padding: 0 var(--gutter);
    margin-bottom: 32px;
}

.gallery-grid > div {
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16/10;
}

.gallery-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Category listing: same poster scale as the detail page (1.5x a gallery
   thumb) in a centered, wrapping grid, so low-res thumbnails aren't stretched
   across the full width. */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, calc(var(--gallery-thumb) * 1.5));
    justify-content: center;
    gap: 16px;
    padding: 0 var(--gutter);
    margin-bottom: 32px;
}

/* Home "Trending" grid fills the width and left-aligns to match the category grid. */
.video-grid.home-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    justify-content: stretch;
}

.video-grid .video-card {
    flex: none;
    width: 100%;
}

.video-detail-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-detail-info { padding: 24px 20px; }

.video-detail-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.video-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 16px;
}

.video-detail-description {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
    line-height: 1.7;
}

.video-detail-cta-label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}
.detail-expired-note {
    background: var(--color-primary-light, #f3efe7);
    border: 1px solid var(--color-primary, #b08d57);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text, #2a2a2a);
}
.detail-expired-note strong { display: block; margin-bottom: 2px; }
.pricing-tier .price-was {
    font-size: 13px;
    color: var(--color-text-secondary);
    text-decoration: line-through;
    line-height: 1;
}

/* Compact action row: purchase tier(s) + favorite button sit side by side
   and wrap on narrow screens instead of stretching full-width. */
.video-detail-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.video-detail-cta .pricing-tier {
    flex: 0 0 auto;
    min-width: 120px;
}

.detail-fav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: transparent;
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
}

.detail-watch-btn { padding: 12px 24px; }

.detail-access-note {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

/* ─── Responsive Desktop ──────────────────── */
@media (min-width: 768px) {
    /* Wider, uniform gutter on larger screens — every section inherits it. */
    :root { --gutter: 40px; --gallery-thumb: 150px; }
    .topbar { padding: 16px var(--gutter); }
    .main-nav { padding: 4px var(--gutter) 20px; }
    .hero { padding: 80px var(--gutter) 60px; min-height: 400px; }
    .hero-headline { font-size: 48px; }
    .bottom-nav { display: none; }
    .form-container { padding: 0; }

    /* Video detail: poster image beside the description/actions instead of a
       small centered image with a large empty gap below it. */
    .video-detail-top {
        display: flex;
        gap: var(--gutter);
        align-items: flex-start;
        padding: 24px var(--gutter) 0;
    }
    .video-detail-top .video-detail-hero {
        flex: 0 0 44%;
        max-width: 480px;
        margin: 0;
        aspect-ratio: 16/10;
    }
    .video-detail-top .video-detail-info {
        flex: 1 1 0;
        min-width: 0;
        padding: 0;
    }
}

@media (min-width: 1024px) {
    .hero-headline { font-size: 56px; }
    .categories-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
    .video-card { flex: 0 0 220px; }
    :root { --gallery-thumb: 190px; }
}

/* ─── Editable Content Pages (About/Terms/Privacy) ─── */
.content-page {
    max-width: 720px;
    margin: 40px auto;
    padding: 0 var(--gutter);
}

.content-page-title {
    font-family: var(--font-heading);
    font-size: 32px;
    margin-bottom: 20px;
}

.content-page-body { line-height: 1.8; color: var(--color-text-secondary); }
.content-page-body p { margin-bottom: 16px; }
.content-page-body h2 { font-family: var(--font-heading); font-size: 22px; color: var(--color-text); margin: 28px 0 12px; }
.content-page-body h3 { font-size: 18px; color: var(--color-text); margin: 20px 0 8px; }
.content-page-body ul, .content-page-body ol { margin: 0 0 16px 22px; }
.content-page-body li { margin-bottom: 6px; }
.content-page-body a { color: var(--color-primary); text-decoration: underline; }

/* ─── Utility ─────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-32 { margin-bottom: 32px; }
.pb-safe { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

/* ─── Creator profile (Instagram-style) ───────────────── */
.creator-profile {
    width: 100%;
    max-width: 935px;
    margin-inline: auto;
    padding: 24px var(--gutter) 0;
}
.creator-profile-header {
    display: flex;
    gap: 28px;
    align-items: center;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 24px;
}
.creator-profile-avatar img,
.creator-profile-avatar-fallback {
    width: 140px;
    height: 140px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 1px solid var(--color-border);
    background: var(--color-primary-light);
}
.creator-profile-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}
.creator-profile-avatar-fallback img { width: 70%; height: 70%; border:none; border-radius:0; background:none; }
.creator-profile-meta { flex: 1; min-width: 0; }
.creator-profile-name {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 12px;
}
.creator-profile-stats { display: flex; gap: 28px; margin-bottom: 12px; color: var(--color-text-secondary); font-size: 15px; }
.creator-profile-stats strong { color: var(--color-text); }
.creator-profile-cat {
    display: inline-block;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
}
.creator-profile-bio { color: var(--color-text); font-size: 15px; line-height: 1.5; white-space: pre-line; }

.creator-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding-bottom: 32px;
}
.creator-post {
    padding: 0;
    border: none;
    background: var(--color-primary-light);
    cursor: pointer;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 4px;
}
.creator-post img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition); }
.creator-post:hover img { transform: scale(1.04); }
.creator-posts-empty { color: var(--color-text-secondary); padding: 24px 0 40px; text-align: center; }

@media (max-width: 640px) {
    .creator-profile-header { gap: 18px; }
    .creator-profile-avatar img,
    .creator-profile-avatar-fallback { width: 88px; height: 88px; }
    .creator-profile-name { font-size: 22px; margin-bottom: 8px; }
    .creator-profile-stats { gap: 18px; font-size: 14px; }
    .creator-posts-grid { gap: 3px; }
}

/* Lightbox */
.creator-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.creator-lightbox[hidden] { display: none; }
.creator-lightbox-figure { max-width: 92vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.creator-lightbox-figure img { max-width: 92vw; max-height: 78vh; object-fit: contain; border-radius: 6px; }
.creator-lightbox-figure figcaption { color: #fff; font-size: 14px; max-width: 680px; text-align: center; }
.creator-lightbox-close {
    position: absolute;
    top: 16px; right: 22px;
    background: none; border: none; color: #fff;
    font-size: 36px; line-height: 1; cursor: pointer;
}
