/* ============================================================
   MDIVINA — shared stylesheet
   ============================================================ */

:root {
  /* Palette */
  --bg:            #FEFCEF;
  --surface:       #F7ECD4;
  --raised:        #EED2A2;
  --primary:       #CCA266;
  --primary-hover: #B8864A;
  --secondary:     #9C653C;
  --text:          #3B2A1E;
  --text-muted:    #6B4F38;
  --text-subtle:   #9C8770;
  --border:        #E5D4B3;
  --border-strong: #C9A876;
  --deep:          #0A0D04;
  --deep-warm:     #1A130C;
  --deep-surface:  #241A10;

  /* Fonts */
  --font-display: 'Cormorant Garamond', 'Didot', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* Layout */
  --max-width: 1280px;
  --max-width-narrow: 760px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

/* Global dark page mode (gallery, about, application, faq, wishlist) */
body.dark {
  background: var(--deep);
  color: var(--raised);
}
body.dark a { color: var(--primary); }

img { display: block; max-width: 100%; }
a { color: var(--secondary); }

/* ============================================================
   Navigation
   ============================================================ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  column-gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: 24px 40px;
  background: linear-gradient(to bottom, rgba(10, 13, 4, 0.7) 0%, rgba(10, 13, 4, 0) 100%);
  transition: background 0.3s ease;
}
body.dark .nav {
  background: linear-gradient(to bottom, rgba(10, 13, 4, 0.95) 0%, rgba(10, 13, 4, 0.75) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-links {
  display: flex;
  gap: clamp(10px, 1.4vw, 20px);
  list-style: none;
  flex-wrap: nowrap;
}
.nav-links li { white-space: nowrap; }
.nav-links a {
  color: var(--bg);
  text-decoration: none;
  font-size: clamp(0.62rem, 0.9vw, 0.85rem);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
  transition: opacity 0.2s, color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active { opacity: 1; color: var(--primary); }

.nav-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--bg);
  text-decoration: none;
  white-space: nowrap;
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 0;
  width: 40px;
  height: 40px;
  cursor: pointer;
  justify-self: end;
  position: relative;
  z-index: 110;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  margin: 5px auto;
  background: var(--bg);
  transition: transform 0.3s ease, opacity 0.2s ease;
}
.nav.menu-open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============================================================
   Hero (homepage)
   ============================================================ */

.hero {
  height: 100vh;
  width: 100%;
  background: var(--deep);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.hero img {
  height: 100vh;
  width: auto;
  max-width: none;
  display: block;
  object-fit: contain;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(10, 13, 4, 0.45) 100%);
  pointer-events: none;
}

/* ============================================================
   Homepage sections (alternating)
   ============================================================ */

.section { padding: 120px 40px; }
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.section.reverse .section-inner > :first-child { order: 2; }
.section.reverse .section-inner > :last-child  { order: 1; }

.section-content .eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 20px;
  font-weight: 500;
}
.section-content h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  color: var(--text);
}
.section-content p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  max-width: 48ch;
}

.cta {
  display: inline-block;
  margin-top: 24px;
  padding: 14px 32px;
  background: transparent;
  color: var(--secondary);
  border: 1px solid var(--border-strong);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
  font-family: inherit;
}
.cta:hover { background: var(--secondary); color: var(--bg); border-color: var(--secondary); }

.section-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--raised);
}
.section-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}
.section-image:hover img { transform: scale(1.03); }

.section.light   { background: #F3E4C0; }
.section.surface { background: #E8D0A0; }
.section.dark,
.section.dusk { color: var(--bg); }
.section.dark { background: var(--deep-warm); }
.section.dusk { background: var(--deep-surface); }
.section.dark .section-content h2,
.section.dusk .section-content h2      { color: var(--bg); }
.section.dark .section-content p,
.section.dusk .section-content p       { color: var(--raised); }
.section.dark .section-content .eyebrow,
.section.dusk .section-content .eyebrow { color: var(--primary); }
.section.dark .cta,
.section.dusk .cta { color: var(--primary); border-color: var(--primary); }
.section.dark .cta:hover,
.section.dusk .cta:hover { background: var(--primary); color: var(--deep); border-color: var(--primary); }

/* ============================================================
   Page header (interior pages — dark hero-lite)
   ============================================================ */

.page-header {
  padding: 200px 40px 80px;
  text-align: center;
  background: var(--deep);
  border-bottom: 1px solid rgba(204, 162, 102, 0.1);
}
.page-header .eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 20px;
  font-weight: 500;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.8vw, 3.8rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--bg);
  margin-bottom: 20px;
}
.page-header p {
  max-width: 52ch;
  margin: 0 auto;
  color: var(--text-subtle);
  font-size: 0.95rem;
}

/* ============================================================
   Page body (dark interior pages)
   ============================================================ */

.page-body { padding: 80px 40px 120px; }
.page-body-inner {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
}
.page-body h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--bg);
  margin: 36px 0 14px;
}
.page-body p {
  color: var(--raised);
  font-size: 0.95rem;
  margin-bottom: 16px;
  opacity: 0.9;
}
.page-body strong { color: var(--bg); font-weight: 500; }

/* ============================================================
   Page accents (side-by-side image + text, interior pages)
   ============================================================ */

.page-accent {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin: 80px -160px;   /* break out of narrow prose */
}
.page-accent.reverse > :first-child { order: 2; }
.page-accent.reverse > :last-child  { order: 1; }

.page-accent-image {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--deep-warm);
}
.page-accent-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}
.page-accent-image:hover img { transform: scale(1.03); }

.page-accent-text h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--bg);
  margin-bottom: 10px;
  line-height: 1.2;
}
.page-accent-text p {
  color: var(--raised);
  font-size: 0.95rem;
  opacity: 0.85;
  margin: 0;
}

@media (max-width: 900px) {
  .page-accent { grid-template-columns: 1fr; gap: 24px; margin: 60px 0; }
  .page-accent.reverse > :first-child { order: 1; }
  .page-accent.reverse > :last-child  { order: 2; }
}

/* ============================================================
   Gallery (masonry columns + lightbox)
   ============================================================ */

.gallery {
  padding: 60px 24px 120px;
  background: var(--deep);
}
.gallery-grid {
  max-width: 1600px;
  margin: 0 auto;
  column-count: 4;
  column-gap: 16px;
}
@media (max-width: 900px) { .gallery-grid { column-count: 3; } }
@media (max-width: 680px) { .gallery-grid { column-count: 2; column-gap: 10px; } }
@media (max-width: 420px) { .gallery-grid { column-count: 1; } }

.gallery-item {
  display: block;
  width: 100%;
  margin: 0 0 18px;
  cursor: zoom-in;
  overflow: hidden;
  position: relative;
  background: var(--deep-warm);
  break-inside: avoid;
  border: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s ease, filter 0.4s ease;
  filter: brightness(0.92);
}
.gallery-item:hover { border-color: rgba(204, 162, 102, 0.4); }
.gallery-item:hover img { transform: scale(1.03); filter: brightness(1); }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 4, 0.97);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  cursor: default;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: transparent;
  border: 1px solid rgba(204, 162, 102, 0.3);
  color: var(--primary);
  font-size: 1.2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: inherit;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--primary);
  color: var(--deep);
  border-color: var(--primary);
}
.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev  { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-subtle);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
}

/* ============================================================
   Forms (application, wishlist, etc.)
   ============================================================ */

.form { display: grid; gap: 24px; margin-top: 40px; }
.form-row { display: grid; gap: 8px; }
.form-row label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 500;
}
.form-row input,
.form-row textarea,
.form-row select {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(204, 162, 102, 0.3);
  color: var(--bg);
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 0;
  outline: none;
  transition: border-color 0.2s;
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus { border-color: var(--primary); }
.form-row textarea { resize: vertical; min-height: 120px; }
.form-row input::placeholder,
.form-row textarea::placeholder { color: var(--text-subtle); opacity: 0.6; }
.form .cta {
  justify-self: start;
  background: var(--primary);
  color: var(--deep);
  border-color: var(--primary);
}
.form .cta:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--deep); }

/* ============================================================
   FAQ accordion
   ============================================================ */

.faq-list { margin-top: 40px; }
.faq-item {
  border-top: 1px solid rgba(204, 162, 102, 0.15);
}
.faq-item:last-child { border-bottom: 1px solid rgba(204, 162, 102, 0.15); }
.faq-item summary {
  padding: 22px 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--bg);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  color: var(--primary);
  font-size: 1.5rem;
  transition: transform 0.3s ease;
  font-family: var(--font-body);
  font-weight: 300;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .answer {
  padding: 0 0 28px;
  color: var(--raised);
  opacity: 0.85;
  max-width: 62ch;
}

/* ============================================================
   Wishlist grid
   ============================================================ */

.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.wishlist-card {
  padding: 28px 24px;
  background: var(--deep-warm);
  border: 1px solid rgba(204, 162, 102, 0.12);
  transition: border-color 0.3s, transform 0.3s;
}
.wishlist-card:hover {
  border-color: rgba(204, 162, 102, 0.35);
  transform: translateY(-2px);
}
.wishlist-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--bg);
  margin-bottom: 8px;
}
.wishlist-card .meta {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
}
.wishlist-card p {
  color: var(--raised);
  font-size: 0.95rem;
  opacity: 0.85;
}

/* ============================================================
   Simple footer (all pages)
   ============================================================ */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  background: var(--deep);
  color: var(--text-subtle);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-top: 1px solid rgba(204, 162, 102, 0.12);
}
.site-footer-location {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.3;
}
.site-footer-label { opacity: 0.7; }
.site-footer-value {
  color: var(--raised);
  font-weight: 500;
  letter-spacing: 0.24em;
}
.site-footer-links { display: flex; gap: 24px; }
.site-footer a {
  color: var(--text-subtle);
  text-decoration: none;
  transition: color 0.2s;
}
.site-footer a:hover { color: var(--primary); }

@media (max-width: 640px) {
  .site-footer { flex-direction: column; gap: 12px; padding: 20px; text-align: center; }
}

/* ============================================================
   Legacy footer (unused)
   ============================================================ */

.footer {
  background: var(--deep);
  color: var(--raised);
  padding: 100px 40px 40px;
  border-top: 1px solid rgba(204, 162, 102, 0.1);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
}
.footer-brand h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  color: var(--bg);
  margin-bottom: 16px;
}
.footer-brand p {
  color: var(--text-subtle);
  max-width: 40ch;
  font-size: 0.95rem;
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--primary);
  margin-bottom: 20px;
  font-weight: 500;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
  color: var(--raised);
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity 0.2s, color 0.2s;
}
.footer-col a:hover { opacity: 1; color: var(--primary); }
.footer-bottom {
  max-width: var(--max-width);
  margin: 60px auto 0;
  padding-top: 30px;
  border-top: 1px solid rgba(204, 162, 102, 0.15);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-subtle);
  letter-spacing: 0.05em;
}

/* ============================================================
   Responsive
   ============================================================ */

/* Hamburger breakpoint — below this, nav-links become a full-screen overlay */
@media (max-width: 900px) {
  .nav {
    grid-template-columns: 1fr auto;
    padding: 18px 20px;
  }
  .nav-title {
    font-size: clamp(1rem, 3.5vw, 1.3rem);
    justify-self: start;
    padding-left: 0;
  }
  .nav-toggle { display: block; }

  .nav-links {
    position: fixed;
    inset: 0;
    background: rgba(10, 13, 4, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin: 0;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    z-index: 95;
  }
  .nav.menu-open .nav-links {
    opacity: 1;
    visibility: visible;
  }
  .nav-links li { list-style: none; }
  .nav-links a {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    text-transform: none;
    opacity: 0.85;
    color: var(--bg);
  }
  .nav-links a:hover,
  .nav-links a.active {
    opacity: 1;
    color: var(--primary);
  }
}

@media (max-width: 820px) {
  .section { padding: 80px 24px; }
  .section-inner { grid-template-columns: 1fr; gap: 40px; }
  .section.reverse .section-inner > :first-child { order: 1; }
  .section.reverse .section-inner > :last-child  { order: 2; }

  .page-header { padding: 140px 24px 60px; }
  .page-body   { padding: 60px 24px 100px; }

  .footer { padding: 60px 24px 30px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 8px; }

  .lightbox-close { top: 16px; right: 16px; }
  .lightbox-prev  { left: 12px; }
  .lightbox-next  { right: 12px; }
}
