:root {
  --blue: #07558d;
  --blue-dark: #063b68;
  --blue-soft: #eaf5fb;
  --gold: #e6a916;
  --gold-light: #ffe174;
  --ink: #303943;
  --muted: #66717a;
  --paper: #fffefa;
  --line: #e7dcc2;
  --shadow: 0 18px 50px rgba(12, 52, 82, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: #f3f6f7;
  background-image: url("/al-amarah/img_index/background.jpg");
  background-position: top center;
  background-repeat: repeat-x;
  font-family: Tahoma, Arial, sans-serif;
  line-height: 1.9;
}

img { max-width: 100%; }
a { color: var(--blue); }

.skip-link {
  position: fixed;
  z-index: 100;
  inset: .5rem auto auto .5rem;
  padding: .65rem 1rem;
  color: #fff;
  background: var(--blue-dark);
  border-radius: .4rem;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.site-header,
.page-shell,
.site-footer {
  width: min(100% - 1.5rem, 800px);
  margin-inline: auto;
}

.site-header { padding-top: .6rem; }

.family-return {
  display: flex;
  justify-content: flex-start;
  margin-bottom: .55rem;
}

.family-return a {
  display: inline-flex;
  align-items: center;
  min-height: 2.45rem;
  padding: .45rem .9rem;
  color: var(--blue-dark);
  background: var(--gold-light);
  border: 1px solid rgba(6, 59, 104, .22);
  border-radius: 999px;
  box-shadow: 0 5px 16px rgba(5, 58, 101, .16);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
}

.family-return a::before {
  content: "←";
  margin-left: .45rem;
  font-size: 1rem;
}

.family-return a:hover,
.family-return a:focus-visible {
  color: #fff;
  background: var(--blue-dark);
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.brand {
  display: block;
  overflow: hidden;
  background: #fff;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 8px 24px rgba(5, 58, 101, .18);
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

.primary-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .25rem;
  margin: .85rem auto 0;
  padding: .4rem;
  background: var(--blue-dark);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: .65rem;
  box-shadow: 0 10px 26px rgba(5, 58, 101, .14);
}

.primary-nav a {
  padding: .45rem .75rem;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: .4rem;
  transition: color .18s ease, background-color .18s ease;
}

.primary-nav a:hover,
.primary-nav a:focus-visible,
.primary-nav a.active {
  color: #102d43;
  background: var(--gold-light);
  outline: none;
}

.menu-button { display: none; }

.page-shell {
  margin-top: 1.2rem;
  padding: clamp(1.1rem, 4vw, 2.25rem);
  background: var(--paper);
  border: 1px solid rgba(222, 204, 166, .75);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.page-shell p {
  margin: 0 0 1rem;
  color: var(--muted);
  text-align: justify;
}

.section-art {
  display: block;
  width: auto;
  max-height: 100px;
  margin: 0 0 1.1rem auto;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 350px);
  align-items: start;
  gap: 1.75rem;
}

.intro-photo,
.story-photo,
.map-image {
  display: block;
  width: 100%;
  border: 8px solid #fff;
  border-radius: .7rem;
  box-shadow: 0 8px 24px rgba(21, 58, 82, .18);
}

.credits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
  padding: 1.1rem 1.4rem;
  background: linear-gradient(135deg, var(--blue-soft), #fff9e4);
  border-right: 4px solid var(--gold);
  border-radius: .7rem;
}

.credits h2 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 1.05rem;
}

.credits ul {
  margin: 0;
  padding-right: 1.2rem;
  font-weight: 700;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--line);
}

.page-heading h1 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.page-heading .section-art { margin: 0; }

.story-section + .story-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.story-section h2 {
  margin: 0 0 .75rem;
  color: var(--blue-dark);
  font-size: 1.25rem;
}

.story-photo {
  float: left;
  width: min(42%, 320px);
  margin: .3rem 1.25rem 1rem 0;
}

.signature {
  margin-top: 1.5rem;
  padding: .8rem 1rem;
  background: var(--blue-soft);
  border-radius: .5rem;
}

.signature p { margin: 0; }

.map-image {
  max-width: 720px;
  margin: 1.5rem auto 0;
}

.gallery-intro { margin-bottom: 1.5rem; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}

.gallery-item {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #e9eef1;
  border: 4px solid #fff;
  border-radius: .55rem;
  box-shadow: 0 5px 14px rgba(19, 52, 75, .16);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease, filter .25s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.045);
  filter: saturate(1.08);
}

.gallery-group + .gallery-group {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.gallery-group h2 {
  margin: 0 0 1rem;
  color: var(--blue-dark);
  font-size: 1.2rem;
}

.lightbox {
  width: min(95vw, 1100px);
  max-width: none;
  padding: 0;
  background: transparent;
  border: 0;
}

.lightbox::backdrop { background: rgba(2, 18, 29, .9); }

.lightbox figure {
  display: grid;
  place-items: center;
  min-height: 80vh;
  margin: 0;
}

.lightbox img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: .35rem;
  box-shadow: 0 20px 70px #000;
}

.lightbox button {
  position: fixed;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  color: #fff;
  background: rgba(6, 59, 104, .88);
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 50%;
  font: 700 1.4rem/1 Tahoma, Arial, sans-serif;
  cursor: pointer;
}

.lightbox-close { inset: 1rem 1rem auto auto; }
.lightbox-prev { inset: 50% auto auto 1rem; }
.lightbox-next { inset: 50% 1rem auto auto; }

.site-footer {
  padding: 1.5rem 1rem 2rem;
  color: #5e6d77;
  font-size: .78rem;
  text-align: center;
}

.site-footer p { margin: 0; }

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

@media (max-width: 700px) {
  .site-header,
  .page-shell,
  .site-footer { width: min(100% - 1rem, 800px); }

  .site-header { position: relative; }

  .menu-button {
    display: block;
    width: 100%;
    margin-top: .65rem;
    padding: .7rem 1rem;
    color: #fff;
    background: var(--blue-dark);
    border: 0;
    border-radius: .55rem;
    font: 700 .9rem Tahoma, Arial, sans-serif;
  }

  .primary-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    margin-top: .35rem;
  }

  .primary-nav.open { display: flex; }
  .primary-nav a { text-align: center; }
  .intro-grid { grid-template-columns: 1fr; }
  .intro-photo { grid-row: 1; }
  .credits { grid-template-columns: 1fr; }
  .page-heading { align-items: center; }
  .story-photo { width: min(48%, 260px); }
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  body { line-height: 1.8; }
  .page-shell { padding: 1rem; }
  .page-shell p { text-align: start; }
  .page-heading { display: block; }
  .page-heading .section-art { margin: .75rem 0 0 auto; }
  .story-photo {
    float: none;
    width: 100%;
    margin: 0 0 1rem;
  }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lightbox-prev { inset-inline: .35rem auto; }
  .lightbox-next { inset-inline: auto .35rem; }
}

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