/* ==========================================================================
   Satwati e-Magazine — core design system
   Self-hosted. No external fonts, no CDNs, no third-party services.
   ========================================================================== */

:root {
  /* Brand */
  --maroon:      #6f1d1b;
  --maroon-deep: #4a120f;
  --saffron:     #d98324;
  --saffron-lt:  #eaa94a;
  --gold:        #b8912f;

  /* Light surface */
  --bg:          #f7f2e9;
  --bg-2:        #fffdf8;
  --paper:       #ffffff;
  --ink:         #2b211c;
  --ink-2:       #6b5c52;
  --ink-3:       #93857a;
  --line:        #e6dccc;
  --shadow-1: 0 1px 2px rgba(58, 36, 24, .06), 0 4px 14px rgba(58, 36, 24, .07);
  --shadow-2: 0 2px 6px rgba(58, 36, 24, .09), 0 18px 40px rgba(58, 36, 24, .14);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --wrap: 1180px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

:root[data-theme="dark"] {
  --bg:     #17130f;
  --bg-2:   #1f1915;
  --paper:  #241d18;
  --ink:    #f0e7dc;
  --ink-2:  #b8a897;
  --ink-3:  #8b7c6d;
  --line:   #3a2f26;
  --maroon: #c65a4f;
  --saffron:#eaa94a;
  --gold:   #d7b352;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
  --shadow-2: 0 2px 6px rgba(0,0,0,.45), 0 18px 40px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 460px at 50% -240px, rgba(217, 131, 36, .16), transparent 70%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--maroon); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--r-sm) var(--r-sm);
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 0; }

/* ---------- Header ------------------------------------------------------ */

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .bar {
  display: flex; align-items: center; gap: 18px;
  min-height: 68px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }

.brand-mark {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
:root[data-theme="dark"] .brand-mark img { filter: invert(1) brightness(1.04); }

.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--serif); font-size: 25px; line-height: 1.05;
  letter-spacing: .01em; color: var(--maroon); font-weight: 600;
}
:root[data-theme="dark"] .brand-name { color: var(--saffron); }
.brand-sub {
  font-size: 10.5px; letter-spacing: .19em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 3px;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; padding: 8px 13px; border-radius: 999px;
  font-size: 14.5px; color: var(--ink-2); transition: background .16s, color .16s;
}
.nav a:hover { background: color-mix(in srgb, var(--saffron) 15%, transparent); color: var(--ink); }
.nav a.is-active { color: var(--maroon); background: color-mix(in srgb, var(--maroon) 10%, transparent); font-weight: 600; }
:root[data-theme="dark"] .nav a.is-active { color: var(--saffron); }

.icon-btn {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink-2);
  border-radius: 50%; cursor: pointer; transition: .16s var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }

/* ---------- Motto ------------------------------------------------------- */

.motto {
  text-align: center; padding: 30px 22px 8px;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(15px, 2.1vw, 19px); color: var(--ink-2);
}
.motto span { color: var(--maroon); font-style: normal; }
:root[data-theme="dark"] .motto span { color: var(--saffron); }

/* ---------- Hero / latest issue ----------------------------------------- */

.hero { padding: 26px 0 54px; }

.hero-card {
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(26px, 5vw, 60px); align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 46px);
  box-shadow: var(--shadow-1);
  position: relative; overflow: hidden;
}
.hero-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 5px;
  background: linear-gradient(180deg, var(--saffron), var(--maroon));
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; letter-spacing: .17em; text-transform: uppercase;
  color: var(--maroon); font-weight: 700; margin-bottom: 12px;
}
:root[data-theme="dark"] .eyebrow { color: var(--saffron); }
.eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--saffron); box-shadow: 0 0 0 4px color-mix(in srgb, var(--saffron) 25%, transparent);
}

.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 5vw, 47px); line-height: 1.1; margin: 0 0 12px;
  letter-spacing: -.01em;
}
.hero p.lede { color: var(--ink-2); font-size: 16.5px; margin: 0 0 22px; max-width: 52ch; }

.meta-row { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 26px; color: var(--ink-3); font-size: 14px; }
.meta-row span { display: inline-flex; align-items: center; gap: 7px; }
.meta-row svg { width: 15px; height: 15px; opacity: .8; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none;
  cursor: pointer; transition: .18s var(--ease); white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: linear-gradient(135deg, var(--saffron), var(--maroon) 90%);
  color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--maroon) 30%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px color-mix(in srgb, var(--maroon) 38%, transparent); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }

/* Cover artwork */
.cover-frame {
  position: relative; border-radius: 4px 10px 10px 4px;
  transform: perspective(1400px) rotateY(-11deg); transform-origin: left center;
  transition: transform .5s var(--ease);
  box-shadow: var(--shadow-2);
  background: var(--paper);
  aspect-ratio: 3 / 4;
}
.hero-card:hover .cover-frame { transform: perspective(1400px) rotateY(-5deg) translateY(-4px); }
.cover-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.cover-frame::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.30) 0, rgba(0,0,0,.06) 4%, rgba(0,0,0,0) 12%,
              rgba(255,255,255,.14) 55%, rgba(0,0,0,.08) 100%);
}
.cover-fallback {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  gap: 6px; padding: 20px; border-radius: inherit; color: #fff;
  background: linear-gradient(160deg, var(--maroon), var(--maroon-deep));
}
.cover-fallback b { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.cover-fallback small { letter-spacing: .18em; text-transform: uppercase; font-size: 10px; opacity: .8; }

/* ---------- Section head + filters -------------------------------------- */

.section { padding: 8px 0 70px; }

.section-head {
  display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap;
  margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.section-head h2 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(23px, 3.2vw, 31px);
  margin: 0; letter-spacing: -.01em;
}
.section-head .count { color: var(--ink-3); font-size: 14px; margin-right: auto; padding-bottom: 4px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.search-box { position: relative; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); }
.search-box input {
  font: inherit; font-size: 14.5px; color: var(--ink);
  padding: 10px 14px 10px 38px; width: 220px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2);
  transition: .18s var(--ease);
}
.search-box input:focus { outline: none; border-color: var(--saffron); width: 260px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--saffron) 18%, transparent); }

select.year-select {
  font: inherit; font-size: 14.5px; color: var(--ink);
  padding: 10px 34px 10px 15px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-2) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393857a' stroke-width='2.2' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 12px center / 15px;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
select.year-select:focus { outline: none; border-color: var(--saffron); }

/* ---------- Archive grid ------------------------------------------------ */

.year-group { margin-bottom: 46px; }
.year-label {
  display: flex; align-items: center; gap: 16px; margin: 0 0 20px;
  font-family: var(--serif); font-size: 21px; color: var(--ink-2); font-weight: 600;
}
.year-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.grid {
  display: grid; gap: clamp(18px, 2.6vw, 30px);
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
}

.issue-card { text-decoration: none; display: block; position: relative; }

.issue-thumb {
  position: relative; aspect-ratio: 3 / 4; border-radius: 3px 8px 8px 3px;
  overflow: hidden; background: var(--paper);
  box-shadow: var(--shadow-1);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.issue-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.issue-thumb::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 9px; z-index: 2;
  background: linear-gradient(90deg, rgba(0,0,0,.28), rgba(0,0,0,.02));
}
.issue-card:hover .issue-thumb { transform: translateY(-7px) scale(1.015); box-shadow: var(--shadow-2); }
.issue-card:focus-visible { outline: none; }
.issue-card:focus-visible .issue-thumb { box-shadow: 0 0 0 3px var(--saffron), var(--shadow-2); }

.issue-thumb .overlay {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center;
  background: linear-gradient(to top, rgba(29,15,10,.78), rgba(29,15,10,.16));
  opacity: 0; transition: opacity .28s var(--ease);
}
.issue-card:hover .overlay, .issue-card:focus-visible .overlay { opacity: 1; }
.overlay .read-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--maroon); font-weight: 700; font-size: 13px;
  padding: 9px 17px; border-radius: 999px; transform: translateY(8px);
  transition: transform .28s var(--ease);
}
.issue-card:hover .read-pill { transform: translateY(0); }
.read-pill svg { width: 15px; height: 15px; }

.badge-new {
  position: absolute; top: 10px; right: -6px; z-index: 4;
  background: linear-gradient(135deg, var(--saffron), var(--maroon));
  color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; padding: 5px 11px; border-radius: 3px;
  box-shadow: 0 4px 12px rgba(0,0,0,.28);
}

.issue-meta { padding: 13px 2px 0; }
.issue-meta h3 { margin: 0; font-family: var(--serif); font-size: 17.5px; font-weight: 600; line-height: 1.28; }
.issue-meta p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-3); }

.about-text { max-width: 70ch; color: var(--ink-2); font-size: 16.5px; margin: 0 0 30px; }

.founders {
  margin: 0; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-1); background: var(--bg-2);
}
.founders img { width: 100%; height: auto; display: block; }
:root[data-theme="dark"] .founders img { filter: brightness(.9); }

.empty {
  text-align: center; padding: 70px 20px; color: var(--ink-3);
  border: 1px dashed var(--line); border-radius: var(--r-lg);
}
.empty h3 { font-family: var(--serif); color: var(--ink-2); margin: 0 0 8px; font-size: 20px; }
.empty code {
  background: color-mix(in srgb, var(--ink) 7%, transparent); padding: 2px 7px;
  border-radius: 4px; font-size: 13px;
}

/* ---------- Footer ------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 46px 0 30px; margin-top: 20px;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; }

/* Devanagari sits on system fonts — nothing is fetched from outside. */
.deva {
  font-family: "Noto Sans Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN",
               "Nirmala UI", Mangal, var(--sans);
}
.footer-grid h4.deva { font-size: 12.5px; letter-spacing: .04em; text-transform: none; }
.footer-grid h4.deva span { letter-spacing: .14em; text-transform: uppercase; font-size: 11px; opacity: .75; }
.editor-name { font-size: 18px; line-height: 1.5; color: var(--ink); margin-bottom: 2px !important; }
.editor-latin { font-size: 13px; color: var(--ink-3) !important; }
.footer-grid h4 {
  margin: 0 0 12px; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3);
}
.footer-grid p, .footer-grid li { color: var(--ink-2); font-size: 14.5px; margin: 0 0 7px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { color: var(--maroon); }
:root[data-theme="dark"] .footer-grid a:hover { color: var(--saffron); }
.footer-brand { font-family: var(--serif); font-size: 24px; color: var(--maroon); margin-bottom: 8px; }
:root[data-theme="dark"] .footer-brand { color: var(--saffron); }
.copyright {
  margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}

@media (max-width: 860px) {
  .hero-card { grid-template-columns: 1fr; text-align: left; }
  .cover-frame { max-width: 230px; transform: none; }
  .hero-card:hover .cover-frame { transform: translateY(-3px); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .nav { display: none; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; }
  .search-box input, .search-box input:focus { width: 100%; }
  .toolbar { width: 100%; }
  .search-box { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
