/* =========================================================================
 * TBM House — Design System
 * -------------------------------------------------------------------------
 * Single source of truth for color, typography, spacing, and component
 * styles across the site. No pure black (#000) or pure white (#fff) — the
 * palette is intentionally warm.
 * ========================================================================= */

/* -------------------------------------------------------------------------
 * 1. Design tokens
 * ------------------------------------------------------------------------- */
:root {
    /* Color — palette */
    --th-bg:            #1C1A17;  /* page background (warm charcoal)   */
    --th-text:          #F5F0E8;  /* primary text / cards (warm white) */
    --th-gold:          #E8A020;  /* primary accent / CTAs / brand     */
    --th-terracotta:    #C4622D;  /* secondary accent / locked tags    */
    --th-muted:         #A09A90;  /* muted text / subtitles            */
    --th-surface:       #2A2520;  /* card / surface background         */
    --th-border:        #2E2A24;  /* card border                       */
    --th-border-light:  #4A4540;  /* outline-button border             */

    /* Color — derived (badge fills, hovers) */
    --th-gold-soft-bg:        #2E2208;
    --th-terracotta-soft-bg:  #2A1608;
    --th-gold-hover:          #F2B23A;

    /* Typography */
    --th-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter,
                    Roboto, "Helvetica Neue", Arial, sans-serif;
    --th-fw-body:    400;
    --th-fw-heading: 500;
    --th-lh-body:    1.7;
    --th-lh-heading: 1.2;
    --th-track-eyebrow: 0.1em;

    /* Layout */
    --th-radius-sm:  6px;
    --th-radius-md:  8px;
    --th-radius-lg:  12px;
    --th-radius-pill: 999px;
    --th-container:  1180px;
    --th-gutter:     24px;

    /* Motion */
    --th-ease: 0.15s ease;
}

/* -------------------------------------------------------------------------
 * 2. Base typography
 * ------------------------------------------------------------------------- */
body {
    margin: 0;
    background: var(--th-bg);
    color: var(--th-text);
    font-family: var(--th-font-sans);
    font-weight: var(--th-fw-body);
    line-height: var(--th-lh-body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--th-text);
    font-weight: var(--th-fw-heading);
    line-height: var(--th-lh-heading);
    margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }
p, li { color: var(--th-text); }

a {
    color: var(--th-gold);
    text-decoration: none;
    transition: color var(--th-ease);
}
a:hover { color: var(--th-gold-hover); }

.th-muted { color: var(--th-muted); }

/* Eyebrow / accent label */
.th-eyebrow {
    text-transform: uppercase;
    letter-spacing: var(--th-track-eyebrow);
    color: var(--th-gold);
    font-size: 12px;
    font-weight: 500;
    margin: 0 0 12px;
    display: inline-block;
}

/* -------------------------------------------------------------------------
 * 3. Layout helpers
 * ------------------------------------------------------------------------- */
.th-container {
    max-width: var(--th-container);
    margin: 0 auto;
    padding: 0 var(--th-gutter);
}
.th-section { padding: 80px 0; }
.th-section--tight { padding: 48px 0; }

.th-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* -------------------------------------------------------------------------
 * 4. Navigation
 * ------------------------------------------------------------------------- */
.th-nav {
    background: var(--th-bg);
    border-bottom: 0.5px solid var(--th-border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.th-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px var(--th-gutter);
    max-width: var(--th-container);
    margin: 0 auto;
}
.th-logo {
    color: var(--th-text);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
}
.th-logo__accent { color: var(--th-gold); }
.th-nav__menu {
    display: flex;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.th-nav__menu a {
    color: var(--th-text);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    transition: color var(--th-ease);
}
.th-nav__menu a:hover,
.th-nav__menu .current-menu-item > a,
.th-nav__menu .active > a { color: var(--th-gold); }
.th-nav__cta {
    background: var(--th-gold);
    color: var(--th-bg) !important;
    padding: 10px 18px;
    border-radius: var(--th-radius-md);
    font-weight: 500;
}
.th-nav__cta:hover { background: var(--th-gold-hover); }

/* Mobile nav toggle */
.th-nav__toggle {
    display: none;
    background: transparent;
    border: 0;
    color: var(--th-text);
    font-size: 22px;
    cursor: pointer;
}
@media (max-width: 800px) {
    .th-nav__toggle { display: block; }
    .th-nav__menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--th-bg);
        border-bottom: 0.5px solid var(--th-border);
        flex-direction: column;
        padding: 16px var(--th-gutter);
        gap: 12px;
        display: none;
    }
    .th-nav__menu.is-open { display: flex; }
}

/* -------------------------------------------------------------------------
 * 5. Buttons
 * ------------------------------------------------------------------------- */
.th-btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: var(--th-radius-md);
    font-weight: 500;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--th-ease), color var(--th-ease),
                border-color var(--th-ease), transform var(--th-ease);
    border: 0;
}
.th-btn--primary {
    background: var(--th-gold);
    color: var(--th-bg);
}
.th-btn--primary:hover {
    background: var(--th-gold-hover);
    color: var(--th-bg);
}
.th-btn--outline {
    background: transparent;
    border: 0.5px solid var(--th-border-light);
    color: var(--th-text);
}
.th-btn--outline:hover {
    border-color: var(--th-gold);
    color: var(--th-gold);
}
.th-btn--lg { padding: 16px 28px; font-size: 16px; }

/* -------------------------------------------------------------------------
 * 6. Hero
 * ------------------------------------------------------------------------- */
.th-hero {
    position: relative;
    padding: 120px var(--th-gutter) 140px;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(28,26,23,0.55) 0%, rgba(28,26,23,0.92) 100%),
        radial-gradient(circle at 50% 0%, #3a3128 0%, #1C1A17 70%);
    overflow: hidden;
}
.th-hero__inner { max-width: 820px; margin: 0 auto; }
.th-hero h1 { margin-bottom: 18px; }
.th-hero p.lede {
    color: var(--th-muted);
    font-size: 1.15rem;
    margin-bottom: 32px;
}
.th-hero__ctas {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
 * 7. Video card (catalog grid)
 * ------------------------------------------------------------------------- */
.th-card {
    background: var(--th-surface);
    border: 0.5px solid var(--th-border);
    border-radius: var(--th-radius-lg);
    overflow: hidden;
    transition: transform var(--th-ease), border-color var(--th-ease);
    display: flex;
    flex-direction: column;
}
.th-card:hover {
    transform: translateY(-2px);
    border-color: var(--th-gold);
}
.th-card__thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: #14110f;
    overflow: hidden;
}
.th-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.th-card__body {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.th-card__title {
    color: var(--th-text);
    font-weight: 500;
    font-size: 1.05rem;
    margin: 0;
}
.th-card__meta {
    color: var(--th-muted);
    font-size: 13px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.th-card__desc {
    color: var(--th-muted);
    font-size: 14px;
    margin: 4px 0 0;
}
.th-card__footer {
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.th-card__price {
    color: var(--th-gold);
    font-weight: 500;
    font-size: 15px;
}

/* Card thumbnail overlays — locked vs unlocked */
.th-thumb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.th-thumb-overlay--locked {
    background: linear-gradient(180deg, rgba(28,26,23,0.4) 0%, rgba(28,26,23,0.85) 100%);
}
.th-thumb-overlay--locked .th-lock-icon {
    width: 44px;
    height: 44px;
    color: var(--th-muted);
}
.th-thumb-overlay--play {
    background: linear-gradient(180deg, rgba(28,26,23,0.0) 0%, rgba(28,26,23,0.55) 100%);
    transition: background var(--th-ease);
}
.th-card:hover .th-thumb-overlay--play {
    background: linear-gradient(180deg, rgba(28,26,23,0.15) 0%, rgba(28,26,23,0.7) 100%);
}
.th-play-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--th-radius-pill);
    background: var(--th-gold);
    color: var(--th-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--th-ease);
}
.th-card:hover .th-play-icon { transform: scale(1.08); }

/* -------------------------------------------------------------------------
 * 8. Badges
 * ------------------------------------------------------------------------- */
.th-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--th-radius-pill);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.4;
}
.th-badge--subscriber {
    background: var(--th-gold-soft-bg);
    color: var(--th-gold);
    border: 0.5px solid var(--th-gold);
}
.th-badge--locked {
    background: var(--th-terracotta-soft-bg);
    color: var(--th-terracotta);
    border: 0.5px solid var(--th-terracotta);
}
.th-badge--tag {
    background: transparent;
    color: var(--th-muted);
    border: 0.5px solid var(--th-border-light);
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
}

/* -------------------------------------------------------------------------
 * 9. Filters bar (Classes page)
 * ------------------------------------------------------------------------- */
.th-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.th-filters a {
    padding: 8px 14px;
    border-radius: var(--th-radius-pill);
    border: 0.5px solid var(--th-border-light);
    color: var(--th-muted);
    font-size: 13px;
    transition: color var(--th-ease), border-color var(--th-ease);
}
.th-filters a:hover,
.th-filters a.is-active {
    color: var(--th-gold);
    border-color: var(--th-gold);
}

/* -------------------------------------------------------------------------
 * 10. Video player wrapper (single-video page)
 * ------------------------------------------------------------------------- */
.th-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #14110f;
    border-radius: var(--th-radius-lg);
    overflow: hidden;
    border: 0.5px solid var(--th-border);
}
.th-video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
/* Transparent overlay above the iframe — blocks right-click and click-through
 * to YouTube. Pointer events are captured; play controls are NOT covered
 * thanks to the bottom inset that lets YouTube's bottom bar receive clicks. */
.th-video-wrap__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;          /* leave YouTube control strip clickable */
    z-index: 2;
    cursor: default;
    background: transparent;
}
.th-video-wrap__overlay::after {
    /* Optional logo masker — blocks the YouTube logo top-right */
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 110px;
    height: 50px;
    background: transparent;
}

/* Locked placeholder for unauthorized viewers */
.th-video-locked {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: var(--th-radius-lg);
    border: 0.5px solid var(--th-terracotta);
    background:
        linear-gradient(180deg, rgba(28,26,23,0.4), rgba(28,26,23,0.95)),
        var(--th-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    gap: 16px;
}
.th-video-locked__icon { color: var(--th-terracotta); width: 56px; height: 56px; }
.th-video-locked h2 { margin: 0; }
.th-video-locked p { color: var(--th-muted); max-width: 460px; }

/* -------------------------------------------------------------------------
 * 11. Pricing
 * ------------------------------------------------------------------------- */
.th-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 40px;
}
.th-pricing-card {
    background: var(--th-surface);
    border: 0.5px solid var(--th-border);
    border-radius: var(--th-radius-lg);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
}
.th-pricing-card--featured {
    border-color: var(--th-gold);
    position: relative;
}
.th-pricing-card--featured::before {
    content: "Most popular";
    position: absolute;
    top: -10px;
    left: 24px;
    background: var(--th-gold);
    color: var(--th-bg);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--th-radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.th-pricing-card h3 { font-size: 1.3rem; margin-bottom: 6px; }
.th-pricing-card .price {
    color: var(--th-gold);
    font-size: 2.2rem;
    font-weight: 500;
    margin: 12px 0 4px;
}
.th-pricing-card .cadence { color: var(--th-muted); font-size: 14px; }
.th-pricing-card ul {
    list-style: none;
    padding: 0;
    margin: 24px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.th-pricing-card li {
    color: var(--th-text);
    font-size: 14px;
    padding-left: 22px;
    position: relative;
}
.th-pricing-card li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--th-gold);
}

/* -------------------------------------------------------------------------
 * 12. Forms (login / register)
 * ------------------------------------------------------------------------- */
.th-form {
    max-width: 420px;
    margin: 0 auto;
    background: var(--th-surface);
    border: 0.5px solid var(--th-border);
    border-radius: var(--th-radius-lg);
    padding: 36px 32px;
}
.th-form h1 { font-size: 1.6rem; text-align: center; margin-bottom: 24px; }
.th-form label {
    display: block;
    color: var(--th-muted);
    font-size: 13px;
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.th-form input[type=text],
.th-form input[type=email],
.th-form input[type=password] {
    width: 100%;
    padding: 12px 14px;
    background: var(--th-bg);
    color: var(--th-text);
    border: 0.5px solid var(--th-border-light);
    border-radius: var(--th-radius-md);
    font-size: 15px;
    margin-bottom: 18px;
    font-family: inherit;
    transition: border-color var(--th-ease);
}
.th-form input:focus {
    border-color: var(--th-gold);
    outline: none;
}
.th-form .th-btn { width: 100%; }
.th-form__alt {
    margin-top: 18px;
    text-align: center;
    color: var(--th-muted);
    font-size: 14px;
}

/* -------------------------------------------------------------------------
 * 13. Account / dashboard
 * ------------------------------------------------------------------------- */
.th-account-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
}
@media (max-width: 800px) {
    .th-account-grid { grid-template-columns: 1fr; }
}
.th-account-sidebar {
    background: var(--th-surface);
    border: 0.5px solid var(--th-border);
    border-radius: var(--th-radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.th-account-sidebar a {
    color: var(--th-text);
    padding: 10px 12px;
    border-radius: var(--th-radius-sm);
    font-size: 14px;
    transition: background var(--th-ease), color var(--th-ease);
}
.th-account-sidebar a:hover,
.th-account-sidebar a.is-active {
    background: var(--th-bg);
    color: var(--th-gold);
}

/* -------------------------------------------------------------------------
 * 14. Testimonials
 * ------------------------------------------------------------------------- */
.th-testimonials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.th-testimonial {
    background: var(--th-surface);
    border: 0.5px solid var(--th-border);
    border-radius: var(--th-radius-lg);
    padding: 26px 26px 22px;
}
.th-testimonial p { color: var(--th-text); font-size: 15px; }
.th-testimonial cite {
    color: var(--th-muted);
    font-style: normal;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* -------------------------------------------------------------------------
 * 15. Footer
 * ------------------------------------------------------------------------- */
.th-footer {
    border-top: 0.5px solid var(--th-border);
    padding: 40px var(--th-gutter);
    color: var(--th-muted);
    font-size: 13px;
    text-align: center;
    margin-top: 80px;
}
.th-footer a { color: var(--th-muted); }
.th-footer a:hover { color: var(--th-gold); }

/* -------------------------------------------------------------------------
 * 16. Utilities
 * ------------------------------------------------------------------------- */
.th-text-center { text-align: center; }
.th-mt-0  { margin-top: 0; }
.th-mt-16 { margin-top: 16px; }
.th-mt-32 { margin-top: 32px; }
.th-mb-0  { margin-bottom: 0; }
.th-mb-32 { margin-bottom: 32px; }
.th-sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
