/* ==========================================================================
   MAHABADI — Inner pages
   blog archive · single post · search · 404 · static page
   ========================================================================== */

/* --------------------------- Shared page shell ------------------------- */
.page-wrap { padding-block: var(--space-l) var(--space-2xl); }
.layout-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-l); align-items: start; }
.layout-main--wide { grid-template-columns: minmax(0, 1fr); }

/* ============================ ARCHIVE / BLOG ========================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  flex-wrap: wrap;
  padding: var(--space-xs);
  margin-bottom: var(--space-l);
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-1);
}
.filter-bar__label { display: inline-flex; align-items: center; gap: var(--space-3xs); padding-inline: var(--space-xs); font-size: var(--step--1); color: var(--ink-3); }
.filter-bar__label svg { width: 16px; height: 16px; color: var(--orange-ink); }

.posts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-s); }

/* =============================== PAGINATION =========================== */
.pagination { display: flex; align-items: center; justify-content: center; gap: var(--space-3xs); margin-top: var(--space-l); flex-wrap: wrap; }
.pagination a, .pagination span {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 var(--space-2xs);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: var(--blue);
  font-size: var(--step-0);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: all var(--dur) var(--ease);
}
.pagination a:hover { background: var(--gold); }
.pagination .is-current { background: var(--blue); color: #fff; }
.pagination .is-disabled { opacity: .4; pointer-events: none; }

/* ============================== WIDGETS =============================== */
.widget { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: var(--space-m); margin-bottom: var(--space-s); }
.widget:last-child { margin-bottom: 0; }
.widget__title { display: flex; align-items: center; gap: var(--space-2xs); font-size: var(--step-0); font-weight: 700; margin-bottom: var(--space-s); }
.widget__title svg { width: 20px; height: 20px; color: var(--orange-ink); }

.widget-list li { border-bottom: 1px solid var(--line); }
.widget-list li:last-child { border-bottom: 0; }
.widget-list a { display: flex; align-items: center; gap: var(--space-2xs); padding: var(--space-2xs) 0; font-size: var(--step--1); color: var(--ink-2); }
.widget-list a:hover { color: var(--orange-ink); }
.widget-list svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.widget-list .count { margin-inline-start: auto; font-size: var(--step--2); color: var(--ink-3); font-variant-numeric: tabular-nums; }

.side-post { display: flex; gap: var(--space-2xs); padding: var(--space-2xs) 0; border-bottom: 1px solid var(--line); }
.side-post:last-child { border-bottom: 0; }
.side-post__media { width: 62px; height: 62px; border-radius: 12px; overflow: hidden; background: var(--sand); flex: none; }
.side-post__media img { width: 100%; height: 100%; object-fit: cover; }
.side-post__title { font-size: var(--step--1); font-weight: 500; line-height: 1.7; }
.side-post a:hover .side-post__title { color: var(--orange-ink); }
.side-post__date { font-size: var(--step--2); color: var(--ink-3); margin-top: 2px; }

.cta-card { background: var(--blue); color: var(--on-blue-2); text-align: center; }
.cta-card .widget__title { color: #fff; justify-content: center; }
.cta-card .widget__title svg { color: var(--gold); }
.cta-card p { font-size: var(--step--1); margin-bottom: var(--space-s); }
.cta-card strong { display: block; font-size: var(--step-2); font-weight: 900; color: var(--gold); direction: ltr; margin-bottom: var(--space-s); font-variant-numeric: tabular-nums; }

/* ============================== ARTICLE =============================== */
.article { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }

.article__head { padding: var(--space-l) var(--space-l) var(--space-m); }
.article__title { font-size: var(--step-4); line-height: 1.45; margin: var(--space-2xs) 0 var(--space-s); }

.article__meta { display: flex; align-items: center; gap: var(--space-m); flex-wrap: wrap; font-size: var(--step--1); color: var(--ink-3); }
.article__meta span { display: inline-flex; align-items: center; gap: var(--space-3xs); }
.article__meta svg { width: 16px; height: 16px; }
.article__meta .author { color: var(--ink-2); font-weight: 500; }

.article__hero { aspect-ratio: 16 / 8; background: var(--sand); }
.article__hero img { width: 100%; height: 100%; object-fit: cover; }

.article__body { padding: var(--space-l); }

/* prose */
.prose { color: var(--ink-2); line-height: 2.15; font-size: var(--step-0); max-width: 76ch; }
.prose > * + * { margin-top: var(--space-s); }
.prose h2 { font-size: var(--step-2); color: var(--blue); margin-top: var(--space-l); scroll-margin-top: 140px; }
.prose h3 { font-size: var(--step-1); color: var(--blue); margin-top: var(--space-m); }
.prose ul, .prose ol { padding-inline-start: var(--space-m); }
.prose ul li, .prose ol li { margin-bottom: var(--space-2xs); position: relative; }
.prose ul li::before { content: ""; position: absolute; inset-inline-start: calc(-1 * var(--space-s)); top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.prose ol { list-style: decimal; }
.prose ol li::marker { color: var(--orange-ink); font-weight: 700; }
.prose blockquote {
  margin: 0;
  padding: var(--space-s) var(--space-m);
  border-inline-start: 4px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--blue);
  font-weight: 500;
}
.prose blockquote p { margin: 0; }
.prose img { border-radius: var(--radius); }
.prose a { color: var(--orange-ink); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--blue); }
.prose table { margin: var(--space-s) 0; border-radius: var(--radius); overflow: hidden; }
.prose th { background: var(--custard); color: var(--blue); font-weight: 500; padding: var(--space-xs) var(--space-s); text-align: right; font-size: var(--step--1); }
.prose td { padding: var(--space-xs) var(--space-s); border-bottom: 1px solid var(--line); font-size: var(--step--1); }

.article__tags { display: flex; align-items: center; gap: var(--space-2xs); flex-wrap: wrap; padding: var(--space-s) var(--space-l); border-top: 1px solid var(--line); }
.article__tags span { font-size: var(--step--1); color: var(--ink-3); }

.article__share { display: flex; align-items: center; gap: var(--space-2xs); flex-wrap: wrap; padding: 0 var(--space-l) var(--space-l); }
.article__share span { font-size: var(--step--1); color: var(--ink-3); }

.author-box { display: flex; gap: var(--space-s); align-items: center; padding: var(--space-m); background: var(--sand); border-radius: var(--radius); margin-top: var(--space-m); }
.author-box img { width: 66px; height: 66px; border-radius: var(--radius-pill); object-fit: cover; background: var(--surface); flex: none; }
.author-box strong { display: block; font-size: var(--step-0); }
.author-box p { font-size: var(--step--1); color: var(--ink-2); margin: 2px 0 0; }

/* comments */
.comments { margin-top: var(--space-m); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: var(--space-m); }
.comments__title { display: flex; align-items: center; gap: var(--space-2xs); font-size: var(--step-1); margin-bottom: var(--space-s); }
.comments__title svg { width: 21px; height: 21px; color: var(--orange-ink); }

.comment { display: flex; gap: var(--space-s); padding: var(--space-s) 0; border-bottom: 1px solid var(--line); }
.comment:last-of-type { border-bottom: 0; }
.comment__avatar { width: 48px; height: 48px; border-radius: var(--radius-pill); background: var(--custard); color: var(--blue); display: grid; place-items: center; font-weight: 700; flex: none; }
.comment__head { display: flex; align-items: center; gap: var(--space-2xs); flex-wrap: wrap; }
.comment__name { font-weight: 700; font-size: var(--step-0); }
.comment__date { font-size: var(--step--2); color: var(--ink-3); }
.comment__body { font-size: var(--step--1); color: var(--ink-2); margin-top: var(--space-3xs); }

/* ============================== SEARCH ================================ */
.search-hero { background: var(--sand); padding-block: var(--space-l) var(--space-xl); }
.search-box { display: flex; gap: var(--space-2xs); flex-wrap: wrap; max-width: 720px; }
.search-box .input-group { flex: 1 1 320px; }
.search-box .input { min-height: 52px; border-radius: var(--radius-pill); font-size: var(--step-0); }

.result-count { font-size: var(--step-1); margin-bottom: var(--space-m); }
.result-count strong { font-weight: 900; color: var(--orange-ink); font-variant-numeric: tabular-nums; }

.result-list { display: grid; gap: var(--space-s); }
.result-row { display: flex; gap: var(--space-s); padding: var(--space-s); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.result-row:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.result-row__media { width: 132px; height: 96px; border-radius: 14px; overflow: hidden; background: var(--sand); flex: none; }
.result-row__media img { width: 100%; height: 100%; object-fit: cover; }
.result-row__body { min-width: 0; }
.result-row__top { display: flex; align-items: center; gap: var(--space-2xs); flex-wrap: wrap; margin-bottom: var(--space-3xs); }
.result-row__title { font-size: var(--step-1); font-weight: 700; line-height: 1.6; }
.result-row:hover .result-row__title { color: var(--orange-ink); }
.result-row__text { font-size: var(--step--1); color: var(--ink-2); margin-top: var(--space-3xs); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result-row__meta { display: flex; align-items: center; gap: var(--space-m); flex-wrap: wrap; margin-top: var(--space-2xs); font-size: var(--step--2); color: var(--ink-3); }
.result-row__meta span { display: inline-flex; align-items: center; gap: var(--space-3xs); }
.result-row__meta svg { width: 14px; height: 14px; }

.suggest-block { margin-top: var(--space-l); padding: var(--space-m); background: var(--sand); border-radius: var(--radius); }
.suggest-block h3 { font-size: var(--step-0); margin-bottom: var(--space-2xs); }

/* =============================== 404 ================================== */
.err-wrap { min-height: 62vh; display: grid; place-items: center; text-align: center; padding-block: var(--space-2xl); }
.err-code { font-size: clamp(84px, 16vw, 168px); font-weight: 900; line-height: 1; color: var(--custard); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.err-title { font-size: var(--step-3); margin: var(--space-xs) 0 var(--space-2xs); }
.err-text { color: var(--ink-2); max-width: 52ch; margin-inline: auto; }
.err-actions { display: flex; gap: var(--space-2xs); justify-content: center; flex-wrap: wrap; margin-top: var(--space-m); }
.err-search { max-width: 460px; margin: var(--space-m) auto 0; }
.err-links { margin-top: var(--space-xl); }
.err-links h2 { font-size: var(--step-0); margin-bottom: var(--space-s); }
.err-links__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-s); text-align: right; }

/* ============================ STATIC PAGE ============================= */
.lead-text { font-size: var(--step-1); color: var(--ink-2); line-height: 2; max-width: 70ch; }

.value-card { padding: var(--space-m); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.value-card__ico { display: grid; place-items: center; width: 54px; height: 54px; border-radius: var(--radius); background: var(--gold-soft); color: var(--orange-ink); margin-bottom: var(--space-s); }
.value-card__ico svg { width: 27px; height: 27px; }
.value-card h3 { font-size: var(--step-1); margin-bottom: var(--space-3xs); }
.value-card p { font-size: var(--step--1); color: var(--ink-2); }
.value-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-s); }

.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--space-xl); align-items: center; }
.split__media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-2); aspect-ratio: 4 / 3; background: var(--sand); }
.split__media img { width: 100%; height: 100%; object-fit: cover; }

.timeline { display: grid; gap: var(--space-s); }
.timeline__item { display: flex; gap: var(--space-s); padding: var(--space-s); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.timeline__year { font-weight: 900; color: var(--orange-ink); font-variant-numeric: tabular-nums; flex: none; min-width: 74px; }
.timeline__item h3 { font-size: var(--step-0); margin-bottom: 2px; }
.timeline__item p { font-size: var(--step--1); color: var(--ink-2); margin: 0; }

/* ============================== CONTACT =============================== */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: var(--space-l); align-items: start; }
.contact-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: var(--space-m); }
.contact-list li { display: flex; gap: var(--space-s); padding: var(--space-s) 0; border-bottom: 1px solid var(--line); }
.contact-list li:last-child { border-bottom: 0; }
.contact-list__ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--radius); background: var(--gold-soft); color: var(--orange-ink); flex: none; }
.contact-list__ico svg { width: 22px; height: 22px; }
.contact-list strong { display: block; font-size: var(--step-0); margin-bottom: 2px; }
.contact-list span, .contact-list a { font-size: var(--step--1); color: var(--ink-2); line-height: 1.9; }
.contact-list a:hover { color: var(--orange-ink); }

.map-block { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--sand); min-height: 260px; display: grid; place-items: center; text-align: center; padding: var(--space-m); }
.map-block__pin { display: grid; place-items: center; width: 60px; height: 60px; border-radius: var(--radius-pill); background: var(--blue); color: var(--gold); margin: 0 auto var(--space-xs); }
.map-block__pin svg { width: 28px; height: 28px; }

/* ============================== RESPONSIVE ============================ */
@media (max-width: 1160px) {
  .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .err-links__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .layout-main { grid-template-columns: 1fr; }
  .value-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: var(--space-l); }
  .split__media { order: -1; }
}

@media (max-width: 720px) {
  .posts-grid { grid-template-columns: 1fr; }
  .article__head, .article__body { padding: var(--space-m); }
  .article__title { font-size: var(--step-3); }
  .result-row { flex-direction: column; }
  .result-row__media { width: 100%; height: 160px; }
  .value-grid, .err-links__grid { grid-template-columns: 1fr; }
  .filter-bar { border-radius: var(--radius); }
}

@media (max-width: 520px) {
  .article__tags, .article__share { flex-direction: column; align-items: flex-start; }
  .author-box { flex-direction: column; text-align: center; }
}

/* small extras */
.chiplist { display: flex; gap: var(--space-2xs); flex-wrap: wrap; margin-top: var(--space-s); }
.footer-contact__icon { display: none; }
