/* =========================================================
   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);
}

/* 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; }

/* 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) */
}

/* ---------- 9. Article subheadings and bold words (written in the admin page) ---------- */
/* "## Subheading" in the article text becomes <h2 class="article-subheading">; **bold** becomes <strong> */
.article--plain .article-subheading {
  margin: 34px 0 14px; font-family: var(--font-bangla); font-weight: 700; letter-spacing: 0;
  font-size: 25px; line-height: 1.35; color: var(--ink);
}
.article--plain strong { font-weight: 700; color: var(--ink); }
@media (min-width: 860px) { .article--plain .article-subheading { font-size: 31px; margin-top: 40px; } }

/* ---------- 10. Articles from the database: loading, "not available", empty, error ---------- */
/* Every title uses the same Bangla headline font (owner's choice): no English-title rules. */
/* Placeholder cards while the articles load: same size as the real cards, so nothing jumps */
.card--loading { pointer-events: none; }
.card--loading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.06) 50%, transparent 70%) 0 0 / 200% 100%;
  animation: card-shimmer 1.6s linear infinite;
}
@keyframes card-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .card--loading::after { animation: none; } }

.articles-note {
  display: grid; gap: 2px; margin: 0 0 16px; padding: 14px 18px; border-radius: var(--r-md);
  background: rgba(255,210,122,.08); border: 1px solid rgba(255,210,122,.3); color: var(--ink); font-size: 15px; line-height: 1.6;
}
.articles-state { display: grid; justify-items: center; gap: 8px; margin-top: 8px; padding: 36px 24px; border-radius: var(--r-lg); text-align: center; }
.articles-state__title { margin: 0 0 4px; font: 700 22px var(--font-display); letter-spacing: -.02em; color: var(--ink); }
.articles-state p { margin: 0; max-width: 46ch; color: rgba(255,255,255,.82); }
.articles-state__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; margin-top: 14px; }
.articles-state .text-link { cursor: pointer; }
.btn__arrow--wa { background: #25D366; color: #fff; }
.btn__arrow--wa svg { display: block; }

/* ---------- 11. Pages of 7 articles (sizes from the place on the page) ---------- */
/* Computers: 6 narrow columns instead of 3 give exactly the same card sizes
   (big = 4, medium = 2, small = 2), and let two small cards share a row evenly.
   Only the list (.bento) uses this; "More articles" keeps its own 3-column grid. */
@media (min-width: 640px) {
  .bento .card--fill { grid-column: 1 / -1; }            /* a lone card fills its row */
}
@media (min-width: 640px) and (max-width: 979.98px) {
  .bento .card--tablet-fill { grid-column: 1 / -1; }     /* tablets: no half-empty last row */
}
@media (min-width: 980px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bento .card--feature { grid-column: span 4; }
  .bento .card--side { grid-column: span 2; }
  .bento .card--mini { grid-column: span 2; }
  .bento .card--fill { grid-column: 1 / -1; }
  .bento .card--half { grid-column: span 3; }            /* two small cards share the last row */
}

/* Page buttons: next to the "Articles" heading (compact on phones) and under the list */
.list-head__title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 500 14px var(--font-body); }
.pager a, .pager .pager__item {
  display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 14px;
  border-radius: var(--pill); border: 1px solid var(--glass-border); background: var(--glass-bg);
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.pager a:hover { background: var(--glass-bg-hi); }
.pager [aria-current="page"] { background: #fff; color: var(--btn-ink); border-color: #fff; font-weight: 600; }
.pager .pager__off { opacity: .4; }
.pager .pager__gap { border-color: transparent; background: none; min-width: 20px; padding: 0 2px; }
.pager .pager__count { border-color: transparent; background: none; padding: 0 4px; font: 500 13px var(--font-mono); letter-spacing: .08em; }
.pager--bottom { justify-content: center; margin-top: 28px; }
.pager__compact { display: flex; align-items: center; gap: 8px; }
.pager--top .pager__full { display: none; }
@media (min-width: 640px) {
  .pager--top .pager__full { display: contents; }
  .pager--top .pager__compact { display: none; }
}

/* ---------- 12. "Copy share link" under each article (same pill as "← All articles") ---------- */
.share-row { display: flex; justify-content: center; margin-top: 20px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 20px; cursor: pointer;
  border-radius: var(--pill); border: 1px solid var(--glass-border); background: var(--glass-bg);
  color: var(--ink); font: 500 14px var(--font-body);
}
.share-btn:hover { background: var(--glass-bg-hi); }
.share-btn:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

/* ---------- 13. Dates and the author box (each article's own page) ---------- */
/* "প্রকাশ: … · হালনাগাদ: …" under the byline, in the picture */
.article-dates { margin: 0; font-size: 14px; line-height: 1.5; color: rgba(255,255,255,.72); }
/* "লিখেছেন রাফিদ রেজওয়ান" under the article text, with a link to the About page */
.author-box {
  display: flex; align-items: flex-start; gap: 16px; margin-top: 20px;
  padding: 22px; border-radius: var(--r-lg);
}
.author-box__avatar { flex: none; width: 48px; height: 48px; font-size: 20px; }
.author-box__text { min-width: 0; }
.author-box__text p { margin: 0; }
.author-box__k { font-size: 13px; color: rgba(255,255,255,.6); }
.author-box__name { margin-top: 2px; font: 700 20px/1.35 var(--font-bangla); color: var(--ink); }
.author-box__line { margin-top: 4px; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.author-box__link { display: inline-block; margin-top: 10px; font-size: 15px; color: var(--accent-hi); text-decoration: none; }
.author-box__link:hover { text-decoration: underline; }
@media (min-width: 860px) { .author-box { padding: 28px 72px; gap: 20px; } }
