/* ==========================================================================
   Reef Digital - the shared template stylesheet.

   Every template imports this and adds its own template.css on top.
   The theme colours are CSS custom properties, so a customer's brand
   colours are applied by setting variables - no rebuild, no CSS edit.

   The theme variables the CMS sets:
     --primary   the brand colour (buttons, links, accents)
     --accent    the second brand colour
     --ink       body text colour
     --paper     page background
     --surface   card background
     --line      hairline borders
     --muted     secondary text
     --radius    corner radius
   ========================================================================== */

:root {
  --primary: #0ea5a0;
  --accent: #ff6b35;
  --ink: #1a2a33;
  --paper: #f7f5f0;
  --surface: #ffffff;
  --line: #e4e0d7;
  --muted: #5a6e7a;
  --radius: 14px;
  --radius-sm: 9px;
  --max: 1160px;
  --shadow: 0 2px 4px rgba(7, 30, 46, .04), 0 12px 32px rgba(7, 30, 46, .08);
  --shadow-lift: 0 4px 8px rgba(7, 30, 46, .06), 0 20px 48px rgba(7, 30, 46, .14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Poppins', system-ui, sans-serif; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section { padding: 84px 0; }
.section-sm { padding: 58px 0; }
.surface { background: var(--surface); }

.eyebrow {
  font-family: 'Poppins', sans-serif;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}
.lead { color: var(--muted); font-size: 1.05rem; max-width: 62ch; }
.centre { text-align: center; }
.centre .lead { margin-left: auto; margin-right: auto; }
.head { margin-bottom: 40px; }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; border: 2px solid transparent;
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: .95rem;
  cursor: pointer; text-align: center;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, .14); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { border-color: currentColor; color: inherit; }
.btn-ghost:hover { background: rgba(127, 127, 127, .12); }
.btn-lg { padding: 16px 34px; font-size: 1rem; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
}
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------------------------------------------------------------- form */
.field { margin-bottom: 15px; }
.field label {
  display: block; font-family: 'Poppins', sans-serif; font-size: .8rem;
  font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-family: inherit; font-size: .95rem;
  color: var(--ink); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.field textarea { resize: vertical; min-height: 120px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* -------------------------------------------------------------- footer */
.site-footer { background: #0b1620; color: rgba(255, 255, 255, .72); padding: 58px 0 26px; }
.site-footer a { color: rgba(255, 255, 255, .78); }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 38px; padding-bottom: 30px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.footer-grid h4 { color: #fff; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
.footer-grid li { margin-bottom: 9px; font-size: .92rem; }
.footer-brand { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 1.2rem; color: #fff; margin-bottom: 10px; }
.footer-brand span { color: var(--primary); }
.footer-bottom { padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .84rem; color: rgba(255, 255, 255, .45); }

/* The prototype element inside a list is only the shape of one
   entry. Once the engine has built the real entries it is hidden - but
   only when the content actually loaded, so the built-in copy is still
   what a visitor sees if content.json cannot be fetched. */
html[data-cms-loaded="true"] [data-cms-template] { display: none !important; }

/* ------------------------------------------------------- CMS map overlay */
[data-cms-highlight] { outline: 2px dashed var(--accent); outline-offset: 3px; }
#reef-cms-map {
  position: fixed; right: 16px; bottom: 16px; z-index: 9999;
  width: min(420px, calc(100vw - 32px)); max-height: 70vh; overflow: auto;
  background: #0b1620; color: #fff; border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .16); box-shadow: var(--shadow-lift);
  font-size: .82rem;
}
#reef-cms-map .reef-cms-map-head {
  position: sticky; top: 0; background: #0b1620; padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
#reef-cms-map .reef-cms-map-head span { color: rgba(255, 255, 255, .6); }
#reef-cms-map .reef-cms-map-head button {
  margin-left: auto; background: transparent; border: 1px solid rgba(255, 255, 255, .3);
  color: #fff; border-radius: 999px; padding: 4px 12px; cursor: pointer; font: inherit;
}
#reef-cms-map ul { padding: 8px 16px 16px; }
#reef-cms-map li { display: flex; gap: 10px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
#reef-cms-map code { color: var(--accent); font-size: .78rem; word-break: break-all; }
.reef-cms-label { color: rgba(255, 255, 255, .8); }
.reef-cms-kind { margin-left: auto; color: rgba(255, 255, 255, .45); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .section { padding: 58px 0; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
}
