/* ==========================================================================
   Gama Residences — stylesheet
   Editorial minimalism. Cream paper + olive ink.
   ========================================================================== */

:root {
  --bg: #f5f1e8;
  --bg-alt: #ebe5d6;
  --ink: #2a2e23;
  --ink-soft: #3d4234;
  --olive: #6b7a3f;
  --olive-dark: #4f5c2e;
  --muted: #8a8472;
  --line: #d9d2bf;

  --serif: "Fraunces", "Tiempos Headline", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --max: 1180px;
  --pad-x: clamp(20px, 4vw, 64px);

  --r-btn: 999px;   /* pill buttons */
  --r-img: 16px;    /* photo corners */
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Subtle paper grain */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.18  0 0 0 0 0.13  0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 350;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(2.4rem, 5.5vw, 4.4rem); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); line-height: 1.15; }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); line-height: 1.25; }
h4 { font-size: 1.05rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--olive-dark); }

p  { margin: 0 0 1em; max-width: 62ch; }
em.serif { font-family: var(--serif); font-style: italic; font-size: 1.08em; color: var(--ink-soft); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--olive);
  margin: 0 0 1.2em;
  display: inline-block;
}

/* Layout helpers */
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--pad-x); }

.section { padding-block: clamp(64px, 9vw, 130px); }
.section--alt { background: var(--bg-alt); }
.section + .section { border-top: 1px solid var(--line); }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 881px) {
  /* Glass blur only on desktop — on mobile it broke fixed positioning of the open nav on some iOS browsers */
  .site-header {
    background: rgba(245, 241, 232, 0.92);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
  }
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
  height: 72px;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--pad-x);
}
.brand {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.brand .amp {
  color: var(--olive);
  font-style: italic;
  text-transform: none;
  font-weight: 400;
  font-size: 1.35em;
  letter-spacing: 0;
  margin: 0 0.05em;
  display: inline-block;
  transform: translateY(0.02em);
}

.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 36px); }
.nav a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  position: relative;
  padding-block: 6px;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--olive);
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.nav a:hover::after,
.nav a.is-active::after { transform: scaleX(1); }

.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--olive);
  color: var(--bg);
  padding: 11px 22px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--olive);
  border-radius: var(--r-btn);
  transition: background .2s ease, color .2s ease;
}
.nav-cta:hover { background: var(--olive-dark); border-color: var(--olive-dark); }
.nav-cta::after { display: none; }

.language-switch {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(245, 241, 232, 0.72);
}
.language-switch button {
  width: 34px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.language-switch button.is-active {
  background: var(--olive);
  color: var(--bg);
}
.language-switch button:focus-visible {
  outline: 2px solid var(--olive-dark);
  outline-offset: 2px;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 44px; height: 44px;
  cursor: pointer;
  padding: 0;
  align-items: center; justify-content: center;
  position: relative;
}
.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  position: absolute;
  left: 50%;
  margin-left: -9px;
  transition: transform .25s ease, top .25s ease, opacity .2s ease, background .2s ease;
}
.menu-toggle span::before, .menu-toggle span::after { content: ""; }
.menu-toggle span        { top: 50%; margin-top: -1px; }
.menu-toggle span::before { top: -7px; }
.menu-toggle span::after  { top:  7px; }

/* Hamburger -> X */
body.menu-open .menu-toggle span         { background: transparent; }
body.menu-open .menu-toggle span::before { top: 0; transform: rotate(45deg);  }
body.menu-open .menu-toggle span::after  { top: 0; transform: rotate(-45deg); }

@media (max-width: 880px) {
  /* Hide desktop nav, show hamburger */
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .language-switch { margin-left: auto; }

  /* Lock background scroll while menu is open */
  body.menu-open { overflow: hidden; }

  /* Open mobile nav: a body-level panel (JS moves the nav out of the sticky header so position:fixed is reliable on iOS) */
  body.menu-open .nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    background: var(--bg);
    padding: 16px var(--pad-x) 32px;
    border-top: 1px solid var(--line);
    z-index: 999;
    isolation: isolate;
    overflow-y: auto;
    animation: menu-slide-down .25s ease;
  }
  body.menu-open .nav a {
    font-family: var(--serif);
    font-size: 1.6rem;
    font-weight: 350;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink);
    padding-block: 18px;
    border-bottom: 1px solid var(--line);
    width: 100%;
  }
  body.menu-open .nav a::after { display: none; }
  body.menu-open .nav-cta {
    margin-top: 28px;
    padding: 16px 30px;
    font-size: 0.85rem;
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    align-self: flex-start;
    border-bottom: 0;
    color: var(--bg);
    background: var(--olive);
  }
}

@keyframes menu-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .site-header__inner { gap: 8px; }
  .brand {
    font-size: 0.9rem;
    letter-spacing: 0.12em;
  }
  .language-switch button {
    width: 30px;
    height: 28px;
    font-size: 0.68rem;
  }
}

/* --------------------------------------------------------------------------
   Hero — full-bleed image background with overlay text (index page)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: min(88vh, 920px);
  display: flex;
  align-items: flex-end;
  padding: 0;
  color: var(--bg);
  background-color: #2a2e23;
  background-image: url("../images/hero/hero-03.jpg");
  background-size: cover;
  background-position: center 55%;
  background-repeat: no-repeat;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(20, 22, 17, 0) 25%, rgba(20, 22, 17, 0.55) 65%, rgba(20, 22, 17, 0.85) 100%),
    linear-gradient(to right,  rgba(20, 22, 17, 0.55) 0%, rgba(20, 22, 17, 0.0) 60%);
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  width: 100%;
  padding-block: clamp(72px, 10vw, 140px);
}
.hero__copy { max-width: 720px; }
.hero__title {
  font-size: clamp(2.6rem, 6.6vw, 5.6rem);
  line-height: 1.0;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  color: var(--bg);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}
.hero__title em {
  font-style: italic;
  color: #e8e8c8;
  font-weight: 350;
}
.hero__lede {
  font-size: 1.18rem;
  color: rgba(245, 241, 232, 0.94);
  max-width: 44ch;
  margin: 0 0 36px;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.3);
}
.hero .btn--primary {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--bg);
}
.hero .btn--primary:hover {
  background: var(--olive);
  color: var(--bg);
  border-color: var(--olive);
}

@media (max-width: 880px) {
  .hero { min-height: 78vh; align-items: flex-end; background-position: left center; }
  .hero .wrap { padding-block: 96px 56px; }
}

/* Page-banner hero (used on accommodation / restaurant pages) */
.page-hero {
  padding-block: clamp(72px, 9vw, 130px) clamp(48px, 6vw, 80px);
  border-bottom: 1px solid var(--line);
}
.page-hero .eyebrow { display: block; }
.page-hero h1 { max-width: 16ch; margin-bottom: 18px; }
.page-hero p  { color: var(--ink-soft); max-width: 60ch; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 30px;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--olive);
  border-radius: var(--r-btn);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.btn--primary { background: var(--olive); color: var(--bg); }
.btn--primary:hover { background: var(--olive-dark); border-color: var(--olive-dark); }
.btn--ghost { background: transparent; color: var(--olive-dark); }
.btn--ghost:hover { background: var(--olive); color: var(--bg); }
.btn .arrow { transition: transform .25s ease; }
.btn:hover .arrow { transform: translateX(4px); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  color: var(--olive-dark);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  padding-bottom: 4px;
  transition: color .2s ease, border-color .2s ease;
}
.link-arrow:hover { color: var(--olive); border-color: var(--olive); }
.link-arrow .arrow { transition: transform .25s ease; }
.link-arrow:hover .arrow { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   About / two-column band
   -------------------------------------------------------------------------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(36px, 6vw, 96px);
  align-items: center;
}
.two-col--reverse > :first-child { order: 2; }

.two-col__media {
  aspect-ratio: 5 / 6;
  overflow: hidden;
  border-radius: var(--r-img);
}
.two-col__media img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 880px) {
  .two-col { grid-template-columns: 1fr; gap: 28px; }
  .two-col--reverse > :first-child { order: initial; }
  .two-col__media { aspect-ratio: 4 / 3; }
}

/* --------------------------------------------------------------------------
   Section heading block
   -------------------------------------------------------------------------- */
.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: clamp(36px, 5vw, 64px);
  max-width: 720px;
}
.section-head h2 { margin: 0; }
.section-head p { color: var(--ink-soft); margin: 0; }

/* --------------------------------------------------------------------------
   Room preview cards (index page)
   -------------------------------------------------------------------------- */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.6vw, 36px);
}
.room-card {
  display: flex; flex-direction: column;
  background: transparent;
  text-decoration: none;
  color: inherit;
  transition: transform .35s ease;
}
.room-card__image {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  margin-bottom: 22px;
  position: relative;
  border-radius: var(--r-img);
}
.room-card__image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s ease;
}
.room-card:hover .room-card__image img { transform: scale(1.04); }
.room-card__index {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.room-card h3 { margin: 0 0 8px; }
.room-card__meta {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--olive-dark);
  margin-bottom: 14px;
}
.room-card p { color: var(--ink-soft); margin: 0 0 20px; }

@media (max-width: 880px) {
  .rooms-grid { grid-template-columns: 1fr; gap: 40px; }
  .room-card__image { aspect-ratio: 4 / 3; }
}

/* --------------------------------------------------------------------------
   Accommodation page — room sections
   -------------------------------------------------------------------------- */
.room-section {
  padding-block: clamp(64px, 8vw, 110px);
  border-top: 1px solid var(--line);
}
.room-section:first-of-type { border-top: 0; }

.room-section__head {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(28px, 5vw, 72px);
  margin-bottom: clamp(36px, 5vw, 56px);
}
.room-section__head .num {
  font-family: var(--serif); font-style: italic;
  color: var(--olive); font-size: 1.05rem; margin: 0 0 8px;
}
.room-section__head h2 { margin: 0 0 10px; }
.room-section__meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
  margin-top: 14px;
}
.room-section__meta span { display: inline-flex; align-items: center; gap: 8px; }
.room-section__meta span + span::before {
  content: ""; width: 1px; height: 12px; background: var(--line); margin-right: 10px;
}

.room-section__body p { color: var(--ink-soft); }
.amenities {
  list-style: none; padding: 0; margin: 18px 0 28px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px;
  font-size: 0.94rem;
}
.amenities li { display: flex; align-items: baseline; gap: 10px; color: var(--ink-soft); }
.amenities li::before {
  content: ""; flex: 0 0 auto; width: 6px; height: 6px;
  background: var(--olive); transform: translateY(-2px);
}

@media (max-width: 880px) {
  .room-section__head { grid-template-columns: 1fr; gap: 14px; }
  .amenities { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Galleries
   -------------------------------------------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(8px, 1vw, 14px);
}
.gallery__item {
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
  background: var(--bg-alt);
  border-radius: var(--r-img);
}
.gallery__item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s ease;
}
.gallery__item:hover img { transform: scale(1.03); }
.gallery__item--wide  { grid-column: span 7; aspect-ratio: 4 / 3; }
.gallery__item--tall  { grid-column: span 5; aspect-ratio: 4 / 5; }
.gallery__item--third { grid-column: span 4; aspect-ratio: 4 / 3; }
.gallery__item--half  { grid-column: span 6; aspect-ratio: 4 / 3; }

@media (max-width: 880px) {
  .gallery { grid-template-columns: 1fr 1fr; gap: 8px; }
  .gallery__item { grid-column: span 1 !important; aspect-ratio: 4 / 3 !important; }
}

/* --------------------------------------------------------------------------
   Restaurant feature (index)
   -------------------------------------------------------------------------- */
.restaurant-feature {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: stretch;
}
.restaurant-feature__media { aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-img); }
.restaurant-feature__media img { width: 100%; height: 100%; object-fit: cover; }
.restaurant-feature__copy { display: flex; flex-direction: column; justify-content: center; padding-block: 18px; }
.restaurant-feature__copy h2 { margin-bottom: 22px; }
.restaurant-feature__copy p { color: var(--ink-soft); margin-bottom: 22px; }

@media (max-width: 880px) {
  .restaurant-feature { grid-template-columns: 1fr; gap: 24px; }
}

/* --------------------------------------------------------------------------
   Location
   -------------------------------------------------------------------------- */
.location-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.location-card { padding-block: 12px; }
.location-card .address {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 18px;
  line-height: 1.35;
}
.distances { list-style: none; padding: 0; margin: 0 0 28px; }
.distances li {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 18px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.distances li:last-child { border-bottom: 1px solid var(--line); }
.distances .num {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--olive-dark);
}
.distances .what {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.map-frame {
  aspect-ratio: 5 / 4;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--bg-alt);
  border-radius: var(--r-img);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; filter: saturate(0.85) contrast(0.95); }

@media (max-width: 880px) {
  .location-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  padding-block: 64px 32px;
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: clamp(20px, 4vw, 56px);
  margin-bottom: 48px;
}
.site-footer h4 { margin-bottom: 14px; }
.site-footer a { text-decoration: none; color: var(--ink-soft); }
.site-footer a:hover { color: var(--olive); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 4px 0; }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(20, 22, 17, 0.94);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox__img {
  max-width: 92vw; max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  border-radius: 12px;
}
.lightbox__btn {
  position: absolute;
  background: transparent;
  border: 1px solid rgba(245, 241, 232, 0.4);
  color: var(--bg);
  width: 48px; height: 48px;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  font-family: var(--serif);
  transition: background .2s ease, border-color .2s ease;
}
.lightbox__btn:hover { background: rgba(245, 241, 232, 0.1); border-color: var(--bg); }
.lightbox__btn--close { top: 20px; right: 20px; }
.lightbox__btn--prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.lightbox__btn--next  { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox__counter {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: var(--bg); font-size: 0.82rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  font-family: var(--sans);
}

@media (max-width: 720px) {
  .lightbox__btn { width: 40px; height: 40px; }
  .lightbox__btn--prev { left: 12px; }
  .lightbox__btn--next { right: 12px; }
}

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */
::selection { background: var(--olive); color: var(--bg); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
