/* ─── TEMPLATES — Atelier Muse & Co. — Free & paid downloads index ─── */
:root {
  --tpl-bg: #FAF7F2;             /* warm cream — matches --bg */
  --tpl-bg-card: #F5EDE0;        /* warm linen — matches --ex-bg */
  --tpl-bg-deep: #fffaf0;        /* printable cream sheet */
  --tpl-ink: #1C1917;
  --tpl-ink-body: #2C1A0E;
  --tpl-muted: #78716C;
  --tpl-burgundy: #3D1A2E;
  --tpl-burgundy-deep: #2a131f;
  --tpl-gold: #C9A96E;
  --tpl-mauve: #C4949A;
  --tpl-rule: rgba(61, 26, 46, 0.12);
  --tpl-font-display: 'Cormorant Garamond', Georgia, serif;
  --tpl-font-body: 'DM Sans', system-ui, sans-serif;
  --tpl-pad: clamp(1.5rem, 5vw, 5rem);
}

* {
  box-sizing: border-box;
}

body.tpl__body {
  background: var(--tpl-bg);
  color: var(--tpl-ink-body);
  font-family: var(--tpl-font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}

/* ─── Page grid ─── */
.tpl {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

/* ─── Brand bar (above nav, italic mark in top-right) ─── */
.tpl__brand {
  padding: 1.75rem var(--tpl-pad);
  border-bottom: 1px solid var(--tpl-rule);
  font-family: var(--tpl-font-display);
  font-style: italic;
  color: var(--tpl-burgundy);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-align: right;
}

/* ─── Main column ─── */
.tpl__main {
  padding: clamp(2.5rem, 6vw, 6rem) var(--tpl-pad) clamp(3rem, 8vw, 7rem);
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
}

/* ─── Hero ─── */
.tpl__hero {
  text-align: center;
  max-width: 38rem;
  margin: 0 auto;
}

.tpl__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--tpl-gold);
  margin-bottom: 1.5rem;
  display: inline-block;
  font-weight: 500;
}

.tpl__accent-rule {
  display: block;
  width: clamp(2.5rem, 8vw, 4.5rem);
  height: 1px;
  background: var(--tpl-mauve);
  margin: 0.5rem 0 2rem;
  opacity: 0.85;
}

.tpl__hero .tpl__accent-rule {
  margin-left: auto;
  margin-right: auto;
}

.tpl__title {
  font-family: var(--tpl-font-display);
  font-weight: 500;
  font-size: clamp(2.25rem, 5.5vw, 3.85rem);
  line-height: 1.15;
  color: var(--tpl-burgundy);
  margin: 0 0 1.25rem;
  letter-spacing: 0.005em;
}

.tpl__lede {
  margin: 0 auto;
  font-family: var(--tpl-font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  color: var(--tpl-burgundy);
  line-height: 1.5;
  max-width: 34rem;
}

/* ─── Section blocks (FREE / PAID) ─── */
.tpl__section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tpl__section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--tpl-gold);
  font-family: var(--tpl-font-body);
  font-weight: 500;
}

.tpl__section-title {
  font-family: var(--tpl-font-display);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  color: var(--tpl-burgundy);
  margin: 0;
  letter-spacing: 0.005em;
  line-height: 1.25;
}

/* ─── Card grid ─── */
.tpl__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.tpl__card {
  background: var(--tpl-bg-card);
  border: 1px solid var(--tpl-rule);
  border-radius: 4px;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}

.tpl__card:hover {
  border-color: var(--tpl-mauve);
  transform: translateY(-2px);
}

.tpl__card--paid {
  background: var(--tpl-bg-deep);
  border: 1px solid rgba(196, 148, 154, 0.35);
}

.tpl__card-eyebrow {
  font-family: var(--tpl-font-body);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tpl-gold);
  margin-bottom: 0.85rem;
}

.tpl__card-title {
  font-family: var(--tpl-font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.25;
  color: var(--tpl-burgundy);
  margin: 0 0 0.85rem;
}

.tpl__card-desc {
  font-family: var(--tpl-font-display);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--tpl-ink-body);
  margin: 0 0 1.1rem;
}

.tpl__card-format {
  font-family: var(--tpl-font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tpl-muted);
  margin-bottom: 1.1rem;
}

.tpl__card-cta {
  font-family: var(--tpl-font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tpl-burgundy);
  text-decoration: none;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--tpl-gold);
  align-self: flex-start;
  margin-top: auto;
  transition: color 0.2s, border-color 0.2s;
}

.tpl__card-cta:hover {
  color: var(--tpl-burgundy-deep);
  border-color: var(--tpl-burgundy);
}

.tpl__card-cta--primary {
  color: var(--tpl-bg);
  background: var(--tpl-burgundy);
  border: 1px solid var(--tpl-burgundy);
  border-bottom: 1px solid var(--tpl-burgundy);
  padding: 0.7rem 1.2rem;
  border-radius: 2px;
}

.tpl__card-cta--primary:hover {
  background: var(--tpl-burgundy-deep);
  border-color: var(--tpl-burgundy-deep);
  color: var(--tpl-bg);
}

/* ─── CTA stack ─── */
.tpl__cta-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin: 1rem auto 0;
}

.tpl__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--tpl-burgundy);
  color: var(--tpl-bg);
  padding: 1rem 2rem;
  border: 1px solid var(--tpl-burgundy);
  border-radius: 2px;
  text-decoration: none;
  font-family: var(--tpl-font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms ease, color 200ms ease;
  min-width: 240px;
}

.tpl__cta:hover {
  background: var(--tpl-burgundy-deep);
  transform: translateY(-1px);
}

.tpl__cta:focus-visible {
  outline: 2px solid var(--tpl-gold);
  outline-offset: 3px;
}

.tpl__cta--secondary {
  background: transparent;
  color: var(--tpl-burgundy);
}

.tpl__cta--secondary:hover {
  background: rgba(61, 26, 46, 0.06);
  transform: translateY(-1px);
}

.tpl__cta-stack .tpl__cta {
  width: 100%;
  max-width: 360px;
}

/* ─── Footer ─── */
.tpl__footer {
  padding: 1.5rem var(--tpl-pad);
  border-top: 1px solid var(--tpl-rule);
  text-align: center;
  font-family: var(--tpl-font-body);
  font-size: 0.82rem;
  color: var(--tpl-burgundy);
  letter-spacing: 0.03em;
  opacity: 0.85;
}

.tpl__footer a {
  color: var(--tpl-burgundy);
  text-decoration: underline;
  text-decoration-color: var(--tpl-gold);
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.tpl__footer a:hover {
  color: var(--tpl-burgundy-deep);
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
  .tpl__title {
    line-height: 1.2;
  }

  .tpl__main {
    gap: clamp(2rem, 5vw, 3rem);
  }

  .tpl__cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .tpl__brand {
    padding: 1.4rem var(--tpl-pad);
    font-size: 0.85rem;
  }

  .tpl__cta {
    min-width: 100%;
    padding: 1rem 1.25rem;
  }
}
