/* ============================================================
   CASA MILAGRO — Shared Stylesheet
   ============================================================ */

:root {
  --chili:      #c0392b;
  --chili-dk:   #a93226;
  --gold:       #d4a017;
  --gold-lt:    #f0c040;
  --gold-pale:  #faf0d0;
  --terracotta: #b85c38;
  --terra-lt:   #d4784f;
  --sand:       #f2e8d5;
  --sand-dk:    #e8d9be;
  --cream:      #fdf6e3;
  --bark:       #3b1f0d;
  --bark-md:    #4d2910;
  --bark-lt:    #5c3317;
  --jade:       #2d6a4f;
  --jade-lt:    #40916c;
  --jade-pale:  #d4ede1;
  --ink:        #1a0e05;
  --mid:        #7a5c45;
  --white:      #ffffff;
  --shadow-sm:  0 2px 8px rgba(26,14,5,.10);
  --shadow-md:  0 6px 24px rgba(26,14,5,.14);
  --shadow-lg:  0 16px 48px rgba(26,14,5,.18);

  --f-display: 'Cinzel', serif;
  --f-accent:  'Lora', serif;
  --f-body:    'Nunito Sans', sans-serif;

  --radius-sm: 3px;
  --radius:    6px;
  --radius-lg: 12px;
  --ease:      cubic-bezier(.16,1,.3,1);
  --trans:     .35s var(--ease);

  --nav-h: 76px;
  --banner-h: 34px;    /* updated by JS after render */
  --top-offset: calc(var(--nav-h) + var(--banner-h));
  --max-w: 1220px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--f-body); background: var(--cream); color: var(--ink); overflow-x: hidden; }
img  { display: block; max-width: 100%; }
a    { color: inherit; text-decoration: none; }
ul   { list-style: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* Custom cursor removed — using browser default */

/* ---- Scroll Reveal ---- */
.sr   { opacity:0; transform:translateY(32px); transition:opacity .7s var(--ease), transform .7s var(--ease); }
.sr-l { opacity:0; transform:translateX(-44px);transition:opacity .7s var(--ease), transform .7s var(--ease); }
.sr-r { opacity:0; transform:translateX(44px); transition:opacity .7s var(--ease), transform .7s var(--ease); }
.sr.up, .sr-l.up, .sr-r.up { opacity:1; transform:none; }

/* ---- Nav ---- */
.site-nav {
  position: fixed; top: var(--banner-h); left: 0; right: 0; z-index: 500;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2.5rem;
  transition: background .4s, box-shadow .4s;
}
.site-nav.stuck {
  background: var(--bark);
  box-shadow: 0 2px 20px rgba(26,14,5,.25);
}
.nav-logo {
  display: flex; align-items: center; gap: .85rem;
  font-family: var(--f-display);
  font-size: 1.3rem; font-weight: 700;
  color: var(--white); letter-spacing: .05em; line-height: 1.15;
  white-space: nowrap;
}
.nav-logo-badge {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 900; color: var(--bark);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(212,160,23,.3);
}
.nav-logo-sub {
  display: block; font-size: .54rem; font-weight: 400;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-lt); margin-top: 3px;
  white-space: nowrap;
}
.nav-links {
  display: flex; align-items: center; gap: 2rem;
}
.nav-links a {
  font-family: var(--f-body); font-size: .78rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(253,246,227,.65);
  position: relative; transition: color .25s;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
  height: 1px; background: var(--gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--gold-lt); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-btn {
  background: var(--chili); color: var(--white) !important;
  padding: .5rem 1.3rem; border-radius: var(--radius-sm);
  font-weight: 700 !important; transition: background .25s !important;
}
.nav-btn::after { display: none !important; }
.nav-btn:hover { background: var(--chili-dk) !important; }

/* Ham */
.ham { display: none; flex-direction: column; gap: 5px; padding: 4px; }
.ham span { display: block; width: 23px; height: 2px; background: var(--cream); transition: .3s; }
.ham.x span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ham.x span:nth-child(2) { opacity: 0; }
.ham.x span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav {
  display: none; position: fixed; inset: 0; top: var(--nav-h);
  background: var(--bark); flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2.8rem; z-index: 490;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-family: var(--f-display); font-size: 1.6rem;
  color: var(--cream); letter-spacing: .06em; transition: color .2s;
}
.mobile-nav a:hover { color: var(--gold-lt); }

/* ---- Banner ---- */
#site-banner {
  background: var(--chili); text-align: center;
  padding: .55rem 1rem;
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 510;
}
#site-banner.hide { display: none; }
#site-banner.hide ~ .site-nav { top: 0; }
#site-banner p {
  font-family: var(--f-body); font-size: .78rem; font-weight: 700;
  color: var(--white); letter-spacing: .03em;
  line-height: 1.4;
}
@media (max-width: 600px) {
  #site-banner p { font-size: .7rem; letter-spacing: .01em; }
  :root { --banner-h: 48px; }
}

/* ---- Page Hero (shared inner-page style) ---- */
.page-hero {
  padding-top: var(--top-offset);
  background: var(--bark);
  position: relative; overflow: hidden;
  text-align: center;
}
.page-hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: .18;
}
.page-hero-inner {
  position: relative; z-index: 2;
  padding: 5rem 2rem 4rem;
}
.page-hero-label {
  font-family: var(--f-body); font-size: .7rem; font-weight: 600;
  letter-spacing: .25em; text-transform: uppercase;
  color: var(--gold-lt); margin-bottom: .6rem; display: block;
}
.page-hero h1 {
  font-family: var(--f-display);
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  font-weight: 900; color: var(--white); letter-spacing: .02em;
  line-height: 1.05;
}
.page-hero h1 em { font-style: italic; color: var(--gold-lt); font-family: 'Lora', serif; font-weight: 400; }
.page-hero-sub {
  font-family: var(--f-accent); font-style: italic;
  font-size: 1.05rem; color: rgba(242,232,213,.7);
  margin-top: .75rem;
}
/* Diagonal bottom */
.page-hero::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 80px; background: var(--cream);
  clip-path: polygon(0 60%, 100% 0, 100% 100%, 0 100%);
  z-index: 3;
}

/* ---- Section Primitives ---- */
.section { padding: 6rem 2rem; }
.section.dark { background: var(--bark); }
.section.sand { background: var(--sand); }
.section.cream { background: var(--cream); }
.inner { max-width: var(--max-w); margin: 0 auto; }

.eyebrow {
  font-family: var(--f-body); font-size: .68rem; font-weight: 700;
  letter-spacing: .25em; text-transform: uppercase;
  color: var(--chili); display: block; margin-bottom: .5rem;
}
.eyebrow.lt { color: var(--gold-lt); }

.section-title {
  font-family: var(--f-display);
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  font-weight: 700; color: var(--bark); line-height: 1.1;
}
.section-title.lt { color: var(--cream); }

.divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 1rem 0 2rem;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gold);
  opacity: .4;
}
.divider span { color: var(--gold); font-size: 1rem; }
.divider.lt::before, .divider.lt::after { opacity: .25; background: var(--gold-lt); }
.divider.lt span { color: var(--gold-lt); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--f-body); font-size: .78rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  padding: .8rem 2rem; border-radius: var(--radius-sm);
  transition: all .25s;
}
.btn-primary { background: var(--chili); color: var(--white); box-shadow: 0 4px 16px rgba(192,57,43,.3); }
.btn-primary:hover { background: var(--chili-dk); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(192,57,43,.4); }
.btn-gold { background: var(--gold); color: var(--bark); }
.btn-gold:hover { background: var(--gold-lt); transform: translateY(-2px); }
.btn-outline { border: 2px solid var(--gold); color: var(--gold-lt); }
.btn-outline:hover { background: var(--gold); color: var(--bark); transform: translateY(-2px); }
.btn-ghost { border: 1px solid rgba(59,31,13,.2); color: var(--bark-lt); }
.btn-ghost:hover { border-color: var(--bark); color: var(--bark); }

/* ---- Color stripe (Aztec tile) ---- */
.stripe {
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold) 0, var(--gold) 20px,
    var(--chili) 20px, var(--chili) 40px,
    var(--jade) 40px, var(--jade) 60px,
    var(--terracotta) 60px, var(--terracotta) 80px
  );
}

/* ---- Footer ---- */
.site-footer {
  background: var(--ink); padding: 4rem 2rem 2rem;
  text-align: center; position: relative;
}
.site-footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--chili) 0, var(--chili) 20px,
    var(--gold) 20px, var(--gold) 40px,
    var(--jade) 40px, var(--jade) 60px,
    var(--terracotta) 60px, var(--terracotta) 80px
  );
}
.footer-logo {
  font-family: var(--f-display); font-size: 2rem; font-weight: 900;
  color: var(--gold-lt); letter-spacing: .05em; margin-bottom: .4rem;
}
.footer-tagline {
  font-family: var(--f-accent); font-style: italic;
  color: rgba(242,232,213,.45); font-size: .9rem; margin-bottom: 2rem;
}
.footer-nav {
  display: flex; justify-content: center; gap: 2.5rem;
  flex-wrap: wrap; margin-bottom: 2rem;
}
.footer-nav a {
  font-family: var(--f-body); font-size: .75rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(242,232,213,.45); transition: color .25s;
}
.footer-nav a:hover { color: var(--gold-lt); }
.footer-copy { font-family: var(--f-body); font-size: .72rem; color: rgba(242,232,213,.25); }
.footer-credit { margin-top: .4rem; font-size: .7rem; color: rgba(242,232,213,.2); }
.footer-credit a { color: rgba(212,160,23,.4); transition: color .25s; }
.footer-credit a:hover { color: var(--gold-lt); }

/* ---- Shared JS hooks ---- */
@keyframes fadeDown { from{opacity:0;transform:translateY(-18px)} to{opacity:1;transform:none} }
@keyframes fadeIn   { from{opacity:0} to{opacity:1} }
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .site-footer { padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .ham { display: flex; }
}
@media (max-width: 600px) {
  :root {
    --nav-h: 62px;
  }
  .section { padding: 4rem 1.25rem; }
  .page-hero-inner { padding: 3.5rem 1.25rem 3rem; }

  /* Nav logo — tighter on mobile */
  .site-nav { padding: 0 1.25rem; }
  .nav-logo { font-size: 1.05rem; gap: .6rem; }
  .nav-logo-badge { width: 36px; height: 36px; font-size: .9rem; }
  .nav-logo-sub { font-size: .48rem; }

  /* Page hero smaller headings */
  .page-hero h1 { font-size: clamp(2rem, 10vw, 3rem); }

  /* Footer tighter */
  .footer-nav { gap: 1.25rem; }
  .footer-copy { font-size: .68rem; }
}
