/* =========================================================
   ICOS Egypt Chapter — stylesheet
   Plain CSS. No framework, no build step.
   Sections: 1 Tokens  2 Base  3 Header  4 Footer  5 Layout
             6 Components  7 Page pieces  8 Arabic/RTL  9 Responsive
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --ink:        #0E2233;   /* headings, dark surfaces */
  --ink-soft:   #1B3A55;
  --slate:      #48627A;   /* body text on light */
  --line:       #D8DDE2;   /* hairlines */
  --paper:      #F4F6F7;   /* page background */
  --white:      #FFFFFF;
  --pulse:      #C43A3C;   /* cardio accent — links, CTAs. Darkened IC-OS red so
                              body-size text clears WCAG AA on white (5.3:1). */
  --pulse-dark: #A22E30;
  --brand-red:  #E94B4D;   /* exact IC-OS logo red — graphics only, never text */
  --brand-blue: #17509E;   /* exact IC-OS logo blue */
  --gold:       #B08A3E;   /* reserved for Center of Excellence only */
  --gold-tint:  #FBF4E4;

  --wrap: 1140px;
  --measure: 68ch;

  --r-sm: 4px;
  --r-md: 8px;

  --shadow: 0 1px 2px rgba(14, 34, 51, .06), 0 8px 24px rgba(14, 34, 51, .06);

  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --arabic: "Cairo", "Segoe UI", Tahoma, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.1rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); }
h3 { font-size: 1.22rem; }
h4 { font-size: 1.02rem; font-family: var(--sans); font-weight: 700; }

p { margin: 0 0 1.1em; max-width: var(--measure); }
ul, ol { max-width: var(--measure); }

/* The measure above is for prose. Lists used as layout must span their column. */
.roster, .figures, .hero-figures, .timeline, .footer-links, .anchor-bar ul, .nav-list {
  max-width: none;
}

a { color: var(--pulse); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pulse-dark); }

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

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: .7rem 1.1rem; z-index: 200;
}
.skip-link:focus { left: 1rem; top: 1rem; }

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

/* ---------- 3. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--wrap); margin: 0 auto; padding: .75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}

/* Header lockup: the official IC-OS heart mark, with the chapter name typeset
   alongside it. The full logo's wordmark is illegible below ~200px, so the
   complete lockup is used in the footer instead, where it has room. */
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand-mark { width: 46px; height: auto; flex: none; }
.brand-text { line-height: 1.15; }
.brand-name {
  display: block; font-family: var(--serif); font-size: 1.16rem;
  font-weight: 600; color: var(--ink);
}
.brand-sub { display: block; font-size: .74rem; color: var(--slate); letter-spacing: .04em; }

.nav-list {
  list-style: none; display: flex; gap: 1.35rem; margin: 0; padding: 0; max-width: none;
}
.nav-list a {
  display: block; padding: .35rem 0; font-size: .95rem; font-weight: 600;
  color: var(--ink-soft); text-decoration: none; border-bottom: 2px solid transparent;
}
.nav-list a:hover { color: var(--pulse); }
.nav-list a[aria-current="page"] { color: var(--pulse); border-bottom-color: var(--pulse); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: .45rem .6rem; cursor: pointer; color: var(--ink);
}
.nav-toggle svg { display: block; }

/* ---------- 4. Footer ---------- */
.site-footer {
  background: var(--ink); color: #B9C7D4;
  margin-top: 4.5rem; padding: 3rem 1.5rem 2rem;
}
.footer-inner {
  max-width: var(--wrap); margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem;
}
.site-footer h4 { color: #fff; margin-bottom: .7rem; font-size: .92rem; letter-spacing: .03em; }
/* The logo sits on a white panel so the brand colours stay exact on the dark band. */
.footer-logo {
  display: inline-block; background: #fff; border-radius: var(--r-md);
  padding: .8rem 1rem; margin: 0 0 1.2rem; max-width: none;
}
.footer-logo img { width: 210px; height: auto; }
.site-footer p { font-size: .92rem; margin-bottom: .6rem; }
.site-footer a { color: #fff; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: .4rem; }
.footer-links a { color: #B9C7D4; text-decoration: none; font-size: .92rem; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  max-width: var(--wrap); margin: 2.5rem auto 0; padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: .82rem; color: #8FA3B4;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem;
}

/* ---------- 5. Layout ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 3.75rem 0; }
.section--tight { padding: 2.5rem 0; }
.section--light { background: var(--white); border-block: 1px solid var(--line); }

.section-head { margin-bottom: 2rem; }
.section-head p.lede { font-size: 1.12rem; color: var(--ink-soft); }

.lede { font-size: 1.15rem; line-height: 1.6; color: var(--ink-soft); }

/* ECG hairline — the one recurring motif, drawn from the subject */
.ecg-rule { display: block; width: 100%; height: 22px; color: var(--brand-red); opacity: .7; }
.ecg-rule path { fill: none; stroke: currentColor; stroke-width: 1.4; }

/* ---------- 6. Components ---------- */
.btn {
  display: inline-block; padding: .72rem 1.4rem; border-radius: var(--r-sm);
  font-weight: 700; font-size: .95rem; text-decoration: none; border: 1.5px solid transparent;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--pulse); color: #fff; }
.btn--primary:hover { background: var(--pulse-dark); color: #fff; }
.btn--ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--light { border-color: rgba(255,255,255,.55); color: #fff; }
.btn--light:hover { background: #fff; color: var(--ink); }

.btn-row { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 1.5rem; }

.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 1.6rem;
}
.card h3 { margin-bottom: .45rem; }
.card p:last-child { margin-bottom: 0; }

.grid { display: grid; gap: 1.5rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* Accordion — replaces the "Read More" links in the source document */
details.more {
  border-top: 1px solid var(--line);
  margin-top: 1.25rem;
}
details.more > summary {
  cursor: pointer; list-style: none; padding: .85rem 0;
  font-weight: 700; color: var(--pulse); font-size: .95rem;
  display: flex; align-items: center; gap: .5rem;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after {
  content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px);
  transition: transform .2s ease;
}
details.more[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
details.more[open] > summary { color: var(--ink); }
.more-body { padding-bottom: .5rem; }
.more-body h4 { margin-top: 1.4rem; }
.more-body h4:first-child { margin-top: 0; }

/* Definition-style blocks used for the statistics and pillars */
.fact { margin-bottom: 1.5rem; }
.fact h4 { color: var(--ink); margin-bottom: .2rem; }
.fact p { margin-bottom: 0; }

/* Key figures strip */
.figures { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.figures li { background: var(--white); padding: 1.35rem 1.25rem; }
.figures .num { display: block; font-family: var(--serif); font-size: 1.85rem; color: var(--ink); line-height: 1.1; }
.figures .lbl { display: block; font-size: .87rem; margin-top: .3rem; }

/* People */
.people { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.person {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 1.5rem; display: flex; flex-direction: column;
}
.person-top { display: flex; gap: 1.1rem; align-items: flex-start; }
.person-photo {
  width: 92px; height: 92px; flex: none; border-radius: 50%;
  object-fit: cover; object-position: center top;
  border: 2px solid var(--white); box-shadow: 0 0 0 1px var(--line); background: var(--paper);
}
.person-name { font-family: var(--serif); font-size: 1.12rem; color: var(--ink); font-weight: 600; margin: 0 0 .15rem; }
.person-role { font-size: .88rem; color: var(--pulse); font-weight: 700; margin: 0 0 .25rem; }
.person-affil { font-size: .88rem; margin: 0; }
.person details.more { margin-top: 1rem; }
.person details.more p { font-size: .95rem; }

/* Leadership roster (names + roles, no photo) */
.roster { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 3.5rem; }
.roster li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
  padding: .8rem 0; border-bottom: 1px solid var(--line); font-size: .96rem;
}
.roster .r-role { color: var(--slate); }
.roster .r-name { color: var(--ink); font-weight: 600; text-align: right; }

/* Gold status callout — the only place --gold appears */
.gold-note {
  background: var(--gold-tint); border: 1px solid #E7D4A8;
  border-left: 4px solid var(--gold); border-radius: var(--r-md);
  padding: 1.4rem 1.6rem;
}
.gold-note h3 { color: #6E5420; }
.gold-note p:last-child { margin-bottom: 0; }

/* Table */
.tbl { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); font-size: .96rem; }
.tbl th { background: #EEF1F3; color: var(--ink); font-weight: 700; }
.tbl tr:last-child td { border-bottom: none; }

/* Timeline — the conference series genuinely is a sequence */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.75rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.75rem; }
.timeline li::before {
  content: ""; position: absolute; left: calc(-1.75rem - 6px); top: .45rem;
  width: 10px; height: 10px; border-radius: 50%; background: var(--pulse);
  box-shadow: 0 0 0 4px var(--paper);
}
.timeline .yr { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); font-weight: 600; display: block; }
.timeline p { margin: .2rem 0 0; }

/* CTA band */
.cta-band { background: var(--ink); color: #D6E0E8; padding: 3rem 0; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #C3D0DA; }

/* ---------- 7. Page pieces ---------- */
.hero { background: var(--white); border-bottom: 1px solid var(--line); padding: 3.5rem 0 0; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: start; }
/* The chapter line is the headline; the positioning line sits beneath it. */
.hero .hero-title {
  font-size: clamp(1.85rem, 3.7vw, 2.6rem);
  color: var(--pulse);
  margin-bottom: .5rem;
}
.hero .hero-line {
  font-family: var(--serif); font-size: clamp(1.2rem, 2vw, 1.42rem);
  font-weight: 600; color: var(--ink); line-height: 1.3; margin-bottom: .4rem;
}
.hero .tagline { font-family: var(--serif); font-size: 1.1rem; color: var(--slate); font-style: italic; margin-bottom: 1.1rem; }
.hero-aside { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.6rem; }
.hero-aside h2 { font-size: 1.15rem; }
.hero-figures { list-style: none; margin: 0; padding: 0; }
.hero-figures li { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.hero-figures li:last-child { border-bottom: none; }
.hero-figures .num { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); display: block; line-height: 1.15; }
.hero-figures .lbl { font-size: .88rem; }
.hero-ecg { margin-top: 2.5rem; }

.page-head { background: var(--ink); color: #C7D5E0; padding: 3rem 0 2.6rem; }
.page-head h1 { color: #fff; margin-bottom: .4rem; }
.page-head .tagline { font-family: var(--serif); font-style: italic; font-size: 1.28rem; color: #9FC0D6; margin: 0; }

.anchor-bar { background: var(--white); border-bottom: 1px solid var(--line); }
.anchor-bar ul { list-style: none; display: flex; gap: 1.6rem; margin: 0; padding: .85rem 0; max-width: none; overflow-x: auto; }
.anchor-bar a { font-size: .92rem; font-weight: 600; color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.anchor-bar a:hover { color: var(--pulse); }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.contact-line { margin-bottom: 1.4rem; }
.contact-line h4 { margin-bottom: .15rem; }
.map-embed { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--white); }
.map-embed iframe { display: block; width: 100%; height: 340px; border: 0; }

/* ---------- 8. Arabic / RTL ---------- */
.rtl {
  direction: rtl; text-align: right;
  font-family: var(--arabic); line-height: 1.95;
}
.rtl h2, .rtl h3, .rtl h4 { font-family: var(--arabic); font-weight: 700; }
.rtl p, .rtl ul { max-width: 62ch; margin-left: auto; margin-right: 0; }
.rtl ul { padding-right: 1.3rem; padding-left: 0; }
.rtl details.more > summary { flex-direction: row-reverse; justify-content: flex-end; }
.qa { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); overflow: hidden; }
.qa details { border-bottom: 1px solid var(--line); }
.qa details:last-child { border-bottom: none; }
.qa summary {
  cursor: pointer; list-style: none; padding: 1.05rem 1.35rem;
  font-weight: 700; color: var(--ink); display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+"; color: var(--pulse); font-size: 1.35rem; line-height: 1; flex: none;
}
.qa details[open] summary::after { content: "–"; }
.qa details[open] summary { background: #F0F3F5; }
.qa .qa-body { padding: 0 1.35rem 1.2rem; }
.qa .qa-body p:last-child { margin-bottom: 0; }

.callout-rtl {
  background: var(--ink); color: #fff; border-radius: var(--r-md);
  padding: 1.5rem 1.7rem; text-align: center; font-family: var(--arabic);
  font-size: 1.2rem; font-weight: 700;
}

/* ---------- 9. Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .figures { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--white); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); padding: .5rem 1.5rem 1.25rem;
  }
  .site-nav.is-open { display: block; }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-list li { border-bottom: 1px solid var(--line); }
  .nav-list li:last-child { border-bottom: none; }
  .nav-list a { padding: .85rem 0; border-bottom: none; }
  .nav-list a[aria-current="page"] { border-bottom: none; }
  .header-inner { position: relative; }
  .brand-mark { width: 40px; }
  .brand-name { font-size: 1.05rem; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .people, .grid--2, .grid--3, .grid--4, .roster { grid-template-columns: 1fr; }
  .figures { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.75rem; }
  .section { padding: 2.75rem 0; }
  .person-top { flex-direction: column; }
  .brand-mark { width: 36px; }
  .brand-name { font-size: .98rem; }
  .brand-sub { font-size: .66rem; }
  .roster li { flex-direction: column; gap: .1rem; }
  .roster .r-name { text-align: left; }
}

@media print {
  .site-header, .anchor-bar, .cta-band, .nav-toggle { display: none; }
  body { background: #fff; font-size: 11pt; }
  details.more, .qa details { display: block; }
  details.more > summary, .qa summary { display: none; }
  .more-body, .qa-body { display: block !important; }
}
