:root {
  --green: #0f5f4c;
  --green-2: #16483f;
  --teal: #0d766c;
  --gold: #d6a72c;
  --gold-text: #8b650e;
  --sand: #f4efe4;
  --ivory: #fbfaf5;
  --ink: #17222b;
  --muted: #4f5c62;
  --line: #ded8ca;
  --white: #fff;
  --shadow: 0 18px 45px rgba(23, 34, 43, .10);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  direction: rtl;
  background: var(--ivory);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", "Cairo", Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
input, textarea, button { font: inherit; }
.container { width: min(1160px, calc(100% - 32px)); margin-inline: auto; }
.screen-reader-text, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
.skip-link:focus {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1000;
  background: var(--gold);
  padding: 10px 14px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 250, 245, .84);
  border-bottom: 1px solid rgba(222, 216, 202, .78);
  backdrop-filter: blur(22px);
  box-shadow: 0 12px 34px rgba(23, 34, 43, .04);
}
.header-inner {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; color: var(--green-2); }
.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  letter-spacing: 0;
}
.brand-text { line-height: 1.25; }
.primary-nav ul { display: flex; gap: 4px; align-items: center; margin: 0; padding: 0; list-style: none; }
.primary-nav li { position: relative; }
.primary-nav a {
  display: block;
  padding: 10px 11px;
  border-radius: 6px;
  font-size: 15px;
  color: #25333a;
}
.primary-nav a:hover, .primary-nav a:focus { background: var(--sand); color: var(--green); outline: none; }
.primary-nav .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  display: grid;
  gap: 2px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.primary-nav .sub-menu a { white-space: nowrap; }
.header-search { position: relative; display: flex; gap: 8px; }
.header-search input, .filter-bar input, .search-form input {
  width: 210px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 10px 15px;
}
.header-search button, .btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 700;
}
.btn.primary, .header-search button { background: var(--green); color: var(--white); }
.btn.secondary { background: var(--sand); color: var(--green-2); border: 1px solid var(--line); }
.btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.55); color: var(--white); }
.nav-toggle { display: none; background: transparent; border: 0; padding: 8px; }
.nav-toggle span:not(.screen-reader-text) { display: block; width: 26px; height: 2px; margin: 5px 0; background: var(--green-2); }
.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: var(--white);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: none;
}
.search-suggestions a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.search-suggestions.is-open { display: block; }

.hero {
  background:
    linear-gradient(110deg, rgba(15,95,76,.96), rgba(22,72,63,.92)),
    radial-gradient(circle at 12% 20%, rgba(214,167,44,.28), transparent 30%);
  color: var(--white);
  padding: 76px 0 44px;
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: 44px; align-items: center; min-height: 560px; }
.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1.08;
  letter-spacing: 0;
}
.hero p { max-width: 680px; color: rgba(255,255,255,.86); font-size: 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-panel {
  min-height: 430px;
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background: #e4dbc7;
  box-shadow: 0 34px 90px rgba(0,0,0,.28);
}
.hero-panel img { width: 100%; height: 430px; object-fit: cover; }
.hero-feature {
  position: absolute;
  inset-inline: 24px;
  bottom: 24px;
  background: rgba(251,250,245,.94);
  color: var(--ink);
  padding: 18px;
  border-radius: 18px;
  backdrop-filter: blur(18px);
}
.hero-feature span, .card-kicker { color: var(--gold-text); font-weight: 700; font-size: 14px; }
.hero-feature h2 { margin: 4px 0 0; font-size: 22px; line-height: 1.35; }
.hero-archive-mark { display: grid; place-items: center; min-height: 430px; font-size: 80px; font-weight: 700; color: var(--green); }
.hero-archive-mark,
.media-placeholder {
  background:
    linear-gradient(135deg, rgba(15,95,76,.08), rgba(214,167,44,.12)),
    repeating-linear-gradient(45deg, rgba(15,95,76,.05) 0 1px, transparent 1px 18px),
    var(--sand);
}

.visual-story {
  padding: 58px 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.visual-story-inner {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}
.visual-story-copy h2 {
  margin: 0 0 12px;
  color: var(--green-2);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
}
.visual-story-copy p {
  margin: 0 0 18px;
  color: var(--muted);
}
.visual-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  grid-auto-rows: 96px;
  gap: 10px;
}
.visual-tile {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: var(--sand);
  box-shadow: 0 14px 34px rgba(23, 34, 43, .08);
}
.visual-tile.is-tall { grid-row: span 2; }
.visual-image,
.gallery-image,
.card-fallback-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.visual-tile::after,
.gallery-item a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.22));
  opacity: 0;
  transition: opacity .22s ease;
}
.visual-tile:hover::after,
.gallery-item a:hover::after { opacity: 1; }

.amej-finder {
  padding: 34px 0;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.finder-panel {
  display: grid;
  grid-template-columns: minmax(240px, .72fr) minmax(0, 1.28fr);
  gap: 22px;
  align-items: stretch;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, #ffffff, #f7f3ea);
  box-shadow: 0 20px 58px rgba(23,34,43,.07);
}
.finder-copy {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px 8px;
}
.finder-copy span,
.curated-media-copy > span {
  color: var(--gold-text);
  font-weight: 800;
  font-size: 14px;
}
.finder-copy h2,
.curated-media-copy h2 {
  margin: 0;
  color: var(--green-2);
  font-size: 34px;
  line-height: 1.24;
}
.finder-copy p,
.curated-media-copy p {
  margin: 0;
  color: var(--muted);
}
.finder-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.finder-grid a {
  display: grid;
  align-content: space-between;
  min-height: 154px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.82);
  color: var(--green-2);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.finder-grid a:hover,
.finder-grid a:focus {
  transform: translateY(-2px);
  border-color: rgba(214,167,44,.52);
  box-shadow: 0 18px 42px rgba(23,34,43,.09);
  outline: none;
}
.finder-grid strong {
  font-size: 22px;
  line-height: 1.25;
}
.finder-grid span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.curated-media {
  padding: 64px 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.curated-media-inner {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 30px;
  align-items: center;
}
.curated-media-copy {
  display: grid;
  gap: 12px;
}
.curated-media-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(2, minmax(0, .72fr));
  grid-auto-rows: 132px;
  gap: 12px;
}
.curated-media-item {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  border-radius: 22px;
  background: var(--sand);
  box-shadow: 0 18px 44px rgba(23,34,43,.08);
  isolation: isolate;
}
.curated-media-item.is-featured {
  grid-row: span 2;
  min-height: 276px;
}
.curated-media-item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 46%, rgba(8,24,21,.66));
}
.curated-media-item span {
  position: absolute;
  z-index: 2;
  right: 12px;
  left: 12px;
  bottom: 10px;
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.5;
  text-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.curated-media-item img {
  transition: transform .35s ease;
}
.curated-media-item:hover img,
.curated-media-item:focus img {
  transform: scale(1.035);
}

.intro-band, .join-cta { background: var(--sand); padding: 36px 0; border-block: 1px solid var(--line); }
.split { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.split h2, .section-head h2 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 44px); line-height: 1.25; color: var(--green-2); }
.split p, .section-head p { margin: 0; color: var(--muted); max-width: 760px; }
.text-link { color: var(--green); font-weight: 700; border-bottom: 2px solid var(--gold); }
.section { padding: 70px 0; }
.section.tinted { background: #f7f3ea; }
.section-head { margin-bottom: 28px; }
.section-head.inline { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.timeline article, .feature-card, .content-card, .branch-card, .contact-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(23,34,43,.05);
}
.timeline article { padding: 22px; border-top: 4px solid var(--gold); }
.timeline time { color: var(--green); font-weight: 700; font-size: 24px; }
.timeline h3, .feature-card h3 { margin: 10px 0 6px; color: var(--green-2); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card { padding: 24px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.content-card { overflow: hidden; }
.content-card {
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.content-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 58px rgba(23,34,43,.10);
  border-color: rgba(214, 167, 44, .45);
}
.card-media { display: block; aspect-ratio: 4 / 3; background: var(--sand); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.media-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--green);
  font-weight: 700;
  font-size: 18px;
}
.card-body { padding: 18px; }
.card-body h3 { margin: 7px 0 8px; font-size: 22px; line-height: 1.35; color: var(--green-2); }
.card-body p { color: var(--muted); margin: 0 0 14px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }
.card-meta a { color: var(--green); font-weight: 700; }
.empty-state { padding: 24px; background: var(--sand); border-radius: var(--radius); }

.page-hero, .article-hero {
  background: linear-gradient(115deg, var(--green-2), var(--green));
  color: var(--white);
  padding: 58px 0;
}
.page-hero h1, .article-hero h1 { margin: 10px 0 8px; font-size: clamp(34px, 5vw, 58px); line-height: 1.18; }
.page-hero p { max-width: 760px; color: rgba(255,255,255,.84); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; color: rgba(255,255,255,.78); font-size: 14px; }
.filter-bar { margin-bottom: 24px; }
.filter-bar form { display: flex; gap: 10px; }
.region-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.branch-card { padding: 22px; }
.branch-card h2 { margin-top: 0; color: var(--green-2); font-size: 24px; }
.article-meta { display: flex; gap: 16px; color: rgba(255,255,255,.78); }
.reading-progress { position: fixed; top: 0; right: 0; height: 3px; background: var(--gold); width: 0; z-index: 200; }
.article-image { margin-top: 32px; }
.article-image img { width: 100%; max-height: 560px; object-fit: cover; border-radius: 10px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; padding-block: 44px; }
.article-content {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 44px);
  font-family: "Noto Naskh Arabic", "IBM Plex Sans Arabic", serif;
  font-size: 20px;
}
.article-content h2, .article-content h3 { font-family: "IBM Plex Sans Arabic", sans-serif; color: var(--green-2); }
.article-side { position: sticky; top: 104px; align-self: start; background: var(--sand); padding: 22px; border-radius: var(--radius); }
.confirmation-note { margin-top: 28px; padding: 16px; border-right: 4px solid var(--gold); background: #fff8df; }
.page-content { max-width: 860px; font-size: 19px; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.amej-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.amej-form label { display: grid; gap: 7px; font-weight: 700; }
.amej-form .full { grid-column: 1 / -1; }
.amej-form input, .amej-form textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  background: #fff;
}
.amej-form input:focus, .amej-form textarea:focus, .header-search input:focus, .filter-bar input:focus {
  outline: 3px solid rgba(214,167,44,.35);
  border-color: var(--gold);
}
.contact-panel { padding: 24px; }

.media-hero {
  background:
    linear-gradient(115deg, rgba(18, 38, 32, .95), rgba(15, 95, 76, .86)),
    var(--green);
}
.gallery-hero { padding: 64px 0; overflow: hidden; }
.gallery-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
  gap: 34px;
  align-items: center;
}
.gallery-hero-copy p { font-size: 19px; }
.gallery-hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}
.gallery-hero-metrics span {
  display: grid;
  gap: 2px;
  min-height: 86px;
  padding: 13px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.74);
  backdrop-filter: blur(18px);
}
.gallery-hero-metrics strong {
  color: var(--white);
  font-size: 24px;
  line-height: 1.15;
}
.gallery-showcase {
  display: grid;
  grid-template-columns: 1.25fr .85fr .85fr;
  grid-auto-rows: 150px;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 30px;
  background: rgba(255,255,255,.10);
  box-shadow: 0 34px 90px rgba(0,0,0,.24);
  backdrop-filter: blur(22px);
}
.showcase-item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 22px;
  background: #e5dece;
  isolation: isolate;
}
.showcase-item.is-primary { grid-row: span 2; }
.showcase-item .gallery-image {
  position: relative;
  z-index: 1;
  object-fit: cover;
  transition: transform .5s ease, filter .5s ease;
}
.showcase-item:hover .gallery-image {
  transform: scale(1.035);
  filter: saturate(1.05) contrast(1.04);
}
.showcase-item span:not(.gallery-backdrop) {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.90);
  color: var(--green-2);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(23,34,43,.15);
}
.gallery-command-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 18px 54px rgba(23,34,43,.07);
  backdrop-filter: blur(18px);
}
.gallery-search-label {
  display: grid;
  gap: 8px;
  color: var(--green-2);
  font-weight: 700;
}
.gallery-search-label input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px 16px;
  background: var(--ivory);
  color: var(--ink);
}
.gallery-sort-controls {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--sand);
}
.gallery-sort-controls button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: transparent;
  color: var(--green-2);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.gallery-sort-controls button.is-active {
  background: var(--white);
  box-shadow: 0 8px 20px rgba(23,34,43,.08);
}
.gallery-toolbar {
  position: sticky;
  top: 88px;
  z-index: 20;
  display: flex;
  gap: 10px;
  padding: 12px;
  margin-bottom: 26px;
  overflow-x: auto;
  background: rgba(251,250,245,.88);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(18px);
}
.gallery-toolbar::-webkit-scrollbar { height: 0; }
.gallery-toolbar button {
  border: 0;
  white-space: nowrap;
  border-radius: 999px;
  padding: 10px 16px;
  background: transparent;
  color: var(--green-2);
  cursor: pointer;
  font-weight: 700;
}
.gallery-toolbar button span {
  color: var(--muted);
  font-weight: 600;
}
.gallery-toolbar button.is-active {
  background: var(--green);
  color: var(--white);
}
.gallery-toolbar button.is-active span { color: rgba(255,255,255,.78); }
.gallery-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(23,34,43,.045);
}
.gallery-status strong {
  color: var(--green-2);
  font-size: 18px;
}
.gallery-status span {
  color: var(--muted);
  font-size: 14px;
}
.masonry-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.gallery-item {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 16px 38px rgba(23,34,43,.07);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.gallery-item[hidden] { display: none; }
.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 58px rgba(23,34,43,.10);
  border-color: rgba(214, 167, 44, .42);
}
.gallery-media-link {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #e8e1d2;
  isolation: isolate;
}
.gallery-item:nth-child(5n) .gallery-media-link { aspect-ratio: 3 / 4; }
.gallery-backdrop {
  position: absolute;
  inset: -16px;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(214,167,44,.24), transparent 34%),
    linear-gradient(135deg, rgba(15,95,76,.10), rgba(244,239,228,.84));
  filter: blur(10px) saturate(1.04);
  opacity: .72;
  transform: scale(1.08);
}
.gallery-media-link .gallery-image {
  position: relative;
  z-index: 1;
  object-fit: contain;
  transition: transform .35s ease, filter .35s ease;
}
.gallery-media-link:hover .gallery-image {
  transform: scale(1.018);
  filter: saturate(1.05) contrast(1.03);
}
.gallery-card-top {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  left: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.gallery-card-top span {
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.52);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255,255,255,.88);
  color: var(--green-2);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(23,34,43,.12);
  backdrop-filter: blur(14px);
}
.gallery-item[data-gallery-quality="archive"] .gallery-card-top span:last-child {
  background: rgba(244,239,228,.92);
  color: var(--gold-text);
}
.gallery-item figcaption {
  display: grid;
  gap: 6px;
  padding: 12px 14px 14px;
}
.gallery-item figcaption strong {
  min-height: 46px;
  color: var(--green-2);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 700;
}
.gallery-item figcaption small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.gallery-empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  background: var(--sand);
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}
.gallery-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}
.gallery-more {
  min-width: min(280px, 100%);
}
.gallery-more[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  place-items: center;
  padding: 28px;
  background: rgba(7, 14, 14, .90);
  backdrop-filter: blur(20px);
}
.lightbox.is-open { display: grid; }
.lightbox-panel {
  display: grid;
  gap: 12px;
  margin: 0;
  max-width: min(1120px, 94vw);
}
.lightbox img {
  max-width: min(1100px, 94vw);
  max-height: 84vh;
  border-radius: 18px;
  box-shadow: 0 40px 110px rgba(0,0,0,.42);
  background: var(--sand);
  object-fit: contain;
}
.lightbox figcaption {
  color: rgba(255,255,255,.86);
  text-align: center;
  font-size: 15px;
}
.lightbox-close {
  position: fixed;
  top: 18px;
  left: 18px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-step {
  position: fixed;
  top: 50%;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.88);
  color: var(--green-2);
  cursor: pointer;
  font-size: 34px;
  line-height: 1;
  box-shadow: 0 20px 50px rgba(0,0,0,.22);
}
.lightbox-prev { right: 22px; }
.lightbox-next { left: 22px; }

.site-footer { background: #122620; color: rgba(255,255,255,.82); padding: 52px 0 84px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.site-footer h2 { color: var(--white); margin-top: 0; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { color: var(--white); }
.footer-cta { display: inline-block; margin-top: 10px; color: var(--gold); font-weight: 700; }
.mobile-actions {
  position: fixed;
  right: 0;
  left: 0;
  bottom: 0;
  z-index: 90;
  display: none;
  background: var(--white);
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(5, 1fr);
}
.mobile-actions a { text-align: center; padding: 10px 4px; font-size: 13px; color: var(--green-2); }
.reveal { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 1024px) {
  .header-inner { grid-template-columns: auto auto; }
  .nav-toggle { display: block; justify-self: end; }
  .primary-nav, .header-search { grid-column: 1 / -1; display: none; }
  .primary-nav.is-open, .header-search.is-open { display: block; }
  .primary-nav ul { display: grid; gap: 2px; }
  .primary-nav .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    border-right: 2px solid var(--gold);
    border-radius: 0;
    margin: 0 14px 8px 0;
    padding: 4px 8px;
    background: transparent;
  }
  .header-search { padding-bottom: 14px; }
  .header-search input { width: 100%; }
  .hero-grid, .form-layout, .article-layout { grid-template-columns: 1fr; }
  .hero-grid { min-height: auto; }
  .finder-panel,
  .visual-story-inner { grid-template-columns: 1fr; }
  .finder-grid { grid-template-columns: repeat(2, 1fr); }
  .curated-media-inner { grid-template-columns: 1fr; }
  .curated-media-grid { grid-template-columns: repeat(2, 1fr); }
  .curated-media-item.is-featured { grid-column: 1 / -1; grid-row: span 1; }
  .timeline, .feature-grid, .card-grid, .region-grid { grid-template-columns: repeat(2, 1fr); }
  .article-side { position: static; }
  .gallery-hero-grid,
  .gallery-command-panel { grid-template-columns: 1fr; }
  .gallery-showcase { grid-template-columns: repeat(2, 1fr); }
  .showcase-item.is-primary { grid-column: 1 / -1; grid-row: span 1; }
}

@media (max-width: 680px) {
  body { font-size: 16px; padding-bottom: 60px; }
  .container { width: min(100% - 24px, 1160px); }
  .site-header { background: rgba(251, 250, 245, .92); }
  .header-inner { min-height: 62px; gap: 10px; }
  .brand { gap: 8px; }
  .brand-text { font-size: 12px; max-width: 110px; }
  .primary-nav.is-open,
  .header-search.is-open {
    position: fixed;
    right: 12px;
    left: 12px;
    background: rgba(251,250,245,.96);
    border: 1px solid var(--line);
    box-shadow: 0 30px 80px rgba(23,34,43,.18);
    backdrop-filter: blur(24px);
  }
  .primary-nav.is-open {
    top: 72px;
    max-height: calc(100svh - 150px);
    overflow-y: auto;
    overflow-x: clip;
    border-radius: 24px 24px 10px 10px;
    padding: 12px;
  }
  .header-search.is-open {
    top: auto;
    bottom: 66px;
    border-radius: 18px;
    padding: 12px;
  }
  .primary-nav a {
    padding: 13px 14px;
    font-size: 16px;
  }
  .hero { padding: 32px 0 28px; min-height: auto; }
  .hero h1 { font-size: clamp(38px, 11vw, 52px); text-align: right; }
  .hero p { font-size: 18px; }
  .hero-actions, .split, .section-head.inline, .filter-bar form { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; text-align: center; }
  .hero-panel, .hero-panel img, .hero-archive-mark { min-height: 330px; height: 330px; border-radius: 24px; }
  .hero-feature { inset-inline: 14px; bottom: 14px; padding: 14px; }
  .amej-finder { padding: 24px 0; }
  .finder-panel {
    padding: 14px;
    border-radius: 22px;
  }
  .finder-copy h2,
  .curated-media-copy h2 {
    font-size: 28px;
  }
  .finder-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 2px;
  }
  .finder-grid a {
    flex: 0 0 78%;
    min-height: 134px;
    scroll-snap-align: start;
    border-radius: 18px;
  }
  .curated-media { padding: 42px 0; }
  .curated-media-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
  }
  .curated-media-item,
  .curated-media-item.is-featured {
    flex: 0 0 78%;
    height: 230px;
    min-height: 230px;
    scroll-snap-align: start;
    border-radius: 18px;
  }
  .visual-story { padding: 38px 0; }
  .visual-rail {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
  }
  .visual-tile {
    flex: 0 0 72%;
    height: 220px;
    scroll-snap-align: start;
  }
  .visual-tile.is-tall { height: 260px; }
  .timeline, .feature-grid, .card-grid, .region-grid, .footer-grid, .amej-form { grid-template-columns: 1fr; }
  .content-card, .feature-card, .timeline article, .branch-card, .contact-panel { border-radius: 18px; }
  .card-media { aspect-ratio: 1 / 1; }
  .section { padding: 46px 0; }
  .page-hero, .article-hero { padding: 42px 0; }
  .page-hero h1, .article-hero h1 { font-size: clamp(32px, 10vw, 46px); }
  .article-content { font-size: 18px; }
  .mobile-actions { display: grid; }
  .mobile-actions a { min-height: 54px; display: grid; place-items: center; font-weight: 700; }
  .brand-mark { width: 48px; height: 48px; }
  .gallery-hero { padding: 38px 0; }
  .gallery-hero-metrics {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }
  .gallery-hero-metrics span { min-height: auto; }
  .gallery-showcase {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 132px;
    gap: 8px;
    padding: 8px;
    border-radius: 22px;
  }
  .showcase-item { border-radius: 16px; }
  .showcase-item.is-primary { grid-column: 1 / -1; min-height: 220px; }
  .gallery-command-panel {
    padding: 12px;
    border-radius: 20px;
  }
  .gallery-sort-controls {
    overflow-x: auto;
    border-radius: 18px;
  }
  .gallery-sort-controls button {
    flex: 0 0 auto;
    padding-inline: 13px;
  }
  .gallery-toolbar {
    top: 70px;
    margin-inline: -2px;
    border-radius: 18px;
  }
  .gallery-status {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
  }
  .masonry-gallery { grid-template-columns: 1fr; gap: 14px; }
  .gallery-item { border-radius: 18px; }
  .gallery-media-link,
  .gallery-item:nth-child(5n) .gallery-media-link { aspect-ratio: 4 / 3; }
  .gallery-card-top { top: 8px; right: 8px; left: 8px; }
  .gallery-card-top span { max-width: 58%; font-size: 11px; }
  .lightbox { padding: 16px; }
  .lightbox-step {
    top: auto;
    bottom: 20px;
    width: 44px;
    height: 44px;
  }
  .lightbox-prev { right: 18px; }
  .lightbox-next { left: 18px; }
}

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

body.amej-lang-fr,
body.amej-lang-en {
  direction: ltr;
  font-family: "IBM Plex Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.utility-bar {
  border-bottom: 1px solid rgba(222,216,202,.76);
  background: rgba(255,255,255,.72);
}
.utility-inner {
  min-height: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
}
.utility-inner nav,
.language-switcher {
  display: flex;
  align-items: center;
  gap: 12px;
}
.language-switcher a {
  min-width: 34px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-align: center;
  font-weight: 800;
  color: var(--green-2);
}
.language-switcher a.is-active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}
.amej-mega-menu > .has-mega > a::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-start: 7px;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.mega-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  z-index: 10;
  width: min(620px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 26px 80px rgba(23,34,43,.15);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.mega-panel.compact { width: min(330px, calc(100vw - 40px)); grid-template-columns: 1fr; }
.has-mega:hover .mega-panel,
.has-mega:focus-within .mega-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.mega-panel section {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: #fbfaf5;
  border-radius: 8px;
}
.mega-panel h3 {
  margin: 0 0 6px;
  color: var(--gold-text);
  font-size: 13px;
}
.mega-panel a {
  border-radius: 6px;
  padding: 9px 10px;
  background: transparent;
}

.ofaj-hero {
  background:
    linear-gradient(120deg, rgba(12,80,66,.97), rgba(13,118,108,.92)),
    radial-gradient(circle at 18% 18%, rgba(214,167,44,.32), transparent 28%);
  color: var(--white);
  padding: 82px 0 56px;
  overflow: hidden;
}
.ofaj-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(320px, 1.05fr);
  gap: 48px;
  align-items: center;
  min-height: 590px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-text);
  font-size: 14px;
  font-weight: 900;
}
.ofaj-hero .eyebrow { color: #f4d77a; }
.ofaj-hero h1 {
  margin: 12px 0 18px;
  font-size: clamp(48px, 7vw, 78px);
  line-height: 1.04;
  letter-spacing: 0;
}
.ofaj-hero p {
  max-width: 680px;
  margin: 0;
  color: rgba(255,255,255,.88);
  font-size: 21px;
}
.ofaj-visual-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 110px;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
  background: rgba(255,255,255,.13);
  box-shadow: 0 34px 90px rgba(0,0,0,.22);
}
.ofaj-visual-tile {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--sand);
}
.ofaj-visual-tile.is-large {
  grid-column: span 4;
  grid-row: span 3;
}
.ofaj-visual-tile:not(.is-large) {
  grid-column: span 2;
  grid-row: span 1;
}
.ofaj-visual-tile img { width: 100%; height: 100%; object-fit: cover; }

.program-finder {
  padding: 44px 0;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.finder-title-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 22px;
}
.finder-title-row h2,
.featured-program h2 {
  margin: 4px 0 8px;
  color: var(--green-2);
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.12;
}
.finder-title-row p,
.featured-program p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}
.ofaj-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.ofaj-filter {
  display: grid;
  gap: 18px;
  min-height: 148px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf5;
  box-shadow: 0 18px 48px rgba(23,34,43,.06);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.ofaj-filter:hover,
.ofaj-filter:focus {
  transform: translateY(-2px);
  border-color: rgba(214,167,44,.62);
  box-shadow: 0 24px 64px rgba(23,34,43,.12);
  outline: none;
}
.ofaj-filter span { color: var(--gold-text); font-size: 13px; font-weight: 900; }
.ofaj-filter strong { color: var(--green-2); font-size: 22px; line-height: 1.28; }

.featured-program {
  padding: 70px 0;
  background: #f6f2e9;
  border-bottom: 1px solid var(--line);
}
.featured-program-grid {
  display: grid;
  grid-template-columns: minmax(280px, .74fr) minmax(0, 1.26fr);
  gap: 34px;
  align-items: center;
}
.featured-program-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.featured-program-cards .content-card {
  min-height: 100%;
}

body.amej-lang-fr .primary-nav .sub-menu,
body.amej-lang-en .primary-nav .sub-menu {
  right: auto;
  left: 0;
}
body.amej-lang-fr .search-suggestions,
body.amej-lang-en .search-suggestions {
  right: auto;
  left: 0;
}

@media (max-width: 1024px) {
  .utility-inner { flex-wrap: wrap; padding: 8px 0; }
  .mega-panel {
    position: static;
    width: 100%;
    max-width: 100%;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    margin: 4px 0 10px;
  }
  .has-mega:not(.is-expanded) .mega-panel {
    display: none;
  }
  .has-mega.is-expanded .mega-panel {
    display: grid;
  }
  .ofaj-hero-grid,
  .featured-program-grid { grid-template-columns: 1fr; }
  .ofaj-filter-grid,
  .featured-program-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .utility-bar { display: none; }
  .ofaj-hero {
    padding: 34px 0 36px;
  }
  .ofaj-hero-grid {
    min-height: auto;
    gap: 26px;
  }
  .ofaj-hero h1 {
    font-size: clamp(38px, 12vw, 54px);
  }
  .ofaj-hero p {
    font-size: 18px;
  }
  .ofaj-visual-board {
    grid-auto-rows: 92px;
  }
  .ofaj-visual-tile.is-large {
    grid-column: 1 / -1;
    grid-row: span 2;
  }
  .ofaj-visual-tile:not(.is-large) {
    grid-column: span 3;
  }
  .finder-title-row,
  .featured-program-grid {
    align-items: stretch;
  }
  .ofaj-filter-grid,
  .featured-program-cards {
    grid-template-columns: 1fr;
  }
  .ofaj-filter {
    min-height: 112px;
  }
  .mega-panel {
    grid-template-columns: 1fr;
  }
}

/* AMEJ 1.2: OFAJ-inspired structure with cleaner premium spacing and sharper mobile behavior. */
.site-header {
  background: rgba(251,250,245,.92);
}
.brand-mark,
.content-card,
.feature-card,
.timeline article,
.branch-card,
.contact-panel,
.gallery-item,
.ofaj-filter,
.mega-panel,
.ofaj-visual-board,
.curated-media-item {
  border-radius: 8px;
}
.utility-bar {
  background: #102c25;
  color: rgba(255,255,255,.82);
}
.utility-bar a:hover,
.utility-bar a:focus {
  color: #fff;
}
.language-switcher a {
  min-width: 42px;
  text-align: center;
}
.language-switcher a.is-active {
  background: #fff;
  color: #102c25;
}
.ofaj-hero {
  color: var(--ink);
  background:
    linear-gradient(180deg, #fbfaf5 0%, #f5efe3 100%);
  border-bottom: 1px solid var(--line);
}
.ofaj-hero-grid {
  min-height: 620px;
}
.ofaj-hero .eyebrow {
  color: var(--gold-text);
}
.ofaj-hero h1 {
  max-width: 920px;
  color: #102c25;
  font-size: clamp(42px, 5.4vw, 66px);
}
.ofaj-hero p {
  color: var(--muted);
}
.ofaj-hero .btn.ghost {
  color: var(--green-2);
  border-color: rgba(15,95,76,.24);
}
.ofaj-visual-board {
  background: #fff;
  border: 1px solid rgba(222,216,202,.9);
  box-shadow: 0 34px 90px rgba(23,34,43,.13);
}
.ofaj-visual-tile {
  border-radius: 6px;
}
.ofaj-visual-tile::after,
.curated-media-item::after,
.gallery-media-link::after {
  background: linear-gradient(180deg, transparent 46%, rgba(0,0,0,.36));
}
.program-finder {
  position: relative;
  margin-top: -22px;
  background: transparent;
  border-bottom: 0;
  padding: 0 0 54px;
}
.program-finder .container {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(23,34,43,.09);
  padding: 24px;
}
.ofaj-filter {
  background: #fff;
}
.featured-program {
  background: #f4efe4;
}
.featured-program-cards .content-card {
  background: #fff;
}
.form-success {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(15,95,76,.22);
  border-radius: 8px;
  background: rgba(15,95,76,.08);
  color: var(--green-2);
  font-weight: 800;
}
body.amej-lang-fr,
body.amej-lang-en {
  direction: ltr;
}
body.amej-lang-fr .mobile-actions,
body.amej-lang-en .mobile-actions {
  direction: ltr;
}
body.amej-lang-fr .lightbox-prev,
body.amej-lang-en .lightbox-prev { left: 22px; right: auto; }
body.amej-lang-fr .lightbox-next,
body.amej-lang-en .lightbox-next { right: 22px; left: auto; }

@media (max-width: 1024px) {
  .program-finder {
    margin-top: 0;
    padding-top: 18px;
  }
  .program-finder .container {
    padding: 18px;
  }
  .amej-mega-menu {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .ofaj-hero {
    padding: 30px 0 28px;
  }
  .ofaj-hero h1 {
    font-size: clamp(30px, 9.5vw, 42px);
    line-height: 1.08;
  }
  .ofaj-hero p {
    font-size: 17px;
  }
  .program-finder .container {
    width: min(100% - 24px, 1160px);
    padding: 14px;
  }
  .finder-title-row {
    display: grid;
  }
  .ofaj-filter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ofaj-filter {
    min-height: 96px;
  }
  .featured-program {
    padding: 46px 0;
  }
  .featured-program-cards {
    display: grid;
    grid-template-columns: 1fr;
  }
  .ofaj-visual-board {
    grid-auto-rows: 86px;
    gap: 8px;
    padding: 8px;
  }
  .ofaj-visual-tile.is-large {
    grid-row: span 2;
  }
  .mobile-actions a {
    font-size: 12px;
    line-height: 1.25;
  }
  body.amej-lang-fr .lightbox-prev,
  body.amej-lang-en .lightbox-prev { left: 18px; right: auto; }
  body.amej-lang-fr .lightbox-next,
  body.amej-lang-en .lightbox-next { right: 18px; left: auto; }
}
