:root {
  --navy: #071827;
  --navy-soft: #0d2a40;
  --gold: #d2aa58;
  --gold-light: #f1d28f;
  --paper: #f6f1e8;
  --ink: #102438;
  --muted: #627080;
  --white: #fff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(210,170,88,.13), transparent 25rem),
    linear-gradient(180deg, #edf1f3 0, var(--paper) 30rem);
  font-family: "Cairo", sans-serif;
}

body.viewer-open { overflow: hidden; }

.egyptian-line {
  height: 5px;
  background: linear-gradient(90deg, #ce1126 0 33.33%, #fff 33.33% 66.66%, #151515 66.66%);
}

.album-header {
  width: min(1500px, calc(100% - 36px));
  min-height: 92px;
  margin: 20px auto 0;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  color: white;
  border: 1px solid rgba(210,170,88,.42);
  background: rgba(7,24,39,.96);
  box-shadow: 0 18px 50px rgba(7,24,39,.17);
}

.identity, .header-actions a {
  color: inherit;
  text-decoration: none;
}

.identity {
  display: inline-flex;
  align-items: center;
  gap: 13px;
}

.identity-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-light);
  font-size: 25px;
}

.identity strong, .identity small { display: block; }
.identity strong { font-size: 19px; }
.identity small { margin-top: 2px; color: var(--gold-light); font-size: 12px; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions a {
  padding: 12px 18px;
  border: 1px solid rgba(255,255,255,.17);
  transition: .25s ease;
}
.header-actions a:hover { color: var(--navy); background: var(--gold-light); border-color: var(--gold-light); }
.header-actions .home-link { color: var(--navy); background: var(--gold-light); border-color: var(--gold-light); font-weight: 800; }

.album-page {
  width: min(1320px, calc(100% - 36px));
  margin: 42px auto 80px;
}

.album-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 5vw, 70px);
  color: white;
  background:
    linear-gradient(120deg, rgba(7,24,39,.98), rgba(13,42,64,.93)),
    repeating-linear-gradient(45deg, transparent 0 20px, rgba(210,170,88,.05) 20px 21px);
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 26px 60px rgba(7,24,39,.2);
}

.album-hero::after {
  content: "مجلس النواب";
  position: absolute;
  left: -15px;
  bottom: -32px;
  color: rgba(255,255,255,.035);
  font-family: "Reem Kufi", sans-serif;
  font-size: clamp(70px, 11vw, 170px);
  white-space: nowrap;
}

.album-meta, .album-title, .album-description, .album-source { position: relative; z-index: 1; }
.album-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.album-meta span {
  padding: 7px 12px;
  color: var(--gold-light);
  border: 1px solid rgba(210,170,88,.43);
  background: rgba(210,170,88,.08);
  font-size: 13px;
}

.album-title {
  max-width: 1000px;
  margin: 0;
  font-family: "Reem Kufi", "Cairo", sans-serif;
  font-size: clamp(30px, 5vw, 61px);
  line-height: 1.35;
}

.album-description {
  max-width: 1050px;
  margin: 24px 0 0;
  color: #e5ebef;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 2.05;
  white-space: pre-line;
}

.album-source {
  display: inline-flex;
  margin-top: 25px;
  color: var(--gold-light);
  text-underline-offset: 5px;
}

.gallery-heading {
  margin: 48px 0 20px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}
.gallery-heading h2 { margin: 0; font-size: clamp(25px, 3vw, 38px); }
.gallery-heading span { color: var(--muted); }

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.media-card {
  min-height: 280px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
  border: 1px solid rgba(16,36,56,.15);
  background: #fff;
  box-shadow: 0 13px 32px rgba(7,24,39,.09);
}

button.media-card { width: 100%; cursor: zoom-in; font: inherit; }
.media-card img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  display: block;
  object-fit: contain;
  background: #eef0f1;
  transition: transform .35s ease;
}
.media-card:hover img { transform: scale(1.025); }
.media-card video {
  width: 100%;
  max-height: 560px;
  display: block;
  background: #02070b;
}
.media-card .zoom-hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 7px 10px;
  color: #fff;
  background: rgba(7,24,39,.83);
  font-size: 12px;
}

.loading-state, .error-state {
  min-height: 430px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}
.loading-seal { font-size: 50px; animation: pulse 1.25s ease-in-out infinite; }
.error-state a { color: #8f6415; font-weight: 800; }
@keyframes pulse { 50% { transform: scale(1.1); opacity: .65; } }

.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  grid-template-rows: 72px 1fr;
  color: white;
  background: rgba(1,8,14,.97);
}

.lightbox-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(210,170,88,.25);
}
.lightbox button {
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  background: rgba(255,255,255,.06);
  cursor: pointer;
}
.lightbox-toolbar button {
  min-width: 48px;
  height: 44px;
  padding: 0 12px;
  font-size: 18px;
}
.zoom-actions { display: flex; gap: 7px; direction: ltr; }
.lightbox-stage {
  grid-column: 2;
  grid-row: 2;
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: grab;
  touch-action: none;
}
.lightbox-stage.dragging { cursor: grabbing; }
.lightbox-stage img {
  max-width: 92%;
  max-height: calc(100vh - 100px);
  user-select: none;
  will-change: transform;
  transform-origin: center;
}
.lightbox-arrow {
  grid-row: 2;
  margin: 20px 7px;
  font-size: 42px;
}
.lightbox-arrow.next { grid-column: 1; }
.lightbox-arrow.previous { grid-column: 3; }
.lightbox button:hover { color: var(--navy); background: var(--gold-light); border-color: var(--gold-light); }

@media (max-width: 700px) {
  .album-header { width: 100%; margin-top: 0; min-height: auto; padding: 12px; }
  .identity-mark { width: 44px; height: 44px; font-size: 19px; }
  .identity strong { font-size: 14px; }
  .identity small { font-size: 10px; }
  .header-actions a { padding: 9px; font-size: 11px; }
  .album-page { width: calc(100% - 20px); margin-top: 20px; }
  .album-hero { padding: 28px 20px; }
  .album-grid { grid-template-columns: 1fr; }
  .gallery-heading { align-items: start; flex-direction: column; }
  .lightbox { grid-template-columns: 48px 1fr 48px; grid-template-rows: 118px 1fr; }
  .lightbox-toolbar { flex-wrap: wrap; }
  .zoom-actions { order: 3; width: 100%; justify-content: center; }
  .lightbox-arrow { margin: 8px 2px; font-size: 31px; }
}
