/* =============================================================
   MCIL Samoa — Design System (v2)
   Matagaluega o Pisinisi, Alamanuia ma Leipa
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400&family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --c-navy-900: #061830;
  --c-navy-800: #0B2A4A;
  --c-navy-700: #123f6a;
  --c-navy-500: #2c5f94;
  --c-navy-100: #d4e0ed;
  --c-navy-50:  #eef3f9;

  --c-red-800: #8c0a22;
  --c-red-700: #A50D2A;
  --c-red-600: #D21034;
  --c-red-500: #E84057;
  --c-red-100: #fadde2;
  --c-red-50:  #fdeef1;

  --c-teuila: #C8102E;

  --c-siapo-900: #3d1e07;
  --c-siapo-700: #6B3410;
  --c-siapo-500: #8c4e21;
  --c-siapo-200: #d9c3a8;
  --c-siapo-100: #f0e3d0;

  --c-cream:    #FDF8EC;
  --c-cream-dk: #F4ECD8;
  --c-paper:    #FFFFFF;

  --c-teal-800: #0a5441;
  --c-teal-600: #0F6E56;
  --c-teal-100: #c8e8dd;

  --c-amber-600: #a66a09;
  --c-amber-100: #f5e4c4;

  --c-ink:     #141414;
  --c-ink-70:  #3d3d3d;
  --c-ink-50:  #6a6a6a;
  --c-ink-30:  #a8a8a8;
  --c-line:    #e5e0d3;
  --c-line-dk: #c9c2ae;

  --c-success: #0F6E56;
  --c-warning: #a66a09;
  --c-danger:  #A50D2A;
  --c-info:    #123f6a;

  /* Fallbacks include fonts with full Polynesian/extended Latin coverage
     (ā ē ī ō ū ʻ) for cases where Fraunces/Public Sans is missing the
     precomposed glyph and the browser would otherwise pull a single char
     from a wildly mismatched serif. */
  --f-display: 'Fraunces', 'Source Serif Pro', 'Charis SIL', Cambria, 'Liberation Serif', Georgia, 'Times New Roman', serif;
  --f-body:    'Public Sans', 'Source Sans Pro', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Liberation Sans', sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(6, 24, 48, 0.06), 0 1px 3px rgba(6, 24, 48, 0.04);
  --shadow-md: 0 4px 12px rgba(6, 24, 48, 0.08);
  --shadow-lg: 0 12px 32px rgba(6, 24, 48, 0.12);
  --shadow-xl: 0 24px 48px rgba(6, 24, 48, 0.18);

  --maxw: 1240px;
  --maxw-narrow: 900px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--c-navy-700); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--c-red-600); }

.sr-only {
  position: absolute !important;
  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; top: -100px; left: 0;
  background: var(--c-navy-800); color: #fff;
  padding: 12px 20px; font-weight: 600; z-index: 9999; text-decoration: none;
}
.skip-link:focus { top: 0; color: #fff; }

:focus-visible {
  outline: 3px solid var(--c-teuila);
  outline-offset: 2px; border-radius: var(--radius-sm);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--f-display);
  font-weight: 500; line-height: 1.2;
  color: var(--c-navy-800);
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
.display-xl {
  font-family: var(--f-display);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 500; line-height: 1.1; letter-spacing: -0.02em;
}
.eyebrow {
  font-family: var(--f-body);
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--c-red-600);
}
.lead {
  font-size: 1.125rem; line-height: 1.6; color: var(--c-ink-70);
}

/* ---------- Layout ---------- */
.container {
  width: 100%; max-width: var(--maxw);
  margin: 0 auto; padding: 0 24px;
}
.container-narrow { max-width: var(--maxw-narrow); }
.section { padding: 64px 0; }

/* =============================================================
   GOV TRUST BAR
   ============================================================= */
.gov-bar {
  background: var(--c-navy-900); color: #f0f5fc;
  font-size: 0.875rem; padding: 10px 0;
  border-bottom: 2px solid var(--c-red-600);
}
.gov-bar .container {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.gov-bar__official { display: inline-flex; align-items: center; gap: 8px; }
.gov-bar__verify {
  display: inline-flex; width: 16px; height: 16px; border-radius: 50%;
  background: var(--c-red-600); align-items: center; justify-content: center; color: #fff;
}

/* =============================================================
   HEADER
   ============================================================= */
.site-header {
  background: var(--c-paper);
  border-bottom: 1px solid var(--c-line);
  position: sticky; top: 0; z-index: 500;
}
.header-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 32px; padding: 22px 0;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.brand__crest { flex-shrink: 0; width: 52px; height: 52px; }
.brand__text { line-height: 1.2; }
.brand__samoan {
  font-family: var(--f-display); font-style: italic;
  font-size: 0.8125rem; color: var(--c-siapo-700);
}
.brand__english {
  font-family: var(--f-display);
  font-size: 1.3125rem; font-weight: 500;
  color: var(--c-navy-900); line-height: 1.2;
  letter-spacing: -0.005em;
}

.header-tools { display: flex; align-items: center; gap: 10px; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--c-line-dk); border-radius: var(--radius-pill);
  padding: 8px 16px; width: 260px; transition: all 0.2s;
  background: var(--c-paper);
}
.search-box:focus-within {
  border-color: var(--c-navy-800);
  box-shadow: 0 0 0 3px var(--c-navy-50);
}
.search-box input {
  border: none; outline: none; flex: 1;
  font-family: inherit; font-size: 0.9375rem; background: transparent;
}
.search-box svg { color: var(--c-ink-50); flex-shrink: 0; }

.mobile-menu-btn {
  display: none; border: 1px solid var(--c-line-dk);
  background: var(--c-paper); padding: 8px 12px;
  border-radius: var(--radius-md); color: var(--c-navy-800);
}

/* =============================================================
   MAIN NAV + MEGA MENU
   ============================================================= */
.main-nav { border-top: 1px solid var(--c-line); }
.main-nav__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 2px; flex-wrap: wrap;
}
.main-nav__item { position: static; }
.main-nav__link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 16px 20px; color: var(--c-navy-800);
  text-decoration: none; font-weight: 500; font-size: 0.9375rem;
  border-bottom: 3px solid transparent;
  transition: all 0.15s; background: transparent; border-left: none;
  border-right: none; border-top: none; font-family: inherit; cursor: pointer;
}
.main-nav__link:hover,
.main-nav__link[aria-expanded="true"],
.main-nav__link.is-active {
  color: var(--c-red-600); border-bottom-color: var(--c-red-600);
}
.main-nav__caret {
  width: 10px; height: 10px; opacity: 0.6;
  transition: transform 0.2s;
}
.main-nav__link[aria-expanded="true"] .main-nav__caret {
  transform: rotate(180deg);
}

/* Mega menu panel */
.mega-menu {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--c-paper);
  border-top: 1px solid var(--c-line);
  border-bottom: 3px solid var(--c-red-600);
  box-shadow: var(--shadow-xl);
  padding: 32px 0;
  display: none;
  z-index: 400;
}
.mega-menu.is-open { display: block; animation: slideDown 0.2s ease; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.mega-menu__grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
}
.mega-menu__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.mega-menu__col h4 {
  font-family: var(--f-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-ink-50);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-line);
}
.mega-menu__links {
  list-style: none; padding: 0; margin: 0;
}
.mega-menu__links li { margin-bottom: 8px; }
.mega-menu__links a {
  display: block;
  padding: 4px 0;
  color: var(--c-navy-800);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  transition: color 0.1s;
}
.mega-menu__links a:hover { color: var(--c-red-600); }
.mega-menu__links .mega-desc {
  display: block;
  font-size: 0.8125rem;
  color: var(--c-ink-50);
  font-weight: 400;
  margin-top: 2px;
}

.mega-menu__featured {
  background: var(--c-cream);
  border-radius: var(--radius-md);
  padding: 24px;
  border-left: 4px solid var(--c-red-600);
}
.mega-menu__featured h4 {
  color: var(--c-navy-800);
  font-family: var(--f-display);
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: none;
  letter-spacing: 0;
  border: none;
  padding: 0;
}
.mega-menu__featured p {
  font-size: 0.875rem;
  color: var(--c-ink-70);
  margin: 0 0 16px;
  line-height: 1.5;
}
.mega-menu__featured a {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--c-red-600); font-weight: 600; text-decoration: none;
  font-size: 0.875rem;
}
.mega-menu__featured a:hover { text-decoration: underline; }

.mega-menu__backdrop {
  position: fixed; inset: 0;
  background: rgba(6, 24, 48, 0.3);
  opacity: 0; visibility: hidden;
  transition: all 0.2s;
  z-index: 300;
}
.mega-menu__backdrop.is-open { opacity: 1; visibility: visible; }

/* =============================================================
   HERO
   ============================================================= */
.hero {
  position: relative; background: var(--c-cream);
  padding: 80px 0; overflow: hidden;
  border-bottom: 1px solid var(--c-line);
}
.hero__pattern {
  position: absolute; inset: 0; opacity: 0.06;
  background-image: url('../img/siapo-pattern.svg');
  background-size: 240px 240px; background-repeat: repeat;
  pointer-events: none;
}
.hero__inner {
  position: relative;
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: 48px; align-items: center;
}
.hero__content { max-width: 620px; }
.hero__vision { margin-top: 16px; margin-bottom: 16px; }
.hero__tagline {
  font-size: 1.125rem; color: var(--c-ink-70);
  line-height: 1.6; margin-bottom: 32px;
}
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero__visual {
  position: relative; aspect-ratio: 1 / 1;
  max-width: 360px; margin-left: auto;
}
.hero__crest {
  width: 100%; height: 100%;
  filter: drop-shadow(0 16px 32px rgba(11, 42, 74, 0.18));
}

@media (max-width: 820px) {
  .hero { padding: 48px 0; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { max-width: 220px; margin: 0 auto; }
}

/* =============================================================
   BUTTONS
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-md);
  font-family: inherit; font-weight: 600; font-size: 0.9375rem;
  text-decoration: none; border: 2px solid transparent;
  transition: all 0.15s ease; cursor: pointer; white-space: nowrap;
}
.btn-primary {
  background: var(--c-red-600); color: #fff; border-color: var(--c-red-600);
}
.btn-primary:hover {
  background: var(--c-red-700); border-color: var(--c-red-700);
  color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md);
}
.btn-secondary {
  background: transparent; color: var(--c-navy-800); border-color: var(--c-navy-800);
}
.btn-secondary:hover { background: var(--c-navy-800); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--c-navy-800);
  border-color: transparent; padding-left: 0; padding-right: 0;
}
.btn-ghost:hover { color: var(--c-red-600); text-decoration: underline; }
.btn .arrow { transition: transform 0.15s; }
.btn:hover .arrow { transform: translateX(3px); }

/* =============================================================
   QUICK TASKS
   ============================================================= */
.quick-tasks {
  background: var(--c-paper); padding: 48px 0;
  border-bottom: 1px solid var(--c-line);
}
.quick-tasks__header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.quick-tasks__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.quick-task {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; background: var(--c-cream);
  border: 1px solid var(--c-line); border-radius: var(--radius-md);
  text-decoration: none; color: var(--c-navy-800);
  font-weight: 500; transition: all 0.2s; line-height: 1.4;
}
.quick-task:hover {
  background: var(--c-paper); border-color: var(--c-red-600);
  transform: translateY(-2px); box-shadow: var(--shadow-md);
  color: var(--c-navy-800);
}
.quick-task__icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.quick-task__icon svg { width: 20px; height: 20px; }
.quick-task__icon--blue { background: var(--c-navy-50); color: var(--c-navy-800); }
.quick-task__icon--red { background: var(--c-red-50); color: var(--c-red-600); }
.quick-task__icon--teal { background: var(--c-teal-100); color: var(--c-teal-600); }
.quick-task__icon--amber { background: var(--c-amber-100); color: var(--c-amber-600); }
.quick-task__icon--siapo { background: var(--c-siapo-100); color: var(--c-siapo-700); }

/* =============================================================
   SERVICES GRID
   ============================================================= */
.services {
  background: var(--c-cream);
  padding: 80px 0; position: relative;
}
.services__header {
  text-align: center; margin-bottom: 48px; max-width: 600px;
  margin-left: auto; margin-right: auto;
}
.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.service-card {
  background: var(--c-paper); border: 1px solid var(--c-line);
  border-radius: var(--radius-lg); padding: 28px 26px;
  text-decoration: none; color: var(--c-ink);
  transition: all 0.2s;
  display: flex; flex-direction: column;
  min-height: 240px;
}
.service-card:hover {
  border-color: var(--c-navy-800);
  transform: translateY(-4px); box-shadow: var(--shadow-lg);
  color: var(--c-ink);
}
.service-card__accent {
  width: 48px; height: 4px; border-radius: var(--radius-pill); margin-bottom: 20px;
}
.service-card__accent--red { background: var(--c-red-600); }
.service-card__accent--navy { background: var(--c-navy-800); }
.service-card__accent--teal { background: var(--c-teal-600); }
.service-card__accent--siapo { background: var(--c-siapo-700); }
.service-card__accent--teuila { background: var(--c-teuila); }
.service-card__accent--amber { background: var(--c-amber-600); }

.service-card h3 {
  color: var(--c-navy-800); margin-bottom: 10px; font-size: 1.25rem;
}
.service-card p {
  color: var(--c-ink-70); font-size: 0.9375rem; line-height: 1.5;
  margin: 0 0 20px; flex-grow: 1;
}
.service-card__cta {
  color: var(--c-red-600); font-weight: 600; font-size: 0.875rem;
  display: inline-flex; align-items: center; gap: 6px;
}
.service-card:hover .service-card__cta .arrow { transform: translateX(4px); }

/* =============================================================
   NEWS & NOTICES
   ============================================================= */
.news { padding: 80px 0; background: var(--c-paper); }
.news__grid {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px;
}
@media (max-width: 820px) {
  .news__grid { grid-template-columns: 1fr; gap: 32px; }
}
.news__col h2 {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 2px solid var(--c-line);
}
.news__col h2 a {
  font-family: var(--f-body); font-size: 0.875rem;
  font-weight: 600; text-decoration: none; color: var(--c-red-600);
}
.news-item {
  display: grid; grid-template-columns: 160px 1fr;
  gap: 20px; padding: 20px 0;
  border-bottom: 1px solid var(--c-line); align-items: start;
}
.news-item:last-child { border-bottom: none; }
.news-item__thumb {
  aspect-ratio: 4/3; border-radius: var(--radius-md);
  overflow: hidden; background: var(--c-cream-dk);
  display: flex; align-items: center; justify-content: center;
}
.news-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-item__meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--c-ink-50); margin-bottom: 8px;
}
.news-item__tag {
  background: var(--c-red-50); color: var(--c-red-700);
  padding: 3px 10px; border-radius: var(--radius-pill); font-size: 0.6875rem;
}
.news-item h3 {
  font-size: 1.125rem; margin: 0 0 8px; line-height: 1.35;
}
.news-item h3 a { color: var(--c-navy-800); text-decoration: none; }
.news-item h3 a:hover { color: var(--c-red-600); }
.news-item p {
  font-size: 0.9375rem; color: var(--c-ink-70); margin: 0; line-height: 1.5;
}

.notices { list-style: none; padding: 0; margin: 0; }
.notices li {
  padding: 16px 0; border-bottom: 1px solid var(--c-line);
}
.notices li:last-child { border-bottom: none; }
.notices a {
  text-decoration: none; color: var(--c-navy-800);
  font-weight: 500; line-height: 1.4; display: block;
}
.notices a:hover { color: var(--c-red-600); }
.notices time {
  display: block; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--c-ink-50); margin-bottom: 4px;
}

/* =============================================================
   CTA BANNER
   ============================================================= */
.cta-banner {
  background: var(--c-navy-800); color: #fff;
  padding: 56px 0; position: relative; overflow: hidden;
}
.cta-banner::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--c-red-600) 0, var(--c-red-600) 30px,
    var(--c-cream) 30px, var(--c-cream) 40px,
    var(--c-siapo-700) 40px, var(--c-siapo-700) 70px,
    var(--c-cream) 70px, var(--c-cream) 80px
  );
}
.cta-banner__inner {
  display: grid; grid-template-columns: 2fr 1fr;
  gap: 32px; align-items: center;
}
@media (max-width: 700px) {
  .cta-banner__inner { grid-template-columns: 1fr; text-align: center; }
}
.cta-banner h2 { color: #fff; margin-bottom: 8px; }
.cta-banner p { color: #c3d0e0; margin: 0; font-size: 1.0625rem; }
.cta-banner .btn-primary {
  background: var(--c-red-600); border-color: var(--c-red-600); justify-self: end;
}
@media (max-width: 700px) {
  .cta-banner .btn-primary { justify-self: center; }
}
.cta-banner .eyebrow {
  color: var(--c-red-500);
  margin-bottom: 8px;
}
.cta-banner__pattern {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 85% 30%, rgba(232,64,87,0.08) 0, transparent 40%),
    radial-gradient(circle at 15% 70%, rgba(248,200,108,0.06) 0, transparent 40%);
}

/* =============================================================
   FOOTER
   ============================================================= */
/* DEPRECATED 20260503 — replaced by .site-footer__* in mcil-overrides.css.
   Kept commented for rollback (Charcoal palette redesign).
.site-footer {
  background: var(--c-navy-900); color: #b8c4d4; padding: 64px 0 0;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; padding-bottom: 48px;
}
@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand h3 {
  font-family: var(--f-display); font-style: italic;
  color: #fff; font-size: 1rem; font-weight: 400; margin-bottom: 4px;
}
.footer-brand p {
  color: #fff; font-family: var(--f-display);
  font-size: 1.25rem; margin-bottom: 20px; line-height: 1.3;
}
.footer-contact { font-size: 0.9375rem; line-height: 1.7; }
.footer-contact strong { color: #fff; font-weight: 500; display: block; }
.footer-contact a { color: #b8c4d4; text-decoration: none; }
.footer-contact a:hover { color: #fff; text-decoration: underline; }

.footer-col h4 {
  color: #fff; font-size: 0.9375rem;
  font-family: var(--f-body); font-weight: 600;
  margin-bottom: 16px; letter-spacing: 0.02em;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
  color: #b8c4d4; text-decoration: none; font-size: 0.9375rem;
}
.footer-col a:hover { color: #fff; text-decoration: underline; }
*/

.social-row { display: flex; gap: 12px; margin-top: 16px; }
.social-row a {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: background 0.15s;
}
.social-row a:hover { background: var(--c-red-600); }

/* DEPRECATED 20260503 — replaced by .site-footer__meta in mcil-overrides.css.
   Kept commented for rollback (Charcoal palette redesign).
.footer-meta {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 0;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; font-size: 0.8125rem; color: #8fa0b8; flex-wrap: wrap;
}
.footer-meta .thanks {
  font-family: var(--f-display); font-style: italic; color: #c3d0e0;
}

.footer-stripe {
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--c-red-600) 0, var(--c-red-600) 30px,
    var(--c-siapo-700) 30px, var(--c-siapo-700) 60px,
    var(--c-cream) 60px, var(--c-cream) 66px
  );
}
*/

/* =============================================================
   PAGE HERO (non-homepage pages)
   ============================================================= */
.page-hero {
  background: var(--c-navy-800); color: #fff;
  padding: 64px 0; position: relative; overflow: hidden;
  border-bottom: 4px solid var(--c-red-600);
}
.page-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: url('../img/siapo-pattern.svg');
  background-size: 200px; opacity: 0.08;
}
.page-hero__inner { position: relative; }
.page-hero h1 {
  color: #fff; margin-bottom: 12px; max-width: 720px;
}
.page-hero p.lead { color: #c3d0e0; max-width: 640px; }
.page-hero .eyebrow { color: #E84057; margin-bottom: 12px; }

.breadcrumbs {
  display: flex; gap: 8px; font-size: 0.875rem;
  margin-bottom: 16px; color: #9ab0c9; flex-wrap: wrap;
}
.breadcrumbs a { color: #c3d0e0; text-decoration: none; }
.breadcrumbs a:hover { color: #fff; text-decoration: underline; }
.breadcrumbs span[aria-hidden="true"] { opacity: 0.5; }

/* =============================================================
   TWO-COLUMN PAGE LAYOUT (with side nav)
   ============================================================= */
.page-layout {
  display: grid; grid-template-columns: 260px 1fr;
  gap: 48px; padding: 64px 0;
}
@media (max-width: 820px) { .page-layout { grid-template-columns: 1fr; } }

.side-nav { position: sticky; top: 200px; align-self: start; }
.side-nav h4 {
  font-family: var(--f-body);
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--c-ink-50); margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 2px solid var(--c-line);
}
.side-nav ul { list-style: none; padding: 0; margin: 0; }
.side-nav li { margin-bottom: 4px; }
.side-nav a {
  display: block; padding: 10px 14px;
  color: var(--c-ink-70); text-decoration: none;
  border-radius: var(--radius-md); font-size: 0.9375rem;
  font-weight: 500; border-left: 3px solid transparent; transition: all 0.15s;
}
.side-nav a:hover {
  background: var(--c-cream); color: var(--c-navy-800);
}
.side-nav a.is-active {
  background: var(--c-red-50); color: var(--c-red-700);
  border-left-color: var(--c-red-600);
}

.page-content > h2 {
  margin-top: 40px; padding-top: 32px; border-top: 2px solid var(--c-line);
}
.page-content > h2:first-child,
.page-content > *:first-child + h2 { border: none; padding: 0; margin-top: 0; }
.page-content p {
  max-width: 68ch; margin-bottom: 1em;
  color: var(--c-ink-70); line-height: 1.7;
}

.meta-chips {
  display: flex; gap: 18px; flex-wrap: wrap;
  margin: 24px 0 32px; padding: 16px 20px;
  background: var(--c-cream); border: 1px solid var(--c-line);
  border-radius: var(--radius-md); font-size: 0.875rem;
}
.meta-chips div strong {
  display: block; color: var(--c-ink-50);
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px;
}

.sub-service-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; margin: 24px 0 40px;
}
.sub-service {
  display: block; padding: 20px;
  background: var(--c-paper); border: 1px solid var(--c-line);
  border-radius: var(--radius-md); text-decoration: none;
  color: var(--c-ink); transition: all 0.15s;
}
.sub-service:hover {
  border-color: var(--c-red-600); transform: translateY(-2px);
  color: var(--c-ink); box-shadow: var(--shadow-sm);
}
.sub-service strong {
  display: block; color: var(--c-navy-800);
  font-family: var(--f-display); font-size: 1.0625rem;
  font-weight: 500; margin-bottom: 4px;
}
.sub-service span { color: var(--c-ink-50); font-size: 0.875rem; }

.callout {
  background: var(--c-navy-50); border-left: 4px solid var(--c-navy-800);
  padding: 20px 24px; border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 32px 0;
}
.callout strong { color: var(--c-navy-800); }
.callout p { margin-bottom: 0; }

.file-list { list-style: none; padding: 0; margin: 16px 0 32px; }
.file-list li {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border: 1px solid var(--c-line);
  border-radius: var(--radius-md); margin-bottom: 8px;
  background: var(--c-paper);
}
.file-list svg { flex-shrink: 0; }
.file-list a {
  color: var(--c-navy-800); text-decoration: none;
  font-weight: 500; flex: 1;
}
.file-list a:hover { color: var(--c-red-600); text-decoration: underline; }
.file-list .filemeta {
  font-size: 0.75rem; color: var(--c-ink-50); font-weight: 500;
}

/* =============================================================
   LEADERSHIP CARDS
   ============================================================= */
.leaders-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px; margin: 32px 0;
}
.leader-card {
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.leader-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--c-red-600);
}
.leader-card__photo {
  width: 120px; height: 120px; margin: 0 auto 20px;
  border-radius: 50%; background: var(--c-cream);
  border: 3px solid var(--c-navy-800);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.leader-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.leader-card__role {
  color: var(--c-red-600); font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px;
}
.leader-card__name {
  color: var(--c-navy-800); font-family: var(--f-display);
  font-size: 1.125rem; font-weight: 500; margin: 0 0 4px; line-height: 1.3;
}
.leader-card__samoan {
  color: var(--c-siapo-700); font-family: var(--f-display);
  font-style: italic; font-size: 0.875rem; margin-top: 4px;
}

/* =============================================================
   DOCUMENT LIBRARY (MBIE-style)
   ============================================================= */
.doc-layout {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 48px; padding: 48px 0 64px;
}
@media (max-width: 900px) { .doc-layout { grid-template-columns: 1fr; } }

.doc-filters {
  position: sticky; top: 200px; align-self: start;
  background: var(--c-paper);
}
.doc-filters__group {
  margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid var(--c-line);
}
.doc-filters__group:last-child { border-bottom: none; }
.doc-filters h3 {
  font-family: var(--f-body); font-size: 0.8125rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--c-navy-800); margin: 0 0 12px;
}
.doc-filters input[type="text"],
.doc-filters input[type="date"],
.doc-filters select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--c-line-dk);
  border-radius: var(--radius-md);
  font-family: inherit; font-size: 0.9375rem;
  background: var(--c-paper); color: var(--c-ink);
  margin-bottom: 8px;
}
.doc-filters input:focus, .doc-filters select:focus {
  outline: none; border-color: var(--c-navy-800);
  box-shadow: 0 0 0 3px var(--c-navy-50);
}
.doc-filters__checkboxes {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 220px; overflow-y: auto;
  padding-right: 8px;
}
.doc-filters__checkboxes::-webkit-scrollbar { width: 6px; }
.doc-filters__checkboxes::-webkit-scrollbar-track { background: var(--c-cream); }
.doc-filters__checkboxes::-webkit-scrollbar-thumb {
  background: var(--c-line-dk); border-radius: 3px;
}
.doc-filters__check {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.875rem; color: var(--c-ink-70); cursor: pointer;
  line-height: 1.3;
}
.doc-filters__check input { width: 16px; height: 16px; accent-color: var(--c-red-600); }
.doc-filters__check:hover { color: var(--c-navy-800); }
.doc-filters__clear {
  display: inline-block; margin-top: 4px; font-size: 0.875rem;
  color: var(--c-red-600); font-weight: 600; cursor: pointer;
  background: none; border: none; padding: 0;
  text-decoration: underline; font-family: inherit;
}

.doc-results__header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 2px solid var(--c-line); flex-wrap: wrap; gap: 12px;
}
.doc-results__count {
  color: var(--c-ink-70); font-size: 0.9375rem;
}
.doc-results__count strong {
  color: var(--c-navy-800); font-size: 1.0625rem;
}
.doc-results__sort {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.875rem; color: var(--c-ink-70);
}
.doc-results__sort select {
  padding: 6px 10px; border: 1px solid var(--c-line-dk);
  border-radius: var(--radius-md); font-family: inherit;
  font-size: 0.875rem; background: var(--c-paper); color: var(--c-navy-800);
}

.doc-card {
  padding: 24px 0; border-bottom: 1px solid var(--c-line);
}
.doc-card__title {
  font-family: var(--f-display); font-size: 1.25rem;
  font-weight: 500; color: var(--c-navy-800); margin: 0 0 8px;
  line-height: 1.3;
}
.doc-card__title a { color: inherit; text-decoration: none; }
.doc-card__title a:hover { color: var(--c-red-600); text-decoration: underline; }
.doc-card__date {
  display: inline-block; font-size: 0.8125rem;
  color: var(--c-ink-50); font-weight: 500; margin-bottom: 8px;
}
.doc-card__desc {
  color: var(--c-ink-70); font-size: 0.9375rem;
  line-height: 1.6; margin: 0 0 16px;
}
.doc-card__meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; font-size: 0.8125rem;
}
.doc-card__meta-label {
  display: block; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--c-ink-50);
  font-size: 0.6875rem; margin-bottom: 2px;
}
.doc-card__meta-val {
  color: var(--c-navy-800); font-weight: 500;
}
.doc-card__meta-val a {
  color: var(--c-navy-700); text-decoration: none;
  background: var(--c-navy-50); padding: 2px 8px;
  border-radius: var(--radius-pill); display: inline-block;
  margin-right: 4px; margin-bottom: 4px; font-size: 0.75rem;
}
.doc-card__meta-val a:hover { background: var(--c-navy-100); color: var(--c-navy-800); }

.pagination {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 40px; flex-wrap: wrap;
}
.pagination button {
  min-width: 38px; height: 38px; padding: 0 10px;
  border: 1px solid var(--c-line-dk);
  background: var(--c-paper); color: var(--c-navy-800);
  border-radius: var(--radius-md); font-weight: 500;
  font-size: 0.875rem; cursor: pointer;
}
.pagination button:hover {
  border-color: var(--c-navy-800); background: var(--c-cream);
}
.pagination button.is-active {
  background: var(--c-navy-800); color: #fff; border-color: var(--c-navy-800);
}
.pagination button:disabled {
  opacity: 0.4; cursor: not-allowed;
}

.no-results {
  padding: 48px 24px; text-align: center; color: var(--c-ink-50);
}

/* =============================================================
   CHAT WIDGET
   ============================================================= */
.chat-toggle {
  position: fixed; bottom: 24px; right: 24px;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--c-red-600); color: #fff;
  border: none; cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  z-index: 900; transition: all 0.2s;
}
.chat-toggle:hover {
  background: var(--c-red-700); transform: scale(1.05);
  box-shadow: var(--shadow-xl);
}
.chat-toggle svg { width: 26px; height: 26px; }
.chat-toggle__badge {
  position: absolute; top: 4px; right: 4px;
  width: 12px; height: 12px; background: var(--c-teal-600);
  border: 2px solid #fff; border-radius: 50%;
}

.chat-panel {
  position: fixed; bottom: 100px; right: 24px;
  width: 380px; max-width: calc(100vw - 48px);
  height: 540px; max-height: calc(100vh - 140px);
  background: var(--c-paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: none; flex-direction: column;
  z-index: 900; overflow: hidden;
  border: 1px solid var(--c-line);
}
.chat-panel.is-open { display: flex; animation: chatIn 0.25s ease; }
@keyframes chatIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-header {
  background: var(--c-navy-800); color: #fff;
  padding: 16px 20px;
  display: flex; align-items: center; gap: 12px;
}
.chat-header__avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--c-red-600); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.chat-header__info { flex: 1; line-height: 1.3; }
.chat-header__name { font-weight: 600; font-size: 0.9375rem; }
.chat-header__status {
  font-size: 0.75rem; opacity: 0.8;
  display: flex; align-items: center; gap: 6px;
}
.chat-header__dot {
  width: 8px; height: 8px; background: #4ade80;
  border-radius: 50%; display: inline-block;
}
.chat-header__close {
  background: transparent; border: none; color: #fff;
  padding: 6px; cursor: pointer; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.chat-header__close:hover { background: rgba(255,255,255,0.15); }

.chat-messages {
  flex: 1; padding: 20px; overflow-y: auto;
  background: var(--c-cream); display: flex; flex-direction: column; gap: 12px;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--c-line-dk); border-radius: 3px; }

.chat-msg {
  max-width: 85%; padding: 10px 14px;
  border-radius: var(--radius-lg); font-size: 0.875rem;
  line-height: 1.5; word-wrap: break-word;
}
.chat-msg--bot {
  background: var(--c-paper); border: 1px solid var(--c-line);
  color: var(--c-ink); align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-msg--user {
  background: var(--c-navy-800); color: #fff; align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-msg--bot strong { color: var(--c-navy-800); }
.chat-msg--bot a { color: var(--c-red-600); font-weight: 600; }

.chat-quick {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
.chat-quick button {
  background: var(--c-paper); border: 1px solid var(--c-navy-800);
  color: var(--c-navy-800); padding: 6px 10px;
  border-radius: var(--radius-pill); font-size: 0.75rem;
  font-weight: 500; cursor: pointer;
}
.chat-quick button:hover { background: var(--c-navy-800); color: #fff; }

.chat-typing {
  display: inline-flex; gap: 4px; padding: 10px 14px;
  background: var(--c-paper); border: 1px solid var(--c-line);
  border-radius: var(--radius-lg); align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-typing span {
  width: 8px; height: 8px; background: var(--c-ink-30);
  border-radius: 50%; animation: typing 1.4s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.chat-input-row {
  display: flex; gap: 8px; padding: 12px 16px;
  background: var(--c-paper); border-top: 1px solid var(--c-line);
}
.chat-input-row input {
  flex: 1; border: 1px solid var(--c-line-dk);
  border-radius: var(--radius-pill);
  padding: 10px 16px; font-family: inherit; font-size: 0.875rem;
  outline: none;
}
.chat-input-row input:focus {
  border-color: var(--c-navy-800);
  box-shadow: 0 0 0 2px var(--c-navy-50);
}
.chat-input-row button {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--c-red-600); color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.chat-input-row button:hover { background: var(--c-red-700); }
.chat-input-row button:disabled { background: var(--c-ink-30); cursor: not-allowed; }

.chat-footer-note {
  font-size: 0.6875rem; color: var(--c-ink-50);
  text-align: center; padding: 8px;
  background: var(--c-paper); border-top: 1px solid var(--c-line);
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 1024px) {
  .main-nav__list { display: none; }
  .main-nav__list.is-mobile-open {
    display: block;
    position: fixed; top: 0; right: 0; bottom: 0;
    background: var(--c-paper); width: min(320px, 85vw);
    padding: 24px; z-index: 999; overflow-y: auto;
    box-shadow: var(--shadow-xl);
  }
  .main-nav__list.is-mobile-open li { width: 100%; }
  .main-nav__list.is-mobile-open .main-nav__link {
    width: 100%; padding: 14px 12px;
    border-bottom: 1px solid var(--c-line);
  }
  .mega-menu { display: none !important; }
  .mobile-menu-btn { display: inline-flex; }
  .search-box { width: 180px; }
}

@media (max-width: 700px) {
  .gov-bar .container { font-size: 0.75rem; }
  /* Trust banner text shown on mobile per Iz directive — Tranche L1.2 (was display:none) */
  .gov-bar__official span:last-child { font-size: 0.7rem; line-height: 1.3; }
  .header-inner { gap: 12px; }
  .brand__english { font-size: 1rem; }
  .brand__samoan { font-size: 0.6875rem; }
  /* Tranche M1 — search visible at mobile (was display:none).
     Tranche Q1.1 — positioned on own row below brand/hamburger via Q1.1
     block in mcil-overrides.css; bare width rule here is a fallback. */
  .search-box { width: 100%; max-width: 100%; }
  .quick-tasks__header { flex-direction: column; align-items: flex-start; }
  .chat-toggle { width: 56px; height: 56px; bottom: 16px; right: 16px; }
  .chat-panel { bottom: 88px; right: 16px; }
  .news-item { grid-template-columns: 1fr; }
  .news-item__thumb { max-height: 180px; }
  .meta-chips { gap: 12px; }
}

.visually-hidden { position: absolute; left: -9999px; }

/* ── M29.6 News image carousel ──────────────────────────────────────── */
.news-carousel { position: relative; margin: 32px 0 8px; }
.news-carousel__track {
  display: flex; gap: 0; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; border-radius: var(--radius-md);
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  margin: 0; padding: 0; list-style: none;
}
.news-carousel__track::-webkit-scrollbar { display: none; }
.news-carousel__slide {
  flex: 0 0 100%; scroll-snap-align: center;
  height: clamp(340px, 64vh, 560px);
  background: var(--c-navy-50);
  display: grid; place-items: center; margin: 0;
}
.news-carousel__slide img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; display: block;
}
.news-carousel__btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: rgba(6, 24, 48, .62); color: #fff; cursor: pointer;
  display: grid; place-items: center; transition: background .15s; z-index: 2;
}
.news-carousel__btn:hover { background: var(--c-navy-800); }
.news-carousel__btn:focus-visible { outline: 3px solid var(--c-red-500); outline-offset: 2px; }
.news-carousel__btn[disabled] { opacity: .35; cursor: default; }
.news-carousel__btn--prev { left: 10px; }
.news-carousel__btn--next { right: 10px; }
.news-carousel__count {
  position: absolute; bottom: 10px; right: 12px; z-index: 2;
  background: rgba(6, 24, 48, .62); color: #fff;
  font-size: 0.75rem; line-height: 1; padding: 5px 9px; border-radius: var(--radius-pill);
}
.news-carousel__dots {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px;
  margin: 14px 0 0; padding: 0; list-style: none;
}
.news-carousel__dots li { margin: 0; }
.news-carousel__dot {
  width: 9px; height: 9px; padding: 0; border-radius: 50%;
  border: 1px solid var(--c-line-dk); background: var(--c-line);
  cursor: pointer; transition: background .15s, transform .15s;
}
.news-carousel__dot[aria-current="true"] {
  background: var(--c-red-600); border-color: var(--c-red-600); transform: scale(1.25);
}
.news-carousel__dot:focus-visible { outline: 2px solid var(--c-navy-700); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .news-carousel__track { scroll-behavior: auto; }
}
@media (max-width: 600px) {
  .news-carousel__btn { width: 40px; height: 40px; }
}
