/* NOX dev. — Templates Page Styles */

/* ── Templates Page Layout ── */
.templates-page {
    min-height: 100vh;
    background: var(--bg);
}

/* ── Templates Hero ── */
.templates-hero {
    padding: 160px 48px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.templates-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    pointer-events: none;
}

.templates-hero .eyebrow {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.templates-hero .eyebrow::before,
.templates-hero .eyebrow::after {
    content: '';
    width: 32px;
    height: 1px;
    background: var(--text-dim);
}

.templates-hero h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.templates-hero h1 em {
    font-style: normal;
    color: var(--text-muted);
}

.templates-hero .lead {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ── Category Filter ── */
.category-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 48px 56px;
}

.filter-pill {
    padding: 10px 22px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    letter-spacing: 0.02em;
}

.filter-pill:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.filter-pill.active {
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

/* ── Templates Grid ── */
.templates-grid {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 48px 120px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

/* ── Template Card ── */
.template-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.5s var(--ease);
    position: relative;
    opacity: 0;
    transform: translateY(24px);
}

.template-card.reveal-active {
    opacity: 1;
    transform: translateY(0);
}

.template-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-6px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}

.template-card[data-hidden="true"] {
    display: none;
}

/* Card Preview (iframe container) */
.template-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 1200 / 630;
    overflow: hidden;
    cursor: pointer;
    background: #111;
    border-bottom: 1px solid var(--border);
    container-type: inline-size;
}

.template-preview iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 1200px;
    height: 630px;
    border: none;
    transform-origin: top left;
    transform: scale(var(--scale, 1));
    pointer-events: none;
}

.template-preview-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.6) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-card:hover .template-preview-overlay {
    opacity: 1;
}

.preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.preview-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.preview-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* Card Info */
.template-info {
    padding: 24px 28px;
}

.template-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.template-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.template-category .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.template-number {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

.template-info h3 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.template-info p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.template-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.template-tags span {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}

/* ── CTA Banner at bottom ── */
.templates-cta-banner {
    text-align: center;
    padding: 80px 48px 120px;
    border-top: 1px solid var(--border);
}

.templates-cta-banner h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.templates-cta-banner p {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 28px;
    line-height: 1.7;
}

.templates-cta-banner .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    background: #fff;
    color: #000;
    text-decoration: none;
    transition: all 0.3s var(--ease);
}

.templates-cta-banner .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.1);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .templates-grid {
        grid-template-columns: 1fr;
        padding: 0 24px 80px;
        max-width: 480px;
        margin: 0 auto;
    }

    .templates-hero {
        padding: 140px 24px 48px;
    }

    .category-filters {
        padding: 0 24px 40px;
    }
}

@media (max-width: 600px) {
    .templates-hero h1 {
        font-size: 1.8rem;
    }

    .template-info {
        padding: 20px;
    }

    .templates-cta-banner {
        padding: 48px 24px 80px;
    }
}
