/* ─────────────────────────────────────────────────────────────────────────────
   Seth Brand Tech Care Templates Pages — hub + detail pages
   Scoped to .templates-page and .templates-hero. Loaded via $extra_head.
   Uses design tokens from theme.css (--green, --bronze, --surface, --serif, etc.)
   ───────────────────────────────────────────────────────────────────────────── */

.templates-page { padding-bottom: 0; }

.templates-page .breadcrumb-nav { padding-top: 1rem; }

/* ── Hub Hero (mirrors .best-hero) ── */
.templates-hero {
    position: relative;
    padding: 3.5rem 0 2.5rem;
    overflow: hidden;
}

.templates-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(94, 207, 120, 0.10), transparent 35%),
        radial-gradient(circle at 20% 80%, rgba(200, 169, 106, 0.06), transparent 30%);
    pointer-events: none;
}

.templates-hero .container { position: relative; z-index: 1; }

.templates-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--green);
}

.templates-hero-eyebrow::before {
    content: "";
    width: 24px;
    height: 1px;
    background: var(--green);
    opacity: 0.5;
}

.templates-hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.1;
    max-width: 20ch;
    margin-bottom: 1rem;
}

.templates-hero .hero-sub {
    font-size: 1.1rem;
    color: var(--text-mid);
    max-width: 60ch;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.templates-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-low);
    margin-bottom: 1.5rem;
}

.templates-hero-meta span { display: inline-flex; align-items: center; gap: 0.4rem; }

/* ── Hub Grid (mirrors .best-hub-grid) ── */
.templates-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.template-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.75rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(24, 27, 33, 0.6), rgba(17, 19, 23, 0.9));
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
}

.template-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
}

.template-card .card-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-low);
}

.template-card .card-tier-badge {
    font-family: var(--mono);
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.template-card .card-tier-badge.free {
    background: var(--green-trace);
    color: var(--green);
    border: 1px solid var(--border-accent);
}

.template-card .card-tier-badge.premium {
    background: var(--bronze-glow);
    color: var(--bronze);
    border: 1px solid var(--bronze);
}

.template-card h3 {
    font-family: var(--serif);
    font-size: 1.3rem;
    color: var(--text);
    line-height: 1.3;
}

.template-card p {
    font-size: 0.92rem;
    color: var(--text-mid);
    line-height: 1.5;
    flex-grow: 1;
}

.template-card .card-arrow {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--green);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.template-card:hover .card-arrow { text-decoration: underline; }

/* ── Template Detail Hero ── */
.template-detail-hero {
    position: relative;
    padding: 3rem 0 2rem;
    overflow: hidden;
}

.template-detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(94, 207, 120, 0.08), transparent 35%);
    pointer-events: none;
}

.template-detail-hero .container { position: relative; z-index: 1; }

.template-detail-hero .template-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--green);
}

.template-detail-hero h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    line-height: 1.15;
    max-width: 22ch;
    margin-bottom: 1rem;
}

.template-detail-hero .template-sub {
    font-size: 1.05rem;
    color: var(--text-mid);
    max-width: 60ch;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.template-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-low);
}

.template-detail-meta span { display: inline-flex; align-items: center; gap: 0.4rem; }

/* ── Checklist Display ── */
.checklist-section {
    padding: 1rem 0 2rem;
}

.checklist-category {
    margin-bottom: 2rem;
}

.checklist-category h3 {
    font-family: var(--serif);
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
}

.checklist-items {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: checklist-item;
}

.checklist-items li {
    position: relative;
    padding: 0.8rem 1rem 0.8rem 2.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface, #12141a);
    font-size: 0.92rem;
    color: var(--text-mid);
    line-height: 1.5;
}

.checklist-items li::before {
    content: "";
    position: absolute;
    left: 0.9rem;
    top: 0.95rem;
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid var(--green);
    border-radius: 4px;
    background: transparent;
}

.checklist-items li strong {
    display: block;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 0.15rem;
}

/* Gated overlay for preview items */
.checklist-gated {
    position: relative;
}

.checklist-gated .gated-overlay {
    padding: 2rem 1.5rem;
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: rgba(17, 19, 23, 0.6);
    margin-top: 1rem;
}

.checklist-gated .gated-overlay p {
    color: var(--text-low);
    font-size: 0.9rem;
    margin: 0;
}

.checklist-gated .gated-overlay .lock-icon {
    font-size: 1.5rem;
    color: var(--bronze);
    margin-bottom: 0.5rem;
    display: block;
}

/* ── Email Gate Form Card ── */
.template-form-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(24, 27, 33, 0.8), rgba(17, 19, 23, 0.95));
    padding: 2rem;
    margin: 2rem 0;
}

.template-form-card h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.template-form-card .form-intro {
    color: var(--text-mid);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.template-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.template-form label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.template-form label span {
    font-family: var(--mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-low);
}

.template-form input[type="email"] {
    padding: 0.7rem 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface, #12141a);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
}

.template-form input[type="email"]:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(94, 207, 120, 0.15);
}

.template-form .hub-link-btn,
.template-form button[type="submit"] {
    align-self: flex-start;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: var(--green);
    color: #0a0b0e;
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.template-form .hub-link-btn:hover,
.template-form button[type="submit"]:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.template-form-meta {
    margin-top: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-low);
    line-height: 1.5;
}

.form-feedback {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.form-feedback-success {
    background: var(--green-trace);
    border: 1px solid var(--border-accent);
    color: var(--green);
}

.form-feedback-error {
    background: rgba(200, 80, 80, 0.1);
    border: 1px solid rgba(200, 80, 80, 0.3);
    color: #e08080;
}

/* ── Unlocked content ── */
.checklist-unlocked {
    margin-top: 1rem;
}

.checklist-unlocked h3 {
    font-size: 1.2rem;
    color: var(--green);
    margin-bottom: 0.5rem;
}

.checklist-unlocked .unlock-meta {
    font-size: 0.85rem;
    color: var(--text-low);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

/* ── Print / PDF button ── */
.print-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--text-mid);
    font-family: var(--mono);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.print-btn:hover {
    border-color: var(--green);
    color: var(--green);
}

/* ── CTA section at bottom ── */
.template-cta {
    padding: 2.5rem 0;
    border-top: 1px solid var(--line);
    margin-top: 2rem;
    text-align: center;
}

.template-cta h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.template-cta p {
    color: var(--text-mid);
    max-width: 50ch;
    margin: 0 auto 1.25rem;
    line-height: 1.6;
}

.template-cta .btn-primary {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    background: var(--green);
    color: #0a0b0e;
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.template-cta .btn-primary:hover { opacity: 0.9; }

/* ── How-it-works section (hub) ── */
.templates-how {
    padding: 2.5rem 0;
    border-top: 1px solid var(--line);
}

.templates-how h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.templates-how p {
    color: var(--text-mid);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.templates-how ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.templates-how li {
    padding: 0.4rem 0 0.4rem 1.4rem;
    position: relative;
    color: var(--text-mid);
    line-height: 1.5;
}

.templates-how li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--green);
}

.templates-how li strong { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 640px) {
    .templates-hub-grid {
        grid-template-columns: 1fr;
    }
    .template-form-card {
        padding: 1.5rem;
    }
    .checklist-items li {
        padding: 0.7rem 0.8rem 0.7rem 2.5rem;
        font-size: 0.88rem;
    }
}

/* ── Print styles (PDF download via browser print) ── */
@media print {
    header, footer, .breadcrumb-nav, .template-form-card,
    .template-cta, .print-btn, .mobile-menu-toggle, .scroll-progress,
    .templates-hero-eyebrow, .template-detail-meta {
        display: none !important;
    }
    .template-detail-hero { padding: 1rem 0; }
    .template-detail-hero::before { display: none; }
    body { background: white !important; color: black !important; }
    .checklist-items li {
        border: 1px solid #ccc;
        background: white;
        color: black;
        page-break-inside: avoid;
    }
    .checklist-items li strong { color: black; }
    .checklist-items li::before {
        border-color: black;
    }
    .checklist-category h3 {
        color: black;
        border-bottom: 1px solid #ccc;
    }
}
