/* CSI Coimbra: estilos do protótipo de página única */
:root {
  --yellow: #d6950d;          /* amarelo da marca (site antigo) */
  --yellow-soft: #f6e7c4;
  --steel: #acc0cd;           /* azul-acinzentado secundário (site antigo) */
  --ink: #2b2b2b;
  --muted: #5d6166;
  --bg: #ffffff;
  --bg-alt: #faf6ee;
  --card: #ffffff;
  --line: #e7e1d4;
  --needle-big: #333333;
  --needle-small: var(--yellow);
  --radius: 14px;
  --shadow: 0 6px 24px rgba(40, 30, 10, .08);
  --max: 1120px;
  --header-h: 64px;
  /* Barra superior: carvão com linha amarela, distinta do conteúdo nos dois modos */
  --header-bg: #26221c;
  --header-ink: #f6f2ea;
  --header-line: rgba(255, 255, 255, .18);
  --footer-bg: #1d1c1a;
  --hero-glow: rgba(214, 149, 13, .10);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --yellow-soft: #3d2f12;
    --ink: #f4f1ea;
    --muted: #c2bcb1;
    --bg: #121110;
    --bg-alt: #1f1a12;
    --card: #2a251d;
    --line: #463e31;
    --needle-big: #ffffff;
    --shadow: 0 8px 28px rgba(0, 0, 0, .55);
    --header-bg: #2e281f;
    --header-line: rgba(255, 255, 255, .14);
    --footer-bg: #0a0908;
    --hero-glow: rgba(214, 149, 13, .16);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --yellow-soft: #3d2f12;
  --ink: #f4f1ea;
  --muted: #c2bcb1;
  --bg: #121110;
  --bg-alt: #1f1a12;
  --card: #2a251d;
  --line: #463e31;
  --needle-big: #ffffff;
  --shadow: 0 8px 28px rgba(0, 0, 0, .55);
  --header-bg: #2e281f;
  --header-line: rgba(255, 255, 255, .14);
  --footer-bg: #0a0908;
  --hero-glow: rgba(214, 149, 13, .16);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font: 400 1.0625rem/1.65 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
h2::after {
  content: ""; display: block; width: 56px; height: 4px; margin-top: .4em;
  background: var(--yellow); border-radius: 2px;
}
p { margin: 0 0 1em; }
.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section.alt { background: var(--bg-alt); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.placeholder { outline: 2px dashed var(--steel); outline-offset: 4px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--yellow); color: #222; padding: 8px 14px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }

/* Botões: amarelo leva texto escuro (contraste 4,9:1; branco só daria 2,6:1) */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .8em 1.4em; border-radius: 999px; border: 2px solid var(--yellow);
  font-weight: 700; text-decoration: none; cursor: pointer; font-size: 1rem;
  transition: transform .2s, background-color .2s, color .2s;
}
.btn-primary { background: var(--yellow); color: #222; }
.btn-primary:hover { background: #c4870a; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--yellow-soft); }
.btn:active { transform: translateY(1px); }
:focus-visible { outline: 3px solid var(--steel); outline-offset: 3px; }

/* Cabeçalho fixo: menu dividido à volta do centro, onde a rosa encaixa ao fazer scroll */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: var(--header-bg); color: var(--header-ink);
  border-bottom: 3px solid var(--yellow);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
}
.site-header .wrap { position: relative; height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; font-size: 1.1rem; white-space: nowrap; }
.brand .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--yellow); }
.nav { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 96px 1fr; align-items: center; pointer-events: none; }
.nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; pointer-events: auto; }
.nav .nav-left { grid-column: 1; justify-self: end; }
.nav .nav-right { grid-column: 3; justify-self: start; }
.nav a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 500; }
.nav a { color: var(--header-ink); }
.nav a:hover { background: rgba(214, 149, 13, .18); color: #ffd27a; }
.nav a[aria-current="true"] { color: var(--yellow); box-shadow: inset 0 -2px 0 var(--yellow); border-radius: 8px 8px 0 0; }
.header-tools { position: relative; z-index: 1; margin-left: auto; display: flex; align-items: center; gap: 6px; }
.lang, .icon-btn {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px;
  border-radius: 8px; border: 1px solid var(--header-line); background: transparent; color: inherit;
  font: inherit; font-weight: 700; font-size: .9rem; text-decoration: none; cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.menu-toggle { display: none; }
@media (max-width: 1099px) {
  .menu-toggle { display: inline-grid; }
  .nav {
    position: fixed; inset: calc(var(--header-h) + 3px) 0 auto 0; background: var(--header-bg);
    border-bottom: 3px solid var(--yellow); box-shadow: var(--shadow);
    display: none; pointer-events: auto; padding: 8px 16px 16px;
  }
  .nav.open { display: flex; flex-direction: column; }
  .nav ul { flex-direction: column; gap: 2px; width: 100%; max-width: 560px; margin: 0 auto; }
  .nav .nav-left, .nav .nav-right { justify-self: auto; }
  .nav .nav-left { border-bottom: 1px solid var(--header-line); padding-bottom: 6px; margin-bottom: 6px; }
  .nav a { padding: 12px 14px; font-size: 1.1rem; }
  .nav a[aria-current="true"] { box-shadow: inset 3px 0 0 var(--yellow); border-radius: 0 8px 8px 0; }
}
/* Ecrãs muito estreitos: logótipo e botões mais compactos para a rosa caber no centro */
@media (max-width: 380px) {
  .brand { font-size: .9rem; gap: 6px; }
  .brand .dot { width: 11px; height: 11px; }
  .header-tools { gap: 4px; }
  .icon-btn, .lang { min-width: 36px; height: 36px; padding: 0 6px; }
}

/* Hero centrado: rosa dos ventos em cima, texto por baixo */
.hero { padding: clamp(28px, 5vw, 64px) 0 clamp(48px, 7vw, 96px); text-align: center; }
.hero h1 { font-size: clamp(2.1rem, 1.3rem + 3.6vw, 4rem); letter-spacing: -.01em; }
.hero h1 span { color: var(--yellow); }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-weight: 700; font-size: .85rem; color: var(--muted); margin-bottom: .6em; }
.hero .lead { margin-inline: auto; }
.hero .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 1.6em; }
.compass-slot { width: min(300px, 62vw); aspect-ratio: 1; margin: 0 auto clamp(20px, 3vw, 36px); }

.compass {
  all: unset; box-sizing: border-box; position: relative; display: grid; place-items: center;
  width: 100%; aspect-ratio: 1; cursor: pointer; border-radius: 50%; touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}
.compass:focus-visible { outline: 3px solid var(--steel); outline-offset: 4px; }
/* Com JS a rosa fica fixa e é posicionada por compass.js (sobe e encolhe até ao cabeçalho) */
.compass.floating { position: fixed; left: 0; top: 0; z-index: 60; transform-origin: center; will-change: transform; }
.compass.floating.gliding { transition: transform .4s cubic-bezier(.2, .7, .2, 1); }
.compass .rose { grid-area: 1 / 1; width: 100%; height: 100%; fill: var(--yellow); animation: spin 60s linear infinite; }
.compass .needle { grid-area: 1 / 1; width: 38%; transition: transform .12s ease-out; will-change: transform; }
.compass .needle-small { fill: var(--needle-small); }
.compass .needle-big { fill: var(--needle-big); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .compass .rose { animation: none; }
  .compass .needle { transition: none; }
}

/* Sobre */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.rounded { border-radius: var(--radius); box-shadow: var(--shadow); }
.features { list-style: none; padding: 0; margin: 1.2em 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.features li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; gap: 10px; align-items: flex-start; }
.features li::before { content: ""; flex: 0 0 10px; height: 10px; margin-top: .55em; border-radius: 50%; background: var(--yellow); }

/* Galeria */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 1.5em; }
@media (min-width: 900px) {
  .gallery { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  /* a foto larga acompanha a altura da linha em vez de a esticar */
  .gallery button:first-child { aspect-ratio: auto; position: relative; }
  .gallery button:first-child img { position: absolute; inset: 0; }
}
.gallery button:first-child { grid-column: span 2; }
.gallery button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 10; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery button:hover img { transform: scale(1.04); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1200px, 94vw); max-height: 92vh; }
.lightbox::backdrop { background: rgba(0, 0, 0, .85); }
.lightbox img { max-height: 86vh; width: auto; margin: auto; border-radius: 8px; }
.lightbox .lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; color: #fff; }
.lightbox .lb-bar button { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 8px; min-width: 44px; height: 44px; font-size: 1.3rem; cursor: pointer; }

/* Localização */
.map-box { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--yellow-soft); display: grid; place-items: center; text-align: center; padding: 24px; border: 1px solid var(--line); }
.map-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-box small { display: block; margin-top: 10px; color: var(--muted); max-width: 40ch; }
.address { font-style: normal; font-size: 1.15rem; font-weight: 500; margin-bottom: 1em; }

/* Comunidade & redes */
.social-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 1.5em; }
.social-card { display: flex; gap: 14px; align-items: center; padding: 20px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; box-shadow: var(--shadow); transition: transform .2s; }
.social-card:hover { transform: translateY(-3px); }
.social-card svg { width: 36px; height: 36px; flex: 0 0 36px; fill: var(--yellow); }
.social-card strong { display: block; }
.social-card span { color: var(--muted); font-size: .95rem; }
.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.strip img { aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
@media (max-width: 560px) { .strip { grid-template-columns: repeat(2, 1fr); } .strip img:nth-child(3) { display: none; } }

/* Contacto / formulário */
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(24px, 4vw, 56px); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; padding: 0; margin: 1em 0 0; display: grid; gap: 10px; }
.contact-list a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.contact-list svg { width: 22px; height: 22px; flex: 0 0 22px; fill: var(--yellow); }
form.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } }
label { display: block; font-weight: 500; font-size: .95rem; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 46px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--yellow); outline-offset: 1px; border-color: var(--yellow); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; min-height: 20px; height: 20px; margin-top: 3px; flex: 0 0 20px; accent-color: var(--yellow); }
.hp { position: absolute; left: -5000px; }
.form-status { margin: 12px 0 0; font-weight: 500; }
.form-status.ok { color: #2f7a3a; }
.form-status.err { color: #b3261e; }
.form-note { color: var(--muted); font-size: .9rem; margin-top: 10px; }

/* WhatsApp flutuante */
.wa-float {
  position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 56px; height: 56px; border-radius: 50%;
  background: #25d366; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.wa-float svg { width: 30px; height: 30px; fill: #fff; }

/* Rodapé */
.site-footer { background: var(--footer-bg); color: #e9e6df; border-top: 3px solid var(--yellow); padding: 40px 0; font-size: .95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer a { color: #e9e6df; }

/* Páginas legais */
.legal { max-width: 72ch; }
.legal h2 { font-size: 1.3rem; margin-top: 1.6em; }
.legal h2::after { display: none; }

/* Textos de informação geral */
h3.sub { font-size: 1.25rem; margin: clamp(32px, 5vw, 56px) 0 0; }
.included { margin-top: 1.2em; padding: 16px 18px; border-radius: 12px; background: var(--yellow-soft); border-left: 5px solid var(--yellow); }
.included strong { display: block; font-size: 1.1rem; }
.included span { color: var(--muted); }
.near { list-style: none; padding: 0; margin: 0 0 1.4em; display: grid; gap: 8px; }
.near li { padding-left: 22px; position: relative; }
.near li::before { content: ""; position: absolute; left: 0; top: .55em; width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); }
.rules { margin-top: 8px; }
.rules ul { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rules li { background: var(--yellow-soft); border-radius: 12px; padding: 14px 16px; font-weight: 500; }

/* Brilho amarelo suave atrás da rosa e cabeçalho: dá profundidade sobretudo no modo escuro */
.hero { background: radial-gradient(60% 55% at 50% 22%, var(--hero-glow), transparent 70%); }
/* Rosa encaixada na barra (fundo escuro): agulha grande em branco */
.compass.docked .needle-big { fill: #fff; }
.lang:hover, .icon-btn:hover { border-color: var(--yellow); color: var(--yellow); }
