/*
 * Magazine homepage layout. Loaded on the front page only.
 * Breakpoints match Flatsome's (849px medium, 549px small).
 */

.tw-home { padding: 24px 0 24px; }

/* Width comes from Flatsome's .container (Customizer → Layout → Site width),
   so the homepage always lines up with the header. */

/* ── Shared card parts ─────────────────────────────────────────────── */

.tw-card { position: relative; min-width: 0; }

.tw-card__media {
  display: block;
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--tw-border);
  margin-bottom: 16px;
}

.tw-card__media > a:not(.tw-eyebrow) { display: block; height: 100%; }

.tw-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tw-card:hover .tw-card__img { transform: scale(1.04); }

.tw-card__img--empty {
  background: linear-gradient(135deg, var(--tw-mint), var(--tw-lavender));
}

.tw-card__title {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
}

.tw-card__title a { color: var(--tw-ink); }
.tw-card__title a:hover { color: var(--tw-accent); }

.tw-eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tw-accent);
}

.tw-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--tw-muted);
}

.tw-meta__author { color: var(--tw-fg); }

.tw-excerpt {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--tw-fg);
}

/* ── Blocks and headings ───────────────────────────────────────────── */

.tw-block { margin-top: 56px; }
.tw-block:first-of-type { margin-top: 0; }

.tw-block--rule + .tw-block--rule,
.tw-block--rule + .tw-pair,
.tw-pair + .tw-block--rule {
  border-top: 1px solid var(--tw-border);
  padding-top: 48px;
}

.tw-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.tw-head__title { margin: 0; font-size: 32px; line-height: 1.2; }
.tw-head--sm .tw-head__title { font-size: 20px; }

.tw-head__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--tw-accent);
}

.tw-head__more svg { transition: transform 0.2s; }
.tw-head__more:hover svg { transform: translateX(3px); }

.tw-grid { display: grid; gap: 32px 30px; }
.tw-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tw-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tw-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tw-grid--flush { gap: 0; }
.tw-grid--tight { gap: 24px 20px; margin-top: 32px; }

/* ── Hero ──────────────────────────────────────────────────────────── */

.tw-hero {
  display: grid;
  grid-template-columns: minmax(0, 3.15fr) minmax(0, 1fr);
  gap: 30px;
}

.tw-card--overlay .tw-card__media { margin: 0; aspect-ratio: 10 / 7; }

.tw-card--overlay .tw-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(20 17 28 / 0) 35%, rgb(20 17 28 / 0.82) 100%);
  pointer-events: none;
}

.tw-card--overlay .tw-card__body {
  position: absolute;
  inset: auto 0 0;
  padding: 24px;
  pointer-events: none;
}

.tw-card--overlay .tw-card__body a { pointer-events: auto; }
.tw-card--overlay .tw-card__title { font-size: 24px; }
.tw-card--overlay .tw-card__title a,
.tw-card--overlay .tw-eyebrow { color: #fff; }
.tw-card--overlay .tw-excerpt { color: rgb(255 255 255 / 0.82); margin: 0; }
.tw-card--overlay .tw-meta,
.tw-card--overlay .tw-meta__author { color: rgb(255 255 255 / 0.75); }

.tw-card--lead .tw-card__media { aspect-ratio: auto; height: 100%; min-height: 480px; }
.tw-card--lead .tw-card__body { padding: 48px; max-width: 720px; }
.tw-card--lead .tw-card__title { font-size: 32px; line-height: 1.3; }

.tw-hero__thumb { aspect-ratio: 280 / 182; margin-bottom: 18px; }
.tw-hero__list { list-style: none; margin: 0; padding: 0; }
.tw-hero__list li { margin: 0 0 18px; }
.tw-hero__list .tw-eyebrow { margin-bottom: 2px; font-size: 10px; }
.tw-hero__list .tw-card__title { font-size: 16px; margin: 0; }

/* ── Tagged small cards ────────────────────────────────────────────── */

.tw-card--tagged .tw-card__media { aspect-ratio: 280 / 182; }

.tw-card--tagged .tw-eyebrow {
  position: absolute;
  top: 12px;
  left: 12px;
  margin: 0;
  padding: 3px 8px;
  font-size: 9px;
  color: var(--tw-ink);
  background: var(--tw-surface);
}

.tw-card--tagged .tw-card__title { font-size: 17px; }

/* ── Row cards ─────────────────────────────────────────────────────── */

.tw-card--row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.tw-card--row .tw-card__media { margin: 0; aspect-ratio: 4 / 3; }
.tw-card--row .tw-card__title { font-size: 19px; }

/* ── Paired feature blocks ─────────────────────────────────────────── */

.tw-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  margin-top: 56px;
}

.tw-pair .tw-block { margin-top: 0; }
.tw-card--feature .tw-card__media { aspect-ratio: 16 / 10.5; }
.tw-card--mini .tw-card__media { aspect-ratio: 3 / 2; margin-bottom: 12px; }
.tw-card--mini .tw-card__title { font-size: 16px; }

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 849px) {
  .tw-hero,
  .tw-pair,
  .tw-list { grid-template-columns: minmax(0, 1fr); }

  .tw-grid--3,
  .tw-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .tw-card--lead .tw-card__media { min-height: 420px; }
  .tw-card--lead .tw-card__body { padding: 28px; }
  .tw-card--lead .tw-card__title { font-size: 26px; }

  .tw-hero__side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 20px;
  }

  .tw-head__title { font-size: 26px; }
}

@media (max-width: 549px) {
  .tw-home { padding-top: 8px; }
  .tw-block { margin-top: 40px; }
  .tw-block--rule + .tw-block--rule,
  .tw-block--rule + .tw-pair,
  .tw-pair + .tw-block--rule { padding-top: 36px; }

  .tw-grid--2,
  .tw-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .tw-grid--4,
  .tw-grid--tight { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }

  .tw-hero__side { grid-template-columns: minmax(0, 1fr); }
  .tw-card--lead .tw-card__media { min-height: 0; height: auto; aspect-ratio: 4 / 4.6; }
  .tw-card--lead .tw-card__body { padding: 20px; }
  .tw-card--lead .tw-card__title { font-size: 22px; }
  .tw-card--overlay .tw-card__title { font-size: 20px; }
  .tw-card--overlay .tw-card__media { aspect-ratio: 4 / 3.4; }
  .tw-card--overlay .tw-card__body { padding: 20px; }
  .tw-card--overlay .tw-excerpt { display: none; }
  .tw-card--lead .tw-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .tw-card--row { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; }
  .tw-card--row .tw-card__media { aspect-ratio: 1; }
  .tw-card--row .tw-card__title { font-size: 16px; }
  .tw-card--row .tw-excerpt { display: none; }

  .tw-card--tagged .tw-card__title { font-size: 15px; }
  .tw-head__title { font-size: 22px; }
  .tw-head--sm .tw-head__title { font-size: 18px; }
}
