/* =============================================================
   Marunadan Scientist 2.3 — simplified homepage, menu & Articles page
   Loaded after theme.css. Uses the theme's own navy/gold variables.
   ============================================================= */

:root {
  --ms-ground:   var(--navy-mid, #0f1e3a);
  --ms-deep:     var(--navy-deep, #0a1223);
  --ms-surface:  #16264a;
  --ms-line:     #2a3d66;
  --ms-ink:      #eef1f7;
  --ms-ink-soft: #b3bdd3;
  --ms-gold:     #e0b55c;
  --ms-gold-wash:#2c2a1f;
  --ms-f-display: 'Baloo Chettan 2', 'Noto Sans Malayalam', system-ui, sans-serif;
  --ms-f-body:    'Manjari', 'Noto Sans Malayalam', 'Lato', system-ui, sans-serif;
}

/* ── Typography (whole site when the 2026 layout is on) ── */
body.ms-refresh { font-family: var(--ms-f-body); background: var(--ms-ground); color: var(--ms-ink); }
body.ms-refresh .mani-page-header h1,
body.ms-refresh .mani-post-content h2,
body.ms-refresh .mani-post-content h3,
body.ms-refresh .mani-card-title { font-family: var(--ms-f-display); }
body.ms-refresh .mani-post-content { font-size: 1.08rem; }
body.ms-refresh .mani-post-content p,
body.ms-refresh .mani-post-content li { line-height: 1.85; }
body.ms-refresh .mani-page-content { background: var(--ms-ground); }

.ms-wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.ms-home h1, .ms-home h2, .ms-home h3,
.ms-articles h1, .ms-articles h3 {
  font-family: var(--ms-f-display);
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
  margin: 0;
  color: var(--ms-ink);
  letter-spacing: 0;
  text-transform: none;
}
.ms-home p, .ms-articles p { margin: 0; }
.ms-home a:focus-visible, .ms-articles a:focus-visible, .ms-articles input:focus-visible, .ms-articles button:focus-visible,
.ms-nav a:focus-visible, .ms-nav summary:focus-visible { outline: 2px solid var(--ms-gold); outline-offset: 3px; border-radius: 4px; }

/* ── Buttons & links ── */
.ms-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ms-gold); color: #14223f;
  font-family: var(--ms-f-display); font-weight: 700; font-size: 1.05rem;
  padding: 12px 24px; border-radius: 999px; border: 0; cursor: pointer;
  text-decoration: none; line-height: 1.2;
}
.ms-btn:hover { filter: brightness(1.07); color: #14223f; }
.ms-btn--small { font-size: .95rem; padding: 10px 18px; }
.ms-textlink { color: var(--ms-ink); text-decoration: none; border-bottom: 1px solid var(--ms-gold); padding-bottom: 2px; }
.ms-textlink:hover { color: var(--ms-gold); }

/* ── HERO: the photo is the stage; text sits on the navy side of a fade ── */
.ms-hero { position: relative; overflow: hidden; isolation: isolate; background: var(--ms-deep); color: var(--ms-ink); border-bottom: 1px solid rgba(224,181,92,.22); }
.ms-hero-media { position: absolute; top: 0; bottom: 0; left: 30%; right: 0; z-index: -1; }
.ms-hero-media img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: var(--ms-focus-x, 32%) 45%; display: block; }
.ms-hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--ms-deep) 0%, rgba(10,18,35,.88) 12%, rgba(10,18,35,.35) 32%, rgba(10,18,35,0) 50%),
    linear-gradient(0deg, rgba(10,18,35,.75) 0%, rgba(10,18,35,0) 28%);
}
.ms-hero-inner { padding-top: clamp(56px, 8vw, 112px); padding-bottom: clamp(56px, 8vw, 112px); }
.ms-hero-text { max-width: 34rem; }
.ms-kicker { font-size: .95rem; color: var(--ms-gold); margin-bottom: 10px !important; }
.ms-hero h1 { font-size: clamp(1.85rem, 4.2vw, 3rem); text-shadow: 0 2px 18px rgba(8,16,34,.6); }
.ms-intro { color: var(--ms-ink-soft); margin-top: 18px !important; font-size: 1.08rem; line-height: 1.75; }
.ms-actions { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; margin-top: 26px; }
@media (max-width: 900px) { .ms-hero-media { left: 20%; } }
@media (max-width: 760px) {
  .ms-hero-media { position: relative; left: auto; right: auto; height: min(92vw, 420px); z-index: 0; }
  .ms-hero-media img { object-position: calc(var(--ms-focus-x, 32%) + 8%) 30%; }
  .ms-hero-media::after { background: linear-gradient(0deg, var(--ms-deep) 0%, rgba(10,18,35,.7) 22%, rgba(10,18,35,0) 55%); }
  .ms-hero-inner { position: relative; z-index: 1; margin-top: -72px; padding-top: 0; padding-bottom: 40px; }
}

/* ── Sections ── */
.ms-home { background: var(--ms-ground); }
.ms-block { padding-top: clamp(40px, 6vw, 64px); padding-bottom: clamp(16px, 3vw, 24px); }
.ms-block--tight { padding-top: clamp(28px, 4vw, 40px); }
.ms-home > .ms-block:last-child { padding-bottom: clamp(48px, 7vw, 72px); }
.ms-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ms-sec-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
.ms-sec-head a { color: var(--ms-gold); text-decoration: none; font-weight: 700; }
.ms-sec-head a:hover { text-decoration: underline; }

/* Subjects */
.ms-subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ms-subject {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
  background: var(--ms-surface); border: 1px solid var(--ms-line); border-radius: 12px;
  padding: 18px 20px; text-decoration: none; color: var(--ms-ink); transition: border-color .15s;
}
.ms-subject:hover { border-color: var(--ms-gold); }
.ms-glyph { width: 44px; height: 44px; border-radius: 50%; background: var(--ms-gold-wash); color: var(--ms-gold); display: grid; place-items: center; font-family: var(--ms-f-display); font-weight: 700; font-size: 1.1rem; }
.ms-subject-text { display: grid; gap: 2px; min-width: 0; }
.ms-subject-title { font-family: var(--ms-f-display); font-weight: 700; font-size: 1.2rem; line-height: 1.35; }
.ms-subject-desc { color: var(--ms-ink-soft); font-size: .95rem; line-height: 1.55; }
.ms-count { color: var(--ms-ink-soft); font-size: .85rem; white-space: nowrap; }
@media (max-width: 640px) { .ms-subjects { grid-template-columns: 1fr; } }

/* Read these first */
.ms-picks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ms-picks--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ms-picks--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ms-picks--1 { grid-template-columns: minmax(0, 1fr); }
.ms-pick {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  background: var(--ms-surface); border: 1px solid var(--ms-line); border-top: 3px solid var(--ms-gold);
  border-radius: 4px 4px 12px 12px; padding: 16px 18px; text-decoration: none; color: var(--ms-ink);
}
.ms-pick .ms-chip { align-self: flex-start; }
.ms-pick-title { font-family: var(--ms-f-display); font-weight: 600; font-size: 1.06rem; line-height: 1.45; }
.ms-pick:hover .ms-pick-title { color: var(--ms-gold); }
@media (max-width: 900px) { .ms-picks, .ms-picks--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .ms-picks, .ms-picks--3, .ms-picks--2 { grid-template-columns: 1fr; } }

/* Chips */
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px !important; }
.ms-chip { display: inline-block; font-size: .78rem; line-height: 1.2; padding: 4px 10px; border-radius: 999px; background: var(--ms-gold-wash); color: var(--ms-gold); font-weight: 700; white-space: nowrap; text-decoration: none; }
a.ms-chip:hover { background: var(--ms-gold); color: #14223f; }

/* Article rows (homepage latest + Articles page) */
.ms-list { border-top: 1px solid var(--ms-line); }
.ms-row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 6px 20px; padding: 16px 0; border-bottom: 1px solid var(--ms-line); }
.ms-row.has-thumb { grid-template-columns: 8.5rem minmax(0, 1fr) 11rem; }
.ms-row-date { color: var(--ms-ink-soft); font-size: .9rem; font-variant-numeric: tabular-nums; padding-top: 3px; }
.ms-row-title { font-size: 1.12rem !important; font-weight: 600 !important; line-height: 1.45 !important; }
.ms-row-title a { color: var(--ms-ink); text-decoration: none; }
.ms-row-title a:hover { color: var(--ms-gold); }
.ms-row-sub { color: var(--ms-ink-soft); font-size: .95rem; line-height: 1.5; margin-top: 2px !important; }
.ms-row-thumb { display: block; align-self: start; }
.ms-row-thumb img { width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; border-radius: 8px; border: 1px solid var(--ms-line); }
@media (max-width: 560px) {
  /* Phones: title first, small picture on the right, date underneath */
  .ms-row { grid-template-columns: minmax(0, 1fr); gap: 4px 14px; }
  .ms-row.has-thumb { grid-template-columns: minmax(0, 1fr) 6.5rem; }
  .ms-row-main { grid-column: 1; grid-row: 1; }
  .ms-row-date { grid-column: 1; grid-row: 2; padding-top: 0; font-size: .85rem; }
  .ms-row-thumb { grid-column: 2; grid-row: 1 / span 2; }
  .ms-row-thumb img { aspect-ratio: 4 / 3; }
}

/* About strip */
.ms-about { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.ms-about > div { border-left: 2px solid var(--ms-gold); padding-left: 16px; }
.ms-about h3 { font-size: 1.1rem; margin-bottom: 4px !important; }
.ms-about p { color: var(--ms-ink-soft); font-size: .98rem; line-height: 1.6; }
@media (max-width: 760px) { .ms-about { grid-template-columns: 1fr; gap: 18px; } }

/* ── ARTICLES PAGE ── */
.ms-articles { background: var(--ms-ground); padding-bottom: 56px; }
.ms-page-head { background: var(--ms-deep); border-bottom: 1px solid rgba(224,181,92,.22); }
.ms-page-head .ms-wrap { padding-top: clamp(28px, 5vw, 48px); padding-bottom: clamp(28px, 5vw, 48px); }
.ms-page-head h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.ms-page-head p { color: var(--ms-ink-soft); margin-top: 6px !important; }
.ms-tools { display: flex; gap: 10px; margin: 24px 0 14px; }
.ms-search { position: relative; flex: 1 1 auto; min-width: 0; }
.ms-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--ms-ink-soft); pointer-events: none; }
.ms-search input {
  width: 100%; font: inherit; font-size: 1rem; padding: 12px 14px 12px 44px;
  border-radius: 10px; border: 1px solid var(--ms-line); background: var(--ms-surface); color: var(--ms-ink);
}
.ms-search input::placeholder { color: var(--ms-ink-soft); opacity: .8; }
.ms-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.ms-filters a { font-size: .95rem; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--ms-line); background: var(--ms-surface); color: var(--ms-ink); text-decoration: none; }
.ms-filters a span { opacity: .65; font-size: .82em; margin-left: 2px; }
.ms-filters a:hover { border-color: var(--ms-gold); }
.ms-filters a[aria-current="true"] { background: var(--ms-ink); color: var(--ms-deep); border-color: var(--ms-ink); }
.ms-result-count { color: var(--ms-ink-soft); font-size: .9rem; margin: 14px 0 12px !important; min-height: 1em; }
.ms-pager { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 28px; }
.ms-pager .page-numbers {
  min-width: 42px; height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--ms-line); background: var(--ms-surface); color: var(--ms-ink);
  text-decoration: none; font-variant-numeric: tabular-nums;
}
.ms-pager .page-numbers.current { background: var(--ms-gold); border-color: var(--ms-gold); color: #14223f; font-weight: 700; }
.ms-pager .page-numbers.dots { border: 0; background: none; }
.ms-pager a.page-numbers:hover { border-color: var(--ms-gold); }
.ms-empty { padding: 32px 0; color: var(--ms-ink-soft); display: grid; gap: 10px; }
.ms-empty a { color: var(--ms-gold); }

/* ── SIMPLIFIED HEADER MENU ── */
.ms-simple-nav .ms-nav { gap: 6px; }
.ms-simple-nav .ms-nav a,
.ms-simple-nav .ms-nav summary {
  font-family: var(--ms-f-body); text-transform: none; letter-spacing: 0;
  font-size: .98rem; font-weight: 400; color: rgba(255,255,255,.85);
  padding: 8px 12px; border-radius: 6px; border-bottom: 0; cursor: pointer; list-style: none;
}
.ms-simple-nav .ms-nav summary::-webkit-details-marker { display: none; }
.ms-simple-nav .ms-nav summary span { font-size: .7em; }
.ms-simple-nav .ms-nav a:hover,
.ms-simple-nav .ms-nav summary:hover,
.ms-simple-nav .ms-nav .current-menu-item > a { background: rgba(255,255,255,.06); color: var(--ms-gold); }
.ms-topics { position: relative; }
.ms-topics-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 200; list-style: none;
  min-width: 15rem; padding: 6px; border-radius: 10px;
  background: var(--ms-surface); border: 1px solid var(--ms-line); box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.ms-simple-nav .ms-topics-menu a { display: block; color: var(--ms-ink); }
.ms-mobile-articles, .ms-mobile-search { display: none; }
.ms-simple-nav .nav-right { margin-left: 8px; }
.ms-simple-nav .nav-right .lang-toggle { margin-right: 0; }

/* Mobile menu (simplified) */
.ms-mobile-list { list-style: none; }
.ms-mobile-list a {
  display: block; padding: 12px 0; font-family: var(--ms-f-body); font-size: 1rem; text-transform: none; letter-spacing: 0;
  color: rgba(255,255,255,.88); text-decoration: none; border-bottom: 1px solid rgba(201,168,76,.18);
}
.ms-mobile-label { font-size: .75rem; color: var(--ms-gold); padding-top: 12px; letter-spacing: .04em; }
.ms-mobile-sub a { padding-left: 14px; }
.ms-mobile-start { display: block; text-align: center; margin-top: 16px; }

@media (max-width: 960px) {
  .ms-simple-nav #site-nav { gap: 8px; }
  .ms-simple-nav #site-nav .logo { margin-right: auto; }
  .ms-simple-nav .nav-right { margin-left: 0; }
  .ms-simple-nav .ms-mobile-articles {
    display: inline-flex; align-items: center; color: #fff; text-decoration: none; font-size: .9rem;
    padding: 5px 12px; border: 1px solid rgba(224,181,92,.55); border-radius: 999px; white-space: nowrap;
  }
  .ms-simple-nav .ms-mobile-search { display: inline-flex; color: #fff; padding: 6px; }
}
@media (max-width: 520px) {
  /* Narrow phones: the language switch moves into the menu so the bar stays on one line */
  .ms-simple-nav .nav-right { display: none; }
  .ms-simple-nav .logo-bold { font-size: 1rem; }
}

/* ── FOOTER ── */
body.ms-refresh .footer-inner { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.ms-translation-note { font-size: .78rem !important; color: rgba(255,255,255,.55) !important; }
body.ms-refresh .footer-bottom { flex-wrap: wrap; gap: 8px 24px; }

@media (prefers-reduced-motion: reduce) {
  .ms-subject, .ms-pick { transition: none; }
}

/* ── Article & page titles: fit long Malayalam words on phones ── */
body.ms-refresh .mani-page-header h1 { font-size: clamp(1.6rem, 5.6vw, 2.6rem); line-height: 1.3; }
body.ms-refresh .mani-post-meta { font-family: var(--ms-f-body); font-size: .9rem; }
