/* =============================================================================
   CAASL UI Revamp — UI-S3 Global Template Foundation
   Direction A "Colombo FIR". Loaded LAST (cascade-final) so it re-skins the
   preserved legacy chrome without editing markup, positions, or workflows.
   Scope: global chrome (header, nav, type, links, buttons, breadcrumb, footer)
   + inner-page surfaces. The homepage hero/sections are intentionally NOT
   redesigned here (UI-S4). Accepted E03 focus/contrast rules are preserved.
   Web fonts (Archivo/Inter/IBM Plex/Noto SI+TA) are declared as stacks with
   system fallbacks; @font-face files are added when self-hosted in a later step.
   ============================================================================ */

:root{
  --navy:#0B2A4A; --navy-600:#1E3A5F; --navy-700:#13395f;
  --paper:#F5F7FA; --white:#fff;
  --ink:#0A1722; --ink-muted:#41566B;
  --amber:#F2A900; --amber-deep:#C98A00; --amber-ink:#2e2200;
  --teal:#0F6E72; --teal-bright:#1B8A8F;
  --line:#C7D2DE; --line-strong:#9fb0c0;
  --radius:4px; --maxw:1200px; --measure:74ch;
  --shadow:0 1px 2px rgba(11,42,74,.06),0 4px 16px rgba(11,42,74,.07);
  /* Latin display/body/mono, then Sinhala + Tamil so each script picks a font
     that actually has its glyphs (Latin->Archivo/Inter, Sinhala->Malithi/Noto,
     Tamil->Latha/Noto). */
  --display:'Archivo','Inter','Noto Sans Sinhala','Malithi Web','Latha','Noto Sans Tamil',system-ui,'Segoe UI',Roboto,Arial,sans-serif;
  --body:'Inter','Noto Sans Sinhala','Malithi Web','Latha','Noto Sans Tamil',system-ui,'Segoe UI',Roboto,Arial,sans-serif;
  --mono:'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}

/* ---------- global surfaces & typography ---------- */
/* legacy <body> carries a blue sky background-image; replace with chart paper.
   (body has no .site class on most views, so target the element directly.) */
html, body{ background:var(--paper) !important; background-image:none !important; }
body{ color:var(--ink); font-family:var(--body); font-size:16px; line-height:1.6;
  border-top:3px solid var(--navy); padding:0 !important; }
.contentNew, .body, .body #top{ background:var(--paper) !important; }
.body .container{ background:var(--white) !important; border:1px solid var(--line) !important;
  border-radius:var(--radius) !important; box-shadow:var(--shadow) !important; }
/* content surface inside the white card: keep it clean, not pale-blue */
.maincontents{ background:var(--white) !important; padding:8px 30px 24px !important; }

h1,h2,h3,h4{ font-family:var(--display); letter-spacing:-.01em; color:var(--navy); }
.maincontents h1, .item-page h1, .page-header h1{ font-size:clamp(1.7rem,3.2vw,2.25rem); line-height:1.15; }
.maincontents h2, .item-page h2{ font-size:1.5rem; }
.maincontents, .item-page{ font-size:1rem; line-height:1.65; }
.maincontents p, .item-page p{ max-width:var(--measure); }

a{ color:var(--teal); text-underline-offset:3px; }
a:hover{ color:var(--teal-bright); }

/* ---------- responsive media (UI-S7): stop oversized images blowing out width ---------- */
img{ max-width:100%; height:auto; }
/* fix/complete-ui-stabilization: cap embeds (Facebook/video/map iframes) so fixed
   widths don't force page overflow on very small screens */
iframe{ max-width:100%; }
/* sidebar news thumbnails (mod_articles_category in innerMods) were overflowing every inner page */
.mod-articles-category-image, .mod-articlescategory a, .innermenuNew img, .innerMods img{ max-width:100%; }
.mod-articles-category-image img{ display:block; max-width:100%; height:auto; }

/* ---------- UI-S7: neutralise the missing legacy JUI IcoMoon font (was 404) ----------
   The legacy template.css activates the 'IcoMoon' @font-face via [class^="icon-"] etc.,
   whose files (media/jui/fonts/IcoMoon.*) were removed in J6 -> 404. Stop those elements
   using the family so the @font-face is never activated (those glyphs were already blank). */
[class^="icon-"]:before, [class*=" icon-"]:before, [data-icon]:before{ font-family:inherit !important; }

/* ---------- containers ---------- */
#header > .container, .contentNew > .container, .body > .container{ max-width:var(--maxw); }

/* ---------- header / masthead ---------- */
#header.header{ background:var(--white) !important; border-bottom:1px solid var(--line);
  box-shadow:0 1px 0 rgba(11,42,74,.04); }
#header .logo img{ max-height:62px; width:auto; }
/* UI-S4 official CAASL emblem + wordmark lockup (English header) */
#header .logo a{ display:inline-flex; align-items:center; gap:14px; text-decoration:none; }
#header .logo .brand-emblem{ height:58px; max-height:58px; width:auto; flex:none; }
#header .logo .brand-words{ display:flex; flex-direction:column; line-height:1.08; font-family:var(--display); }
#header .logo .brand-words .bw-1{ font-weight:800; font-size:1.06rem; color:var(--navy); letter-spacing:-.01em; }
#header .logo .brand-words .bw-2{ font-weight:600; font-size:.92rem; color:var(--ink-muted); }
@media (max-width:520px){ #header .logo .brand-words{ display:none; } }
/* utility cluster (search + Falang language + A± font sizer) */
#header .header-social{ font-family:var(--mono); font-size:.8rem; }
#header .header-social a{ color:var(--navy); text-decoration:none; }
#header .header-social .lang-inline li a{ padding:4px 7px; border-radius:3px; font-weight:600; }
#header .header-social .lang-inline li a:hover{ background:var(--paper); }
#header .header-social .fastfont a{ border:1px solid var(--line) !important; color:var(--navy) !important; }
/* UI-S7: WCAG 2.2 AA target size (24x24 min everywhere; roomy 40px on touch/tablet) */
#header .header-social a, #header .header-social .fastfont a, #header .header-social .lang-inline li a{
  min-height:24px; min-width:24px; display:inline-flex; align-items:center; justify-content:center; }
@media (max-width:1024px){
  #header .header-social a, #header .header-social .fastfont a, #header .header-social .lang-inline li a{
    min-height:40px; min-width:40px; padding:6px 10px; }
}

/* ---------- primary navigation (BS3 navbar, preserved markup) ----------
   Base layer only — the authoritative desktop nav skin (the modern "flight deck"
   navy bar) lives in ui-polish.css, which loads last and wins at >=768px. The
   .custom-nav is .hide-mobile so it never shows below 768px; these base rules are
   kept minimal to avoid leaking colours under the polish layer. */
#header .custom-nav{ position:static !important; margin-top:0 !important; clear:both; }
/* dropdown card (shared by all breakpoints where the nav shows) */
#header .custom-nav .nav-child.dropdown-menu{
  border:1px solid var(--line); border-top:3px solid var(--amber); border-radius:0 0 var(--radius) var(--radius);
  box-shadow:var(--shadow); padding:6px 0; }
#header .custom-nav .nav-child.dropdown-menu > li > a{ color:var(--ink) !important; padding:9px 16px; font-size:.9rem; }
#header .custom-nav .nav-child.dropdown-menu > li > a:hover{ background:var(--paper); color:var(--navy) !important; }

/* ---------- breadcrumbs ---------- */
.breadcrumb, .mod-breadcrumbs{ background:transparent !important; padding:14px 0 !important; margin:0 !important;
  font-family:var(--mono); font-size:.78rem; letter-spacing:.03em; }
.breadcrumb a, .mod-breadcrumbs a{ color:var(--teal) !important; }
.breadcrumb .active, .mod-breadcrumbs .active span{ color:var(--ink-muted) !important; }

/* ---------- inner-page sidebar (innerMods) ---------- */
.innermenuNew{ background:var(--white); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:8px 8px 16px; }
.innermenuNew a{ color:var(--ink); }
/* (ss/24) give the last news card room below it + drop its trailing divider so it
   isn't cramped against the card's bottom edge */
.innermenuNew .mod-articlescategory > li:last-child,
.innerMods .mod-articlescategory > li:last-child{ border-bottom:0 !important; padding-bottom:0 !important; }

/* ---------- buttons ---------- */
.btn, .btn-primary, button.btn{ border-radius:var(--radius); font-family:var(--display); font-weight:700; }
.btn-primary, .btn.btn-primary{ background:var(--amber) !important; border-color:var(--amber) !important;
  color:var(--amber-ink) !important; }
.btn-primary:hover{ background:#ffbd1a !important; border-color:#ffbd1a !important; }
.btn-secondary, .btn-default{ background:var(--navy) !important; border-color:var(--navy) !important; color:#fff !important; }

/* ---------- global footer (inner) ---------- */
.site-footer{ background:var(--navy) !important; color:#b9cce0; padding:40px 0 28px; }
.site-footer a{ color:#cfe0f0 !important; }
.site-footer a:hover{ color:#fff !important; }
.site-footer h1,.site-footer h2,.site-footer h3,.site-footer h4{ color:#fff; }

/* ---------- system messages mapped to design alerts ---------- */
.alert{ border-radius:var(--radius); border:1px solid var(--line); }
.alert-success{ border-left:4px solid var(--teal); }
.alert-warning, .alert-notice{ border-left:4px solid var(--amber); }
.alert-danger, .alert-error{ border-left:4px solid #b3261e; }

/* ---------- motion: respect reduced-motion (neutralise animate.css/wow) ---------- */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{ animation-duration:.001ms !important; animation-iteration-count:1 !important;
    transition-duration:.001ms !important; scroll-behavior:auto !important; }
  .wow{ visibility:visible !important; }
}
