/* ==========================================================================
   MyNaksh blog theme — synced to Figma (desktop 841-5212, mobile 841-4571)
   Fully server-rendered (Ghost/Handlebars). Mobile-first + responsive.
   Design tokens taken directly from the Figma Dev Mode export.
   ========================================================================== */

:root {
  --bg:        #ede5da;              /* page background */
  --ink:       #161a24;             /* primary text */
  --ink-80:    rgba(22,26,36,0.8);  /* muted text */
  --ink-60:    rgba(22,26,36,0.6);
  --paper:     #fbfaf8;             /* light / inverse text + surfaces */
  --brown:     #803003;             /* accent */
  --brown-10:  rgba(128,48,3,0.1);
  --border:    rgba(22,26,36,0.1);

  --maxw: 1128px;                   /* 1440 - 156*2 content padding */
  --r-sm: 12px;
  --r-md: 16px;
  --r-pill: 100px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================ HEADER (site nav replica) ================== */
.site-header-outer {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 18px;
  position: sticky; top: 0; z-index: 1000;
}
.site-header {
  width: calc(100% - 32px);
  max-width: 1200px;
  border-radius: 32px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 28px;
  border: 1px solid rgba(22,26,36,0.12);
  background: rgba(237,229,218,0.75);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.site-header__left { display: flex; align-items: center; gap: 12px; }
.site-header__logo { width: 48px; height: 48px; border-radius: 50%; }
.site-header__title { font-size: 1.5rem; font-weight: 600; color: var(--ink); }
.site-header__actions { display: flex; align-items: center; gap: 10px; }
.btn {
  border: 1px solid var(--brown);
  border-radius: var(--r-md);
  padding: 9px 16px;
  font: 500 0.95rem 'Inter', sans-serif;
  color: var(--brown);
  background: transparent;
  cursor: pointer;
  transition: background .18s, color .18s;
  display: inline-flex; align-items: center; line-height: 1;
}
.btn:hover { background: var(--brown); color: var(--paper); }
.btn--solid { background: var(--brown); color: var(--paper); }

/* Download App — Figma 841-4565: beige pill, translucent brown outline */
.btn--download {
  background: var(--bg);                       /* #ede5da */
  border: 1px solid rgba(128,48,3,0.3);
  border-radius: 60px;
  color: var(--brown);                         /* #803003 */
  font-size: 1rem;
  font-weight: 500;
  padding: 12px 24px;
  transition: background .18s, color .18s, border-color .18s;
}
.btn--download:hover { background: var(--brown); border-color: var(--brown); color: var(--paper); }

/* ============================ PAGE TITLE ================================= */
.blog-head {
  padding: 96px 0 64px;
}
.blog-head__title { font-size: 40px; font-weight: 700; margin: 0 0 8px; color: var(--ink); }
.blog-head__subtitle { font-size: 24px; font-weight: 400; line-height: 40px; margin: 0; color: var(--ink); }

/* ============================ SECTION ==================================== */
.section { margin-bottom: 72px; }
.section__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.section__title { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 600; color: var(--ink); }
.section__title .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brown); }
.section__viewall { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; color: var(--ink); }
.section__viewall::after { content: "→"; }

/* Two-column: featured (left) + list (right) */
.section__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* ---- Featured hero card ---- */
.feature-card { display: flex; flex-direction: column; gap: 16px; }
.feature-card__img {
  width: 100%; aspect-ratio: 2 / 1; object-fit: cover;
  border-radius: var(--r-md); background: var(--brown-10);
}
.feature-card__title {
  font-size: 24px; font-weight: 600; line-height: 32px; margin: 0;
  color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.feature-card__excerpt {
  font-size: 16px; font-weight: 500; line-height: 24px; margin: 0;
  color: var(--ink-80);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 500; color: var(--ink-80); margin-top: 4px;
}
.card-meta__more { display: inline-flex; align-items: center; gap: 4px; }
.card-meta__more::after { content: "→"; }

/* ---- Compact list cards ---- */
.list-col { display: flex; flex-direction: column; gap: 24px; }
.mini-card { display: flex; gap: 16px; align-items: stretch; }
.mini-card__img {
  width: 132px; height: 100px; flex-shrink: 0; object-fit: cover;
  border-radius: var(--r-sm); background: var(--brown-10);
}
.mini-card__body { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; gap: 6px; }
.mini-card__title {
  font-size: 16px; font-weight: 600; line-height: 20px; margin: 0; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mini-card__excerpt {
  font-size: 14px; font-weight: 500; line-height: 20px; margin: 0; color: var(--ink-80);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mini-card__meta { font-size: 13px; color: var(--ink-80); margin: 0; }

/* ============================ DOWNLOAD APP BLOCK ======================== */
.download {
  background: var(--ink);
  border-radius: 32px;
  padding: 56px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  margin: 48px 0 72px;
}
.download__title { color: var(--paper); font-size: 20px; letter-spacing: 1px; text-transform: uppercase; margin: 0; }
.download__buttons { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.store-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 60px; width: 248px; border-radius: var(--r-md);
  background: rgba(251,250,248,0.1); border: 1px solid var(--paper);
  color: var(--paper); font-weight: 500;
}

/* ============================ POST DETAIL =============================== */
.post-full { padding: 64px 0; }
.post-full__header { max-width: 760px; margin: 0 auto 32px; }
.post-full__tag { color: var(--brown); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; font-size: 14px; }
.post-full__title { font-size: clamp(28px, 4.5vw, 40px); font-weight: 700; margin: 12px 0; color: var(--ink); }
.post-full__meta { color: var(--ink-80); font-size: 14px; }
.post-full__feature { max-width: var(--maxw); margin: 0 auto 40px; border-radius: var(--r-md); overflow: hidden; }
.post-full__content { max-width: 720px; margin: 0 auto; font-size: 17px; color: var(--ink); }
.post-full__content h2, .post-full__content h3 { color: var(--ink); }
.post-full__content .kg-width-wide { max-width: 1040px; margin-left: auto; margin-right: auto; }
.post-full__content .kg-width-full { max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.kg-image, .kg-image-card img { margin: 0 auto; }
.kg-gallery-container { display: flex; flex-direction: column; gap: 10px; margin: 24px auto; max-width: 1040px; }
.kg-gallery-row { display: flex; gap: 10px; }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }
.kg-bookmark-card { width: 100%; margin: 24px 0; }
.kg-bookmark-container { display: flex; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.kg-bookmark-content { padding: 20px; flex: 1; }
.kg-bookmark-thumbnail img { height: 100%; object-fit: cover; }

/* ============================ FOOTER (Figma 841-5622) =================== */
:root { --footer-navy: #0b1a3a; --footer-navy-2: #0a1530; }
.site-footer {
  position: relative;
  background: radial-gradient(1200px 500px at 50% -10%, #16264d 0%, var(--footer-navy) 45%, var(--footer-navy-2) 100%);
  color: var(--paper);
  overflow: hidden;
  padding: 64px 0 32px;
  text-align: center;
}
/* CSS starfield (lightweight galaxy vibe, no WebGL) */
.site-footer__stars {
  position: absolute; inset: 0; pointer-events: none; opacity: .9;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,.9), transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 40% 60%, rgba(255,255,255,.8), transparent),
    radial-gradient(1px 1px at 85% 55%, rgba(255,255,255,.6), transparent),
    radial-gradient(2px 2px at 60% 80%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 10% 75%, rgba(255,255,255,.7), transparent),
    radial-gradient(1.5px 1.5px at 90% 85%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 30% 10%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 50% 40%, rgba(255,255,255,.6), transparent);
  background-repeat: no-repeat;
}
.site-footer__inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 0 24px;
  display: flex; flex-direction: column; align-items: center; gap: 36px; }

/* Brand */
.site-footer__brand { display: flex; align-items: center; justify-content: center; }
.site-footer__logo { height: 56px; width: auto; }

/* Download glass card */
.footer-download {
  width: 100%; border: 1px solid rgba(251,250,248,0.18); border-radius: 20px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 28px 24px; display: flex; flex-direction: column; gap: 20px; align-items: center;
}
.footer-download__title { text-transform: uppercase; letter-spacing: 2px; font-size: 18px; margin: 0; color: var(--paper); }
.footer-download__buttons { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; width: 100%; }
.store-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 12px;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.14);
  color: var(--paper); text-decoration: none; font-size: 15px; flex: 1; justify-content: center; min-width: 200px;
}
.store-btn__icon { font-size: 20px; }
.store-btn--soon { background: rgba(255,255,255,0.08); color: rgba(251,250,248,0.75); }

/* Legal */
.footer-legal__title { font-weight: 600; margin: 0 0 12px; color: var(--paper); }
.footer-legal__links { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; }
.footer-legal__links a { color: rgba(251,250,248,0.85); text-decoration: underline; text-underline-offset: 4px;
  letter-spacing: 1px; font-size: 14px; }

/* Feature row */
.footer-features { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 28px;
  color: var(--paper); font-size: 14px; letter-spacing: 1px; opacity: .92; }

/* Social */
.footer-social__title { font-weight: 600; margin: 0 0 16px; color: var(--paper); }
.footer-social__icons { display: flex; gap: 16px; justify-content: center; }
.footer-social__icons a {
  width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,0.10);
  display: inline-flex; align-items: center; justify-content: center; color: var(--paper);
  font-size: 1.1rem; text-decoration: none; transition: background .18s;
}
.footer-social__icons a:hover { background: rgba(255,255,255,0.22); }

.footer-copyright { font-size: .8rem; opacity: .6; margin: 0; }

.pagination { display: flex; justify-content: center; gap: 16px; padding: 24px 0 64px; font-size: 15px; }
.pagination a { color: var(--brown); font-weight: 600; }

/* ============================ RESPONSIVE ================================ */
/* Tablet: stack the featured + list into one column */
@media (max-width: 900px) {
  .section__body { grid-template-columns: 1fr; }
  .blog-head { padding: 72px 0 48px; }
  .blog-head__title { font-size: 32px; }
  .blog-head__subtitle { font-size: 18px; line-height: 28px; }
}

/* Mobile (Figma 841-4571 ≈ 375px): smaller type, tighter, single column */
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .site-header { padding: 10px 16px; border-radius: 18px; }
  .site-header__title { font-size: 1.15rem; }
  .site-header__logo { width: 40px; height: 40px; }
  .btn { padding: 7px 12px; font-size: .85rem; }

  .blog-head { padding: 48px 0 32px; }
  .blog-head__title { font-size: 24px; }
  .blog-head__subtitle { font-size: 14px; line-height: 22px; }

  .section { margin-bottom: 40px; }
  .section__title { font-size: 20px; }
  .section__viewall { font-size: 14px; }

  .feature-card__title { font-size: 18px; line-height: 24px; }
  .feature-card__excerpt { font-size: 14px; line-height: 20px; -webkit-line-clamp: 3; }

  .mini-card { gap: 12px; }
  .mini-card__img { width: 96px; height: 72px; border-radius: 8px; }
  .mini-card__title { font-size: 14px; line-height: 18px; }
  .mini-card__excerpt { display: none; }
  .mini-card__meta { font-size: 12px; }

  .download { padding: 40px 16px; border-radius: 20px; }
  .download__buttons { flex-direction: column; width: 100%; }
  .store-btn { width: 100%; max-width: 320px; }

  .site-footer__middle { flex-direction: column; gap: 20px; }
}

/* ==========================================================================
   Layout additions: header download btn, breadcrumb, pills, featured wide,
   card-grid (latest), related-row, footer store buttons.
   ========================================================================== */

/* Header link + download button */
.site-header__link { color: var(--ink); font-weight: 500; font-size: 0.95rem; padding: 8px 4px; }
.btn__dl { font-weight: 700; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 8px; padding: 24px 0 0; font-size: 14px; color: var(--ink-80); }
.breadcrumb a { color: var(--brown); }
.breadcrumb__sep { color: var(--ink-60); }
.breadcrumb__current { color: var(--ink); font-weight: 500; }

/* Tag pills */
.pill { align-self: flex-start; display: inline-block; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--brown);
  background: var(--brown-10); padding: 4px 10px; border-radius: var(--r-pill); }
.pill--sm { font-size: 0.66rem; padding: 3px 8px; }

/* Featured — wide (image left, body right on desktop) */
.feature-card--wide { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center;
  background: var(--paper); border-radius: var(--r-md); overflow: hidden; padding: 0; }
.feature-card--wide .feature-card__img { aspect-ratio: 16/10; border-radius: 0; height: 100%; }
.feature-card--wide .feature-card__body { display: flex; flex-direction: column; gap: 14px; padding: 32px 32px 32px 0; }

/* Latest posts — responsive card grid (3-up) */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.post-card { background: var(--paper); border-radius: var(--r-md); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(22,26,36,.10); }
.post-card__img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--brown-10); }
.post-card__body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card__title { font-size: 18px; font-weight: 600; line-height: 24px; margin: 0; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card__excerpt { font-size: 14px; line-height: 20px; margin: 0; color: var(--ink-80); flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card__meta { font-size: 13px; color: var(--ink-80); margin: 0; }

/* Related reads — horizontal mini-card row */
.related-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* Responsive */
@media (max-width: 900px) {
  .feature-card--wide { grid-template-columns: 1fr; }
  .feature-card--wide .feature-card__img { aspect-ratio: 16/9; }
  .feature-card--wide .feature-card__body { padding: 20px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .related-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; gap: 20px; }
  .site-header__link { display: none; }
  .footer-download__buttons { flex-direction: column; }
  .store-btn { width: 100%; min-width: 0; }
  .footer-legal__links { gap: 18px; }
  .footer-features { gap: 12px 18px; font-size: 13px; }
}
