/* =========================================================
   Clean, fluid, device-agnostic layout
   ========================================================= */

/* Load your custom Arabic font from /fonts/arabic.ttf */
@font-face{
  font-family: "ArabicCustom";
  src: url("/fonts/arabic.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root{
  /* colors */
  --bg: #fafaf7; /* slightly off-white main/page background */
  --ink: #131415;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #1e4fbf;

  /* radii & fonts */
  --radius: 10px;
  --font-bn: 'SolaimanLipi', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-ar: 'ArabicCustom', serif;

  /* sizing */
  --container-max: 1280px;
  --read-max: 70ch;
  --gutter: clamp(12px, 3vw, 24px);

  /* spacing scale */
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
}

/* Base */
* { box-sizing: border-box; }
html, body { min-width: 320px; overflow-x: hidden; height: 100%; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-bn);
  font-weight: 700; /* always bold */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a{ color: var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; }
img, video{ max-width: 100%; height: auto; display: block; }

/* ---------- Fluid container ---------- */
.container,
.site-header .container,
main.container,
.site-footer .container{
  width: min(100%, var(--container-max));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Header ---------- */
.site-header{
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease;
}
.scrolled .site-header{ box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.site-header .container{
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 64px;
}
.brand{ font-size: 26px; color: #1C4A4C; text-decoration: none; }
.nav{ margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
.nav-link{ color: var(--ink); opacity: .9; }
.icon-btn{
  border: 1px solid var(--line);
  background: transparent;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

/* Hamburger menu */
.menu{ position: relative; }
.hamburger{
  min-width: 36px; min-height: 36px; font-size: 18px; line-height: 1;
  color: #1C4A4C; background: none; border: 0; display: flex; place-items: center;
}
.hamburger svg{ display: block; }
.menu-panel{
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 220px; z-index: 20;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,.10); padding: 8px; display: none;
}
.menu.open .menu-panel{ display: block; animation: menuIn .14s ease; }
@keyframes menuIn{ from{opacity:0; transform: translateY(-4px)} to{opacity:1; transform: translateY(0)} }
.menu-panel a{ display: block; padding: 10px 12px; border-radius: 8px; color: #1C4A4C; }
.menu-panel a:hover{ background: color-mix(in oklab, #1C4A4C 6%, transparent); }

/* Search */
.search-wrap{ position: relative; width: 36px; height: 36px; display: grid; place-items: center; z-index: 5; }
.search-input{
  position: absolute; top: 50%; right: 0; transform: translateY(-50%) scaleX(.6);
  transform-origin: right center;
  width: 240px; opacity: 0; pointer-events: none;
  transition: transform .18s ease, opacity .18s ease;
  border: 1px solid var(--line); background: var(--bg); #1C4A4C;
  padding: 8px 12px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0,0,0,.06);
  font-family: var(--font-bn);
}
.search-wrap.open .search-input{ opacity: 1; pointer-events: auto; transform: translateY(-50%) scaleX(1); }

/* Minimal search icon */
.search-btn svg{
  width: 18px; height: 18px; display: block;
  stroke: #1C4A4C; stroke-width: 2; fill: none;
}
.search-btn:hover { opacity: .9; }

/* ---------- Home list ---------- */
.post-list{
  display: grid; gap: var(--space-4); padding-block: var(--space-5);
}

/* Fluid card */
.post-card{
  display: grid;
  grid-template-columns: minmax(220px, 32vw) 1fr;
  gap: var(--space-3);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-4);
}
.post-card:last-child{ border-bottom: none; }

/* Stack on narrow screens */
@media (max-width: 820px){
  .post-card{ grid-template-columns: 1fr; }
}

.thumb{
  display: block; width: 100%;
  height: clamp(140px, 22vw, 260px);
  overflow: hidden; border-radius: var(--radius);
  background: #f3f4f6;
}
.thumb img{ width: 100%; height: 100%; object-fit: cover; }

.post-card .title{
  margin: 0 0 var(--space-2) 0;
  font-size: 20px;
  line-height: 1.7;
  color: #143435
}
.post-card .title a{
  color: #143435; text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size .15s ease;
}
.post-card .title a:hover{ background-size: 100% 1px; }
.excerpt{ margin: 0 0 var(--space-2) 0; color: var(--ink); opacity: .9; }
.meta{ display: flex; flex-wrap: wrap; gap: var(--space-2); color: var(--muted); }
.meta .dot{ opacity: .6; }
.cat-chip{ 
  /* changed: light blue background, deep blue text, no border */
  background: #e8eded; 
  color: #1C4A4C; 
  border: none; 
  padding: 2px 8px; 
  border-radius: 999px; 
  text-decoration: none; 
}

/* Buttons */
.btn-outline-black{
  display: inline-block; border: 1.5px solid #000; color: #000; background: transparent;
  padding: 6px 12px; border-radius: 999px; line-height: 1; margin: 6px 0 10px; text-decoration: none;
}
.btn-outline-black:hover{ text-decoration: none; background: rgba(0,0,0,0.04); }

/* Make the "আরো পড়ুন" button inside post cards blue (border + text) */
.post-card .btn-outline-black{
  border-color: #1C4A4C;
  color: #1C4A4C;
}
.post-card .btn-outline-black:hover{
  background: rgba(30,79,191,0.06);
}

/* Pagination */
.pagination{ display: flex; gap: 8px; justify-content: center; padding-bottom: var(--space-6); }
.pagination a, .pagination span{ border: 1px solid var(--line); padding: 6px 12px; border-radius: 8px; color: #1C4A4C;  background:#d2dbdb; text-decoration: none; }
.pagination .active{ background: #1C4A4C; color: var(--bg); }

/* ---------- Taxonomy clouds ---------- */
.tax-cloud{ padding-block: var(--space-5); display: grid; gap: 12px; grid-auto-rows: min-content; }
.tax-cloud a{ display: inline-block; border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px; color: var(--ink); text-decoration: none; }

/* ---------- Post page ---------- */
.post{
  padding-block: var(--space-5);
  max-width: min(100%, var(--read-max));
  margin-inline: auto;
}
.post-title{
  font-size: clamp(28px, 4vw, 34px);
  line-height: 1.7;
  margin: 0 0 var(--space-2) 0;
  /* changed: page/post title in blue */
  color: #143435;
}
.post-meta{ color: var(--muted); margin-bottom: var(--space-4); }
.post-cover{ margin: 0 0 var(--space-4) 0; }
.post-cover img{ width: 100%; height: auto; border-radius: var(--radius); }

.post-body{ font-size: clamp(16px, 0.9vw + 12px, 20px); line-height: 1.85; }
/* changed: only body text (not headings) to blueish gray */
.post-body p{ margin: 0 0 var(--space-3) 0; color: #1C4A4C; }
.post-body ul li{ color: #1C4A4C; }
.post-body ol li{ color: #1C4A4C; }
.post-body h2{ font-size: 22px; margin: var(--space-4) 0 var(--space-2); color: #143435 line-height: 1.7; }
.post-body h3{ font-size: 19px; margin: var(--space-3) 0 var(--space-2); color: #143435 line-height: 1.7; }
.post-body blockquote{
  margin: var(--space-3) 0; padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--line);
  background: color-mix(in oklab, var(--ink) 4%, transparent);
  border-radius: 6px;
}

/* Arabic handling */
.ar-inline{ font-family: var(--font-ar); font-weight: 400; }
.ar-separate{
  font-family: var(--font-ar); font-weight: 400;
  text-align: right; direction: rtl; display: block; margin: 1em 0;
}

/* ---------- Footer ---------- */
.site-footer{ border-top: 1px solid var(--line); padding: var(--space-5) 0; margin-top: var(--space-6); }

/* ---------- Related posts ---------- */
.related-posts{ margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.related-title{ font-size: 22px; margin-bottom: 20px; color: #143435}
.related-grid{ display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); }
.related-card{ display: grid; grid-template-columns: 100px 1fr; gap: 14px; align-items: start; }
.related-card .thumb{ width: 100%; height: 70px; overflow: hidden; border-radius: var(--radius); background: #f3f4f6; }
.related-card .thumb img{ width: 100%; height: 100%; object-fit: cover; }
.related-card .title{ font-size: 16px; margin: 0 0 4px 0; color: #143435 }
.related-card .excerpt{ font-size: 14px; color: #1C4A4C; margin: 0; }

/* ---------- "More posts" 2×2 (auto-fit on wide) ---------- */
.more{ margin: 48px 0 24px; }
.more-heading{ font-size: 1.6rem; margin-bottom: 16px; }
.more-grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: clamp(14px, 2.4vw, 22px); }
.more-card{
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .12s ease;
}
.more-card:hover{ transform: translateY(-2px); }
.more-thumb{ aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--muted); display: block; }
.more-thumb img{ width: 100%; height: 100%; object-fit: cover; }
.more-title{ font-size: 1.05rem; line-height: 1.35; color: #143435 }
.more-title a{ text-decoration: none; color: #143435}
.more-excerpt{ font-size: .95rem; opacity: .85; color: #1C4A4C }

/* ---------- Wider reading width (desktop) ---------- */
:root{
  /* min 720px, grows with viewport, max 1080px */
  --read: clamp(720px, 78vw, 1080px);
}
.post{
  max-width: var(--read);
  margin-inline: auto;
  padding-inline: clamp(12px, 3vw, 28px);
}

/* ---------- Treat touch devices like mobile ---------- */
@media (hover: none) and (pointer: coarse) {
  .post-card { grid-template-columns: 1fr !important; }
  .container,
  .site-header .container,
  main.container,
  .site-footer .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .post { max-width: 92vw !important; }
  .more-grid, .related-grid { grid-template-columns: 1fr !important; }
  .thumb { height: 160px; }
}

/* Arabic font sizing (refined) */
.ar-inline {
  font-family: var(--font-ar);
  font-weight: 400;
  font-size: 1.1em;
  line-height: 1.8;
}
.ar-separate {
  font-family: var(--font-ar);
  font-weight: 400;
  font-size: 2em;
  line-height: 2;
  text-align: right;
  direction: rtl;
  display: block;
  margin: 1em 0;
}

/* === Post list cards: rounded rectangle + subtle shadow === */
.post-list{
  display: grid;
  gap: 18px;
  padding-block: var(--space-5);
}
.post-card{
  display: grid;
  grid-template-columns: minmax(220px, 32vw) 1fr;
  gap: var(--space-3);
  background: #ffffff; /* changed: cards full white against off-white page */
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow:
    0 1px 2px rgba(0,0,0,.05),
    0 6px 18px rgba(0,0,0,.06);
  border-bottom: none !important;
}
.post-card:hover{
  transform: translateY(-2px);
  transition: transform .14s ease, box-shadow .14s ease;
  box-shadow:
    0 2px 6px rgba(0,0,0,.06),
    0 10px 24px rgba(0,0,0,.08);
}
.post-card .thumb{
  height: clamp(140px, 22vw, 260px);
  border-radius: 12px;
  background: #f3f4f6;
  overflow: hidden;
}
.post-card .title{
  margin: 2px 0 8px 0;
  font-size: 20px;
  line-height: 1.7;
  color: #143435 !important;
}
.post-card .excerpt{
  margin: 0 0 10px 0;
  color: #1C4A4C;
}
@media (max-width: 820px),
       (hover:none) and (pointer:coarse){
  .post-card{ grid-template-columns: 1fr; }
}

/* Make outer container fluid & centered */
.container,
.site-header .container,
main.container,
.site-footer .container{
  width: min(100%, var(--container-max, 1280px));
  margin-inline: auto;
  padding-inline: clamp(12px, 3vw, 24px);
}








