/* ============================================================
   ILSI Nepal — ilsinepal.org
   File: css/style.css
   Purpose: Shared institutional stylesheet (all pages)
   Tone: institutional, factual, restrained (WHO/FAO register)
   Brand colours are CSS variables — replace with confirmed
   ILSI hex values when available.
   ============================================================ */

:root {
  /* Brand — PLACEHOLDER defaults until confirmed ILSI hex supplied */
  --ilsi-blue:        #173a6a;   /* primary */
  --ilsi-blue-dark:   #0f2a4d;
  --ilsi-blue-700:    #1f4d8a;
  --ilsi-orange:      #d97a23;   /* accent */
  --ilsi-purple:      #5b4b8a;   /* accent */

  --ink:              #1c2530;
  --ink-soft:         #44505f;
  --line:             #d9e0e8;
  --bg:               #ffffff;
  --bg-soft:          #f4f7fa;
  --bg-blue-tint:     #eef3f8;

  --maxw: 1120px;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(15,42,77,.06), 0 6px 20px rgba(15,42,77,.06);

  --serif: "Georgia", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--serif); color: var(--ilsi-blue-dark); line-height: 1.25; font-weight: 600; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 .5em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0 0 .6em; }
h3 { font-size: 1.18rem; margin: 0 0 .4em; }
p  { margin: 0 0 1rem; }
a  { color: var(--ilsi-blue-700); }
a:hover { color: var(--ilsi-blue-dark); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; }
.section--soft { background: var(--bg-soft); }
.section--tint { background: var(--bg-blue-tint); }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 70ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--ilsi-orange); font-family: var(--sans); margin: 0 0 .6rem; }
.measure { max-width: 72ch; }
.center { text-align: center; }

/* Skip link for accessibility */
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--ilsi-blue-dark); color: #fff;
  padding: 10px 16px; z-index: 200; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--line);
}
.topbar { background: var(--ilsi-blue-dark); color: #cdd9e8; font-size: .8rem; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; padding-top: 7px; padding-bottom: 7px; gap: 16px; }
.topbar a { color: #e6eef8; text-decoration: none; }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__mark {
  width: 46px; height: 46px; flex: none; border-radius: 5px;
  background: var(--ilsi-blue); color: #fff; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 1.15rem; letter-spacing: .5px;
}
.brand__text { line-height: 1.1; }
.brand__name { font-family: var(--serif); font-weight: 700; color: var(--ilsi-blue-dark); font-size: 1.05rem; }
.brand__tag { font-size: .76rem; color: var(--ink-soft); }

.nav__links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav__links a {
  text-decoration: none; color: var(--ink); font-size: .95rem; font-weight: 500;
  padding: 9px 13px; border-radius: var(--radius); display: inline-block;
}
.nav__links a:hover { background: var(--bg-blue-tint); color: var(--ilsi-blue-dark); }
.nav__links a[aria-current="page"] { color: var(--ilsi-blue-dark); box-shadow: inset 0 -3px 0 var(--ilsi-orange); border-radius: 0; }

.nav__toggle {
  display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 10px; cursor: pointer; color: var(--ilsi-blue-dark);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 12px 22px; border-radius: var(--radius); border: 1.5px solid transparent; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn--primary { background: var(--ilsi-blue); color: #fff; }
.btn--primary:hover { background: var(--ilsi-blue-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--ilsi-blue-dark); border-color: var(--ilsi-blue); }
.btn--ghost:hover { background: var(--ilsi-blue); color: #fff; }
.btn--light { background: #fff; color: var(--ilsi-blue-dark); }
.btn--light:hover { background: var(--bg-blue-tint); }
.btn--soft { background: var(--bg-blue-tint); color: var(--ilsi-blue-dark); }
.btn[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(15,42,77,.72), rgba(15,42,77,.90)),
    linear-gradient(120deg, #14315a, #1f4d8a 60%, #2a5da0);
}
.hero__inner { position: relative; z-index: 2; padding: 96px 0 104px; max-width: 60ch; }
.hero h1 { color: #fff; }
.hero .lead { color: #dce8f5; }
.hero__mountains { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1; width: 100%; height: auto; display: block; opacity: .5; }
.page-hero { background: var(--ilsi-blue-dark); color: #fff; padding: 56px 0; }
.page-hero h1 { color: #fff; margin-bottom: .2em; }
.page-hero .lead { color: #cfe0f1; }
.breadcrumb { font-size: .82rem; color: #9fb6d2; margin-bottom: 14px; }
.breadcrumb a { color: #cfe0f1; text-decoration: none; }

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); height: 100%;
}
.card h3 { color: var(--ilsi-blue-dark); }
.card p { color: var(--ink-soft); margin-bottom: 0; }

.focus-tile { text-decoration: none; color: inherit; display: block; }
.focus-tile:hover { border-color: var(--ilsi-blue); }
.focus-tile .ico {
  width: 42px; height: 42px; border-radius: 8px; background: var(--bg-blue-tint);
  color: var(--ilsi-blue); display: grid; place-items: center; margin-bottom: 12px;
}
.focus-tile .ico svg { width: 24px; height: 24px; }

/* ---------- Two-column feature ---------- */
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.panel { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--ilsi-orange); border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow); }
.panel--blue { border-left-color: var(--ilsi-blue); }
.panel--purple { border-left-color: var(--ilsi-purple); }

/* ---------- Lists ---------- */
.tick { list-style: none; padding: 0; margin: 0; }
.tick li { position: relative; padding: 6px 0 6px 30px; color: var(--ink-soft); }
.tick li::before {
  content: ""; position: absolute; left: 0; top: 13px; width: 16px; height: 16px;
  background: var(--ilsi-blue); border-radius: 50%;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/14px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/14px no-repeat;
}
.tick li strong { color: var(--ink); font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .94rem; min-width: 540px; }
table.data th, table.data td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
table.data thead th { background: var(--bg-blue-tint); color: var(--ilsi-blue-dark); font-family: var(--sans); }
table.data tbody tr:nth-child(even) { background: var(--bg-soft); }

/* ---------- Notices / placeholders ---------- */
.placeholder {
  background: repeating-linear-gradient(45deg, #fbf6ee, #fbf6ee 10px, #f7efe2 10px, #f7efe2 20px);
  border: 1px dashed var(--ilsi-orange); border-radius: var(--radius);
  padding: 14px 16px; color: #8a5a16; font-size: .9rem; margin: 14px 0;
}
.placeholder strong { color: #6f4711; }

/* ---------- Governance snapshot ---------- */
.snapshot { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.snapshot .card { text-align: left; }
.snapshot .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ilsi-orange); font-weight: 700; }
.snapshot .v { font-family: var(--serif); font-size: 1.15rem; color: var(--ilsi-blue-dark); }

/* ---------- Featured ---------- */
.featured { background: linear-gradient(120deg, var(--ilsi-blue-dark), var(--ilsi-blue-700)); color: #fff; border-radius: var(--radius); padding: 40px; }
.featured h2 { color: #fff; }
.featured p { color: #d7e4f3; }
.featured .eyebrow { color: #ffd9ad; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; max-width: 640px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; color: var(--ink); }
.field .req { color: var(--ilsi-orange); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; color: var(--ink); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--ilsi-blue-700); border-color: var(--ilsi-blue-700); }
.field textarea { min-height: 130px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: auto; margin-top: 5px; }
.form-note { font-size: .85rem; color: var(--ink-soft); }
.form-success { background: var(--bg-blue-tint); border: 1px solid var(--ilsi-blue); border-radius: var(--radius); padding: 16px 18px; color: var(--ilsi-blue-dark); }
.hidden { display: none !important; }

/* ---------- Contact strip ---------- */
.contact-lines { list-style: none; padding: 0; margin: 0; }
.contact-lines li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; }
.contact-lines .k { width: 90px; flex: none; color: var(--ink-soft); font-size: .9rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ilsi-blue-dark); color: #c3d2e6; margin-top: 8px; }
.site-footer a { color: #e6eef8; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding: 56px 0 28px; }
.footer-grid h4 { color: #fff; font-family: var(--sans); font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { padding: 4px 0; }
.footer__brand .brand__mark { background: #fff; color: var(--ilsi-blue-dark); }
.footer__tag { color: #9fb6d2; max-width: 34ch; font-size: .92rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 16px 0; font-size: .82rem; color: #9fb6d2; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .grid--4 { grid-template-columns: repeat(2,1fr); }
  .grid--3 { grid-template-columns: repeat(2,1fr); }
  .split { grid-template-columns: 1fr; }
  .snapshot { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .nav__toggle { display: inline-block; }
  .nav__links {
    display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff;
    flex-direction: column; align-items: stretch; gap: 0; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); padding: 8px 16px 16px;
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 12px 8px; border-radius: 0; border-bottom: 1px solid var(--bg-soft); }
  .nav { position: relative; }
  .topbar .container { font-size: .74rem; }
}
@media (max-width: 560px) {
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .featured { padding: 28px; }
  .section { padding: 48px 0; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
