/* =========================
   Articles (mobile-first)
   ========================= */

/* Hero wrapper */
.articles-hero {
  background: linear-gradient(135deg, #9dd1d1, #5d9698);
  padding: 48px 0 80px;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Headline + intro */
.page-title.center {
  text-align: center;
  margin: 0 0 6px;
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.15;
  color: #0f2e2e;
}
.articles-intro {
  text-align: center;
  max-width: 820px;
  margin: 6px auto 16px;
  color: #123;
  opacity: 0.95;
}

/* Search */
.article-search {
  position: relative;
  max-width: 700px;
  margin: 16px auto 28px;
}
.article-search input {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 12px 16px 12px 44px;
  background: #eef7f6;
  font-size: 16px;
  outline: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}
.article-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  fill: #557e7c;
}

/* Section subtitle */
.articles-subtitle {
  text-align: center;
  margin: 10px 0 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #0f2e2e;
}

/* Grid */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
}

/* =========================
   Card shell
   ========================= */
.article-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #cbe2df;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  width: 100%;
  height: 280px; /* consistent mobile height */
  margin-bottom: 50px;
}
.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.16);
}
.article-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* =========================
   Image
   ========================= */
.article-image {
  height: calc(100% - 68px); /* leave room for caption */
  overflow: hidden;
}
.article-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

/* =========================
   Caption footer (always flush to bottom)
   ========================= */
.article-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #f3f9f9;
  padding: 10px 12px;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05) inset;
  min-height: 60px;
  justify-content: center;
}

/* Text inside caption */
.article-caption h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #132d2b;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
.article-caption p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #3a5957;
  opacity: 0.9;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

/* =========================
   Empty/error states
   ========================= */
.articles-empty,
.articles-error {
  text-align: center;
  margin: 18px 0;
}

/* =========================
   Reader (detail page)
   ========================= */
.article-shell {
  max-width: 900px;
  margin: 6px auto 40px;
  background: #ffffffcc;
  backdrop-filter: blur(2px);
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  padding: 22px 24px 28px;
}
.article-header h1 {
  margin: 0 0 6px;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
}
.article-meta {
  text-align: center;
  margin: 0 0 12px;
  color: #24524e;
  opacity: 0.8;
}
.article-figure {
  margin: 0 0 14px;
}
.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  object-fit: cover;
}
.article-figure figcaption {
  margin-top: 6px;
  text-align: center;
}
.article-summary {
  background: #eef7f6;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
}
.article-body {
  color: #102a28;
  line-height: 1.7;
}
.article-body h2 {
  margin: 22px 0 10px;
  font-size: 22px;
}
.article-body h3 {
  margin: 18px 0 8px;
  font-size: 18px;
}
.article-body p {
  margin: 0 0 12px;
}
.article-body ul,
.article-body ol {
  margin-left: 0;
  padding-left: 1.1rem;
  list-style-position: outside;
}


/* =========================
   Responsive adjustments
   ========================= */

/* Small phones */
@media (max-width: 600px) {
  .article-caption h3 {
    font-size: 15px;
    line-height: 1.4;
  }
  .article-caption p {
    font-size: 13px;
  }
}

/* Desktop grid & proportions */
@media (min-width: 920px) {
  .article-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 36px 28px;
  }

  .article-card {
    height: 280px;
  }

  .article-image {
    height: calc(100% - 70px);
  }

  .article-caption {
    padding: 12px 14px;
    min-height: 60px;
    justify-content: center;
  }
}

/* Light safeguards for reader on smaller widths */
@media (max-width: 900px) {
  .article-header h1 {
    font-size: 24px;
  }
  .article-shell {
    padding: 16px 16px 22px;
  }
}

/* =========================================
   Article Reader (detail page)
   ========================================= */
.article-reader,
.hero:has(.article-shell) {
  background: linear-gradient(135deg, #9dd1d1, #5d9698);
  padding: 36px 0 72px;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  width: 100%;
}

.article-reader .container,
.hero:has(.article-shell) .container {
  max-width: 720px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* Glass card like FAQ */
.article-shell {
  background: #9dc0c1; /* same teal as FAQ */
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(2px);
  padding: 18px 18px 24px;
}

/* Header */
.article-header h1 {
  margin: 0 0 8px;
  text-align: center;
  font-size: clamp(24px, 6vw, 28px);
  font-weight: 800;
  color: #0f2e2e;
}

.article-meta {
  text-align: center;
  margin: 0 0 12px;
  color: #24524e;
  opacity: 0.85;
}

/* Banner image */
.article-figure {
  padding-top: 6px;
  margin: 0 0 14px;
}
.article-figure img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04) inset;
}

/* Optional summary chip */
.article-summary {
  background: #eef7f6;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
  color: #102a28;
}

/* Body typography */
.article-body {
  color: #102a28;
  line-height: 1.7;
  max-width: 65ch;
  margin-inline: auto;
  font-size: 15px;
}
.article-body h2 {
  margin: 24px 0 10px;
  font-size: 22px;
  font-weight: 800;
  color: #0f2e2e;
}
.article-body h3 {
  margin: 18px 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: #103330;
}
.article-body p {
  margin: 0 0 12px;
}
.article-body ul,
.article-body ol {
  margin: 0 0 12px 20px;
}

/* =========================================
   Desktop reader layout (≥920px)
   ========================================= */
@media (min-width: 920px) {
  .article-reader,
  .hero:has(.article-shell) {
    padding: 56px 0 96px;
  }

  .article-reader .container,
  .hero:has(.article-shell) .container {
    max-width: 980px;
    padding-inline: 24px;
  }

  .article-shell {
    max-width: 760px;
    margin-inline: auto;
    padding: 22px 24px 28px;
  }

  .article-figure img {
    height: 220px;
  }

  .article-header h1 {
    font-size: 32px;
  }

  .article-body {
    font-size: 16px;
  }
}
