/* ================================
   TEMPLATE DETAIL PAGE (Sidebar)
   ================================ */

/* Content area */
.td-content {
    padding: calc(var(--nav-height) + 48px) 0 80px;
}

.td-content .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 32px;
}

.td-content .breadcrumb a {
    color: rgba(255, 255, 255, 0.5);
}

.td-content .breadcrumb a:hover {
    color: var(--amber);
}

.td-content .breadcrumb-sep {
    color: rgba(255, 255, 255, 0.2);
    font-size: 11px;
}

/* Two-column layout */
.td-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 48px;
    align-items: start;
}

.td-main {
    min-width: 0;
}

/* Sidebar (sticky) */
.td-sidebar {
    position: sticky;
    top: calc(var(--nav-height) + 24px);
}

.td-name {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 900;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 12px;
}

.td-desc {
    font-size: 15px;
    color: var(--silver);
    line-height: 1.7;
    margin-bottom: 28px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 160, 74, 0.38) rgba(255, 255, 255, 0.04);
}

.td-desc::-webkit-scrollbar {
    width: 8px;
}

.td-desc::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.td-desc::-webkit-scrollbar-thumb {
    background: rgba(212, 160, 74, 0.38);
    border-radius: 999px;
}

.td-desc::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 160, 74, 0.56);
}

/* Meta info */
.td-meta {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 28px;
    border: 1px solid var(--ink-mid);
    border-radius: 12px;
    overflow: hidden;
}

.td-meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
}

.td-meta-item+.td-meta-item {
    border-top: 1px solid var(--ink-mid);
}

.td-meta-label {
    font-size: 13px;
    color: var(--slate);
}

.td-meta-value {
    font-size: 13px;
    color: var(--mist);
    font-weight: 500;
}

/* Action buttons */
.td-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Back link */
.td-back {
    font-size: 13px;
    color: var(--slate);
    transition: color 0.3s ease;
}

.td-back:hover {
    color: var(--amber);
}

/* Main content */
.td-content-card {
    border-radius: 0;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--silver);
    line-height: 1.8;
}

/* Keep imported template HTML visible even if source content contains reveal classes. */
.content-no-reveal .reveal,
.content-no-reveal .reveal.visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

.td-content-card>*:first-child {
    margin-top: 0;
}

.td-content-card>*:last-child {
    margin-bottom: 0;
}

.td-content-card h1,
.td-content-card h2,
.td-content-card h3,
.td-content-card h4,
.td-content-card h5,
.td-content-card h6 {
    font-family: var(--font-display);
    color: var(--white);
    line-height: 1.35;
    margin: 1.3em 0 0.5em;
}

.td-content-card h2 {
    font-size: clamp(24px, 3vw, 34px);
}

.td-content-card h3 {
    font-size: clamp(20px, 2.2vw, 28px);
}

.td-content-card p {
    margin: 0 0 1.1em;
}

.td-content-card ul,
.td-content-card ol {
    margin: 0.4em 0 1.2em 1.25em;
}

.td-content-card li+li {
    margin-top: 0.4em;
}

.td-content-card a {
    color: var(--amber);
}

.td-content-card a:hover {
    color: var(--amber-soft);
}

.related-posts .templates-grid {
    align-items: start;
}

.related-templates-section {
    padding-top: 0;
    padding-bottom: 56px;
}

.related-posts .template-info {
    min-height: auto;
    padding: 12px 2px 2px;
    align-items: center;
    gap: 10px;
}

.related-posts .template-info h3 {
    line-height: 1.35;
}

.related-posts .template-type {
    align-self: center;
}

@media (max-width: 768px) {
    .related-templates-section {
        padding-bottom: 40px;
    }
}

@media (max-width: 480px) {
    .related-templates-section {
        padding-bottom: 28px;
    }
}

.td-content-card blockquote {
    margin: 1.2em 0;
    padding: 0.9em 1em;
    border-left: 3px solid var(--amber);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    color: var(--mist);
}

.td-content-card pre {
    overflow-x: auto;
    padding: 0.9em 1em;
    border-radius: 10px;
    border: 1px solid var(--ink-mid);
    background: rgba(0, 0, 0, 0.28);
}

.td-content-card code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.92em;
}

.td-content-card img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.blocksy-template-showcase {
    display: grid;
    gap: 40px;
}

.blocksy-template-hero h3,
.blocksy-template-gallery-section h3 {
    margin-bottom: 18px;
}

.blocksy-template-hero-media {
    margin: 0;
}

.blocksy-template-hero-media img {
    display: block;
    width: 100%;
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.blocksy-template-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.blocksy-template-gallery-item {
    margin: 0;
    display: flex;
    flex-direction: column-reverse;
    gap: 16px;
}

.blocksy-template-gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
}

.blocksy-template-gallery-item figcaption {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 700;
    line-height: 1.18;
    color: var(--white);
    letter-spacing: -0.02em;
}

.td-content-card table {
    width: 100%;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
}

.td-content-card th,
.td-content-card td {
    border: 1px solid var(--ink-mid);
    padding: 10px 12px;
    text-align: left;
}

.td-content-card th {
    color: var(--white);
    background: rgba(255, 255, 255, 0.03);
}

.td-content-card hr {
    border: 0;
    border-top: 1px solid var(--ink-mid);
    margin: 1.6em 0;
}

.td-cta {
    padding: 0 0 100px;
}

.td-cta-inner {
    text-align: center;
    padding: 56px 40px;
    background: var(--ink-light);
    border: 1px solid var(--ink-mid);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.td-cta-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(212, 160, 74, 0.06), transparent 60%);
    pointer-events: none;
}

.td-cta-inner h2 {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 10px;
    position: relative;
}

.td-cta-inner p {
    font-size: 15px;
    color: var(--silver);
    margin-bottom: 28px;
    position: relative;
}

.td-cta-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

/* Responsive */
@media (max-width: 900px) {
    .td-layout {
        grid-template-columns: 1fr;
    }

    .td-sidebar {
        position: static;
    }

    .td-desc {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .td-actions {
        flex-direction: row;
    }

    .td-actions .btn {
        flex: 1;
    }

    .td-cta-inner {
        padding: 40px 24px;
    }
}

@media (max-width: 640px) {
    .blocksy-template-showcase {
        gap: 28px;
    }

    .blocksy-template-gallery {
        gap: 24px;
    }

    .blocksy-template-gallery-item {
        gap: 12px;
    }

    .blocksy-template-gallery-item figcaption {
        font-size: 24px;
    }
}

/* Pricing callout in sidebar */
.td-pricing-cta {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(212, 160, 74, 0.3);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(212, 160, 74, 0.06), transparent);
}

.td-pricing-cta-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.td-pricing-cta-badge {
  color: var(--amber);
  font-weight: 700;
  font-size: 15px;
}

.td-pricing-cta-desc {
  color: var(--silver);
  font-size: 13px;
  line-height: 1.5;
}
