/* Beaches Mallorca — public site.
   Same philosophy as the admin dashboard: no framework, no build step, no CSS library.
   The pages are static HTML, so the only thing standing between a visitor and the content
   is this file — keep it small. */

:root {
  --bg: #f7f9fb;
  --panel: #ffffff;
  --line: #e3e8ee;
  --text: #12161c;
  --muted: #5c6673;
  --accent: #0a7ea4;          /* the app's sea blue */
  --accent-ink: #ffffff;
  --accent-soft: #e6f3f8;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --quiet: #067647;
  --quiet-soft: #e7f6ee;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .05);
  --maxw: 1080px;
  --measure: 66ch;            /* comfortable line length for body text */

  /* One spacing ladder for the whole site, so vertical rhythm is a choice from a small set
     rather than whatever number someone typed that day. */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 44px; --s8: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --panel: #171b21;
    --line: #262c35;
    --text: #e9edf2;
    --muted: #98a2b0;
    --accent: #38bdf8;
    --accent-ink: #06212c;
    --accent-soft: #0c2b38;
    --warn: #fbbf24;
    --warn-soft: #3a2e10;
    --quiet: #4ade80;
    --quiet-soft: #12301f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 4px 14px rgba(0, 0, 0, .28);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); }

/* Visible only for keyboard users, so it never adds noise for mouse users but never leaves
   a keyboard user guessing where they are either. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

img { max-width: 100%; height: auto; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0; z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- vertical rhythm ----------
   A heading belongs to the content *below* it, so it takes generous space above and little
   below. Getting this backwards — which is what happens when headings carry only a bottom
   margin — makes a page of h2 + content pairs read as one undifferentiated column, because
   every heading sits closer to the previous section than to its own text. */

.flow > * { margin-top: var(--s5); margin-bottom: 0; }
.flow > :first-child { margin-top: 0; }
.flow > h2 { margin-top: var(--s8); }
.flow > h2 + * { margin-top: var(--s4); }
.flow > h3 { margin-top: var(--s6); }
.flow > h3 + * { margin-top: var(--s3); }
/* Text keeps a readable measure; full-width blocks (maps, grids) are exempt. */
.flow > p { max-width: var(--measure); }

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

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap {
  display: flex; align-items: center; gap: var(--s5);
  min-height: 62px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: var(--s2);
  font-weight: 700; text-decoration: none; color: var(--text); font-size: 17px;
}
.brand .logo { font-size: 21px; line-height: 1; }
.site-nav { display: flex; gap: var(--s5); margin-inline-start: auto; align-items: center; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }

/* ---------- headings ---------- */

h1, h2, h3 { letter-spacing: -.018em; line-height: 1.18; }
h1 { font-size: clamp(29px, 4.6vw, 42px); }
h2 { font-size: clamp(21px, 2.9vw, 27px); }
h3 { font-size: 17px; line-height: 1.35; }

/* ---------- hero ---------- */

.hero {
  padding: var(--s8) 0;
  background: radial-gradient(1000px 380px at 78% -12%, var(--accent-soft), transparent 66%);
}
.hero h1 { margin: 0 0 var(--s4); max-width: 17ch; }
.hero p {
  margin: 0 0 var(--s6);
  font-size: clamp(17px, 2.1vw, 19px); color: var(--muted); max-width: 56ch;
}

.cta-row { display: flex; gap: var(--s3); flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 13px 22px; border-radius: 999px;
  font-weight: 600; font-size: 16px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: filter .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-secondary { background: var(--panel); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- sections ---------- */

section { padding: var(--s8) 0; }
/* Consecutive sections would otherwise stack two paddings into a chasm. */
section + section { padding-top: 0; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

.grid {
  display: grid; gap: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
}
.card { padding: var(--s5); }
.card h3 { margin: 0 0 var(--s2); }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card .ico { font-size: 22px; margin-bottom: var(--s3); display: block; }

/* ---------- report status band ----------
   The one piece of live data on the page. Styled as a statement of fact, not an alarm:
   it reports what people found, and overstating that would be dishonest. */

.status {
  display: flex; align-items: flex-start; gap: var(--s3);
  padding: 18px 20px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel);
}
.status .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--muted); flex: none; margin-top: 7px;
}
.status .label { font-weight: 650; font-size: 17px; display: block; }
.status .sub { color: var(--muted); font-size: 14px; margin-top: 2px; display: block; }
.status[data-state="reported"] { background: var(--warn-soft); border-color: transparent; }
.status[data-state="reported"] .dot { background: var(--warn); }
.status[data-state="quiet"] { background: var(--quiet-soft); border-color: transparent; }
.status[data-state="quiet"] .dot { background: var(--quiet); }
.status[data-state="loading"] .dot { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .3 } 50% { opacity: 1 } }

/* The caption explains the band directly above it, so it stays tight to it — the one place
   the usual rhythm would say too much. */
.status + .caption { margin-top: var(--s3); }
.caption { color: var(--muted); font-size: 13.5px; max-width: var(--measure); }

/* ---------- install prompt ----------
   Appears where the need is felt, not as a sitewide banner. */

.install {
  padding: var(--s5);
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent-soft);
}
.install h2, .install h3 { margin: 0 0 var(--s2); font-size: 20px; }
.install p { margin: 0 0 var(--s4); color: var(--muted); max-width: 54ch; }
@media (prefers-color-scheme: dark) { .install p { color: #b9c4d1; } }

/* ---------- beach page ---------- */

.beach-head { padding: var(--s7) 0 0; }
.beach-head h1 { margin: 0 0 var(--s1); }
.beach-head .where { color: var(--muted); margin: 0 0 var(--s5); font-size: 15px; }
/* The head block is its own funnel — name, what's reported, the offer — so it gets a clear
   break before the reference content starts. */
.beach-head .install { margin-top: var(--s6); }

.facts {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  max-width: 560px;
}
.facts li {
  background: var(--panel); padding: 13px 18px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s4); align-items: baseline; font-size: 15px;
}
.facts .k { color: var(--muted); }
.facts .v { font-weight: 600; text-align: end; }

.amenities { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.amenities li {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 13px; font-size: 14px; color: var(--muted);
}

#map, #beach-map {
  height: 440px; width: 100%;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--panel); z-index: 1;
}
#beach-map { height: 300px; }

.legend { display: flex; gap: var(--s5); flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }

/* ---------- beach index ---------- */

.beach-list { columns: 3 210px; column-gap: var(--s6); margin: 0; padding: 0; list-style: none; }
.beach-list li { break-inside: avoid; margin: 0 0 var(--s1); }
.beach-list a { color: var(--text); text-decoration: none; font-size: 15px; }
.beach-list a:hover { color: var(--accent); text-decoration: underline; }

.nearby {
  list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.nearby a {
  display: block; padding: 14px 16px; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s ease;
}
.nearby a:hover { border-color: var(--accent); }
.nearby .dist { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

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

.site-footer {
  border-top: 1px solid var(--line); background: var(--panel);
  margin-top: var(--s8); padding: var(--s6) 0; font-size: 14px; color: var(--muted);
}
.site-footer .wrap { display: grid; gap: var(--s4); }
.site-footer a { color: var(--muted); }
.site-footer .links { display: flex; gap: var(--s5); flex-wrap: wrap; }
.site-footer .disclaimer { max-width: 74ch; margin: 0; }
.site-footer p { margin: 0; }
.langs { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.langs a[aria-current="true"] { color: var(--text); font-weight: 600; }

/* ---------- narrow screens ----------
   Mobile visitors on the island are the highest-intent installs there are, so the layout
   gives the install prompt more room rather than less. */

@media (max-width: 640px) {
  :root { --s7: 32px; --s8: 44px; }
  .hero { padding: var(--s7) 0; }
  .beach-list { columns: 1; }
  .cta-row .btn { flex: 1 1 100%; justify-content: center; }
  #map { height: 340px; }
  .facts li { padding: 12px 14px; }
}
