/* ==========================================================================
   XIPA — Building Skills. Building Communities.
   Site stylesheet (single file, no build step required).

   Design direction: "seal" logo concept — light cream background, navy text,
   olive-green and gold accents. Classic and institutional, but warm.
   Mobile-first: base styles are for small screens, media queries scale up.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Colour palette (drawn from the XIPA seal logo) */
  --cream:        #FBF6EA;  /* page background */
  --cream-2:      #F3EAD5;  /* alternating section background */
  --cream-3:      #EADFC4;  /* borders / subtle fills */
  --navy:         #1B2A4A;  /* primary text + primary buttons */
  --navy-2:       #142038;  /* darker navy for hover states */
  --navy-soft:    #3B4C71;  /* secondary/body text */
  --olive:        #5F7343;  /* accent: icons, rules, links on cream */
  --olive-light:  #8FA06B;
  --gold:         #C08A2E;  /* accent: CTAs (with navy text), decorative */
  --gold-deep:    #8A5F13;  /* gold used as TEXT on cream (contrast-safe) */
  --white:        #FFFFFF;

  --border:       rgba(27, 42, 74, 0.14);
  --shadow-sm:    0 1px 2px rgba(27, 42, 74, 0.06);
  --shadow-md:    0 6px 18px rgba(27, 42, 74, 0.09);

  /* Typography */
  --font-serif: "Lora", Georgia, "Times New Roman", serif;
  --font-sans:  "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI",
                Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-beng:  "Noto Sans Bengali", "Noto Serif Bengali", "Nirmala UI", sans-serif;

  /* Layout */
  --container: 1120px;
  --container-narrow: 780px;
  --radius: 6px;
  --radius-lg: 12px;
  --space-section: 3.5rem;
}

@media (min-width: 768px) {
  :root { --space-section: 5rem; }
}

/* --------------------------------------------------------------------------
   2. Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background-color: var(--cream);
  color: var(--navy);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* When the site is switched to Assamese, prefer a font with Bengali-script
   coverage so the copy renders cleanly once real translations are added. */
html[lang="as"] body,
html[lang="as"] h1,
html[lang="as"] h2,
html[lang="as"] h3 {
  font-family: var(--font-beng), var(--font-sans);
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--navy);
  line-height: 1.22;
  margin: 0 0 0.6em;
  font-weight: 600;
}

h1 { font-size: clamp(2rem, 5.2vw, 3.1rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.55rem, 3.6vw, 2.15rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.4rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--olive); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--navy); }

ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Visible, high-contrast focus for keyboard users */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: var(--cream);
  padding: 0.7rem 1.1rem;
  z-index: 200;
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
  left: 0;
  color: var(--cream);
}

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

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (min-width: 768px) { .container { padding: 0 2rem; } }

.container--narrow { max-width: var(--container-narrow); }

.section { padding: var(--space-section) 0; }
.section--alt { background-color: var(--cream-2); }
.section--navy { background-color: var(--navy); color: var(--cream); }
.section--navy h2, .section--navy h3 { color: var(--cream); }
.section--navy a { color: var(--gold); }
.section--navy a:hover { color: var(--white); }

.section-head { max-width: 46rem; margin-bottom: 2.25rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.eyebrow {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.65rem;
}
.section--navy .eyebrow { color: var(--gold); }

.lead {
  font-size: 1.15rem;
  color: var(--navy-soft);
}
.section--navy .lead { color: var(--cream-3); }

.text-muted { color: var(--navy-soft); }
.small { font-size: 0.925rem; }

/* Decorative rule with a small leaf-ish diamond in the middle */
.rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  color: var(--olive);
}
.rule::before, .rule::after {
  content: "";
  height: 1px;
  background: var(--cream-3);
  flex: 1;
}
.rule span {
  width: 8px; height: 8px;
  transform: rotate(45deg);
  background: var(--gold);
  flex: none;
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: var(--radius);
  border: 2px solid var(--navy);
  background: var(--navy);
  color: var(--cream);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn:hover { background: var(--navy-2); border-color: var(--navy-2); color: var(--cream); }

.btn--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
}
.btn--gold:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: var(--cream); }

.btn--outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn--outline:hover { background: var(--navy); color: var(--cream); }

.section--navy .btn--outline { color: var(--cream); border-color: var(--cream); }
.section--navy .btn--outline:hover { background: var(--cream); color: var(--navy); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.75rem;
}

/* --------------------------------------------------------------------------
   5. Site header + navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
/* On small screens the nav drops below the logo row (DOM order stays sensible
   for screen readers; visual order is adjusted here). */
.brand { order: 1; }
.header-actions { order: 2; }
.site-nav { order: 3; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--navy);
  flex: none;
}
.brand img { width: 48px; height: 48px; object-fit: contain; border-radius: 50%; }
.brand__text { display: none; }
@media (min-width: 480px) {
  .brand__text { display: block; }
  .brand img { width: 54px; height: 54px; }
}
.brand__name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.1;
  display: block;
}
.brand__tag {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--navy-soft);
  display: block;
}

.header-actions { display: flex; align-items: center; gap: 0.5rem; }

/* Language toggle */
.lang-toggle {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  overflow: hidden;
  background: transparent;
}
.lang-toggle button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border: 0;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  line-height: 1.4;
}
.lang-toggle button + button { border-left: 1px solid var(--navy); }
.lang-toggle button[aria-pressed="true"] { background: var(--navy); color: var(--cream); }
.lang-toggle button:hover:not([aria-pressed="true"]) { background: var(--cream-2); }

/* Mobile menu button */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }

.site-nav {
  display: none;
  width: 100%;
  border-top: 1px solid var(--border);
  padding: 0.5rem 0 1rem;
}
.site-nav.is-open { display: block; }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.site-nav li { margin: 0; }
.site-nav a {
  display: block;
  padding: 0.6rem 0.25rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.site-nav a:hover { color: var(--olive); }
.site-nav a[aria-current="page"] { color: var(--olive); }

@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .site-header__inner { flex-wrap: nowrap; }
  .site-nav { order: 2; }
  .header-actions { order: 3; }
  .site-nav {
    display: block !important;
    width: auto;
    border-top: 0;
    padding: 0;
    margin-left: auto;
    margin-right: 0.75rem;
  }
  .site-nav ul { flex-direction: row; gap: 1.35rem; align-items: center; }
  .site-nav a {
    padding: 0.35rem 0;
    border-bottom: 2px solid transparent;
    font-size: 0.97rem;
  }
  .site-nav a:hover { border-bottom-color: var(--olive-light); }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--gold); }
}

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.hero {
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(143, 160, 107, 0.18) 0%, rgba(251, 246, 234, 0) 60%),
    linear-gradient(180deg, var(--cream-2) 0%, var(--cream) 100%);
  border-bottom: 1px solid var(--border);
  padding: 2.75rem 0 3rem;
}
@media (min-width: 768px) { .hero { padding: 4.5rem 0 4.75rem; } }

.hero__grid { display: grid; gap: 2.25rem; align-items: center; }
@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1.25fr 0.85fr; gap: 3.5rem; }
}

.hero__title { margin-bottom: 0.35rem; }
.hero__sub {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  font-style: italic;
  color: var(--olive);
  margin-bottom: 1.25rem;
}
.hero__seal { justify-self: center; max-width: 340px; }
.hero__seal img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--cream-3);
}

/* Page banner for interior pages */
.page-header {
  background: linear-gradient(180deg, var(--cream-2) 0%, var(--cream) 100%);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0 2.25rem;
}
@media (min-width: 768px) { .page-header { padding: 3.75rem 0 3.25rem; } }
.page-header .lead { max-width: 48rem; }

/* --------------------------------------------------------------------------
   7. Cards + grids
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
@media (min-width: 620px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 940px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--white);
  border: 1px solid var(--cream-3);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--navy-soft); }
.card__link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.95rem;
}

a.card { text-decoration: none; display: block; transition: transform .18s ease, box-shadow .18s ease; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
a.card h3 { color: var(--navy); }

.icon-badge {
  width: 52px; height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--cream-2);
  border: 1px solid var(--cream-3);
  color: var(--olive);
  margin-bottom: 1rem;
}
.icon-badge svg { width: 28px; height: 28px; }

/* Values strip */
.values-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}
.values-list li {
  margin: 0;
  background: var(--white);
  border: 1px solid var(--cream-3);
  border-left: 4px solid var(--olive);
  border-radius: var(--radius);
  padding: 0.55rem 1rem;
  font-weight: 600;
  font-size: 0.97rem;
}

/* Value detail blocks (About page) */
.value-item {
  border-left: 3px solid var(--gold);
  padding: 0.15rem 0 0.15rem 1.1rem;
  margin-bottom: 1.5rem;
}
.value-item h3 { margin-bottom: 0.25rem; font-size: 1.15rem; }
.value-item p { color: var(--navy-soft); }

/* Focus-area detail sections */
.focus-block {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  margin-top: 2rem;
}
.focus-block:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.focus-block__head { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.focus-block__head h2 { margin: 0; }
.focus-block__head .icon-badge { margin-bottom: 0; flex: none; }
.activity-list { margin: 1rem 0 0; padding-left: 1.15rem; }
.activity-list li { color: var(--navy-soft); }

/* Numbered "ways to help" steps */
.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.step__num {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--font-serif);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step h3 { margin-bottom: 0.25rem; }

/* --------------------------------------------------------------------------
   8. Impact page: project cards + photo placeholders
   -------------------------------------------------------------------------- */
.project {
  background: var(--white);
  border: 1px solid var(--cream-3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.project__body { padding: 1.5rem; }
.project__meta {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.5rem;
}
@media (min-width: 820px) {
  .project--wide { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .project--wide .project__body { padding: 2rem; align-self: center; }
}

/* Deliberately obvious placeholder for photography that has not been supplied
   yet. Replace the whole .media-placeholder element with a real <img> when
   photos are dropped into assets/images/impact/. */
.media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 210px;
  padding: 1.5rem;
  text-align: center;
  background:
    repeating-linear-gradient(
      45deg,
      var(--cream-2) 0px, var(--cream-2) 12px,
      var(--cream) 12px, var(--cream) 24px
    );
  border: 2px dashed var(--olive-light);
  color: var(--navy-soft);
}
.media-placeholder svg { width: 34px; height: 34px; color: var(--olive); }
.media-placeholder strong {
  display: block;
  font-family: var(--font-serif);
  color: var(--navy);
  font-size: 1rem;
}
.media-placeholder span { font-size: 0.85rem; max-width: 24rem; }

/* --------------------------------------------------------------------------
   9. Callout / support blocks
   -------------------------------------------------------------------------- */
.callout {
  background: var(--white);
  border: 1px solid var(--cream-3);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.callout h2, .callout h3 { margin-top: 0; }

.contact-email {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 600;
  word-break: break-word;
}

.detail-list { list-style: none; margin: 0; padding: 0; }
.detail-list li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.detail-list li:last-child { border-bottom: 0; }
.detail-list svg { width: 22px; height: 22px; color: var(--olive); flex: none; margin-top: 0.2rem; }
.detail-list strong { display: block; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--navy-soft); }

/* --------------------------------------------------------------------------
   10. Forms
   -------------------------------------------------------------------------- */
.form { display: grid; gap: 1.1rem; }
.form__row { display: grid; gap: 1.1rem; }
@media (min-width: 640px) { .form__row { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .hint { font-size: 0.85rem; color: var(--navy-soft); }
.field .req { color: var(--gold-deep); }

input[type="text"],
input[type="email"],
select,
textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--cream-3);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  width: 100%;
}
textarea { min-height: 150px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--olive); }

.form-note {
  font-size: 0.9rem;
  color: var(--navy-soft);
  background: var(--cream-2);
  border-left: 3px solid var(--olive-light);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* --------------------------------------------------------------------------
   11. CTA band
   -------------------------------------------------------------------------- */
.cta-band { background: var(--navy); color: var(--cream); padding: 3rem 0; text-align: center; }
.cta-band h2 { color: var(--cream); }
.cta-band p { color: var(--cream-3); max-width: 40rem; margin-left: auto; margin-right: auto; }
.cta-band .btn-row { justify-content: center; }

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--cream-2);
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
  font-size: 0.97rem;
}
.site-footer__grid { display: grid; gap: 2rem; }
@media (min-width: 720px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }

.site-footer h3 {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--font-sans);
  color: var(--navy-soft);
  margin-bottom: 0.9rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer a { color: var(--navy); text-decoration: none; }
.site-footer a:hover { color: var(--olive); text-decoration: underline; }

.footer-brand { display: flex; gap: 0.9rem; align-items: flex-start; }
.footer-brand img { width: 62px; height: 62px; object-fit: contain; border-radius: 50%; flex: none; }
.footer-brand p { margin: 0.35rem 0 0; color: var(--navy-soft); font-size: 0.92rem; }

.site-footer__bottom {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  color: var(--navy-soft);
  font-size: 0.87rem;
}

/* --------------------------------------------------------------------------
   Assamese "coming soon" overlay (js/main.js) — covers the page instead of
   showing untranslated English copy under an "অসমীয়া" label.
   -------------------------------------------------------------------------- */
body.i18n-coming-soon-active { overflow: hidden; }

.i18n-coming-soon {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--cream);
}

.i18n-coming-soon__card {
  max-width: 26rem;
  width: 100%;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
}

.i18n-coming-soon__eyebrow {
  font-family: var(--font-beng), var(--font-sans);
  color: var(--olive);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 0.5rem;
}

.i18n-coming-soon__title {
  margin: 0 0 0.75rem;
}

.i18n-coming-soon__body {
  color: var(--navy-soft);
  margin: 0 0 1.5rem;
}

.i18n-coming-soon__back {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--white);
  background: var(--navy);
  border: none;
  border-radius: var(--radius);
  padding: 0.7rem 1.4rem;
  cursor: pointer;
}
.i18n-coming-soon__back:hover { background: var(--navy-2); }
