/* ==========================================================================
   Mariam Bakhsh — Design tokens & base styles
   Arabic-first: elegant Arabic type, English as a graceful secondary.
   ========================================================================== */

:root {
  --color-bg: #FBF3EC;          /* warm cream */
  --color-bg-soft: #F5E9DE;     /* slightly deeper cream for alt sections */
  --color-bg-accent: #E8D5C4;   /* blush / champagne */
  --color-text: #3D2B1F;        /* espresso */
  --color-text-muted: #6B5A4E;  /* softened brown */
  --color-line: #E2D2C2;        /* thin divider / border */
  --color-gold-start: #B8860B;  /* bronze */
  --color-gold-end: #E8C468;    /* gold */
  --color-white: #FFFFFF;

  --gold-gradient: linear-gradient(120deg, var(--color-gold-start), var(--color-gold-end));

  /* English faces */
  --font-heading: 'Cormorant Garamond', serif;
  --font-accent: 'Alex Brush', cursive;
  --font-body: 'Inter', sans-serif;
  /* Arabic faces */
  --font-heading-ar: 'El Messiri', serif;
  --font-accent-ar: 'Aref Ruqaa', serif;
  --font-body-ar: 'Tajawal', sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 7rem;

  --max-width: 1180px;
  --radius: 6px;
  --shadow-soft: 0 12px 40px rgba(61, 43, 31, 0.10);
  --transition: 0.35s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
input, textarea, select { font: inherit; }

html {
  scroll-behavior: smooth;
  color-scheme: light;              /* never let the phone auto-darken the page */
  -webkit-text-size-adjust: 100%;   /* stop iOS auto-resizing text */
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[dir="rtl"] body {
  font-family: var(--font-body-ar);
  line-height: 1.9;              /* Arabic breathes better with more leading */
}

/* Arabic must never be letter-spaced (it's cursive — spacing breaks joins). */
html[dir="rtl"] * { letter-spacing: normal !important; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin: 0 0 var(--space-sm);
  color: var(--color-text);
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4 {
  font-family: var(--font-heading-ar);
  font-weight: 600;
  line-height: 1.35;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.85rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.75rem); }

p {
  margin: 0 0 var(--space-sm);
  color: var(--color-text-muted);
}

/* Calligraphic accent line (taglines / pull quotes only) */
.accent-script {
  font-family: var(--font-accent);
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  color: var(--color-gold-start);
  font-weight: 400;
  line-height: 1.2;
}

html[dir="rtl"] .accent-script {
  font-family: var(--font-accent-ar);
  font-weight: 400;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section { padding: var(--space-xl) 0; }
.section-bg-accent { background: var(--color-bg-accent); }
.section-bg-soft { background: var(--color-bg-soft); }

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-lg);
}

.divider {
  width: 60px;
  height: 2px;
  background: var(--gold-gradient);
  border: none;
  margin: var(--space-sm) auto var(--space-md);
}

.divider-thin {
  border: none;
  border-top: 1px solid var(--color-line);
  margin: var(--space-lg) 0;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 0.9rem 2.4rem;
  border-radius: 2px;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: all var(--transition);
}

html[dir="rtl"] .btn {
  font-family: var(--font-body-ar);
  font-size: 1.05rem;
  font-weight: 500;
  text-transform: none;
}

.btn-primary {
  background: var(--gold-gradient);
  color: var(--color-white);
  box-shadow: 0 6px 18px rgba(184, 134, 11, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.07);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(184, 134, 11, 0.32);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-text);
  color: var(--color-text);
}

.btn-outline:hover {
  border-color: var(--color-gold-start);
  color: var(--color-gold-start);
}

/* Light outline for use over dark imagery */
.btn-light {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.85);
  color: var(--color-white);
  backdrop-filter: blur(2px);
}

.btn-light:hover {
  background: var(--color-white);
  color: var(--color-text);
}

/* ---- Header / Nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 243, 236, 0.90);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-line);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem var(--space-md);
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo { display: inline-block; line-height: 0; }

.logo img {
  height: 46px;
  width: auto;
  display: block;
  border-radius: 4px;
}

.site-footer .logo img {
  height: 72px;
  margin: 0 auto;
}

.nav-links {
  display: flex;
  gap: var(--space-md);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[dir="rtl"] .nav-links {
  font-family: var(--font-heading-ar);
  font-size: 1.08rem;
  font-weight: 500;
  text-transform: none;
  gap: 1.6rem;
}

.nav-links a {
  position: relative;
  padding-bottom: 5px;
  color: var(--color-text);
  transition: color var(--transition);
}

.nav-links a::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background: var(--gold-gradient);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active { color: var(--color-gold-start); }

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.lang-toggle {
  background: none;
  border: 1px solid var(--color-text-muted);
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--color-text);
  transition: all var(--transition);
}

.lang-toggle:hover {
  border-color: var(--color-gold-start);
  color: var(--color-gold-start);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text);
  line-height: 1;
}

@media (max-width: 820px) {
  .nav-links {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    background: var(--color-bg);
    flex-direction: column;
    align-items: center;
    padding: var(--space-md);
    gap: var(--space-md);
    border-bottom: 1px solid var(--color-line);
    box-shadow: var(--shadow-soft);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--color-bg-accent);
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(45, 30, 20, 0.72) 0%, rgba(45, 30, 20, 0.25) 45%, rgba(45, 30, 20, 0.45) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: var(--color-white);
  padding: var(--space-lg) var(--space-md);
  max-width: 760px;
  width: 100%;
}

.hero-content .accent-script { color: #F3D9A8; }

.hero-content h1 {
  color: var(--color-white);
  margin: 0.25rem 0 var(--space-sm);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.hero-content p {
  color: rgba(255, 255, 255, 0.92);
  max-width: 540px;
  margin-inline: auto;
  margin-bottom: var(--space-md);
  font-size: 1.05rem;
}

.hero-scroll {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.4rem;
  animation: floaty 2.2s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ---- Placeholder blocks (fallback if an image is missing) ---- */
.placeholder-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, var(--color-bg-accent), #d8c0aa);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  text-align: center;
  padding: var(--space-sm);
}

/* ---- Grid layouts ---- */
.grid { display: grid; gap: var(--space-md); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  /* Stack image+text / step blocks on phones… */
  .grid-2 { grid-template-columns: 1fr; }
  /* …but keep dresses two-up — it reads like a boutique, not a long scroll. */
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Dress card ---- */
.dress-card {
  cursor: pointer;
  margin: 0;
}

.dress-card .dress-photo {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(61, 43, 31, 0.08);
}

.dress-card img,
.dress-card .placeholder-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.dress-card:hover img { transform: scale(1.05); }

.dress-card .dress-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(61, 43, 31, 0.28), transparent 45%);
  opacity: 0;
  transition: opacity var(--transition);
}

.dress-card:hover .dress-photo::after { opacity: 1; }

.dress-card figcaption {
  margin-top: 0.9rem;
  text-align: center;
}

.dress-card .dress-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--color-text);
}

html[dir="rtl"] .dress-card .dress-title {
  font-family: var(--font-heading-ar);
  font-weight: 600;
}

.dress-card .dress-category {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold-start);
  margin-top: 0.15rem;
}

html[dir="rtl"] .dress-card .dress-category {
  font-family: var(--font-body-ar);
  font-size: 0.85rem;
  text-transform: none;
}

/* ---- Gallery filters ---- */
.filter-bar {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.filter-btn {
  background: none;
  border: 1px solid var(--color-line);
  border-radius: 22px;
  padding: 0.5rem 1.4rem;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  transition: all var(--transition);
}

html[dir="rtl"] .filter-btn {
  font-family: var(--font-body-ar);
  font-size: 0.98rem;
}

.filter-btn:hover { border-color: var(--color-gold-start); color: var(--color-gold-start); }

.filter-btn.active {
  background: var(--gold-gradient);
  border-color: transparent;
  color: var(--color-white);
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(45, 30, 20, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.lightbox.open { display: flex; }

.lightbox-content {
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

[data-lightbox-body] img { width: 100%; max-height: 62vh; object-fit: cover; }

.lightbox-body { padding: var(--space-md); }
.lightbox-body h3 { margin-bottom: 0.5rem; }

html[dir="rtl"] .lightbox-body h3 { font-family: var(--font-heading-ar); }

.lightbox-close {
  position: absolute;
  top: var(--space-md);
  inset-inline-end: var(--space-md);
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 2.4rem;
  line-height: 1;
}

/* ---- Footer (compact) ---- */
.site-footer {
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-md) 0 1.25rem;
  text-align: center;
}

.site-footer .logo img {
  height: 52px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.site-footer p, .site-footer a { color: var(--color-bg-accent); }

.footer-tagline {
  color: #F3D9A8 !important;
  margin: 0.6rem 0 0;
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 1rem 0 0.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html[dir="rtl"] .footer-links {
  font-family: var(--font-heading-ar);
  font-size: 1rem;
  text-transform: none;
}

.footer-links a:hover { color: var(--color-white); }

.footer-social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin: 1rem 0 0;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--color-bg-accent);
  transition: color var(--transition);
}

.footer-social a:hover { color: #F3D9A8; }

.footer-social svg { width: 19px; height: 19px; fill: currentColor; }

.footer-copy {
  font-size: 0.8rem;
  color: rgba(232, 213, 196, 0.6) !important;
  margin-top: 1.1rem;
  margin-bottom: 0.25rem;
}

.footer-credit {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: rgba(232, 213, 196, 0.45) !important;
  margin: 0;
}

html[dir="rtl"] .footer-credit {
  font-family: var(--font-body-ar);
  font-size: 0.85rem;
}

/* ---- Forms ---- */
.form-field { margin-bottom: var(--space-md); }

.form-field label {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.45rem;
}

html[dir="rtl"] .form-field label {
  font-family: var(--font-body-ar);
  font-size: 0.98rem;
  text-transform: none;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-line);
  border-radius: 4px;
  background: var(--color-white);
  color: var(--color-text);
  transition: border-color var(--transition);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-gold-start);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.10);
}

.form-note {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ---- About ---- */
.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.about-photo {
  position: relative;
}

.about-photo::before {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 1px solid var(--color-gold-start);
  border-radius: var(--radius);
  z-index: -1;
  opacity: 0.5;
}

html[dir="rtl"] .about-photo::before {
  inset: 14px 14px -14px -14px;
}

@media (max-width: 700px) {
  .about-photo::before { display: none; }
}

/* ---- Utility ---- */
.text-center { text-align: center; }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }

/* ---- Admin ---- */
.admin-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-line);
}

.admin-row img { border-radius: 4px; }

.admin-section { margin-bottom: var(--space-lg); }

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--space-md);
}

.checkbox-field input { width: auto; }

/* ==========================================================================
   Mobile refinements — ~98% of visitors are on phones, so this is the
   experience that matters most.
   ========================================================================== */
@media (max-width: 640px) {
  :root {
    --space-xl: 3.75rem;   /* was 7rem — desktop section padding is too tall on phones */
    --space-lg: 2.5rem;
    --space-md: 1.5rem;
  }

  body { font-size: 15.5px; }
  html[dir="rtl"] body { line-height: 1.85; }

  .container { padding-inline: 1.25rem; }

  .grid { gap: 0.85rem; }

  h1 { font-size: clamp(2.1rem, 9vw, 2.8rem); }
  h2 { font-size: clamp(1.65rem, 7vw, 2.1rem); }
  h3 { font-size: 1.35rem; }

  /* Hero: immersive but sized to the phone; keep text comfortably readable */
  .hero { min-height: 88vh; }
  .hero-content { padding: var(--space-lg) 1.25rem; }
  .hero-content .accent-script { font-size: 1.7rem; }
  .hero-content p { font-size: 1rem; margin-bottom: var(--space-md); }

  /* Bigger, easier tap targets */
  .btn { padding: 0.9rem 2rem; font-size: 0.95rem; }
  html[dir="rtl"] .btn { font-size: 1.1rem; }

  .section-header { margin-bottom: var(--space-md); }

  .dress-card .dress-title { font-size: 1rem; }
  .dress-card figcaption { margin-top: 0.6rem; }

  .filter-bar { gap: 0.45rem; margin-bottom: var(--space-lg); }
  .filter-btn { padding: 0.45rem 1.05rem; }

  /* Mobile nav menu: roomy, centered, tappable */
  .nav-links { padding: var(--space-lg) var(--space-md); gap: 1.5rem; }
  html[dir="rtl"] .nav-links { font-size: 1.25rem; }
  .nav-links a { font-size: 1.1rem; }

  /* Footer: keep it a compact wrapping row, not a tall stack */
  .footer-social { gap: 0.5rem 1.1rem; }
  .footer-social a { font-size: 0.95rem; }
  .footer-links { gap: 1rem; }
}

/* Very small phones */
@media (max-width: 360px) {
  .grid { gap: 0.7rem; }
  .container { padding-inline: 1rem; }
}
