/*
 * The Sultanate Hotels — brand design system
 * Implements SULTANATE_BRAND_GUIDELINE.pdf, Edition One, 2026.
 *
 * The governing rule of that document: Ivory Cream is the default ground and
 * "most of the brand is this colour". Ink Black is body text and the REVERSED
 * ground for ceremony moments only. Sultanate Gold is an accent — rules, small
 * caps, the emblem — and is "never a large fill".
 *
 * Restraint is the house style. When in doubt, do less.
 *
 * This file is byte-identical across every Sultanate marketing site. Change it
 * here and copy; never fork it per property.
 */

:root {
  /* --- Primary palette (approved) ------------------------------------ */
  --ivory: #F9F5F1;        /* the default ground */
  --ink: #1A1A1A;          /* body text; reversed ground for ceremony */
  --gold: #C8AA62;         /* accent only — never a large fill */
  --gold-tint: #D9C493;    /* hairlines and pattern, low contrast */

  /* DEVIATION, flagged to the brand custodian.
     The guideline sets small caps in Sultanate Gold. On the Ivory Cream ground
     that measures 2.06:1 — well under the 4.5:1 minimum for small text, and the
     small caps are specified at 10px. This is a darkened member of the same gold
     family used ONLY where gold sets small type on a light ground: 5.16:1 on
     Ivory Cream, 4.77:1 on the alternating band.
     On the Ink Black ceremony ground the true Sultanate Gold is 7.78:1 and is
     used unchanged. Rules, hairlines and the emblem always use --gold. */
  --gold-ink: #7E6430;

  /* The secondary palette (Lagoon Deep, Warm Sand, Royal Blue) is marked
     "PROPOSED, FOR REVIEW" in the guideline and is deliberately not used. */

  /* --- Derived neutrals ---------------------------------------------- */
  /* Ivory warmed or cooled a step, so alternating bands read as one family
     rather than as new colours. */
  --ivory-deep: #F2ECE4;   /* alternating band on ivory */
  --ivory-edge: #EAE2D6;   /* card edges, dividers on ivory */
  --ink-soft: rgba(26, 26, 26, 0.62);   /* secondary text on ivory */
  --ink-faint: rgba(26, 26, 26, 0.12);  /* hairlines on ivory */
  --on-ink: #F3EEE7;       /* text on the reversed ground */
  --on-ink-soft: rgba(243, 238, 231, 0.66);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --ease-cinematic: cubic-bezier(0.22, 1, 0.36, 1);
  --max-w: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold); color: var(--ink); }

img { max-width: 100%; display: block; }

a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--gold); }
a:hover { color: var(--gold); }

/* ---------- typography ----------
 * Display is Cormorant Garamond Light. The guideline: "Never bolder than
 * Medium; never below 16px." Inter never sets a headline. */

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); letter-spacing: 0.005em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.875rem); line-height: 1.09; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); }

/* Tracked small caps — Inter 500, 0.3em. The guideline's only use of Inter
   above body weight. */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin: 0 0 1.1rem;
}

.lede {
  font-size: clamp(1.02rem, 2vw, 1.18rem);
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 40em;
  font-weight: 300;
}

/* Pull quote — Cormorant 300 italic. */
.pull {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.35rem, 2.6vw, 1.5rem);
  line-height: 1.5;
  color: var(--ink);
  max-width: 24em;
  margin: 2.4rem 0 0;
}

/* ---------- layout ---------- */

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
}

section { padding: clamp(3.5rem, 9vw, 7rem) 0; }

/* The header is sticky, so anchored sections must clear it when jumped to. */
section[id], [id].island-map { scroll-margin-top: 6.5rem; }
@media (max-width: 720px) { section[id], [id].island-map { scroll-margin-top: 8.5rem; } }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1.1rem 0;
  background: rgba(249, 245, 241, 0.93);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink-faint);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.25rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  border-bottom: 0;
}

.brand small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--gold-ink);
  margin-top: 0.15rem;
}

/* Tighter than the old nav: brand small caps carry 0.3em tracking, which makes
   every item wider, so the gap gives the width back and keeps one row. */
nav.main-nav { display: flex; gap: clamp(0.85rem, 2.1vw, 1.6rem); flex-wrap: wrap; }
/* Tracking adds a trailing space after the last letter; pull it back so items
   sit optically evenly. */
nav.main-nav a { margin-right: -0.3em; }

nav.main-nav a {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 0;
  transition: color 0.3s var(--ease-cinematic);
}
nav.main-nav a:hover { color: var(--gold); }

/* ---------- hero ----------
 * Ivory ground. The old obsidian gradient is retired: an ivory brand does not
 * open on navy. Where a photograph is set it fills the hero; the art below is
 * a quiet warm wash, not a picture of the sea. */

.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  padding: 3rem 0 clamp(3rem, 8vw, 6rem);
  overflow: hidden;
  isolation: isolate;
  background: var(--ivory);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse 80% 50% at 72% 12%, rgba(200, 170, 98, 0.10), transparent 66%),
    radial-gradient(ellipse 70% 45% at 18% 88%, rgba(217, 196, 147, 0.14), transparent 62%),
    linear-gradient(180deg, #FBF8F5 0%, var(--ivory) 100%);
}

.hero::after {
  /* faint atoll ring — a hairline, per the pattern rule */
  content: '';
  position: absolute;
  z-index: -1;
  width: 60vmin;
  height: 60vmin;
  right: -10vmin;
  top: 8vmin;
  border-radius: 50%;
  border: 1px solid rgba(200, 170, 98, 0.28);
}

.hero .eyebrow { margin-bottom: 1.4rem; }
.hero h1 { max-width: 12em; }
.hero .lede { margin-top: 1.6rem; }

.hero-meta {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.2rem;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.hero-meta span::before { content: '◆'; color: var(--gold); font-size: 0.5rem; margin-right: 0.7rem; vertical-align: 2px; }

/* ---------- gold rule ---------- */

.rule {
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  border: 0;
  margin: 1.6rem 0 0;
}

/* ---------- property grid (brand home) ---------- */

.props {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.4rem;
  margin-top: 3rem;
}

.prop-card {
  position: relative;
  display: block;
  padding: 2.2rem 1.9rem 1.9rem;
  border: 1px solid var(--ivory-edge);
  background: #FDFBF9;
  color: var(--ink);
  transition: border-color 0.4s var(--ease-cinematic), transform 0.4s var(--ease-cinematic);
}

.prop-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  color: var(--ink);
}

.prop-card .atoll {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.prop-card h3 { margin: 0.7rem 0 0.6rem; }

.prop-card p { color: var(--ink-soft); font-size: 0.92rem; margin: 0; font-weight: 300; }

.prop-card .go {
  display: block;
  width: fit-content;
  margin-top: 1.4rem;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--gold);
}
.prop-card .go::after { content: ' →'; }
/* Second CTA sits tight under Visit website. */
.prop-card .go + .go { margin-top: 0.55rem; }
a.prop-card .go, .prop-card a.go { text-decoration: none; }
.prop-card a.go:hover { color: var(--gold); }

/* ---------- alternating band ----------
 * A warmer step of the same ivory, not a second colour. */

.section-sand {
  background: var(--ivory-deep);
  color: var(--ink);
}
.section-sand h2, .section-sand h3 { color: var(--ink); }
.section-sand .lede, .section-sand p { color: var(--ink-soft); }
.section-sand .eyebrow { color: var(--gold-ink); }

/* ---------- ceremony band ----------
 * The guideline's "reversed ground for ceremony moments". Use sparingly — a
 * closing statement, a single quote. Never for a whole page. */

.section-ink {
  background: var(--ink);
  color: var(--on-ink);
}
.section-ink h1, .section-ink h2, .section-ink h3 { color: var(--on-ink); }
.section-ink .lede, .section-ink p { color: var(--on-ink-soft); }
.section-ink .eyebrow, .section-ink .atoll, .section-ink .facts .k { color: var(--gold); }
.section-ink a { color: var(--on-ink); border-bottom-color: var(--gold); }
.section-ink a:hover { color: var(--gold); }
.section-ink .facts li { border-color: rgba(243, 238, 231, 0.16); }
.section-ink .pull { color: var(--on-ink); }

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

/* ---------- facts / detail lists ---------- */

.facts {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.facts li {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--ink-faint);
  font-size: 0.92rem;
}

.facts .k {
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--gold-ink);
  padding-top: 0.35rem;
  white-space: nowrap;
}

.facts .v { text-align: right; font-weight: 300; }

.tbc {
  font-style: italic;
  opacity: 0.6;
}

/* ---------- experiences ---------- */

.exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem;
  margin-top: 2.6rem;
}

.exp {
  padding: 1.6rem 1.5rem;
  border: 1px solid var(--ivory-edge);
  background: #FDFBF9;
}
.section-sand .exp { background: rgba(255, 255, 255, 0.6); }
.section-ink .exp { background: rgba(255, 255, 255, 0.04); border-color: rgba(243, 238, 231, 0.16); }

.exp h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.exp p { font-size: 0.88rem; margin: 0; color: var(--ink-soft); font-weight: 300; }
.section-ink .exp p { color: var(--on-ink-soft); }

/* ---------- CTA ---------- */

.btn {
  display: inline-block;
  margin-top: 2.2rem;
  padding: 0.95rem 2.4rem;
  border: 1px solid var(--gold);
  color: var(--ink);
  background: none;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  transition: background 0.35s var(--ease-cinematic), color 0.35s var(--ease-cinematic);
}
.btn:hover { background: var(--gold); color: var(--ink); }
.section-ink .btn { color: var(--on-ink); }
.section-ink .btn:hover { background: var(--gold); color: var(--ink); }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--ink-faint);
  padding: 3rem 0 3.5rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}

footer nav { display: flex; flex-direction: column; gap: 0.45rem; }
footer nav a { color: var(--ink-soft); border-bottom: 0; }
footer nav a:hover { color: var(--gold); }

footer .foot-brand { max-width: 22em; }
footer .foot-brand .brand { font-size: 1.05rem; }

/* ---------- property hero variants ----------
 * Each island gets a different quiet warm wash, not a different colour. */

.hero.h-fulhadhoo::before {
  background:
    radial-gradient(ellipse 85% 50% at 30% 18%, rgba(217, 196, 147, 0.20), transparent 62%),
    radial-gradient(ellipse 70% 45% at 82% 78%, rgba(200, 170, 98, 0.10), transparent 62%),
    linear-gradient(180deg, #FCF9F6 0%, var(--ivory) 100%);
}
.hero.h-edge::before {
  background:
    radial-gradient(ellipse 80% 55% at 76% 10%, rgba(200, 170, 98, 0.13), transparent 66%),
    radial-gradient(ellipse 55% 40% at 14% 86%, rgba(217, 196, 147, 0.16), transparent 62%),
    linear-gradient(180deg, #FBF8F4 0%, var(--ivory) 100%);
}
.hero.h-courtyard::before {
  background:
    radial-gradient(ellipse 75% 50% at 50% 0%, rgba(200, 170, 98, 0.15), transparent 62%),
    radial-gradient(ellipse 60% 45% at 86% 82%, rgba(217, 196, 147, 0.13), transparent 66%),
    linear-gradient(180deg, #FCFAF7 0%, var(--ivory) 100%);
}
.hero.h-beach::before {
  background:
    radial-gradient(ellipse 90% 55% at 24% 14%, rgba(217, 196, 147, 0.22), transparent 62%),
    radial-gradient(ellipse 60% 40% at 82% 86%, rgba(200, 170, 98, 0.09), transparent 62%),
    linear-gradient(180deg, #FCF9F6 0%, var(--ivory) 100%);
}
.hero.h-laamu::before {
  background:
    radial-gradient(ellipse 85% 55% at 70% 18%, rgba(200, 170, 98, 0.12), transparent 66%),
    radial-gradient(ellipse 65% 45% at 18% 82%, rgba(217, 196, 147, 0.18), transparent 62%),
    linear-gradient(180deg, #FBF8F4 0%, var(--ivory) 100%);
}

/* property page heroes are shorter */
.hero.prop-hero { min-height: 62vh; }

.crumb {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
}
.crumb a { color: var(--ink-soft); border-bottom: 0; }
.crumb a:hover { color: var(--gold); }

/* ---------- notice ---------- */

.notice {
  margin-top: 3rem;
  padding: 1.1rem 1.4rem;
  border-left: 2px solid var(--gold);
  background: rgba(200, 170, 98, 0.07);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.section-ink .notice { background: rgba(200, 170, 98, 0.10); color: var(--on-ink-soft); }

@media (max-width: 640px) {
  .facts li { flex-direction: column; gap: 0.15rem; }
  .facts .v { text-align: left; }
  .hero { min-height: 84vh; }
}

footer .legal {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  opacity: 0.75;
}

/* ---------- lattice divider ----------
 * The pattern from the guideline, used the way the guideline allows it: on a
 * surface that would otherwise be empty, as a quiet interlude between sections.
 *
 * Three rules govern it and all three are enforced here:
 *   - never above 12% opacity;
 *   - never behind body copy or a lockup — this band carries neither;
 *   - never cropped mid-motif on a visible edge. A hard-edged band would slice
 *     rosettes along all four sides, so the tile is masked to dissolve before it
 *     reaches any edge. Nothing is cut; it fades out.
 */
.divider {
  height: clamp(96px, 11vw, 150px);
  background-image: url(pattern.svg?v=20260906c);
  background-repeat: repeat;
  background-size: 232px auto;
  background-position: center center;
  opacity: 0.12;
  /* Dissolve on both axes. Two mask layers intersected: without the composite
     the second layer would simply replace the first. */
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000 38%, #000 62%, transparent 100%),
    linear-gradient(to right, transparent 0%, #000 22%, #000 78%, transparent 100%);
  mask-image:
    linear-gradient(to bottom, transparent 0%, #000 38%, #000 62%, transparent 100%),
    linear-gradient(to right, transparent 0%, #000 22%, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  pointer-events: none;
}

/* Where masks are unavailable the band would show hard-cropped motifs, which the
   guideline forbids outright — so it simply does not render. */
@supports not ((mask-composite: intersect) or (-webkit-mask-composite: source-in)) {
  .divider { display: none; }
}

/* ---------- island map ---------- */
.island-map {
  height: 440px;
  margin-top: 2.4rem;
  border: 1px solid var(--ivory-edge);
  z-index: 0;
}
.island-map .leaflet-popup-content { font-family: var(--font-body); font-size: 0.85rem; }
.atoll-facts { margin-top: 2rem; display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* ---------- mobile header stacking ---------- */
@media (max-width: 720px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 0.55rem; }
  nav.main-nav { gap: 0.5rem 1.1rem; }
}

/* ---------- scoped typography (survives app-level CSS resets) ---------- */
.bs h1, .bs h2, .bs h3,
.hero h1, section h2, section h3 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.05;
  margin: 0;
}
.bs h1, .hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); letter-spacing: 0.005em; color: var(--ink); }
.bs h2, section h2 { font-size: clamp(1.9rem, 4vw, 2.875rem); color: var(--ink); }
.bs h3, section h3 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); color: var(--ink); }
.bs .exp h3, section .exp h3 { font-size: 1.15rem; }
.bs .prop-card h3 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); }
.bs .section-ink h1, .bs .section-ink h2, .bs .section-ink h3,
.section-ink h2, .section-ink h3 { color: var(--on-ink); }
.bs a { color: var(--ink); text-decoration: none; }
.bs a:hover { color: var(--gold); }
.bs .facts, .bs ul.facts { list-style: none; }
.bs section, .bs .hero { box-sizing: border-box; }

/* ---------- editable photos (admin-managed) ---------- */
/* Sits above the gradient art (::before, -3) and below the atoll ring (::after, -1),
   so a real photo replaces the art entirely instead of being dimmed behind it. */
.hero-photo { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; }

/* Legibility scrim — only painted once a photo is actually set. Weighted to the
   bottom, where the hero copy sits (.hero uses align-items: flex-end). A
   photographic hero is a ceremony moment, so its copy reverses to ivory. */
.hero-photo[style*="background-image"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26, 26, 26, 0.12) 0%, rgba(26, 26, 26, 0.46) 45%, rgba(26, 26, 26, 0.84) 100%);
}
.hero:has(.hero-photo[style*="background-image"]) h1,
.hero:has(.hero-photo[style*="background-image"]) .crumb { color: var(--on-ink); }
.hero:has(.hero-photo[style*="background-image"]) .lede,
.hero:has(.hero-photo[style*="background-image"]) .hero-meta { color: var(--on-ink-soft); }
/* A photographic hero is a dark ground, so the small caps revert to true
   Sultanate Gold — 7.78:1 there, where the darkened gold would disappear. */
.hero:has(.hero-photo[style*="background-image"]) .eyebrow,
.hero:has(.hero-photo[style*="background-image"]) .hero-meta span::before { color: var(--gold); }

.island-photo { display: none; margin-top: 1.8rem; aspect-ratio: 4 / 3; background-size: cover; background-position: center; border: 1px solid var(--ivory-edge); }
.island-photo[style*="background-image"] { display: block; }

/* ---------- gallery ---------- */

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: 2.4rem; }
.gallery-grid img { width: 100%; height: 260px; object-fit: cover; border: 1px solid var(--ivory-edge); display: block; }

/* ---------- accessibility ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.85rem 1.4rem;
  background: var(--ink);
  color: var(--ivory);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  border-bottom: 0;
}
.skip-link:focus { left: 0; color: var(--ivory); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Brand logo (emblem + wordmark lockup) -------------------------------
 * The master artwork is never recoloured. On the ivory ground the full-colour
 * lockup is the approved form; the reversed ceremony band uses the white one. */
.brand-logo {
  display: block;
  height: clamp(58px, 6.4vw, 82px);
  width: auto;
}
.brand:has(.brand-logo) { line-height: 0; }
.brand .brand-logo + small { margin-top: 0.45rem; }
.foot-brand .brand-logo { height: 56px; }

/* Coming-soon lockup carries an extra line, so lift it slightly to keep the
   wordmark optically the same size as on the open houses. */
.brand-logo.is-soon { height: clamp(63px, 7vw, 90px); }
