/* =========================================================
   Articles page (loads after style.css and reuses its theme)
   1. Helpers & progress bar
   2. Bento grid
   3. Cards (featured + demo covers)
   4. Animated covers
   5. Full article
   ========================================================= */

/* ---------- 1. Helpers & progress bar ---------- */
[hidden] { display: none !important; }
.view { padding: 28px 0 72px; }
.articles-page main { font-family: var(--font-bangla); }

.progress {
  position: fixed; z-index: 20; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  transform: scaleX(0); transform-origin: 0 50%;
  box-shadow: 0 0 12px rgba(47,107,255,.8);
}

.list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 18px; }
.list-head .label { margin: 0; }
.list-count { margin: 0; font: 500 12px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---------- 2. Bento grid ----------
   Desktop: featured story fills 2×2, two cards stack beside it, three cards below. */
.bento { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card--feature { grid-column: 1 / -1; }
}
@media (min-width: 980px) {
  .bento { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card--feature { grid-column: span 2; grid-row: span 2; }
}

/* ---------- 3. Cards ---------- */
.card {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  border-radius: var(--r-lg); text-decoration: none; color: inherit;
  background: linear-gradient(180deg, var(--glass-bg-hi), var(--glass-bg));
  border: 1px solid var(--glass-border); border-top-color: var(--glass-edge);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  transition: transform .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(156,192,255,.4); }

.tag {
  padding: 4px 11px; border-radius: var(--pill);
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); color: #fff;
  font-size: 12px; font-weight: 500; line-height: 1.5;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.tag[lang="en"] { font: 500 10px/1.9 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }

.card__title {
  margin: 0; font-family: var(--font-bangla); font-weight: 700; letter-spacing: 0;
  font-size: 21px; line-height: 1.4; color: var(--ink);
}
.card__title[lang="en"] { font-family: var(--font-display); letter-spacing: -.02em; line-height: 1.2; }

/* Featured card: photo fills it, text over a dark fade */
.card--feature { min-height: 520px; justify-content: flex-end; }
.card--feature img, .article-hero img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%;
  transition: transform .8s ease;
}
.card--feature:hover img { transform: scale(1.04); }
.card__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(6,11,24,0) 25%, rgba(6,11,24,.55) 55%, rgba(6,11,24,.95) 100%),
    linear-gradient(180deg, rgba(27,63,160,.25), rgba(27,63,160,0) 40%);
}
.card__content { position: relative; padding: 24px; display: grid; gap: 14px; }
.card--feature .card__title { font-size: clamp(34px, 5vw, 56px); line-height: 1.2; }
.card__excerpt { margin: 0; max-width: 52ch; font-size: 17px; line-height: 1.75; color: rgba(255,255,255,.82); }
.card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.byline { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; color: rgba(255,255,255,.85); }
.avatar {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 15px;
}
.read-btn {
  display: inline-flex; align-items: center; gap: 12px; height: 48px; padding: 0 5px 0 22px;
  border-radius: var(--pill); background: #fff; color: var(--btn-ink); font-weight: 600; font-size: 16px;
}
.read-btn .btn__arrow { width: 38px; height: 38px; }
@media (min-width: 860px) { .card__content { padding: 36px; } }

/* Demo cards: animated cover + title */
.card--soon { cursor: default; }
.cover { position: relative; height: 150px; margin: 8px 8px 0; border-radius: 20px; overflow: hidden; }
.cover svg { position: absolute; inset: 0; width: 100%; height: 100%; }

@keyframes draw { 0% { stroke-dashoffset: 700; } 70%, 100% { stroke-dashoffset: 0; } }

@keyframes flow { to { stroke-dashoffset: -20; } }
@keyframes blink { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

@keyframes float1 { 0%,100% { transform: translate(170px, 95px) rotate(-20deg); } 50% { transform: translate(180px, 85px) rotate(-8deg); } }
@keyframes float2 { 0%,100% { transform: translate(280px, 135px) rotate(25deg); } 50% { transform: translate(268px, 145px) rotate(40deg); } }
@keyframes float3 { 0%,100% { transform: translate(80px, 60px) rotate(60deg); } 50% { transform: translate(92px, 70px) rotate(80deg); } }

@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }

@keyframes breathe { 0%, 100% { transform: scale(.94); } 50% { transform: scale(1.06); } }

@media (prefers-reduced-motion: reduce) {
  .cover * { animation: none !important; }
}

/* ---------- 5. Full article ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;
  padding: 10px 18px; border-radius: var(--pill);
  border: 1px solid var(--glass-border); background: var(--glass-bg);
  color: var(--ink); text-decoration: none; font: 500 14px var(--font-body);
}
.back-link:hover { background: var(--glass-bg-hi); }

.article-hero {
  position: relative; overflow: hidden; min-height: 420px; border-radius: var(--r-xl);
  display: flex; align-items: flex-end;
  border: 1px solid rgba(255,255,255,.12);
}
.article-hero__text { position: relative; padding: 28px 22px; display: grid; gap: 14px; }
.article-title { margin: 0; font-family: var(--font-bangla); font-weight: 700; letter-spacing: 0; font-size: clamp(40px, 7vw, 80px); line-height: 1.15; }
@media (min-width: 860px) { .article-hero { min-height: 520px; } .article-hero__text { padding: 48px; } }

.article { padding: 28px 22px; border-radius: var(--r-lg); min-width: 0; }
@media (min-width: 860px) { .article { padding: 56px 64px; } }
.article > * { max-width: 62ch; margin-left: auto; margin-right: auto; }
.article p { margin-top: 0; margin-bottom: 20px; font-size: 18px; line-height: 1.9; color: var(--ink-soft); }
.article .lead { font-size: 21px; line-height: 1.8; color: var(--ink); font-weight: 500; }

.note {
  margin: 8px auto 28px; padding: 18px 20px; border-radius: 20px;
  background: rgba(47,107,255,.14); border: 1px solid rgba(47,107,255,.45);
}
.note p { margin: 0; color: var(--ink); }
.article .note p:last-child { margin-bottom: 0; }

.article .ask { font-size: 26px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }

.more { margin-top: 48px; }
.more-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Plain article: text only, one paragraph after another */
.article--plain { margin-top: 20px; }
.article--plain p { color: var(--ink-soft); font-weight: 400; }

/* ---------- Page title, filter & sort bar ---------- */
.list-head { align-items: flex-end; margin-bottom: 20px; }
.page-title {
  margin: 0; font-family: var(--font-display); font-weight: 700; color: var(--ink);
  font-size: clamp(36px, 5vw, 56px); line-height: 1; letter-spacing: -.035em;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.sort { display: flex; align-items: center; gap: 12px; }
.sort select {
  appearance: none; -webkit-appearance: none; height: 100%; padding: 0 40px 0 18px;
  border: 0; outline: 0; background: transparent; color: var(--ink); cursor: pointer;
  font: 500 14px var(--font-body);
}
.sort select option { background: var(--space-2); color: var(--ink); }

.bento { grid-auto-flow: dense; }
@media (max-width: 640px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: calc(100vw - 64px); padding-bottom: 2px; }
}

/* ---------- 7. Reading font: Noto Serif Bengali for article text ---------- */
/* Titles keep Hind Siliguri; the writing itself uses a serif for comfortable reading */
.article p, .card__excerpt { font-family: "Noto Serif Bengali", var(--font-bangla), serif; }
.article--plain p { line-height: 1.37; margin-bottom: 20px; }
/* ---------- 8. Desktop reading layout: one centred column ---------- */
/* The article card is as wide as the text, so there is no big empty space on the sides */
@media (min-width: 860px) {
  .view .back-link,
  .article-hero,
  .article--plain { max-width: 880px; margin-left: auto; margin-right: auto; }
  .view .back-link { display: flex; width: fit-content; margin-left: max(0px, calc((100% - 880px) / 2)); }
  .article--plain { padding: 56px 64px 40px; }
  .article--plain > * { max-width: none; }
  .article--plain p { font-size: 20.5px; line-height: 1.37; margin-bottom: 22px; }
}

/* Desktop rows: big story + side story, then coming-soon slots three in a row. */

/* Side story: a real article in the narrow slot beside the first one (desktop) */
@media (min-width: 980px) {
  .card--side { grid-column: span 1; grid-row: span 2; }
  .card--side .card__content { padding: 26px; }
  .card--side .card__title { font-size: clamp(30px, 2.8vw, 40px); }
  .card--side .card__foot { gap: 14px; }
}

/* Small story: a real article in the three-across row (same size as a coming-soon slot) */
.card--mini { min-height: 440px; }
@media (min-width: 640px) { .card--mini { grid-column: span 1; } }
@media (min-width: 980px) { .card--mini { grid-row: span 1; } }
.card--mini .card__content { padding: 22px; gap: 10px; }
.card--mini .card__title { font-size: clamp(28px, 2.6vw, 36px); }
.card--mini .card__excerpt { font-size: 15.5px; line-height: 1.6; }
/* Coming-soon slots beside a small story stretch their cover to match its height */
.bento .card--soon .cover { flex: 1 1 150px; height: auto; min-height: 150px; }
/* English article titles (e.g. "Cardiac Arrest") use the headline font */
.article-title[lang="en"] { font-family: var(--font-display); letter-spacing: -.03em; line-height: 1.05; }

/* Desktop reading view: article box fills the page width (same as the cards grid),
   the page margins + box padding are the breathing space */
@media (min-width: 860px) {
  .view .back-link, .article-hero, .article--plain { max-width: none; }
  .view .back-link { margin-left: 0; }
  .article--plain { padding: 56px 72px 40px; }
  .article--plain p { font-size: 24.6px; }   /* story text 20% larger (was 20.5px) */
}
