/* ============================================================
   BLOG INDEX — Eterniit Uudised & nõuanded
   Ported from Design much/Eterniit Uudised.html
   Layered on top of styles.css; only loaded when is_home().
   ============================================================ */

main { padding-bottom: var(--s-9); }

/* ============================================================
   PAGE INTRO
   ============================================================ */
.page-intro {
  border-bottom: 1px solid var(--line);
  padding: var(--s-6) 0 var(--s-7);
}
.page-intro .breadcrumb { padding: 0 0 var(--s-5); }

.intro-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: var(--s-7);
  align-items: end;
}
.intro-text .eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.intro-text .eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--accent);
}
.intro-text h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
  max-width: 14ch;
}
.intro-lede {
  color: var(--ink-3);
  font-size: 16px;
  line-height: 1.6;
  max-width: 46ch;
  margin: 0;
}
.intro-lede b { color: var(--ink); font-weight: 600; }

@media (max-width: 820px) {
  .intro-grid { grid-template-columns: 1fr; gap: var(--s-4); }
}

/* ============================================================
   CATEGORY BADGE
   ============================================================ */
.cat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-3);
  border: 1px solid var(--line);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.cat::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--ink-3);
  display: inline-block;
}

/* meta line: date · reading time */
.meta-line {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.meta-line .sep {
  width: 3px; height: 3px;
  background: var(--line-strong);
  border-radius: 999px;
  display: inline-block;
}
.meta-line .read { display: inline-flex; align-items: center; gap: 4px; }

/* ============================================================
   FEATURED HERO — text-left, image-right
   ============================================================ */
.featured-wrap { padding: var(--s-7) 0 var(--s-8); }

.feat-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-3);
}
.feat-eyebrow .dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--accent);
  position: relative;
  flex-shrink: 0;
}
.feat-eyebrow .dot::before {
  content: ""; position: absolute; inset: 0;
  border-radius: 999px; background: var(--accent);
  animation: featPulse 1.8s ease-out infinite;
}
@keyframes featPulse {
  0%   { transform: scale(1);   opacity: 0.55; }
  100% { transform: scale(3.2); opacity: 0;    }
}
.feat-h2 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.024em;
  color: var(--ink);
  margin: 0;
}
.feat-h2 a { color: inherit; text-decoration: none; }
.feat-h2 a:hover { color: var(--accent); text-decoration: none; }

.feat-lede { color: var(--ink-2); line-height: 1.6; margin: 0; }

.feat-cta {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px;
  padding: 0 var(--s-5);
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-2);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.15s;
}
.feat-cta:hover { background: var(--accent); color: #fff; text-decoration: none; }
.feat-cta svg { transition: transform 0.18s; }
.feat-cta:hover svg { transform: translateX(3px); }

.feat-b {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-7);
  align-items: stretch;
  padding: var(--s-5) 0;
}
.feat-b .text-side {
  display: flex; flex-direction: column;
  gap: var(--s-4);
  justify-content: center;
  padding-right: var(--s-4);
}
.feat-b .feat-h2 { font-size: clamp(28px, 3vw, 42px); max-width: 14ch; }
.feat-b .feat-lede { font-size: 16px; max-width: 44ch; }
.feat-b .meta-and-cat {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
}
.feat-b .actions { display: flex; gap: var(--s-3); margin-top: var(--s-2); }
.feat-b .img-side {
  position: relative;
  display: block;
  aspect-ratio: 5 / 4;
  border-radius: var(--r-4);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.feat-b .img-side .feat-img,
.feat-b .img-side img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.feat-b .img-side:hover img { transform: scale(1.02); }
.feat-b .img-side .photo-ph { position: absolute; inset: 0; }
.feat-b .img-side .ribbon {
  position: absolute;
  top: var(--s-4); left: var(--s-4);
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
}
.feat-b .img-side .ribbon::before {
  content: ""; width: 6px; height: 6px;
  background: var(--accent); border-radius: 999px;
}

@media (max-width: 900px) {
  .feat-b { grid-template-columns: 1fr; }
  .feat-b .text-side { padding-right: 0; }
}

/* ============================================================
   ARCHIVE / GRID
   ============================================================ */
.archive-section {
  padding: var(--s-8) 0 var(--s-9);
  border-top: 1px solid var(--line);
}
.archive-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s-5);
  margin-bottom: var(--s-6);
  flex-wrap: wrap;
}
.archive-head h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.4vw, 32px);
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.archive-head .meta {
  font-size: 13px;
  color: var(--muted);
  display: flex; align-items: center; gap: 8px;
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}
.archive-head .meta b { color: var(--ink-2); font-weight: 600; }

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}
.article-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  display: flex; flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(20,24,30,0.08);
  border-color: var(--line-strong);
  text-decoration: none;
}
.article-card .img {
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.article-card .img .card-img,
.article-card .img > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.article-card .img .photo-ph { position: absolute; inset: 0; }
.article-card .img .cat {
  position: absolute;
  top: var(--s-3); left: var(--s-3);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(4px);
  z-index: 2;
}
.article-card .body {
  padding: var(--s-4) var(--s-4) var(--s-5);
  display: flex; flex-direction: column;
  gap: var(--s-3);
  flex: 1;
}
.article-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.25;
  color: var(--ink);
  margin: 0;
  text-wrap: pretty;
}
.article-card:hover h3 { color: var(--accent); }
.article-card .blurb {
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
  flex: 1;
  text-wrap: pretty;
}
.article-card .meta-line {
  padding-top: var(--s-3);
  border-top: 1px dashed var(--line);
}

@media (max-width: 1024px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .article-grid { grid-template-columns: 1fr; }
}

.archive-empty {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: var(--s-7) 0;
}

/* ============================================================
   PAGINATION — server-side (paginate_links), styled to match
   the "Lae rohkem" button vocabulary from the design.
   ============================================================ */
.pagination {
  margin-top: var(--s-8);
  display: flex; justify-content: center;
}
.pagination ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.pagination a,
.pagination .current {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px;
  padding: 0 12px;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  font-variant-numeric: tabular-nums;
}
.pagination a:hover {
  background: var(--ink); color: #fff; border-color: var(--ink);
  text-decoration: none;
}
.pagination .current {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.pagination .dots {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; color: var(--muted);
}

/* ============================================================
   RESPONSIVE REFINEMENTS
   Sub-layout breakpoints (intro-grid stack @ 820, feat-b stack @ 900,
   article-grid 3→2 @ 1024, 2→1 @ 600) are defined inline above; this
   block tunes phones (typography / paddings / image proportions).
   ============================================================ */

/* Tighten line-breaks on narrow widths so the long Estonian titles
   don't leave single-word orphans on the last line. */
.intro-text h1,
.feat-h2,
.article-card h3,
.archive-head h2 { text-wrap: balance; }

@media (max-width: 900px) {
  /* When the featured stacks, the image side becomes full-width.
     5:4 turns into a ~440px tall block on a 550px container — too
     dominant. Drop to 16:10 so it reads as a header image, not a hero. */
  .feat-b .img-side { aspect-ratio: 16 / 10; }
  .feat-b { gap: var(--s-5); padding: var(--s-4) 0; }
}

@media (max-width: 820px) {
  .page-intro { padding: var(--s-5) 0 var(--s-6); }
}

@media (max-width: 640px) {
  /* Section rhythm */
  .page-intro       { padding: var(--s-4) 0 var(--s-5); }
  .page-intro .breadcrumb { padding: 0 0 var(--s-4); }
  .featured-wrap    { padding: var(--s-5) 0 var(--s-6); }
  .archive-section  { padding: var(--s-6) 0 var(--s-7); }
  .archive-head     { margin-bottom: var(--s-5); gap: var(--s-3); }

  /* Featured: stacked, even tighter image, smaller meta gap */
  .feat-b           { gap: var(--s-4); padding: 0; }
  .feat-b .img-side { aspect-ratio: 16 / 10; border-radius: var(--r-3); }
  .feat-b .text-side { gap: var(--s-3); padding-right: 0; }
  .feat-b .feat-h2  { font-size: clamp(24px, 6vw, 32px); max-width: none; }
  .feat-b .feat-lede { font-size: 15px; max-width: none; }
  .feat-cta         { height: 44px; padding: 0 var(--s-4); font-size: 13.5px; }

  /* Article grid */
  .article-grid     { gap: var(--s-4); }
  .article-card .img { aspect-ratio: 16 / 10; }
  .article-card .body { padding: var(--s-3) var(--s-4) var(--s-4); gap: var(--s-2); }
  .article-card h3  { font-size: 17px; }
  .article-card .blurb { font-size: 13px; }

  /* Intro typography — drop the 14ch cap so the headline can fill
     the column instead of wrapping after every few words. */
  .intro-text h1    { max-width: none; font-size: clamp(26px, 7.5vw, 34px); }
  .intro-lede       { font-size: 15px; max-width: none; }

  /* Pagination: smaller buttons + tighter gaps for thumb reach */
  .pagination       { margin-top: var(--s-6); }
  .pagination ul    { gap: 4px; }
  .pagination a,
  .pagination .current { min-width: 36px; height: 36px; font-size: 13.5px; padding: 0 10px; }
}

@media (max-width: 420px) {
  /* Very-narrow phones: drop the leading "—" eyebrow underline so
     the eyebrow + category badge don't fight for the line. */
  .intro-text .eyebrow::before { display: none; }
  .archive-head .meta { font-size: 12px; }
}
