/* Tanweer Center — Design D, "Bright community".
   Photo-led and confident: the logo's blues as bold blocks, its sun as the
   yellow highlight, one bilingual typeface (Readex Pro, Arabic and Latin)
   throughout. Every blue is sampled from the centre's own logo. */

:root {
  --blue: #1E4F8C;        /* main colour: between the logo's outline and its Arabic */
  --blue-deep: #143A66;   /* the logo's outline blue */
  --blue-soft: #EAF2FC;   /* a wash of the logo's light "CENTER" fill */
  --sun: #F5C24A;
  --sun-soft: #FFF5DA;
  --stone: #D3DEEC;       /* rules and borders, tinted blue */
  --ink: #1B2430;
  --paper: #FFFFFF;
  --warm: #FFFBF3;        /* page background: white warmed by the sun */

  --radius: 1.25rem;
  --radius-sm: 0.75rem;
  --measure: 36rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --shadow: 0 10px 30px -18px rgba(20, 58, 102, 0.45);

  --font: "Readex Pro", "Segoe UI", Tahoma, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--warm);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 350;
  line-height: 1.7;
}

[dir="rtl"] body { line-height: 1.85; }

h1, h2, h3 {
  font-family: var(--font);
  font-weight: 650;
  color: var(--blue-deep);
  line-height: 1.2;
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); margin: 0 0 0.75rem; }
h2 { font-size: clamp(1.45rem, 3.2vw, 2.1rem); margin: 0 0 1rem; }
h3 { font-size: 1.2rem; }

a { color: var(--blue); text-underline-offset: 0.2em; }
a:hover { color: var(--blue-deep); }

:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
  border-radius: 0.35rem;
}

img { max-width: 100%; }

/* Decorative suns may lean past a section's edge; never past the page's. */
main { overflow-x: clip; }

.wrap {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose { max-width: var(--measure); }

.section { padding-block: clamp(2.25rem, 6vw, 4rem); }

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--blue-deep);
  color: #fff;
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; color: #fff; }

/* ---- masthead ---------------------------------------------------------- */

/* The logo is a white-background image with glows, so the masthead is white
   and the colour lives in the bands around it. */
.masthead-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-top: 6px solid var(--sun);
  box-shadow: 0 6px 20px -16px rgba(20, 58, 102, 0.6);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.5rem;
}

.brand { flex: none; display: block; text-decoration: none; }
.brand img { display: block; height: 4.75rem; width: auto; }

/* Kept for any template that spells the names out in text. */
.brand-name { font-weight: 700; color: var(--blue-deep); }
.brand-ar { display: block; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: var(--blue-deep);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover { background: var(--blue-soft); }
.nav a[aria-current="page"] { background: var(--blue); color: #fff; }

.nav .lang-switch {
  margin-inline-start: 0.35rem;
  background: var(--sun);
  color: var(--blue-deep) !important;
  font-weight: 600 !important;
}
.nav .lang-switch:hover { background: #F0B530; }

/* ---- buttons ----------------------------------------------------------- */

.button {
  display: inline-block;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.button:hover { background: var(--blue-deep); color: #fff; transform: translateY(-1px); }

.button-sun { background: var(--sun); color: var(--blue-deep); }
.button-sun:hover { background: #F0B530; color: var(--blue-deep); }

.button-light {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75);
}
.button-light:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* ---- home hero: blue block and photo mosaic ---------------------------- */

.home-hero {
  position: relative;
  overflow: hidden;
  background: var(--blue);
  color: #fff;
  padding-block: clamp(2.5rem, 7vw, 5rem);
}

.home-hero::before {
  content: "";
  position: absolute;
  width: 26rem;
  height: 26rem;
  inset-inline-start: -9rem;
  bottom: -11rem;
  background: url("../img/burst.svg") center / contain no-repeat;
  opacity: 0.22;
  pointer-events: none;
}

.home-hero-grid {
  position: relative;
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
  grid-template-columns: 1fr;
}

.home-hero-text { min-width: 0; }

.home-hero h1 { color: #fff; font-size: clamp(2.5rem, 8vw, 4.25rem); }

.home-lede {
  margin: 0;
  max-width: 30rem;
  font-size: clamp(1.15rem, 2.4vw, 1.35rem);
  font-weight: 300;
  color: #EAF2FC;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 0; }

.mosaic {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1.1fr 1fr 1fr;
  grid-template-rows: 9.5rem 9.5rem;
}

.mosaic-tile { margin: 0; overflow: hidden; border-radius: var(--radius); background: var(--blue-deep); }
.mosaic-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }

.mosaic-1 { grid-row: 1 / span 2; }
.mosaic-2 { grid-column: 2 / span 2; }
.mosaic-3 { border-end-start-radius: 2.75rem; }
.mosaic-4 { border: 4px solid var(--sun); }

/* ---- figures strip ----------------------------------------------------- */

.figures {
  background: var(--sun);
  color: var(--blue-deep);
  padding-block: clamp(2rem, 5vw, 3rem);
}

.figures h2 { color: var(--blue-deep); font-size: clamp(1.25rem, 2.6vw, 1.6rem); }

.figure-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
}

.figure-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.1rem 1.2rem;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.figure-value {
  font-size: clamp(2rem, 4.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--blue);
}

.figure-label { font-size: 0.95rem; line-height: 1.5; }

.figure-source {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
}

.figures-note { margin: 1rem 0 0; font-size: 0.9rem; }

/* ---- home: about, programmes, visit band ------------------------------- */

.home-about {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: 1fr;
  align-items: center;
}

.home-about-text h2 + .prose { margin-bottom: 1.5rem; }

.home-about-photo {
  position: relative;
  margin: 0;
}
.home-about-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.home-about-photo::after {
  content: "";
  position: absolute;
  width: 6rem;
  height: 6rem;
  inset-inline-end: -1.5rem;
  top: -1.75rem;
  background: url("../img/burst.svg") center / contain no-repeat;
  pointer-events: none;
}

.programme-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
}

.programme-tile {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 500;
  line-height: 1.45;
}

.programme-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--paper);
  color: var(--blue);
}

.programme-name { padding-top: 0.3rem; }

.tone-blue { background: var(--blue); color: #fff; }
.tone-sun { background: var(--sun-soft); color: var(--blue-deep); box-shadow: inset 0 0 0 2px var(--sun); }
.tone-sky { background: var(--blue-soft); color: var(--blue-deep); }

.icon { display: block; }

.visit-band {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  margin-block: clamp(1rem, 4vw, 2rem) clamp(2.5rem, 6vw, 4rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: calc(var(--radius) * 1.5);
  background: var(--blue-deep);
  color: #fff;
}
.visit-text, .visit-contact { min-width: 0; }
.visit-band h2 { color: #fff; }
.visit-band p { margin: 0; }
.visit-band .contact-link { color: var(--sun); }

/* ---- inner-page hero --------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--blue);
  color: #fff;
  border-end-start-radius: 2.5rem;
  border-end-end-radius: 2.5rem;
}

.hero::after {
  content: "";
  position: absolute;
  width: 16rem;
  height: 16rem;
  inset-inline-end: -4rem;
  top: -5rem;
  background: url("../img/burst.svg") center / contain no-repeat;
  opacity: 0.9;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  padding-block: clamp(2.25rem, 7vw, 4.25rem);
  padding-inline-end: clamp(var(--gutter), 14vw, 12rem);
}

.hero h1 { color: #fff; }
.hero p.lede { margin: 0; max-width: var(--measure); font-size: 1.2rem; font-weight: 300; color: #EAF2FC; }
.hero .activity-date { color: var(--sun); margin: 0 0 0.5rem; }

/* ---- block cards (about, visit) ---------------------------------------- */

.block-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
}

.block-card {
  padding: 1.5rem 1.6rem;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 5px solid var(--sun);
}
.block-card h2 { font-size: 1.35rem; }
.block-card p { margin: 0 0 0.75rem; }
.block-card p:last-child { margin-bottom: 0; }

.block-card-blue { background: var(--blue); color: #fff; border-top-color: var(--sun); }
.block-card-blue .contact-link { color: var(--sun); }

.group-heading {
  display: inline-block;
  padding-bottom: 0.3rem;
  border-bottom: 4px solid var(--sun);
}

/* ---- photo gallery ----------------------------------------------------- */

.gallery {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr));
}

.shot {
  margin: 0;
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--blue-soft);
}

.shot-caption {
  padding: 0.85rem 1.1rem 1.1rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.shot-caption span { display: block; }
.shot-caption span + span { margin-block-start: 0.3rem; }
.shot-caption span[lang="en"] + span[lang="ar"],
.shot-caption span[lang="ar"] + span[lang="en"] { color: #4A5568; }

.shot-source,
.reel-source {
  display: inline-block;
  margin-block-start: 0.5rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--blue-soft);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}
.shot-source:hover, .reel-source:hover { background: var(--sun-soft); }

/* ---- video ------------------------------------------------------------- */

.reel {
  margin: 0;
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.reel-player { display: block; width: 100%; height: auto; background: var(--ink); }

.reel-caption {
  padding: 0.85rem 1.1rem 1.1rem;
  font-size: 0.9rem;
  line-height: 1.55;
}
.reel-caption span { display: block; }
.reel-caption span + span { padding-block-start: 0.3rem; }

/* ---- activities -------------------------------------------------------- */

.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr));
}

.activity-card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.activity-card:hover { transform: translateY(-3px); }

.activity-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.activity-link:hover { color: inherit; }
.activity-link:hover h3 { text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 3px; }

.activity-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--blue-soft);
}

.activity-text { padding: 1rem 1.2rem 1.3rem; }
.activity-text h3 { margin: 0.35rem 0 0.5rem; }
.activity-text p { margin: 0; }

.activity-date {
  display: inline-block;
  margin: 0;
  padding: 0.1rem 0.65rem;
  border-radius: 999px;
  background: var(--sun-soft);
  color: var(--blue-deep);
  font-size: 0.85rem;
  font-weight: 600;
}
.hero .activity-date { background: rgba(255, 255, 255, 0.12); }

.activity-body { font-size: 1.1rem; }
.activity-photos { margin-block: 2rem; }

.empty-note {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--blue-soft);
  text-align: center;
}

/* ---- contact ----------------------------------------------------------- */

.contact { margin: 0; }

.contact-line {
  margin: 0;
  padding-block: 0.2rem;
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.contact-line > span { opacity: 0.8; font-size: 0.9rem; }

.contact-link { color: var(--sun); font-weight: 600; text-underline-offset: 0.2em; }

/* ---- footer ------------------------------------------------------------ */

.site-footer {
  margin-top: clamp(2rem, 6vw, 4rem);
  background: var(--blue-deep);
  color: #fff;
  padding-block: clamp(2.5rem, 6vw, 3.5rem) 4.5rem;
  border-top: 6px solid var(--sun);
}

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
}

.footer-brand, .footer-contact { min-width: 0; }

.logo-badge {
  display: inline-block;
  padding: 0.6rem 0.9rem;
  background: var(--paper);
  border-radius: var(--radius);
}
.logo-badge img { display: block; height: 4.5rem; width: auto; }

.footer-name { margin: 0.9rem 0 0; font-weight: 600; font-size: 1.1rem; }
.footer-tagline { margin: 0; color: var(--sun); }

.footer-heading {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: var(--sun);
}

.footer-nav { display: flex; flex-direction: column; gap: 0.3rem; }
.footer-nav a { color: #fff; text-decoration: none; }
.footer-nav a:hover { color: var(--sun); text-decoration: underline; }

/* ---- design label (shown while managers compare) ----------------------- */

.design-tag {
  position: fixed;
  inset-inline-start: 0.75rem;
  bottom: 0.75rem;
  z-index: 30;
  margin: 0;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(20, 58, 102, 0.92);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* ---- wider screens ----------------------------------------------------- */

@media (min-width: 52rem) {
  .home-hero-grid { grid-template-columns: 1fr 1.05fr; }
  .mosaic { grid-template-rows: 12rem 12rem; }
  .home-about { grid-template-columns: 1.1fr 0.9fr; }
  .visit-band { grid-template-columns: 1.3fr 1fr; align-items: center; }
}

/* ---- phones ------------------------------------------------------------ */

@media (max-width: 47.99rem) {
  .masthead { flex-direction: column; align-items: stretch; gap: 0.25rem; padding-block: 0.4rem 0.5rem; }
  .brand { align-self: center; }
  .brand img { height: 3.6rem; }
  /* Chips wrap onto centred rows: a sideways-scrolling row with a hidden
     scrollbar hid Visit and the language switch off the edge of a phone. */
  .nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    padding-bottom: 0.15rem;
  }
  .nav a { font-size: 0.88rem; padding: 0.35rem 0.7rem; background: var(--blue-soft); }
  .nav a[aria-current="page"] { background: var(--blue); }
  .masthead-bar { position: static; }
  .mosaic { grid-template-rows: 7.5rem 7.5rem; gap: 0.5rem; }
  .hero::after { width: 9rem; height: 9rem; inset-inline-end: -2.5rem; top: -3rem; }
}

/* ---- right to left ----------------------------------------------------- */

/* Logical properties carry nearly everything. Readex Pro sets Arabic a
   touch large next to Latin, so Arabic headings are eased slightly. */
[dir="rtl"] h1, [dir="rtl"] h2 { letter-spacing: 0; }
[dir="rtl"] .figure-value { font-feature-settings: "tnum"; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- activity videos ---------------------------------------------------- */

.activity-videos { display: grid; gap: 1.5rem; margin-block: 2rem; }
.activity-video { margin: 0; max-width: 48rem; }
.activity-video iframe,
.activity-video video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--ink);
  box-shadow: var(--shadow);
}
