/* ──────────────────────────────────────────────────────────────────────
   Components: hero, cards, carousels, prose
   ────────────────────────────────────────────────────────────────────── */

/* ─── Cinematic Hero ─── */
.tdm-hero {
    position: relative;
    min-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tdm-cream);
    background-color: var(--tdm-charcoal);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}
.tdm-hero-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
}
.tdm-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, var(--tdm-hero-overlay) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 2;
}
.tdm-hero-content {
    position: relative;
    z-index: 3;
    max-width: 920px;
    padding: 80px 24px;
    text-align: center;
}
.tdm-hero-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--tdm-gold);
    margin-bottom: 16px;
}
.tdm-hero-title {
    color: var(--tdm-cream);
    font-size: clamp(2.5rem, 7vw, 5rem);
    line-height: 1.05;
    margin: 0 0 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.tdm-hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    line-height: 1.5;
    color: rgba(245, 234, 211, 0.92);
    margin: 0 auto 40px;
    max-width: 640px;
}
.tdm-hero-scroll-cue {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    color: rgba(245, 234, 211, 0.5);
    animation: tdm-bounce 2s infinite ease-in-out;
}
@keyframes tdm-bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 8px); }
}

/* ─── Card grid ─── */
.tdm-card-grid {
    display: grid;
    gap: 32px;
    grid-template-columns: 1fr;
}
@media (min-width: 600px) {
    .tdm-card-grid-3, .tdm-card-grid-4, .tdm-card-grid-magazine {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1000px) {
    .tdm-card-grid-3 { grid-template-columns: repeat(3, 1fr); }
    .tdm-card-grid-4 { grid-template-columns: repeat(4, 1fr); }
    .tdm-card-grid-magazine {
        grid-template-columns: 2fr 1fr 1fr;
        grid-template-rows: auto auto;
    }
    .tdm-card-grid-magazine .tdm-card-lead {
        grid-row: span 2;
    }
}

/* ─── Card ─── */
.tdm-card {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}
.tdm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}
.tdm-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}
.tdm-card-media {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--tdm-border);
}
.tdm-aspect-portrait .tdm-card-media {
    aspect-ratio: 3/4;
}
.tdm-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.tdm-card:hover .tdm-card-media img {
    transform: scale(1.04);
}
.tdm-card-media-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--tdm-charcoal) 0%, #2a2a2a 100%);
}

.tdm-card-body {
    padding: 24px;
}
.tdm-card-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tdm-gold);
    margin-bottom: 8px;
}
.tdm-card-title {
    font-size: 1.35rem;
    margin: 0 0 8px;
    line-height: 1.2;
    color: var(--tdm-charcoal);
}
.tdm-card:hover .tdm-card-title {
    color: var(--tdm-gold);
}
.tdm-card-tagline {
    font-family: 'Roboto Slab', Georgia, serif;
    font-style: italic;
    color: var(--tdm-text-muted);
    margin: 0 0 12px;
    font-size: 0.95rem;
}
.tdm-card-excerpt {
    color: var(--tdm-text-muted);
    margin: 0 0 12px;
    font-size: 0.95rem;
    line-height: 1.6;
}
.tdm-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--tdm-text-muted);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--tdm-border);
}
.tdm-card-meta span:not(:last-child)::after {
    content: '·';
    margin-left: 12px;
    opacity: 0.5;
}
.tdm-card-rating {
    color: var(--tdm-gold);
    font-weight: 600;
}

/* Magazine lead card scaling */
.tdm-card-lead .tdm-card-title { font-size: 1.7rem; }
.tdm-card-lead .tdm-card-media { aspect-ratio: 16/10; }

/* ─── Pills ─── */
.tdm-difficulty-pill, .tdm-rating-pill {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(26, 26, 26, 0.92);
    color: var(--tdm-cream);
    padding: 5px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 2px;
    backdrop-filter: blur(8px);
}
.tdm-difficulty-easy      { background: rgba(74, 143, 58, 0.92); }
.tdm-difficulty-moderate  { background: rgba(204, 158, 51, 0.92); }
.tdm-difficulty-difficult { background: rgba(204, 121, 51, 0.92); }
.tdm-difficulty-expert    { background: rgba(192, 57, 43, 0.92); }
.tdm-difficulty-extreme   { background: rgba(120, 30, 30, 0.92); }

.tdm-rating-pill {
    background: rgba(200, 168, 75, 0.92);
    color: var(--tdm-charcoal);
}

/* ─── Carousel ─── */
.tdm-carousel {
    position: relative;
}
.tdm-carousel-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 8px;
}
.tdm-carousel-track::-webkit-scrollbar { display: none; }
.tdm-carousel-track > .tdm-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
}
@media (min-width: 768px) {
    .tdm-carousel-track > .tdm-card { flex: 0 0 320px; }
}

.tdm-carousel-dots {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding: 0;
}
@media (min-width: 768px) {
    .tdm-carousel-dots { display: flex; }
}
.tdm-carousel-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: rgba(26, 26, 26, 0.22);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, width 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
}
.tdm-carousel-dot:hover { background: rgba(26, 26, 26, 0.45); }
.tdm-carousel-dot.is-active {
    background: var(--tdm-gold);
    width: 26px;
    border-radius: 5px;
}
.tdm-carousel-dot:focus-visible {
    outline: 2px solid var(--tdm-gold);
    outline-offset: 3px;
}

/* ─── Prose ─── */
.tdm-prose {
    font-size: 1.1rem;
    line-height: 1.8;
}
.tdm-prose p { margin: 0 0 1.4em; }
.tdm-prose h2 {
    margin-top: 2em;
    margin-bottom: 0.6em;
    font-size: 1.7rem;
}
.tdm-prose h3 {
    margin-top: 1.8em;
    margin-bottom: 0.4em;
    font-size: 1.3rem;
}
.tdm-prose h2 + p, .tdm-prose h3 + p {
    margin-top: 0;
}
.tdm-prose img {
    margin: 1.6em 0;
    border-radius: 4px;
}
.tdm-prose figure { margin: 2em 0; }
.tdm-prose figure img { margin: 0; }
.tdm-prose figcaption {
    font-family: 'Roboto Slab', Georgia, serif;
    font-style: italic;
    font-size: 0.92rem;
    color: var(--tdm-text-muted);
    text-align: center;
    margin-top: 8px;
}
.tdm-prose ul, .tdm-prose ol {
    margin: 0 0 1.4em;
}
.tdm-prose li { margin-bottom: 0.6em; }

/* Editorial styling — drop cap on first paragraph */
.tdm-prose-editorial > p:first-of-type::first-letter {
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 4em;
    line-height: 0.9;
    float: left;
    margin: 0.05em 0.1em -0.05em 0;
    color: var(--tdm-charcoal);
    font-weight: 700;
}

/* ─── Search form ─── */
.tdm-search-form-wide {
    display: flex;
    margin: 24px 0;
    max-width: 600px;
}
.tdm-search-form-wide input[type="search"] {
    flex: 1;
    border-right: none;
    border-radius: 3px 0 0 3px;
}
.tdm-search-form-wide button {
    background: var(--tdm-charcoal);
    color: var(--tdm-cream);
    border-radius: 0 3px 3px 0;
    padding: 0.7em 1.6em;
}

/* ─── 404 ─── */
.tdm-404 {
    text-align: center;
    padding: 120px 0;
}
.tdm-404-title { font-size: clamp(2.5rem, 6vw, 4rem); }
.tdm-404-text {
    font-size: 1.2rem;
    color: var(--tdm-text-muted);
    margin: 16px 0 32px;
}
.tdm-404-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 48px;
}
.tdm-404 .tdm-search-form-wide {
    margin: 0 auto;
}

/* ─── Comments ─── */
.tdm-comments {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid var(--tdm-border);
}
.tdm-comments-title {
    font-size: 1.5rem;
    margin: 0 0 32px;
}
.tdm-comments-list {
    list-style: none;
    margin: 0 0 48px;
    padding: 0;
}
.tdm-comments-list .comment {
    background: #fff;
    padding: 20px 24px;
    border-radius: 4px;
    margin-bottom: 16px;
    border-left: 3px solid var(--tdm-gold);
}
.tdm-comments-list .children {
    list-style: none;
    margin: 16px 0 0 32px;
    padding: 0;
}
.tdm-comments-list .comment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.tdm-comments-list .comment-author { font-weight: 600; }
.tdm-comments-list .comment-metadata {
    font-size: 0.85rem;
    color: var(--tdm-text-muted);
}

/* ──────────────────────────────────────────────────────────────────────
   Author card — sits at the bottom of articles
   Rugged: charcoal panel, gold accent, slab serif name, social row
   ────────────────────────────────────────────────────────────────────── */

.tdm-author-card {
    margin: 56px 0 32px;
    background: var(--tdm-charcoal, #1a1a1a);
    color: var(--tdm-cream, #f5ead3);
    border-top: 4px solid var(--tdm-gold, #c8a84b);
    padding: 36px 0 40px;
    position: relative;
}
.tdm-author-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--tdm-gold, #c8a84b) 50%, transparent 100%);
    opacity: 0.4;
}

.tdm-author-card-inner {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.tdm-author-card-avatar {
    flex: 0 0 auto;
    display: block;
    line-height: 0;
}
.tdm-author-card-avatar img,
.tdm-author-card-avatar-img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--tdm-gold, #c8a84b);
    background: #2a2a2a;
}

.tdm-author-card-body {
    flex: 1 1 auto;
    min-width: 0;
}

.tdm-author-card-eyebrow {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--tdm-gold, #c8a84b);
    margin-bottom: 4px;
}

.tdm-author-card-name {
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 10px;
    color: var(--tdm-cream, #f5ead3);
}
.tdm-author-card-name a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}
.tdm-author-card-name a:hover {
    border-bottom-color: var(--tdm-gold, #c8a84b);
}

.tdm-author-card-bio {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.96rem;
    line-height: 1.6;
    color: rgba(245, 234, 211, 0.88);
    margin: 0 0 16px;
    max-width: 60ch;
}

/* Social link row — small chips with rugged border */
.tdm-author-card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}
.tdm-author-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: transparent;
    color: var(--tdm-cream, #f5ead3);
    border: 1px solid rgba(245, 234, 211, 0.28);
    border-radius: 3px;
    text-decoration: none;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.84rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.15s ease;
}
.tdm-author-card-link:hover {
    background: var(--tdm-gold, #c8a84b);
    color: var(--tdm-charcoal, #1a1a1a);
    border-color: var(--tdm-gold, #c8a84b);
}
.tdm-author-card-link-icon {
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 2px;
    background: rgba(200, 168, 75, 0.18);
    color: var(--tdm-gold, #c8a84b);
    transition: all 0.15s ease;
}
.tdm-author-card-link:hover .tdm-author-card-link-icon {
    background: rgba(26, 26, 26, 0.18);
    color: var(--tdm-charcoal, #1a1a1a);
}
.tdm-author-card-link-label {
    line-height: 1;
}

@media (max-width: 600px) {
    .tdm-author-card { padding: 28px 0 32px; margin: 40px 0 24px; }
    .tdm-author-card-inner { flex-direction: column; gap: 20px; }
    .tdm-author-card-avatar img,
    .tdm-author-card-avatar-img { width: 80px; height: 80px; }
    .tdm-author-card-name { font-size: 1.35rem; }
    .tdm-author-card-bio { font-size: 0.92rem; }
}

/* ──────────────────────────────────────────────────────────────────────
   Custom auth form ([tdm_auth_form])
   ────────────────────────────────────────────────────────────────────── */

.tdm-auth-wrap {
    max-width: 480px;
    margin: 64px auto;
    padding: 0 20px;
}
@media (max-width: 600px) {
    .tdm-auth-wrap { margin: 32px auto; }
}

.tdm-auth-card {
    background: #fff;
    border: 1px solid var(--tdm-border, #e5e0d4);
    border-top: 4px solid var(--tdm-gold, #c8a84b);
    border-radius: 4px;
    box-shadow: 0 8px 28px rgba(26, 26, 26, 0.08);
    overflow: hidden;
}

.tdm-auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--tdm-border, #e5e0d4);
    background: #faf6ec;
}
.tdm-auth-tab {
    flex: 1;
    padding: 16px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--tdm-text-muted, #555);
    cursor: pointer;
    transition: all 0.15s ease;
}
.tdm-auth-tab:hover {
    color: var(--tdm-charcoal, #1a1a1a);
}
.tdm-auth-tab.is-active {
    color: var(--tdm-charcoal, #1a1a1a);
    border-bottom-color: var(--tdm-gold, #c8a84b);
    background: #fff;
}

.tdm-auth-form {
    padding: 32px 28px;
    display: none;
}
.tdm-auth-form.is-active {
    display: block;
}

.tdm-auth-title {
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 4px;
    color: var(--tdm-charcoal, #1a1a1a);
}
.tdm-auth-sub {
    font-size: 0.92rem;
    color: var(--tdm-text-muted, #555);
    margin: 0 0 24px;
    line-height: 1.5;
}

.tdm-auth-row {
    margin-bottom: 16px;
}
.tdm-auth-row label {
    display: block;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tdm-charcoal, #1a1a1a);
    margin-bottom: 6px;
}
.tdm-auth-row input[type=text],
.tdm-auth-row input[type=email],
.tdm-auth-row input[type=password] {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--tdm-border, #d4d0c4);
    border-radius: 3px;
    font-size: 0.95rem;
    font-family: 'Inter', system-ui, sans-serif;
    background: #fff;
    color: var(--tdm-charcoal, #1a1a1a);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}
.tdm-auth-row input:focus {
    outline: none;
    border-color: var(--tdm-gold, #c8a84b);
    box-shadow: 0 0 0 3px rgba(200, 168, 75, 0.15);
}
.tdm-auth-row-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.tdm-auth-remember {
    font-size: 0.85rem !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-weight: 400 !important;
    color: var(--tdm-text-muted, #555) !important;
    margin-bottom: 0 !important;
    cursor: pointer;
}
.tdm-auth-remember input {
    margin-right: 6px;
    accent-color: var(--tdm-gold, #c8a84b);
}
.tdm-auth-link {
    font-size: 0.85rem;
    color: var(--tdm-gold, #c8a84b);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}
.tdm-auth-link:hover {
    border-bottom-color: var(--tdm-gold, #c8a84b);
}

.tdm-auth-submit {
    width: 100%;
    padding: 13px 20px;
    margin-top: 8px;
    background: var(--tdm-charcoal, #1a1a1a);
    color: var(--tdm-cream, #f5ead3);
    border: none;
    border-radius: 3px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.15s ease;
}
.tdm-auth-submit:hover:not(:disabled) {
    background: var(--tdm-gold, #c8a84b);
    color: var(--tdm-charcoal, #1a1a1a);
}
.tdm-auth-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}
.tdm-auth-submit.is-loading {
    background: var(--tdm-gold, #c8a84b);
    color: var(--tdm-charcoal, #1a1a1a);
}

.tdm-auth-msg {
    margin-top: 14px;
    padding: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    min-height: 1.45em;
}
.tdm-auth-msg.is-error {
    color: #c0392b;
    padding: 10px 12px;
    background: rgba(192, 57, 43, 0.08);
    border-radius: 3px;
}
.tdm-auth-msg.is-success {
    color: #2d6a3a;
    padding: 10px 12px;
    background: rgba(45, 106, 58, 0.08);
    border-radius: 3px;
}

.tdm-auth-disclaimer {
    font-size: 0.78rem;
    color: var(--tdm-text-muted, #555);
    margin-top: 14px;
    line-height: 1.5;
}
.tdm-auth-disclaimer a {
    color: var(--tdm-charcoal, #1a1a1a);
    border-bottom: 1px solid var(--tdm-gold, #c8a84b);
    text-decoration: none;
}

.tdm-auth-switch {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--tdm-border, #e5e0d4);
    text-align: center;
    font-size: 0.88rem;
    color: var(--tdm-text-muted, #555);
}
.tdm-auth-switch a {
    color: var(--tdm-gold, #c8a84b);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}
.tdm-auth-switch a:hover {
    border-bottom-color: var(--tdm-gold, #c8a84b);
}

.tdm-auth-already {
    padding: 24px 28px;
    margin: 0;
    font-size: 1rem;
    color: var(--tdm-charcoal, #1a1a1a);
}
.tdm-auth-already a {
    color: var(--tdm-gold, #c8a84b);
    font-weight: 600;
    text-decoration: none;
}
