/* ─────────────────────────────────────────────────────────────────────────────
   أسماء الله الحسنى — Styles
   ───────────────────────────────────────────────────────────────────────────── */

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

:root {
  --gd:    #1a4731;
  --gm:    #2d6a4f;
  --cream: #f5f0e8;
  --gold:  #c9a84c;
  --goldl: #e8c97a;
  --sh:    0 8px 40px rgba(0,0,0,0.18);
}

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  font-family: 'Amiri', serif;
  color: #1a1a1a;
  min-height: 100vh;
}

/* ── Header ── */
header {
  background: var(--gd);
  color: var(--cream);
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(201,168,76,.18) 0%, transparent 70%);
  pointer-events: none;
}

header img {
  position: relative;
}

header h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--goldl);
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
  position: relative;
}

header p {
  font-size: clamp(.95rem, 2.5vw, 1.2rem);
  color: rgba(245,240,232,.75);
  margin-top: .5rem;
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  letter-spacing: .08em;
  position: relative;
}

.gold-line {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 1rem auto 0;
}

/* ── Gallery ── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
  padding: 2rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 480px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
    padding: 1rem .75rem;
  }
}

/* ── Card with image ── */
.card {
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,.12);
  transition: transform .25s ease, box-shadow .25s ease;
  background: var(--gd);
  position: relative;
}

.card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 36px rgba(0,0,0,.22);
}

.card:hover .overlay { opacity: 1; }

.card:hover img { filter: brightness(.85); }

.card img {
  width: 100%;
  height: auto;
  display: block;
  transition: filter .25s ease;
}

.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,71,49,.85) 0%, transparent 55%);
  opacity: 0;
  transition: opacity .25s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}

.overlay span {
  color: var(--goldl);
  font-size: 1.5rem;
  font-family: 'Amiri', serif;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}

/* ── Placeholder card (no image yet) ── */
.card-ph {
  cursor: pointer;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,.12);
  transition: transform .25s ease, box-shadow .25s ease;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  gap: .5rem;
  background: linear-gradient(135deg, var(--gd), var(--gm));
  border: 1.5px dashed rgba(201,168,76,.28);
  position: relative;
}

.card-ph:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 36px rgba(0,0,0,.22);
}

.card-ph .ph-name {
  color: var(--goldl);
  font-size: 1.85rem;
  font-family: 'Amiri', serif;
  text-align: center;
}

.card-ph .ph-tr {
  color: rgba(245,240,232,.42);
  font-size: .76rem;
  font-family: 'Lato', sans-serif;
  font-style: italic;
  text-align: center;
}

.card-ph .ph-badge {
  position: absolute;
  top: .5rem;
  right: .5rem;
  background: rgba(201,168,76,.12);
  border: 1px solid rgba(201,168,76,.28);
  color: rgba(201,168,76,.55);
  font-size: .63rem;
  font-family: 'Lato', sans-serif;
  padding: .14rem .42rem;
  border-radius: 20px;
  letter-spacing: .05em;
}

/* ── Lightbox ── */
#lb {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10,24,16,.93);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
  animation: fadeIn .22s ease;
}

#lb.on { display: block; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lb-inner {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1rem 3rem;
}

/* Close button */
.lb-x {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(201,168,76,.2);
  border: 1.5px solid var(--gold);
  color: var(--goldl);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  z-index: 1010;
}

.lb-x:hover { background: rgba(201,168,76,.4); }

/* Language tabs */
.lang-bar {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.ltab {
  padding: .35rem .9rem;
  border-radius: 20px;
  border: 1.5px solid rgba(201,168,76,.4);
  background: transparent;
  color: rgba(245,240,232,.6);
  font-family: 'Lato', sans-serif;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .04em;
}

.ltab:hover {
  border-color: var(--gold);
  color: var(--goldl);
}

.ltab.on {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--gd);
}

/* ── Navigation row (prev | image | next) ── */
.lb-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 720px;
  margin-top: .5rem;
}

/* #lbImg sits between the two nav buttons */
#lbImg {
  flex: 1;
  min-width: 0; /* prevents flex overflow */
}

/* Navigation arrow buttons */
.lb-nav {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(201,168,76,.15);
  border: 1.5px solid rgba(201,168,76,.45);
  color: var(--goldl);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .15s;
  align-self: center;
}

.lb-nav:hover {
  background: rgba(201,168,76,.35);
  transform: scale(1.1);
}

.lb-nav:active {
  transform: scale(.95);
}

@media (max-width: 480px) {
  .lb-nav {
    width: 36px;
    height: 36px;
    font-size: 1.6rem;
  }

  .lb-nav-row {
    gap: .5rem;
  }
}

/* Image with content */
.lb-imgw {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--sh);
  animation: up .3s ease;
}

.lb-imgw img { width: 100%; display: block; }

/* Image placeholder */
.lb-imgph {
  width: 100%;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--gd), var(--gm));
  border: 2px dashed rgba(201,168,76,.28);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  animation: up .3s ease;
}

.lb-imgph .ip-name {
  color: var(--goldl);
  font-size: 3rem;
  font-family: 'Amiri', serif;
}

.lb-imgph .ip-tr {
  color: rgba(245,240,232,.35);
  font-size: .78rem;
  font-family: 'Lato', sans-serif;
  font-style: italic;
}

.lb-imgph .ip-file {
  color: rgba(201,168,76,.38);
  font-size: .7rem;
  font-family: 'Lato', monospace;
  margin-top: .2rem;
}

@keyframes up {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Content card */
.lb-card {
  width: 100%;
  max-width: 540px;
  margin-top: 1.6rem;
  background: linear-gradient(135deg, var(--gd) 0%, var(--gm) 100%);
  border-radius: 16px;
  padding: 1.8rem 1.5rem;
  color: var(--cream);
  box-shadow: var(--sh);
  animation: up .32s .05s ease both;
}

.lb-name {
  font-size: clamp(2rem, 7vw, 3rem);
  color: var(--goldl);
  text-align: center;
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(0,0,0,.4);
}

.lb-div {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 auto 1.2rem;
}

/* Text panels */
.tx       { display: none; }
.tx.on    { display: block; }

.tx-ar {
  font-size: clamp(1rem, 2.8vw, 1.2rem);
  line-height: 2.1;
  text-align: justify;
  color: rgba(245,240,232,.93);
  direction: rtl;
}

.tx-fr,
.tx-en {
  font-size: clamp(.9rem, 2.4vw, 1.05rem);
  line-height: 1.85;
  text-align: justify;
  color: rgba(245,240,232,.93);
  font-family: 'Lato', sans-serif;
  direction: ltr;
}

/* Empty text placeholder */
.lb-empty {
  text-align: center;
  padding: 1.2rem;
  color: rgba(245,240,232,.22);
  font-family: 'Lato', sans-serif;
  font-size: .83rem;
  font-style: italic;
  letter-spacing: .05em;
  border: 1.5px dashed rgba(201,168,76,.2);
  border-radius: 10px;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--gd);
  color: rgba(245,240,232,.5);
  font-family: 'Lato', sans-serif;
  font-size: .85rem;
  letter-spacing: .06em;
}

footer span { color: var(--gold); }
