/* Self-hosted Almarai (offline-safe, no external deps) */
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(../fonts/almarai-300-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(../fonts/almarai-300-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/almarai-400-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/almarai-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/almarai-700-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/almarai-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(../fonts/almarai-800-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(../fonts/almarai-800-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===== WASM Weather — Enhanced UI ===== */
:root {
  --gold: #f9bf19;
  --gold-soft: #ffd451;
  --navy: #0c141d;
  --navy-2: #121b25;
  --navy-3: #18242f;
  --card: rgba(255, 255, 255, 0.045);
  --card-2: rgba(255, 255, 255, 0.07);
  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-2: rgba(255, 255, 255, 0.14);
  --text: #eef2f6;
  --muted: #9fb0c0;
  --muted-2: #6f8095;

  --green: #28c76f;
  --green-d: #0ea88a;
  --yellow: #fad961;
  --yellow-d: #ffcc70;
  --orange: #f47a37;
  --orange-d: #e35d5b;
  --red: #f23a3a;
  --red-d: #bf3650;

  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.55);
  --maxw: 1180px;

  /* theme-driven surfaces (dark is default) */
  --surface: #16212d;
  --track: rgba(255, 255, 255, 0.08);
  --node-fill: #0e1822;
  --cursor-stroke: #ffffff;
  --label-fill: #ffe08a;
  --label-now: #ffffff;
  --header-bg: rgba(10, 16, 22, 0.72);
  --footer-bg: rgba(8, 13, 18, 0.6);
  --tip-bg: rgba(20, 30, 42, 0.94);
  --app-bg:
    radial-gradient(1100px 620px at 88% -8%, rgba(249, 191, 25, 0.10), transparent 60%),
    radial-gradient(900px 600px at 0% 0%, rgba(40, 90, 160, 0.18), transparent 55%),
    linear-gradient(180deg, #0e1822 0%, #0c141d 60%, #080d13 100%);
}

[data-theme="light"] {
  --text: #18222e;
  --muted: #566676;
  --muted-2: #8493a3;
  --card: rgba(20, 30, 42, 0.04);
  --card-2: rgba(20, 30, 42, 0.07);
  --stroke: rgba(20, 30, 42, 0.10);
  --stroke-2: rgba(20, 30, 42, 0.16);
  --surface: #ffffff;
  --track: rgba(20, 30, 42, 0.10);
  --node-fill: #ffffff;
  --cursor-stroke: #18222e;
  --label-fill: #9a7a10;
  --label-now: #18222e;
  --header-bg: rgba(255, 255, 255, 0.8);
  --footer-bg: rgba(255, 255, 255, 0.55);
  --tip-bg: rgba(255, 255, 255, 0.96);
  --shadow: 0 20px 50px -22px rgba(40, 60, 90, 0.3);
  --app-bg:
    radial-gradient(1100px 620px at 88% -8%, rgba(249, 191, 25, 0.20), transparent 60%),
    radial-gradient(900px 600px at 0% 0%, rgba(120, 160, 220, 0.16), transparent 55%),
    linear-gradient(180deg, #eef1f6 0%, #e8edf4 60%, #e0e6ee 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Almarai", "Segoe UI", system-ui, sans-serif;
  background: var(--app-bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: color .25s ease;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* smooth theme transition for surfaces */
.card, .site-header, .site-footer, .search input, .theme-btn, .menu-btn,
.alert-banner, .day-row, .hour, .t-tip { transition: background-color .25s ease, border-color .25s ease, color .2s ease; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--stroke);
}
.header-inner {
  display: flex; align-items: center; gap: 18px;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 42px; height: 42px; border-radius: 50%; box-shadow: 0 0 0 1px var(--stroke-2), 0 6px 18px rgba(0,0,0,.4); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 20px; letter-spacing: .5px; }
.brand-text span { font-size: 12px; color: var(--muted); }

.nav { display: flex; gap: 6px; margin-inline-start: auto; }
.nav a {
  font-size: 14px; color: var(--muted); padding: 8px 14px; border-radius: 999px;
  transition: .2s;
}
.nav a:hover { color: var(--text); background: var(--card-2); }
.nav a.active { color: var(--navy); background: var(--gold); font-weight: 700; }

.header-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold); color: var(--navy); font-weight: 700;
  padding: 9px 16px; border-radius: 999px; font-size: 14px; border: none;
  transition: .2s; white-space: nowrap;
}
.header-cta:hover { background: var(--gold-soft); transform: translateY(-1px); }
.menu-btn { display: none; background: var(--card-2); border: 1px solid var(--stroke); color: var(--text); width: 42px; height: 42px; border-radius: 12px; font-size: 20px; }
.theme-btn { background: var(--card-2); border: 1px solid var(--stroke); color: var(--text); width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; transition: .2s; flex: none; }
.theme-btn:hover { background: var(--gold); color: var(--navy); border-color: var(--gold); transform: translateY(-1px); }
.theme-btn svg { width: 19px; height: 19px; }

/* ===== Location bar / search ===== */
.locbar { margin-top: 26px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.loc-title { display: flex; align-items: baseline; gap: 10px; }
.loc-title h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 800; }
.loc-title .sub { color: var(--muted); font-size: 15px; }
.searchbar { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; flex-wrap: wrap; }
/* Custom country dropdown (replaces the native <select> so the flag emoji can
   be sized independently — native <option> caps them at the control font). */
.country-filter {
  position: relative; display: flex; align-items: center; gap: 8px; white-space: nowrap;
  background: var(--card); border: 1px solid var(--stroke); color: var(--text);
  border-radius: 999px; padding: 9px 15px; font-family: inherit; font-size: 15px;
  outline: none; cursor: pointer; transition: .2s; user-select: none;
}
.country-filter:focus, .country-filter.open { border-color: var(--gold); background: var(--card-2); }
.country-filter .cf-flag { font-size: 1.55em; line-height: 1; }
.country-filter .cf-caret { color: var(--muted); font-size: 11px; margin-inline-start: 2px; }
.cf-menu {
  position: absolute; top: calc(100% + 8px); inset-inline-start: 0; z-index: 40;
  min-width: 100%; width: max-content; max-width: 280px; max-height: 340px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--stroke-2); border-radius: var(--r-sm);
  box-shadow: var(--shadow); display: none; padding: 6px; cursor: default;
}
.cf-menu.open { display: block; }
.cf-option {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 15px; color: var(--text);
}
.cf-option:hover, .cf-option.sel { background: var(--card-2); }
.cf-option .cf-flag { font-size: 1.75em; line-height: 1; }
/* Flag emoji next to a country in search results. */
.flag-ico { font-size: 1.6em; line-height: 0; vertical-align: -0.18em; }
.country-filter:focus { border-color: var(--gold); background: var(--card-2); }
.search {
  position: relative; min-width: 240px;
}
.search input {
  width: 100%; background: var(--card); border: 1px solid var(--stroke);
  color: var(--text); border-radius: 999px;
  /* Logical padding so the wide side always matches the icon (inset-inline-start),
     in both RTL (Arabic) and LTR (English) — otherwise the icon overlaps the text. */
  padding-block: 12px; padding-inline-start: 44px; padding-inline-end: 16px;
  font-family: inherit; font-size: 14px; outline: none; transition: .2s;
}
.search input:focus { border-color: var(--gold); background: var(--card-2); }
.search .ico { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-results {
  position: absolute; top: calc(100% + 8px); inset-inline: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--stroke-2); border-radius: var(--r-sm);
  max-height: 340px; overflow-y: auto; box-shadow: var(--shadow); display: none;
}
.search-results.open { display: block; }
.search-results button {
  display: flex; width: 100%; align-items: center; gap: 10px; justify-content: space-between;
  background: none; border: none; color: var(--text); padding: 12px 16px; font-size: 14px; text-align: start;
}
.search-results button:hover { background: var(--card-2); }
.search-results small { color: var(--muted); }

/* ===== Alert banner ===== */
.alert-banner {
  margin-top: 18px; display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: var(--r-md);
  border: 1px solid var(--stroke); background: var(--card);
}
.alert-banner .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 4px rgba(255,255,255,.06); }
.alert-banner b { font-weight: 700; }
.alert-banner span { color: var(--muted); font-size: 14px; }
/* Neutral "glass" status pill — colored dot + colored number hint the alert level */
.alert-banner .pill {
  margin-inline-start: auto;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 7px 14px; border-radius: 999px; font-weight: 800;
  white-space: nowrap;
  background: var(--card-2);
  border: 1px solid var(--stroke-2);
  backdrop-filter: blur(4px);
}
.pill .pdot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06); }
.pill .pscore { letter-spacing: .3px; }

/* color helpers */
.c-green { color: var(--green); }
.c-yellow { color: var(--yellow-d); }
.c-orange { color: var(--orange); }
.c-red { color: var(--red); }
.bg-green { background: linear-gradient(135deg, var(--green), var(--green-d)); }
.bg-yellow { background: linear-gradient(135deg, var(--yellow), var(--yellow-d)); }
.bg-orange { background: linear-gradient(135deg, var(--orange), var(--orange-d)); }
.bg-red { background: linear-gradient(135deg, var(--red), var(--red-d)); }
.badge.bg-yellow { color: #2a2200; }

/* ===== Hero / current ===== */
.hero { margin-top: 18px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--stroke); border-radius: var(--r-lg);
  box-shadow: var(--shadow); backdrop-filter: blur(6px);
}
.current { padding: 28px; display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.current::after {
  content: ""; position: absolute; inset-inline-end: -60px; top: -60px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(249,191,25,.16), transparent 70%); pointer-events: none;
}
.current .top { display: flex; align-items: center; justify-content: space-between; }
.current .now-label { color: var(--muted); font-size: 14px; }
.current .updated { font-size: 12px; color: var(--muted-2); }
.current .main { display: flex; align-items: center; gap: 22px; }
.current .wicon-ring {
  width: 112px; height: 112px; border-radius: 50%; border: 3px solid;
  display: grid; place-items: center; flex: none;
}
.current .wicon-ring .wicon { width: 80px; height: 80px; }
.current .wicon { width: 96px; height: 96px; flex: none; }
.current .temp { font-size: 72px; font-weight: 800; line-height: 1; letter-spacing: -2px; }
.current .temp sup { font-size: 28px; font-weight: 600; vertical-align: super; color: var(--muted); }
.current .state { display: flex; flex-direction: column; gap: 4px; }
.current .state .st { font-size: 22px; font-weight: 700; }
.current .state .feel { color: var(--muted); font-size: 14px; }
.minmax { display: flex; gap: 16px; font-size: 15px; color: var(--muted); }
.minmax b { color: var(--text); }

/* alert gauge card */
.gauge-card { padding: 26px; display: flex; flex-direction: column; align-items: center; gap: 12px; justify-content: center; text-align: center; }
.gauge-card .label { color: var(--muted); font-size: 14px; }
.gauge-wrap { position: relative; width: 180px; height: 180px; }
.gauge-wrap svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge-center .val { font-size: 46px; font-weight: 800; line-height: 1; }
.gauge-center .of { font-size: 13px; color: var(--muted); }
.gauge-status { font-weight: 700; font-size: 16px; }

/* ===== Metrics grid ===== */
.metrics { margin-top: 18px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.metric { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.metric .m-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.metric .m-top svg { width: 18px; height: 18px; opacity: .9; }
.metric .m-val { font-size: 24px; font-weight: 800; }
.metric .m-val small { font-size: 14px; font-weight: 600; color: var(--muted); }
.metric .m-sub { font-size: 12px; color: var(--muted-2); }

/* ===== Section heading ===== */
.section { margin-top: 38px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: 22px; font-weight: 800; }
.section-head .bar { width: 4px; height: 22px; border-radius: 4px; background: var(--gold); }
.section-head .hint { margin-inline-start: auto; color: var(--muted); font-size: 13px; }

/* ===== Hourly ===== */
.hourly-card { padding: 22px; position: relative; }
.hours-scroll {
  overflow-x: auto;
  padding-bottom: 14px;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgba(249, 191, 25, 0.55) var(--track);
}
/* WebKit / Chromium / Safari */
.hours-scroll::-webkit-scrollbar { height: 8px; }
.hours-scroll::-webkit-scrollbar-track {
  background: var(--track);
  border-radius: 99px;
  margin: 0 4px;
}
.hours-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(249, 191, 25, 0.7), rgba(255, 212, 81, 0.85));
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background .2s;
}
.hours-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  background-clip: padding-box;
}
.hours-track { display: flex; flex-direction: column; gap: 10px; width: max-content; }
.hour-chart { width: 100%; position: relative; }
.hour-chart svg { display: block; overflow: visible; }

/* ---- chart entrance + ambient animation ---- */
.t-line { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: tdraw 1.7s cubic-bezier(.55,0,.2,1) forwards; }
@keyframes tdraw { to { stroke-dashoffset: 0; } }
.t-area { opacity: 0; animation: tfade 1.3s ease .45s forwards; }
@keyframes tfade { to { opacity: 1; } }
.t-shine { fill: none; stroke: rgba(255,255,255,.9); stroke-width: 2.4; stroke-linecap: round;
  stroke-dasharray: 24 976; stroke-dashoffset: 1000; opacity: 0;
  filter: drop-shadow(0 0 5px rgba(255,255,255,.8)); animation: tshine 3.6s linear 1.7s infinite; }
@keyframes tshine { 0% { stroke-dashoffset: 1000; opacity: 0; } 10% { opacity: .9; } 90% { opacity: .9; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.t-node { opacity: 0; transform-box: fill-box; transform-origin: center; animation: tpop .45s cubic-bezier(.34,1.56,.64,1) forwards; }
@keyframes tpop { from { opacity: 0; transform: scale(.1); } to { opacity: 1; transform: scale(1); } }
.t-label { opacity: 0; animation: tup .5s ease forwards; }
@keyframes tup { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.t-now-ring { transform-box: fill-box; transform-origin: center; animation: tpulse 2.2s ease-out infinite; }
@keyframes tpulse { 0% { opacity: .55; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(3.2); } }
.t-scan, .t-cursor { opacity: 0; transition: opacity .15s ease; pointer-events: none; }
.hour-chart.scrub .t-scan, .hour-chart.scrub .t-cursor { opacity: 1; }
/* theme-aware chart fills (override inline presentation attrs) */
.t-node { fill: var(--node-fill); }
.t-now-node { fill: var(--gold); }
.t-label { fill: var(--label-fill); }
.t-now-label { fill: var(--label-now); }
.t-cursor { fill: var(--node-fill); stroke: var(--cursor-stroke); }
.gauge-track { stroke: var(--track); }

/* ---- floating glass tooltip ---- */
.t-tip {
  position: absolute; left: 0; top: 0; z-index: 8; pointer-events: none;
  transform: translate(-50%, -100%) translateY(-14px);
  opacity: 0; transition: opacity .16s ease;
  background: var(--tip-bg); border: 1px solid var(--stroke-2); border-radius: 16px;
  padding: 11px 13px; min-width: 150px; box-shadow: var(--shadow); backdrop-filter: blur(10px);
}
.t-tip.below { transform: translate(-50%, 0) translateY(14px); }
.t-tip.show { opacity: 1; }
.t-tip::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px;
  background: var(--tip-bg); border-right: 1px solid var(--stroke-2); border-bottom: 1px solid var(--stroke-2);
  transform: translateX(-50%) rotate(45deg);
}
.t-tip.below::after { bottom: auto; top: -6px; border: none; border-left: 1px solid var(--stroke-2); border-top: 1px solid var(--stroke-2); }
.t-tip .tt-head { display: flex; align-items: center; gap: 10px; }
.t-tip .tt-ico { width: 34px; height: 34px; flex: none; }
.t-tip .tt-temp { font-size: 26px; font-weight: 800; line-height: 1; }
.t-tip .tt-time { margin-inline-start: auto; font-size: 12px; color: var(--muted); }
.t-tip .tt-st { font-size: 13px; font-weight: 700; margin-top: 6px; }
.t-tip .tt-rows { display: flex; gap: 12px; margin-top: 8px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.t-tip .tt-rows b { color: var(--text); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .t-line { stroke-dashoffset: 0; animation: none; }
  .t-shine, .t-now-ring { display: none; }
  .t-area, .t-node, .t-label { opacity: 1; animation: none; }
}
.hours-row { display: flex; gap: 10px; }
.hour {
  flex: none; width: 84px; text-align: center; padding: 14px 8px; border-radius: var(--r-sm);
  background: var(--card); border: 1px solid var(--stroke); transition: .2s;
}
.hour:hover { background: var(--card-2); transform: translateY(-2px); border-color: var(--stroke-2); }
.hour .h-time { font-size: 13px; color: var(--muted); }
.hour .h-ico { width: 34px; height: 34px; margin: 8px auto; }
.hour .h-temp { font-size: 18px; font-weight: 800; }
.hour .h-time { white-space: nowrap; }
.hour .h-wind { font-size: 11px; color: var(--muted-2); margin-top: 4px; white-space: nowrap; }
.hour .h-alert { width: 26px; height: 4px; border-radius: 4px; margin: 8px auto 0; }

/* ===== Daily ===== */
.daily { display: flex; flex-direction: column; gap: 10px; }
.day-row {
  display: grid; grid-template-columns: 140px 72px 1fr; align-items: center; gap: 18px;
  padding: 14px 18px; border-radius: var(--r-md); background: var(--card);
  border: 1px solid var(--stroke); transition: .2s; cursor: pointer; width: 100%; text-align: start; color: inherit;
}
.day-row:hover { background: var(--card-2); border-color: var(--stroke-2); }
.day-row.active { border-color: var(--gold); background: rgba(249,191,25,.07); }
.day-row .d-name b { display: block; font-size: 15px; }
.day-row .d-name span { font-size: 12px; color: var(--muted); }
.day-row .d-ico-col { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.day-row .d-ring {
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid;
  display: grid; place-items: center; box-sizing: border-box;
}
.day-row .d-ring .d-ico { width: 30px; height: 30px; }
.day-row .d-temps { font-size: 13px; white-space: nowrap; }
.day-row .d-state { font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.day-row .d-state .d-night { font-size: 12px; color: var(--muted); opacity: .8; }
.hub-badge {
  margin-inline-start: 10px; font-size: 12px; font-weight: 700;
  color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  border-radius: 999px; padding: 2px 10px;
}
.hub-badge::before { content: "🟢 "; }
.day-row .d-temps b { font-weight: 800; }
.day-row .d-temps span { color: var(--muted); }
.day-row .d-alert { display: flex; align-items: center; justify-content: center; }
.day-row .d-alert .badge { font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 999px; }
.badge.bg-yellow { color: #2a2200; }

/* ===== Day parts ===== */
.parts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.part { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.part .p-name { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.part .p-temp { font-size: 30px; font-weight: 800; }
.part .p-meta { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.part .p-alert { height: 4px; border-radius: 4px; margin-top: 4px; }

/* ===== Alert system explainer ===== */
.legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.legend-item { padding: 18px; display: flex; flex-direction: column; gap: 8px; border-radius: var(--r-md); position: relative; overflow: hidden; border: 1px solid var(--stroke); }
.legend-item .swatch { width: 100%; height: 6px; border-radius: 6px; }
.legend-item b { font-size: 16px; }
.legend-item p { font-size: 13px; color: var(--muted); }

/* ===== Services ===== */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.service { padding: 24px; display: flex; flex-direction: column; gap: 12px; transition: .2s; }
.service:hover { transform: translateY(-3px); border-color: var(--stroke-2); }
.service .s-ico { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: rgba(249,191,25,.12); color: var(--gold); }
.service .s-ico svg { width: 26px; height: 26px; }
.service h3 { font-size: 18px; font-weight: 800; }
.service p { font-size: 14px; color: var(--muted); }

/* ===== Footer ===== */
.site-footer { margin-top: 60px; border-top: 1px solid var(--stroke); background: var(--footer-bg); padding: 46px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 30px; }
.footer-grid h4 { font-size: 14px; color: var(--muted); margin-bottom: 14px; letter-spacing: .5px; }
.footer-grid a { display: block; color: var(--text); font-size: 14px; padding: 5px 0; opacity: .85; }
.footer-grid a:hover { opacity: 1; color: var(--gold); }
.footer-brand p { color: var(--muted); font-size: 14px; margin-top: 12px; max-width: 320px; }
.socials { display: flex; gap: 10px; margin-top: 16px; }
.socials a { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--stroke); }
.socials a:hover { background: var(--gold); color: var(--navy); }
.socials svg { width: 18px; height: 18px; }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--stroke); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }

/* Entrance animation — self-contained so content is always visible even if JS is slow */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.reveal { animation: rise .55s ease both; }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; gap: 4px;
    position: absolute; top: 64px; inset-inline-end: 20px; z-index: 60;
    background: var(--surface); padding: 10px; border-radius: 14px;
    border: 1px solid var(--stroke-2); box-shadow: var(--shadow);
  }
  .menu-btn { display: block; margin-inline-start: auto; }
  .header-cta { display: none; }
  .hero { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .parts { grid-template-columns: repeat(2, 1fr); }
  .legend { grid-template-columns: repeat(2, 1fr); }
  .services { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .metric { padding: 15px; }
  .day-row { grid-template-columns: auto 60px 1fr; gap: 12px; padding: 12px 14px; }
  .day-row .d-state { font-size: 13px; }
  .current { padding: 22px; }
  .current .temp { font-size: 58px; }
  .current .wicon-ring { width: 92px; height: 92px; }
  .current .wicon-ring .wicon { width: 64px; height: 64px; }
  .current .wicon { width: 76px; height: 76px; }
  .gauge-card { padding: 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .loc-title h1 { font-size: 26px; }

  /* let the min/max row wrap cleanly instead of breaking words */
  .minmax { flex-wrap: wrap; gap: 8px 16px; }
  .minmax span { white-space: nowrap; }

  /* headings: title and hint stack instead of crowding */
  .section { margin-top: 28px; }
  .section-head { flex-wrap: wrap; row-gap: 4px; }
  .section-head .hint { font-size: 12px; }

  /* search fills the row under the location name */
  .locbar { gap: 12px; }
  .searchbar { width: 100%; margin-inline-start: 0; }
  .country-filter { flex: 1; }
  .search { min-width: 100%; margin-inline-start: 0; }

  .hourly-card { padding: 16px; }
  .alert-banner { padding: 12px 14px; gap: 10px; }
}

@media (max-width: 430px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .parts { grid-template-columns: 1fr 1fr; }
  .legend { grid-template-columns: 1fr; }
  .brand-text span { display: none; }
  .header-inner { gap: 10px; }
  .loc-title { flex-direction: column; align-items: flex-start; gap: 2px; }
  .current .top .updated { display: none; }
}

/* ===== News ===== */
.news-head { margin-top: 26px; }
.news-cat {
  display: inline-block; background: var(--gold); color: var(--navy);
  font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 999px;
}
.news-cat.topic { background: var(--gold); color: var(--navy); }
.news-cat.region { background: var(--card-2); color: var(--text); border: 1px solid var(--card); }

/* Region filter bar */
.news-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.news-filter .flabel { color: var(--muted); font-size: 14px; margin-inline-end: 4px; }
.news-filter .rchip {
  font-size: 13px; font-weight: 700; text-decoration: none;
  padding: 6px 14px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--card); color: var(--text);
}
.news-filter .rchip:hover { border-color: var(--gold); }
.news-filter .rchip.active { background: var(--gold); color: var(--navy); border-color: var(--gold); }

.article-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }

/* CMS static pages */
.page-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 36px 0 64px; align-items: start; }
.page-side { position: sticky; top: 90px; }
.page-nav { display: flex; flex-direction: column; gap: 4px; }
.page-nav .pnav-link {
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px;
  padding: 10px 14px; border-radius: 10px; border-right: 3px solid transparent;
}
.page-nav .pnav-link:hover { background: var(--card-2); color: var(--text); }
.page-nav .pnav-link.active { background: var(--card-2); color: var(--gold); border-right-color: var(--gold); }
.page-article { max-width: 780px; }
.page-title { font-size: 32px; font-weight: 800; margin: 0 0 20px; }
.page-content { color: var(--text); line-height: 1.9; font-size: 17px; }
.page-content h3 { font-size: 21px; font-weight: 700; margin: 26px 0 10px; color: var(--gold); }
.page-content p { margin: 0 0 16px; }
.page-content ul { margin: 0 0 16px; padding-inline-start: 22px; }
.page-content li { margin-bottom: 8px; }
.page-content a { color: var(--gold); }
.page-error { color: var(--muted); }
@media (max-width: 760px) {
  .page-wrap { grid-template-columns: 1fr; gap: 18px; }
  .page-side { position: static; }
  .page-nav { flex-direction: row; flex-wrap: wrap; }
}

/* Featured cover */
.news-featured { margin-bottom: 22px; }
.news-featured .cover {
  position: relative; display: block; border-radius: 20px; overflow: hidden;
  height: 380px; text-decoration: none;
}
.news-featured .cover img { width: 100%; height: 100%; object-fit: cover; object-position: bottom; display: block; }
.news-featured .cover-overlay {
  position: absolute; inset-inline: 0; bottom: 0; padding: 26px;
  background: linear-gradient(to top, rgba(6,12,18,.92), rgba(6,12,18,.35) 60%, transparent);
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
}
.news-featured .cover-overlay h3 { color: #fff; font-size: 28px; font-weight: 800; line-height: 1.35; margin: 0; }
.news-featured .cover-date { color: #cdd6e0; font-size: 14px; }

/* Card grid */
.news-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
.news-card {
  display: flex; flex-direction: column; background: var(--card-2);
  border: 1px solid var(--card); border-radius: 18px; overflow: hidden;
  text-decoration: none; color: var(--text); transition: transform .18s, box-shadow .18s;
}
.news-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0,0,0,.28); }
.news-card .thumb { height: 172px; overflow: hidden; flex: 0 0 172px; }
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: bottom; display: block; }
.news-card .news-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.news-card .news-body h3 { font-size: 16px; font-weight: 700; line-height: 1.5; margin: 0; }
.news-card .news-date { color: var(--muted); font-size: 13px; margin-top: auto; }

/* Pagination */
.news-pagination { display: flex; justify-content: center; gap: 8px; margin: 30px 0 40px; flex-wrap: wrap; }
.news-pagination .pg {
  min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--card-2); border: 1px solid var(--card);
  color: var(--text); text-decoration: none; font-weight: 700; padding: 0 10px;
}
.news-pagination a.pg:hover { border-color: var(--gold); }
.news-pagination .pg.active { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.news-pagination .pg.disabled { opacity: .4; }
.news-pagination .pg.gap { background: transparent; border: none; min-width: 20px; padding: 0 2px; }

/* Article detail */
.article { max-width: 820px; margin: 26px auto 60px; }
.back-link { color: var(--gold); font-weight: 700; text-decoration: none; }
.article-cover { margin: 16px 0; border-radius: 18px; overflow: hidden; }
/* Banner crop anchored to the bottom: cover images are often share cards with the
   headline baked into a caption band at the top (which the page renders itself
   below), so crop that band out of view. The image file is untouched. */
.article-cover img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: bottom; display: block; }
.article-title { font-size: 30px; font-weight: 800; line-height: 1.4; margin: 12px 0; }
.article-meta { display: flex; gap: 16px; color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.article-body p { line-height: 2; margin: 0 0 16px; font-size: 17px; }
.article-body h1, .article-body h2, .article-body h3 { font-weight: 800; margin: 22px 0 10px; line-height: 1.4; }
.article-body h1 { font-size: 26px; }
.article-body h2 { font-size: 22px; }
.article-body h3 { font-size: 19px; }
.article-body img { max-width: 100%; height: auto; border-radius: 14px; margin: 12px 0; display: block; }
.article-body ul, .article-body ol { padding-inline-start: 1.6em; margin: 0 0 16px; line-height: 2; }
.article-body a { color: var(--gold); }
.article-body blockquote {
  border-inline-start: 3px solid var(--gold); margin: 0 0 16px;
  padding: 4px 16px; color: var(--muted); background: var(--card);
}
.article-body .ql-align-center { text-align: center; }
.article-body .ql-align-left { text-align: left; }
.article-body .ql-align-right { text-align: right; }
.article-body .ql-align-justify { text-align: justify; }
.article-body [dir="ltr"] { direction: ltr; }
.news-empty { color: var(--muted); text-align: center; padding: 40px 0; }

@media (max-width: 640px) {
  .news-featured .cover { height: 240px; }
  .news-featured .cover-overlay h3 { font-size: 20px; }
  .article-title { font-size: 24px; }
}

/* ---- Loading skeletons (theme-aware via --card / --card-2) ---- */
@keyframes sk-shimmer { to { background-position: -200% 0; } }
.sk {
  border-radius: 14px;
  background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 37%, var(--card) 63%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}

/* ===== SWAS info button + explanation modal ===== */
.gauge-card .label { display: inline-flex; align-items: center; }
.info-btn {
  background: none; border: 0; padding: 0; margin-inline-start: 6px;
  color: var(--gold); cursor: pointer; display: inline-flex;
  width: 16px; height: 16px; line-height: 0;
}
.info-btn svg { width: 16px; height: 16px; }
.info-btn:hover { opacity: .82; }
.info-modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.info-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); }
.info-dialog {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  background: var(--card); border: 1px solid var(--stroke); border-radius: 18px;
  padding: 22px; box-shadow: var(--shadow); animation: info-pop .18s ease;
}
@keyframes info-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.info-dialog h3 { margin: 0 0 10px; font-size: 19px; font-weight: 800; }
.info-dialog p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.info-bands { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 9px; }
.info-bands li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.info-bands .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.info-bands b { min-width: 62px; font-weight: 700; }
.info-bands li > span:last-child { color: var(--muted); }
.info-close {
  display: block; margin-inline-start: auto; margin-top: 2px;
  background: none; border: 0; color: var(--gold); font-weight: 700;
  font-size: 14px; cursor: pointer; padding: 8px 4px; font-family: inherit;
}

/* ===== Hub-broadcast news alerts (dismissible banners) ===== */
.news-alerts { display: flex; flex-direction: column; gap: 10px; }
.news-alerts:empty { display: none; }
.news-alert {
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  padding: 12px 14px; border-radius: 14px; border: 1px solid; transition: filter .2s;
}
.news-alert:hover { filter: brightness(1.07); }
.news-alert .na-ico { flex: none; width: 22px; height: 22px; margin-top: 1px; }
.news-alert .na-ico svg { width: 22px; height: 22px; }
.news-alert .na-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.news-alert .na-body b { font-size: 14.5px; font-weight: 800; color: inherit; }
.news-alert .na-body span { font-size: 13px; color: var(--muted); }
.news-alert .na-close {
  flex: none; background: none; border: 0; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px; font-family: inherit;
}
.news-alert .na-close:hover { color: #fff; }
.na-danger  { background: rgba(242,58,58,.12);  border-color: rgba(242,58,58,.5);  color: #f87171; }
.na-warning { background: rgba(249,191,25,.12); border-color: rgba(249,191,25,.5); color: #f9bf19; }
.na-info    { background: rgba(90,169,230,.12); border-color: rgba(90,169,230,.5); color: #5aa9e6; }

/* ===== Day parts: richer cards (they stand alone when a day is selected) ===== */
.part .p-name { justify-content: space-between; }
.part .p-name .p-range { font-size: 11.5px; color: var(--muted-2); font-weight: 600; }
.part .p-main { display: flex; align-items: center; gap: 10px; }
.part .p-main .p-ico { width: 38px; height: 38px; flex: none; }
.part .p-main .p-temp { font-size: 28px; line-height: 1; }
.part .p-main .p-score { margin-inline-start: auto; font-size: 13px; font-weight: 800; }
.part .p-st { font-size: 12.5px; color: var(--muted); }

/* Optical centring for the Arabic language glyph. `place-items: center` centres
   the line box; Almarai's ain descends, leaving its ink ~0.3em low. */
.lang-btn .lang-ar { display: block; transform: translateY(-0.3em); }

/* Hazard pill — names why a clear-sky day/hour is coloured (heat/dust/wind/…).
   Used on the daily rows and the current card. */
.day-row .d-state { align-items: flex-start; }
.d-hazard {
  align-self: flex-start; margin-top: 5px;
  font-size: 11px; font-weight: 800; line-height: 1;
  padding: 3px 8px; border-radius: 999px; border: 1px solid;
}
.current .state .d-hazard { margin-top: 6px; font-size: 12px; }
