@import url("https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&display=swap");

:root {
  color-scheme: light;
  --paper: #faf6f0;
  --cream: #fffdf9;
  --ink: #322820;
  --muted: #6e625a;
  --rose: #e5c5bd;
  --sage: #3e5b4a;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.container { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.masthead {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 72px;
  padding: 14px 24px;
  background:
    linear-gradient(to bottom, #faf6f02e, #faf6f065 38%, var(--paper) 100%),
    linear-gradient(to right, #b9c8b5, #e3e7d9 50%, #e5c5bd);
  backdrop-filter: blur(18px);
}
.masthead img { width: 104px; height: auto; }
.hero {
  position: relative;
  width: min(1440px, calc(100% - clamp(16px, 4vw, 48px)));
  margin: clamp(10px, 2vw, 24px) auto 0;
  overflow: hidden;
  isolation: isolate;
  border-radius: clamp(18px, 3vw, 30px);
  background: #e8d7c6;
}
.hero img { width: 100%; height: auto; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: #faf6f04d;
  backdrop-filter: blur(5px);
  mask-image: radial-gradient(ellipse 69% 72% at center, transparent 76%, #000 100%);
}
.categories, .photo-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 24px; }
.categories { padding-block: 30px 42px; }
.category { display: block; text-decoration: none; text-align: center; background: var(--cream); border: 1px solid #e9d7cf; padding: 8px 8px 14px; }
.category:hover { border-color: #a7796c; }
.cover { background: #f2e7dc; aspect-ratio: 4 / 5; width: 100%; object-fit: contain; }
.category h2 { font-size: clamp(.95rem, 2vw, 1.2rem); line-height: 1.55; margin: 10px 2px 3px; }
.english { color: var(--muted); font-family: Georgia, serif; font-size: .94rem; margin: 0; }
footer { text-align: center; padding: 20px 20px 85px; border-top: 1px solid var(--rose); color: var(--muted); font-size: .88rem; }
footer span { display: block; margin-top: 4px; }
.contact { position: fixed; z-index: 2; inset-inline-end: 20px; bottom: max(18px, env(safe-area-inset-bottom)); padding: 11px 19px; background: var(--sage); color: white; text-decoration: none; font-weight: 650; border-radius: 999px; box-shadow: 0 3px 12px #251d1726; }
.gallery-page { padding-block: 26px 44px; }
.back { display: inline-block; color: var(--sage); text-underline-offset: 4px; }
.gallery-heading { text-align: center; padding: 8px 0 23px; }
.gallery-heading h1 { font-size: clamp(1.6rem, 5vw, 2.7rem); margin: 0 0 4px; }
.custom-message { background: #f3e5df; border-block: 1px solid var(--rose); width: fit-content; max-width: 100%; margin: 20px auto 0; padding: 10px 20px; line-height: 1.7; }
.photo-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.photo-group + .photo-group { border-top: 1px solid var(--rose); padding-top: 25px; margin-top: 34px; }
.photo-group h2 { margin: 0 0 4px; }
.photo-group .english { margin-bottom: 13px; text-align: right; }
.photo { display: block; border: 1px solid #e9d7cf; padding: 5px; width: 100%; aspect-ratio: 4 / 5; background: var(--cream); cursor: zoom-in; }
.photo img { width: 100%; height: 100%; object-fit: contain; }
#status { text-align: center; color: var(--muted); }
#status:empty { display: none; }
dialog { position: fixed; inset: 0; padding: 0; border: 0; background: #241c18; color: white; width: min(96vw, 1100px); max-width: none; max-height: none; }
dialog::backdrop { background: #221b17e8; }
body:has(dialog[open]) { overflow: hidden; }
.lightbox-content { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 52px 10px 8px; position: relative; }
.lightbox-content button { border: 1px solid #ffffff70; border-radius: 50%; background: #382d27; color: white; width: 42px; height: 42px; cursor: pointer; font-size: 1.35rem; }
.lightbox-content button:focus-visible { outline-color: white; }
.close { position: absolute; inset-inline-end: 10px; top: 5px; }
#large-photo { width: 100%; height: min(72vh, 72dvh); object-fit: contain; }
#photo-count { grid-column: 1 / -1; text-align: center; margin: 4px 0; }
@media (max-width: 700px) {
  .container { width: calc(100% - 24px); }
  .categories, .photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .categories { padding-top: 16px; }
  .masthead { padding: 12px; }
  .masthead img { width: 88px; }
  .category { padding: 5px 5px 10px; }
  .category .english { font-size: .8rem; }
  .contact { inset-inline-end: 12px; }
}

.shortcuts {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 5px 4px 9px;
  margin-block: 12px 18px;
  scrollbar-width: thin;
  scrollbar-color: #bfa499 transparent;
}
.shortcut {
  display: flex;
  flex: none;
  min-height: 44px;
  align-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: var(--rose);
  color: var(--ink);
  font-size: .9rem;
  font-weight: 650;
  text-decoration: none;
}
.shortcut:nth-child(even) { background: #dce5da; }
.shortcut:hover, .shortcut[aria-current="page"] { background: var(--sage); color: white; }
.shortcut span { padding-inline: 12px; }
.shortcut img { width: 43px; height: 44px; object-fit: cover; }
.shortcuts + .categories { padding-top: 0; }
.photo-grid {
  grid-auto-rows: 2px;
  gap: 0 14px;
  align-items: stretch;
}
.photo-grid .photo {
  aspect-ratio: auto;
  min-height: 0;
  margin-bottom: 12px;
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  padding: 0;
  background: #eee4db;
}
.photo-grid .photo img { object-fit: cover; }
@media (max-width: 700px) {
  .gallery-page { width: calc(100% - 16px); }
  .photo-grid { column-gap: 8px; }
  .photo-grid .photo { margin-bottom: 8px; border-radius: 18px; }
}

.masthead a {
  display: grid;
  place-items: center;
  padding: 5px;
  border-radius: 8px;
  mix-blend-mode: multiply;
}
.masthead img {
  filter: contrast(1.4) sepia(.55) hue-rotate(75deg) brightness(1.16);
}
.category h2,
.gallery-heading h1,
.photo-group h2,
.custom-message {
  font-family: "Amiri", "Traditional Arabic", serif;
}
.category h2 { font-size: clamp(1.2rem, 2.3vw, 1.5rem); line-height: 1.3; }
.custom-message { font-size: 1.2rem; }
.categories {
  grid-auto-rows: 2px;
  gap: 0 16px;
}
.category {
  align-self: start;
  padding: 0;
  margin-bottom: 16px;
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  background: var(--cream);
}
.category .cover {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.category:nth-child(4n + 2) .cover { aspect-ratio: 1; }
.category:nth-child(4n + 3) .cover { aspect-ratio: 3 / 4; }
.category:nth-child(4n + 4) .cover { aspect-ratio: 5 / 6; }
.category-caption {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 10px 8px 12px;
  background: color-mix(in srgb, var(--category-accent) 16%, var(--cream));
}
.category-caption::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -18px 8% 20%;
  border-radius: 50%;
  background: var(--category-accent);
  opacity: .36;
  filter: blur(23px);
}
.category h2 { margin: 0 0 3px; }
.category:hover .category-caption {
  background: color-mix(in srgb, var(--category-accent) 25%, var(--cream));
}
@media (max-width: 700px) {
  .categories { column-gap: 9px; }
  .category { margin-bottom: 9px; border-radius: 18px; }
}
