/* Madô — shared styles. Colours and type follow docs/design-system.md.
   The "playful" colours (rose, butter, teal) are the kids' extension of the
   palette: illustrations and decoration only, never body text. */
:root {
  /* Principais */
  --mado-green: #42532f;
  --mado-brown: #964a32;
  --mado-cream: #f6f0e6;
  /* Secundárias */
  --mado-ochre: #dc9250;
  --mado-sage: #70845f;
  --mado-sage-light: #a1a57c;
  /* Playful extension (illustrations only) */
  --mado-rose: #c27b7b;
  --mado-butter: #eec170;
  --mado-teal: #7fa3a1;
  --mado-chocolate: #3b2a1e;

  --paper: #fffdf9;
  --text: var(--mado-green);
  --text-soft: #56623f;
  --font: "Be Vietnam Pro", "Be Vietnam", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", cursive;
  --blob-a: 32px 18px 30px 16px / 20px 30px 18px 28px;
  --blob-b: 18px 30px 16px 32px / 28px 18px 30px 20px;
  --max: 1100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--mado-cream);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--mado-brown); }
strong, b { font-weight: 500; }
:focus-visible { outline: 3px solid var(--mado-ochre); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 240, 230, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1.5px solid rgba(161, 165, 124, 0.45);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 1rem;
  min-height: 64px;
}
.brand { flex-shrink: 0; }
.brand img { height: 38px; width: auto; }
.nav { display: flex; gap: 0.25rem; margin-left: auto; }
.nav a {
  text-decoration: none; color: var(--text);
  font-weight: 400; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem;
  padding: 0.45em 0.8em; border-radius: 999px;
  transition: background 0.2s;
}
.nav a:hover { background: rgba(161, 165, 124, 0.25); }
.nav a[aria-current="page"] { background: var(--mado-green); color: var(--mado-cream); }

.lang-switch { display: flex; gap: 0.15rem; border: 1.5px solid var(--mado-sage-light); border-radius: 999px; padding: 0.15rem; }
.lang-btn {
  font: 500 0.78rem/1 var(--font); letter-spacing: 0.06em;
  color: var(--text-soft); background: transparent; border: 0;
  padding: 0.45em 0.6em; border-radius: 999px; cursor: pointer; text-decoration: none;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--mado-ochre); color: var(--mado-chocolate); }

/* Menu button: added by mado.js (so without JS the links stay inline). */
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex-shrink: 0;
  background: transparent; border: 1.5px solid var(--mado-sage-light); border-radius: 999px;
  color: var(--text); cursor: pointer;
}
.nav-toggle:hover { background: rgba(161, 165, 124, 0.2); }
.nav-toggle .x { display: none; }
.nav-open .nav-toggle .bars { display: none; }
.nav-open .nav-toggle .x { display: block; }

@media (max-width: 600px) {
  .site-header .wrap { gap: 0.6rem; min-height: 60px; position: relative; }
  .brand img { height: 32px; }
  .lang-btn { padding: 0.45em 0.5em; }
  .has-nav-toggle .nav-toggle { display: inline-flex; }
  .has-nav-toggle .lang-switch { margin-left: auto; }
  .has-nav-toggle .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0.3rem; padding: 0.7rem 1.25rem 1rem;
    background: var(--mado-cream); border-bottom: 1.5px solid rgba(161, 165, 124, 0.45);
    box-shadow: 0 12px 24px rgba(66, 83, 47, 0.12);
  }
  .has-nav-toggle.nav-open .nav { display: flex; }
  .has-nav-toggle .nav a { font-size: 0.95rem; padding: 0.75em 1em; letter-spacing: 0.08em; }
}

/* ---------- Type ---------- */
.eyebrow {
  font-weight: 400; text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.8rem; color: var(--mado-brown);
}
.hand { font-family: var(--hand); font-weight: 600; color: var(--mado-brown); }
.section-title {
  font-weight: 300; text-transform: uppercase; letter-spacing: 0.05em;
  font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.15;
  margin: 0.3rem 0 1.25rem;
}
.section-title::after {
  content: ""; display: block; width: 72px; height: 7px; margin-top: 0.6rem;
  border-radius: 50% 40% 60% 45%;
  background: var(--accent, var(--mado-ochre));
}
.section-text { font-size: 1.12rem; line-height: 1.8; max-width: 640px; }
.section-text + .section-text { margin-top: 1rem; }

section.block { padding: 4.5rem 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font: 500 1rem/1.2 var(--font);
  text-decoration: none; cursor: pointer;
  min-height: 48px; padding: 0.8em 1.5em;
  border-radius: 999px; border: 1.5px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-2px) rotate(-1deg); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--mado-brown); color: var(--mado-cream); }
.btn-primary:hover { background: #7e3d29; }
.btn-green { background: var(--mado-green); color: var(--mado-cream); }
.btn-green:hover { background: #34431f; }
.btn-ghost { background: transparent; color: var(--text); border-color: currentColor; }
.btn-ghost:hover { background: rgba(66, 83, 47, 0.07); }
.btn-small { min-height: 40px; padding: 0.55em 1.1em; font-size: 0.92rem; }
.btn svg { flex-shrink: 0; }

/* ---------- Motif border (stool / flower / bowl) ---------- */
.motif { height: 120px; background-repeat: repeat-x; background-position: left bottom; background-size: auto 100%; }
.motif.small { height: 70px; }
@media (max-width: 560px) { .motif { height: 84px; } .motif.small { height: 54px; } }

/* ---------- Hero ---------- */
.hero {
  background: var(--mado-green); color: var(--mado-cream);
  position: relative; overflow: hidden; text-align: center;
}
.hero-inner { padding: 4.5rem 1.25rem 2.5rem; position: relative; z-index: 1; }
.hero-logo { width: min(520px, 86vw); margin: 0 auto 1.6rem; animation: breathe 5s ease-in-out infinite; }
.hero-tagline { font-size: clamp(1.1rem, 2.6vw, 1.45rem); max-width: 560px; margin: 0 auto; line-height: 1.5; }
@keyframes breathe { 0%, 100% { transform: scale(1) rotate(-1deg); } 50% { transform: scale(1.025) rotate(0deg); } }

.float-shape {
  position: absolute; z-index: 0; opacity: 0.55;
  animation: floaty 7s ease-in-out infinite;
}
@media (max-width: 560px) { .float-shape { display: none; } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-16px) rotate(8deg); } }

/* ---------- Event cards ---------- */
.date-badge {
  flex-shrink: 0; width: 84px; height: 92px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--mado-ochre); color: var(--mado-chocolate);
  border-radius: var(--blob-a); transform: rotate(-3deg);
  line-height: 1;
}
.date-badge .d { font-size: 2.3rem; font-weight: 500; }
.date-badge .m { font-size: 0.85rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.3rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-size: 0.9rem; font-weight: 400; line-height: 1.3;
  padding: 0.35em 0.8em; border-radius: 999px;
  background: var(--chip-bg, rgba(161, 165, 124, 0.22)); color: var(--text);
}
.chip svg { flex-shrink: 0; }
.chip.c-rose { --chip-bg: rgba(194, 123, 123, 0.2); }
.chip.c-ochre { --chip-bg: rgba(220, 146, 80, 0.22); }
.chip.c-teal { --chip-bg: rgba(127, 163, 161, 0.25); }
.chip.c-butter { --chip-bg: rgba(238, 193, 112, 0.35); }

/* Mini card (home) */
.next-event {
  position: relative; z-index: 2;
  margin: -2.5rem auto 0; max-width: 820px;
  background: var(--paper);
  border: 1.5px solid var(--mado-sage-light);
  border-radius: var(--blob-a);
  box-shadow: 0 14px 36px rgba(66, 83, 47, 0.12);
  padding: 1.6rem 1.6rem 1.5rem;
}
.next-event .top { display: flex; gap: 1.2rem; align-items: center; }
.next-event h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 400; line-height: 1.2; margin: 0.15rem 0 0; }
.next-event .chips { margin: 1rem 0 1.2rem; }
.next-event .actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
@media (max-width: 560px) {
  .next-event { margin: -1.5rem 0.75rem 0; padding: 1.3rem 1.1rem; }
  .next-event .date-badge { width: 66px; height: 74px; }
  .next-event .date-badge .d { font-size: 1.8rem; }
  .next-event .actions .btn { flex: 1 1 100%; }
}

/* Full card (/eventos) */
.event-card {
  display: grid; grid-template-columns: 1fr 260px; gap: 0;
  background: var(--paper);
  border: 1.5px solid var(--mado-sage-light);
  border-radius: var(--blob-a);
  box-shadow: 0 14px 36px rgba(66, 83, 47, 0.12);
  overflow: hidden;
}
.event-card .body { padding: 2rem 2rem 1.8rem; }
.event-card .head { display: flex; gap: 1.2rem; align-items: center; margin-bottom: 1.1rem; }
.event-card h2 { font-size: clamp(1.4rem, 3.4vw, 2rem); font-weight: 400; line-height: 1.15; }
.event-card .summary { font-size: 1.05rem; margin: 0.9rem 0 1.1rem; }
.event-card .highlights { list-style: none; display: grid; gap: 0.55rem; margin: 0 0 1.3rem; }
.event-card .highlights li { display: flex; gap: 0.7rem; align-items: center; font-size: 1.02rem; }
.event-card .highlights svg { flex-shrink: 0; }
.event-card .note {
  display: inline-block; font-weight: 500; color: var(--mado-brown);
  background: rgba(220, 146, 80, 0.18); padding: 0.35em 0.8em; border-radius: 10px;
  transform: rotate(-1deg); margin-bottom: 1.4rem;
}
.event-card .actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.event-card .side {
  background: var(--mado-green); position: relative;
  display: flex; align-items: center; justify-content: center; padding: 1.4rem;
}
.event-card .side a { display: block; transform: rotate(2deg); transition: transform 0.2s; }
.event-card .side a:hover { transform: rotate(0deg) scale(1.02); }
.event-card .side img { border-radius: 10px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); }
.event-card .side .poster-label {
  display: block; text-align: center; color: var(--mado-cream); font-size: 0.85rem; margin-top: 0.7rem;
}
@media (max-width: 760px) {
  .event-card { grid-template-columns: 1fr; }
  .event-card .side { padding: 1.2rem; }
  .event-card .side img { max-height: 220px; width: auto; margin: 0 auto; }
  .event-card .body { padding: 1.5rem 1.2rem 1.4rem; }
  .event-card .actions .btn { flex: 1 1 100%; }
}

/* Past events: grey, horizontal slider */
.past { margin-bottom: 2.5rem; }
.past-row {
  display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0.3rem 0.2rem 1rem; -webkit-overflow-scrolling: touch;
}
.past-card {
  flex: 0 0 min(300px, 80vw); scroll-snap-align: start;
  display: flex; gap: 0.9rem; align-items: center;
  background: #ece9e3; color: #6f6a60;
  border-radius: var(--blob-b); padding: 1rem 1.1rem;
  filter: grayscale(1); opacity: 0.85;
}
.past-card .date-badge { width: 58px; height: 64px; transform: rotate(-2deg); }
.past-card .date-badge .d { font-size: 1.5rem; }
.past-card .date-badge .m { font-size: 0.7rem; }
.past-card h3 { font-size: 1rem; font-weight: 400; line-height: 1.3; }
.past-card p { font-size: 0.85rem; }

.more-card {
  text-align: center; max-width: 620px; margin: 0 auto;
  border: 2px dashed var(--mado-ochre); border-radius: var(--blob-b);
  background: rgba(238, 193, 112, 0.12);
  padding: 2rem 1.5rem 1.8rem; transform: rotate(-0.6deg);
}
.more-card .flowers { display: flex; justify-content: center; gap: 0.4rem; margin-bottom: 0.6rem; }
.more-card .flowers svg:nth-child(2) { transform: translateY(-6px) rotate(12deg); }
.more-card h2 { font-size: clamp(1.6rem, 4vw, 2rem); line-height: 1.15; margin-bottom: 0.5rem; }
.more-card p { max-width: 460px; margin: 0 auto 1.2rem; }
.more-card .actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }

.empty {
  text-align: center; padding: 2.5rem 1.5rem;
  border: 2px dashed var(--mado-sage-light); border-radius: var(--blob-a);
}

/* ---------- Newsletter signup (home, end of questionnaires) ---------- */
.subscribe-form { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; margin-top: 1.3rem; }
.subscribe-form[hidden] { display: none; }
.subscribe-form input[type="email"] {
  font: 300 1.05rem var(--font); color: var(--text);
  background: var(--mado-cream); border: 1.5px solid var(--mado-sage);
  border-radius: 999px; padding: 0.75em 1.2em; min-height: 48px;
  flex: 1 1 220px; max-width: 320px; outline: none;
}
.subscribe-form input[type="email"]:focus { border-color: var(--mado-brown); }
.subscribe-form input::placeholder { color: var(--text-soft); opacity: 0.7; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.subscribe-msg { margin-top: 1rem; min-height: 1.4em; font-size: 1rem; }
.subscribe-msg.error { color: var(--mado-brown); }

/* ---------- Footer ---------- */
.site-footer { background: var(--mado-green); color: var(--mado-cream); text-align: center; }
.site-footer .inner { padding: 2.2rem 1.25rem 2.5rem; }
.site-footer img { width: 220px; margin: 0 auto 1rem; }
.site-footer p { font-size: 0.95rem; opacity: 0.85; }
.site-footer a { color: var(--mado-cream); }
.site-footer .links { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; margin-top: 0.8rem; }
.site-footer .team-link { display: inline-flex; align-items: center; opacity: 0.55; transition: opacity 0.2s; }
.site-footer .team-link:hover, .site-footer .team-link:focus-visible { opacity: 1; }

/* ---------- Scroll fade ---------- */
.fade-in { opacity: 0; transform: translateY(26px); transition: opacity 0.8s ease, transform 0.8s ease; }
.fade-in.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fade-in { opacity: 1; transform: none; }
}
