/* ══════════════════════════════════════════════════
   Template Single Page — template-single.css
══════════════════════════════════════════════════ */

/* ── Breadcrumb ────────────────────────────────── */
.ts-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255,255,255,.45);
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.ts-breadcrumb a { color: rgba(255,255,255,.55); text-decoration: none; transition: color .15s; }
.ts-breadcrumb a:hover { color: #FFBA12; }
.ts-breadcrumb .sep { color: rgba(255,255,255,.2); }
.ts-breadcrumb .current { color: rgba(255,255,255,.9); font-weight: 600; }

/* ── Hero ──────────────────────────────────────── */
.ts-hero {
    background: #0B0D0F;
    padding: 180px 0 0;
    position: relative;
    overflow: hidden;
}
.ts-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(255,186,18,.05) 0%, transparent 55%);
    pointer-events: none;
}
.ts-hero-inner {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: end;
}
.ts-hero-text { padding: 32px 0 52px; }
.ts-hero-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #FFBA12;
    text-transform: uppercase;
    letter-spacing: .9px;
    margin-bottom: 18px;
}
.ts-hero h1 {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -.4px;
    margin-bottom: 16px;
}
.ts-hero-desc {
    font-size: 16px;
    color: rgba(255,255,255,.55);
    line-height: 1.7;
    max-width: 440px;
    margin-bottom: 30px;
}
.ts-hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ts-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #FFBA12;
    color: #0B0D0F;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s, transform .15s;
}
.ts-btn-primary:hover { background: #e6a800; color: #0B0D0F; text-decoration: none; transform: translateY(-1px); }
.ts-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,.55);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid rgba(255,255,255,.15);
    padding: 11px 20px;
    border-radius: 8px;
    transition: all .15s;
}
.ts-btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,.4); text-decoration: none; }

/* ── Hero browser preview ──────────────────────── */
.ts-hero-preview {
    position: relative;
    height: 320px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.ts-browser {
    width: 100%;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.08);
    border-bottom: none;
    box-shadow: 0 -8px 40px rgba(0,0,0,.4);
    /* background set via inline style= from PHP */
}
.ts-browser-chrome {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: rgba(0,0,0,.18);
    border-bottom: 1px solid rgba(255,255,255,.06);
    backdrop-filter: blur(4px);
}
.ts-browser-dots { display: flex; gap: 5px; }
.ts-browser-dots span { width: 8px; height: 8px; border-radius: 50%; display: block; }
.ts-browser-url {
    flex: 1;
    background: rgba(255,255,255,.1);
    border-radius: 5px;
    padding: 3px 10px;
    font-size: 9px;
    color: rgba(255,255,255,.5);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.ts-browser-body {
    padding: 24px;
    display: flex;
    justify-content: center;
}
.ts-form-preview {
    background: rgba(255,255,255,.96);
    border-radius: 10px;
    padding: 16px 20px;
    width: 240px;
    box-shadow: 0 8px 32px rgba(0,0,0,.28);
}
.ts-form-title { font-size: 13px; font-weight: 800; color: #0B0D0F; margin-bottom: 12px; }
.ts-form-label {
    font-size: 9px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 3px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.ts-form-stars {
    font-size: 11px;
    color: #FFBA12;
    letter-spacing: 2px;
    margin-bottom: 8px;
    display: block;
    line-height: 1;
}
.ts-form-opts {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
    align-items: center;
}
.ts-form-opts span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1.5px solid #9ca3af;
    flex-shrink: 0;
}
.ts-form-opts span:first-child {
    background: #374151;
    border-color: #374151;
}
.ts-form-input {
    display: block;
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 9px;
    color: #9ca3af;
    margin-bottom: 8px;
    background: #f9fafb;
}
.ts-form-btn {
    display: block;
    width: 100%;
    padding: 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    margin-top: 6px;
    color: #fff;
    /* background set via inline style= from PHP */
}
.ts-theme-pill {
    position: absolute;
    top: 44px;
    right: 12px;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.1);
}

/* ── Content + sidebar layout ──────────────────── */
.ts-body { padding: 64px 0 80px; }
.ts-body-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 60px;
    align-items: start;
}

/* ── Sidebar ───────────────────────────────────── */
.ts-sidebar { position: sticky; top: 100px; }
.ts-cta-card {
    background: #0B0D0F;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 14px;
}
.ts-cta-card h3 { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.ts-cta-card p { font-size: 13px; color: rgba(255,255,255,.55); margin-bottom: 16px; line-height: 1.55; }
.ts-cta-btn-primary {
    display: block;
    width: 100%;
    padding: 13px;
    background: #FFBA12;
    color: #0B0D0F;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: opacity .15s;
}
.ts-cta-btn-primary:hover { opacity: .9; color: #0B0D0F; text-decoration: none; }
.ts-cta-btn-secondary {
    display: block;
    width: 100%;
    padding: 11px;
    background: transparent;
    color: rgba(255,255,255,.65);
    border: 1.5px solid rgba(255,255,255,.15);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    margin-top: 8px;
    transition: all .15s;
}
.ts-cta-btn-secondary:hover { border-color: rgba(255,255,255,.4); color: #fff; text-decoration: none; }
.ts-meta-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
}
.ts-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}
.ts-meta-row:last-child { border-bottom: none; }
.ts-meta-label { color: #9ca3af; font-weight: 500; }
.ts-meta-value { color: #0B0D0F; font-weight: 600; }
.ts-tip-card {
    background: #f8f9fb;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
}
.ts-tip-card p { font-size: 13px; color: #6b7280; margin: 0 0 8px; line-height: 1.55; }

/* ── Article content typography ────────────────── */
.ts-article { font-size: 15px; color: #374151; line-height: 1.8; }
.ts-article h2 {
    font-size: 22px;
    font-weight: 800;
    color: #0B0D0F;
    margin: 40px 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
    line-height: 1.3;
}
.ts-article h2:first-child { margin-top: 0; }
.ts-article h3 {
    font-size: 17px;
    font-weight: 700;
    color: #0B0D0F;
    margin: 28px 0 10px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ts-article h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: #FFBA12;
    border-radius: 2px;
    flex-shrink: 0;
}
.ts-article h4 { font-size: 15px; font-weight: 700; color: #1f2937; margin: 20px 0 8px; line-height: 1.4; }
.ts-article h5 { font-size: 14px; font-weight: 600; color: #374151; margin: 16px 0 6px; text-transform: uppercase; letter-spacing: .5px; }
.ts-article p { margin: 0 0 16px; color: #4B5563; line-height: 1.8; font-size: 15px; }
.ts-article p:last-child { margin-bottom: 0; }
.ts-article ul { list-style: none; padding: 0; margin: 0 0 20px; }
.ts-article ul li { position: relative; padding: 5px 0 5px 22px; color: #4B5563; font-size: 15px; line-height: 1.7; }
.ts-article ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #FFBA12;
}
.ts-article ol { padding-left: 20px; margin: 0 0 20px; counter-reset: ol-counter; list-style: none; }
.ts-article ol li { position: relative; padding: 5px 0 5px 10px; color: #4B5563; font-size: 15px; line-height: 1.7; counter-increment: ol-counter; }
.ts-article ol li::before { content: counter(ol-counter) "."; position: absolute; left: -20px; color: #FFBA12; font-weight: 700; font-size: 14px; }
.ts-article strong, .ts-article b { color: #0B0D0F; font-weight: 700; }
.ts-article em, .ts-article i { font-style: italic; }
.ts-article a { color: #0B0D0F; text-decoration: underline; text-underline-offset: 3px; transition: color .15s; }
.ts-article a:hover { color: #FFBA12; }
.ts-article code { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px; background: #f3f4f6; color: #1f2937; padding: 2px 6px; border-radius: 4px; }
.ts-article blockquote { margin: 0 0 20px; padding: 14px 20px; border-left: 4px solid #FFBA12; background: #fffbeb; border-radius: 0 8px 8px 0; font-style: italic; color: #374151; }
.ts-article blockquote p { margin: 0; }
.ts-article hr { border: none; border-top: 2px solid #f3f4f6; margin: 32px 0; }
.ts-article table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 14px; }
.ts-article table th { background: #f3f4f6; color: #0B0D0F; font-weight: 700; padding: 10px 14px; text-align: left; border-bottom: 2px solid #e5e7eb; }
.ts-article table td { padding: 10px 14px; border-bottom: 1px solid #f3f4f6; color: #4B5563; }
.ts-article table tr:last-child td { border-bottom: none; }

/* ── How-to block ──────────────────────────────── */
.ts-how-to { background: #f8f9fb; border: 1px solid #e9ecef; border-radius: 12px; padding: 24px; margin-top: 36px; }
.ts-how-to h2 { font-size: 17px; font-weight: 700; color: #0B0D0F; margin: 0 0 14px; border: none; padding: 0; }
.ts-how-to p { font-size: 14px; color: #6b7280; margin: 0 0 14px; line-height: 1.7; }
.ts-how-to ul { margin: 0; }
.ts-how-to ul li { position: relative; padding: 4px 0 4px 20px; font-size: 14px; color: #4B5563; line-height: 1.65; list-style: none; }
.ts-how-to ul li::before { content: ''; position: absolute; left: 0; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: #FFBA12; }

/* ── Related template cards ────────────────────── */
.ts-rel-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow .2s, transform .15s;
    text-decoration: none;
    display: block;
    height: 100%;
}
.ts-rel-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); transform: translateY(-2px); text-decoration: none; }
.ts-rel-preview {
    height: 110px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* background set via inline style= from PHP */
}
.ts-rel-mini {
    background: rgba(255,255,255,.96);
    border-radius: 6px;
    padding: 8px 10px;
    width: 110px;
    box-shadow: 0 4px 16px rgba(0,0,0,.22);
    position: relative;
    z-index: 1;
}
.ts-rel-mini-label {
    font-size: 7px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 2px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.ts-rel-mini-stars {
    font-size: 7px;
    color: #FFBA12;
    letter-spacing: 1px;
    margin-bottom: 3px;
    display: block;
    line-height: 1;
}
.ts-rel-mini-opts {
    display: flex;
    gap: 3px;
    margin-bottom: 4px;
    align-items: center;
}
.ts-rel-mini-opts span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1.5px solid #9ca3af;
    flex-shrink: 0;
}
.ts-rel-mini-opts span:first-child {
    background: #374151;
    border-color: #374151;
}
.ts-rel-mini-input {
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    padding: 3px 5px;
    font-size: 7px;
    color: #9ca3af;
    margin-bottom: 4px;
    background: #f9fafb;
    display: block;
    width: 100%;
}
.ts-rel-mini-btn {
    display: block;
    width: 100%;
    padding: 4px;
    border-radius: 3px;
    font-size: 7px;
    font-weight: 700;
    text-align: center;
    color: #fff;
    /* background set via inline style= from PHP */
}
.ts-rel-body { padding: 12px 14px 14px; background: #fff; position: relative; z-index: 1; }
.ts-rel-cat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #9ca3af; margin-bottom: 3px; }
.ts-rel-name { font-size: 13px; font-weight: 700; color: #0B0D0F; line-height: 1.3; }

/* ── Stats strip ──────────────────────────────── */
.ts-stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin: 28px 0 0;
}
.ts-stat {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 18px 16px 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: box-shadow .15s, transform .15s;
}
.ts-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #0B0D0F;
    border-radius: 10px 10px 0 0;
}
.ts-stat:hover { box-shadow: 0 4px 14px rgba(0,0,0,.07); transform: translateY(-1px); }

.ts-stat--free::before { background: #059669; }

.ts-stat-num {
    display: block;
    font-size: 30px;
    font-weight: 800;
    color: #0B0D0F;
    line-height: 1;
    margin-bottom: 7px;
    letter-spacing: -.5px;
}
.ts-stat-num small {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    color: #6b7280;
    margin-left: 2px;
}
.ts-stat-num--free {
    font-size: 22px;
    color: #059669;
}
.ts-stat-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .6px;
    line-height: 1.3;
}

/* ── Field type chips ──────────────────────────── */
.ts-field-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 28px 0 0;
    padding: 16px 18px;
    background: #f8f9fb;
    border: 1px solid #e9ecef;
    border-radius: 10px;
}
.ts-chips-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: #9ca3af;
    margin-right: 4px;
    flex-shrink: 0;
}
.ts-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
    line-height: 1.4;
}
.ts-chip em { font-style: normal; opacity: .6; font-size: 11px; }

/* chip color families */
.ts-chip--text     { background: #f9fafb; color: #374151; border-color: #e5e7eb; }
.ts-chip--choice   { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.ts-chip--rating   { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.ts-chip--datetime { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.ts-chip--media    { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }
.ts-chip--layout   { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.ts-chip--other    { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }

/* ── Questions section ─────────────────────────── */
.ts-questions { margin-top: 36px; }

.ts-questions-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.ts-questions-title {
    font-size: 20px;
    font-weight: 800;
    color: #0B0D0F;
    margin: 0;
    line-height: 1.3;
}
.ts-free-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    white-space: nowrap;
    letter-spacing: .2px;
}
.ts-questions-sub {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 18px;
    line-height: 1.6;
}

.ts-questions-pg {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
}

.ts-questions-pg-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    background: #0B0D0F;
}
.ts-pg-num {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: rgba(255,255,255,.35);
    flex-shrink: 0;
}
.ts-pg-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex: 1;
}
.ts-pg-count {
    font-size: 11px;
    color: rgba(255,255,255,.3);
    font-weight: 500;
    flex-shrink: 0;
}

.ts-questions-list { background: #fff; }

.ts-q-section-head {
    padding: 7px 18px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #9ca3af;
    background: #f8f9fb;
    border-bottom: 1px solid #f3f4f6;
}

.ts-question-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid #f3f4f6;
    transition: background .1s;
}
.ts-question-row:last-child { border-bottom: none; }
.ts-question-row:hover { background: #fafafa; }

.ts-q-num {
    width: 22px;
    height: 22px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    flex-shrink: 0;
}
.ts-q-label {
    flex: 1;
    font-size: 14px;
    color: #1f2937;
    line-height: 1.45;
    font-weight: 500;
}
.ts-q-req {
    color: #dc2626;
    margin-left: 2px;
    font-weight: 700;
}
.ts-q-type {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid transparent;
}

/* q-type badge color families (same as chips) */
.ts-q-type--text     { background: #f9fafb; color: #374151; border-color: #e5e7eb; }
.ts-q-type--choice   { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.ts-q-type--rating   { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.ts-q-type--datetime { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.ts-q-type--media    { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }
.ts-q-type--layout   { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.ts-q-type--other    { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 991px) {
    .ts-hero-inner { grid-template-columns: 1fr; }
    .ts-hero-preview { display: none; }
    .ts-hero h1 { font-size: 32px; }
    .ts-body-grid { grid-template-columns: 1fr; gap: 32px; }
    .ts-sidebar { position: static; }
}
@media (max-width: 600px) {
    .ts-stats-strip { grid-template-columns: repeat(2, 1fr); }
    .ts-stat-num { font-size: 24px; }
    .ts-q-type { display: none; }
    .ts-question-row { gap: 8px; padding: 11px 14px; }
    .ts-questions-pg-head { padding: 10px 14px; }
    .ts-questions-list .ts-q-section-head { padding: 7px 14px; }
}
