/* ============================================================
   Arraial Joao de Deus - festa theme
   Portuguese summer street-party look: cream wood planks,
   bunting, wooden sign boards, gold/red accents, grass footer.
   Palette sampled from the event posters.
   ============================================================ */

:root {
  --wood: #f5e6d2;
  --wood-2: #efdcc2;
  --wood-line: #e2cba6;
  --brown-dark: #5e3712;
  --brown: #6c4727;
  --brown-light: #98603a;
  --brown-edge: #b9794a;
  --cream: #fff8ec;
  --gold: #f7ae24;
  --gold-deep: #ef9a12;
  --red: #d6362f;
  --red-deep: #bb2a26;
  --teal: #1ba0b9;
  --blue: #2f9fe0;
  --green: #2ead42;
  --green-dark: #229a36;
  --star: #ffce3a;
  --ink: #4a3017;
  --muted: #8a6a49;

  --radius: 16px;
  --maxw: 660px;
  --sign-grad: linear-gradient(180deg, #875331 0%, #6c4727 45%, #5e3712 100%);
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-script: "Caveat", "Segoe Script", cursive;
  --shadow-card: 0 10px 30px -12px rgba(74, 48, 23, 0.45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--wood);
  /* horizontal plank seams + faint long grain */
  background-image:
    repeating-linear-gradient(0deg, rgba(94, 55, 18, 0.05) 0 1.5px, transparent 1.5px 86px),
    repeating-linear-gradient(0deg, rgba(94, 55, 18, 0.025) 0 1px, transparent 1px 43px),
    repeating-linear-gradient(90deg, rgba(120, 80, 40, 0.018) 0 3px, transparent 3px 9px);
  background-attachment: fixed;
}

.is-hidden { display: none !important; }

/* ---------- bunting ---------- */
.bunting {
  height: 56px;
  background: url("/assets/img/bunting.svg") repeat-x top center;
  background-size: auto 56px;
  animation: sway 6s ease-in-out infinite;
  transform-origin: top center;
}
@keyframes sway {
  0%, 100% { transform: rotate(-0.4deg); }
  50% { transform: rotate(0.4deg); }
}

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .85rem 1.25rem;
  max-width: var(--maxw); margin: 0 auto;
}
.brand {
  font-weight: 700; font-size: 1.15rem; color: var(--brown-dark);
  letter-spacing: .01em;
}
.lang-toggle { display: flex; gap: .3rem; }
.lang-btn {
  font-family: var(--font-display); font-weight: 600;
  border: 2px solid var(--brown-edge); background: var(--cream);
  color: var(--brown); padding: .28rem .62rem; border-radius: 999px;
  cursor: pointer; font-size: .82rem; transition: transform .12s ease, background .15s ease;
}
.lang-btn:hover { transform: translateY(-1px); }
.lang-btn.is-active { background: var(--gold); color: var(--brown-dark); border-color: var(--gold-deep); }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 1.1rem 1rem; }

/* staggered page-load reveal */
.reveal { opacity: 0; transform: translateY(16px); animation: rise .6s ease forwards; }
.reveal.d1 { animation-delay: .05s; }
.reveal.d2 { animation-delay: .18s; }
.reveal.d3 { animation-delay: .32s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; animation: none; }
  .bunting { animation: none; }
  .poster, .poster-frame { animation: none; }
  .poster-frame { transform: rotate(-1deg); }
  .menu-list li, .menu-tagline {
    opacity: 1; transform: none; transition: none; animation: none;
  }
}

/* ---------- hero poster ---------- */
/* z-index keeps the "add to calendar" dropdown above the section below it. */
.hero { text-align: center; padding: 1.2rem 0 .5rem; position: relative; z-index: 5; }
.poster-frame {
  display: inline-block; position: relative;
  padding: 10px; background: var(--cream);
  border-radius: 14px;
  box-shadow: var(--shadow-card), inset 0 0 0 2px rgba(185, 121, 74, .35);
  transform: rotate(-1deg);
  /* swing from the tape at the top, like a sign hanging from a single pin */
  transform-origin: 50% -8px;
  animation: poster-swing 5.5s ease-in-out 1.1s infinite;
  transition: transform .25s ease, box-shadow .25s ease;
}
.poster-frame:hover {
  transform: rotate(-1deg) scale(1.015);
  box-shadow: 0 18px 36px -14px rgba(74, 48, 23, .6), inset 0 0 0 2px rgba(185, 121, 74, .35);
}
@keyframes poster-swing {
  0%, 100% { transform: rotate(-1.8deg); }
  50% { transform: rotate(1.4deg); }
}
.poster-frame::before {
  /* a bit of "tape" at the top */
  content: ""; position: absolute; top: -12px; left: 50%;
  width: 92px; height: 26px; transform: translateX(-50%) rotate(-3deg);
  background: rgba(247, 174, 36, .55);
  box-shadow: 0 2px 5px rgba(74,48,23,.25);
}
.poster {
  display: block; width: 100%; max-width: 420px; height: auto;
  border-radius: 8px;
  /* springy pop-in on load */
  animation: poster-pop .75s cubic-bezier(.2, .85, .3, 1.25) .25s backwards;
}
@keyframes poster-pop {
  0% { opacity: 0; transform: scale(.84); }
  60% { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
.event-line {
  font-family: var(--font-display); font-weight: 700; color: var(--brown-dark);
  font-size: 1.05rem; margin: 1rem 0 .2rem;
}
.event-line .event-where {
  display: inline-block; margin-top: .3rem; font-weight: 700; font-size: .95rem;
  color: var(--red); text-decoration: none; border-bottom: 2px dotted var(--gold-deep);
}
.event-line .event-where:hover { color: var(--red-deep); border-bottom-color: var(--red-deep); }
.intro { color: var(--brown); max-width: 520px; margin: .3rem auto 0; }

.cal { position: relative; display: inline-block; margin-top: 1.1rem; }
.btn-cal {
  display: inline-flex; align-items: center; gap: .45rem; cursor: pointer;
  font-family: var(--font-display); font-weight: 700;
  font-size: .95rem; padding: .6rem 1.15rem; border-radius: 999px;
  background: var(--gold); color: var(--brown-dark); text-decoration: none;
  border: 2px solid var(--gold-deep);
  box-shadow: 0 4px 0 -1px var(--gold-deep), 0 9px 16px -8px rgba(239, 154, 18, .65);
  transition: transform .12s ease, filter .15s ease;
}
.btn-cal::before { content: "📅"; font-size: 1.05em; }
.btn-cal::after { content: "▾"; font-size: .9em; margin-left: .1rem; }
.btn-cal:hover { filter: brightness(1.04); }
.btn-cal:active { transform: translateY(1px); box-shadow: 0 2px 0 -1px var(--gold-deep); }

.cal-menu {
  position: absolute; left: 50%; top: calc(100% + .5rem); transform: translateX(-50%);
  background: var(--cream); border: 2px solid var(--brown-edge); border-radius: 12px;
  box-shadow: var(--shadow-card); padding: .35rem; z-index: 20;
  min-width: 230px; display: flex; flex-direction: column; gap: .12rem; text-align: left;
}
.cal-menu a {
  display: block; text-decoration: none; color: var(--brown-dark);
  font-family: var(--font-display); font-weight: 600; font-size: .92rem;
  padding: .58rem .7rem; border-radius: 8px;
}
.cal-menu a:hover { background: #f3e7cf; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- wooden sign heading ---------- */
.sign {
  position: relative; display: inline-block;
  background: var(--sign-grad);
  color: #fff; font-weight: 700; font-family: var(--font-display);
  padding: .5rem 1.4rem; border-radius: 10px;
  box-shadow: 0 6px 0 -1px rgba(74,48,23,.35), 0 12px 22px -10px rgba(74,48,23,.6);
  border-top: 2px solid rgba(255,255,255,.18);
  text-shadow: 0 2px 0 rgba(0,0,0,.35);
  /* faux plank lines */
  background-image: var(--sign-grad),
    repeating-linear-gradient(0deg, rgba(0,0,0,.10) 0 1px, transparent 1px 14px);
  letter-spacing: .02em;
}
.sign::before, .sign::after {
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px;
  border-radius: 50%; background: radial-gradient(circle at 35% 35%, #d9b894, #7a5230);
  transform: translateY(-50%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.sign::before { left: 8px; } .sign::after { right: 8px; }

.section-title { text-align: center; margin: 1.6rem 0 1rem; }
.section-title .sign { font-size: 1.35rem; }

/* ---------- menu (ementa) ---------- */
.menu { text-align: center; padding: .4rem 0 1rem; }
.menu-list {
  list-style: none; margin: 0 auto; padding: 0; max-width: 460px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem 1.8rem;
}
.menu-list li {
  font-family: var(--font-script); font-weight: 700;
  font-size: 1.95rem; line-height: 1.25; color: var(--brown);
  position: relative;
  /* hidden until the section scrolls into view, then a staggered pop */
  opacity: 0; transform: translateY(16px) scale(.78);
  transition: opacity .5s ease, transform .55s cubic-bezier(.2, .8, .25, 1.4);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.menu.in-view .menu-list li { opacity: 1; transform: none; }
.menu-list li::before {
  content: "\2726"; color: var(--gold); font-size: .9rem;
  font-family: var(--font-display); vertical-align: middle; margin-right: .4rem;
}
.menu-tagline {
  font-family: var(--font-script); font-weight: 700;
  font-size: 1.7rem; color: var(--green-dark); margin: .8rem 0 0;
  display: inline-block; transform-origin: center bottom;
  /* pops in after the menu items, then rocks to catch the eye */
  opacity: 0; transform: scale(.7);
  transition: opacity .5s ease, transform .55s cubic-bezier(.2, .8, .25, 1.5);
  transition-delay: .62s;
}
.menu.in-view .menu-tagline {
  opacity: 1; transform: none;
  animation: tagline-rock 2.4s ease-in-out 1.25s infinite;
}
@keyframes tagline-rock {
  0%, 100% { transform: rotate(-3.5deg); }
  50% { transform: rotate(3.5deg); }
}

/* ---------- cards / forms ---------- */
.rsvp { padding: .4rem 0 1.5rem; }
.disclaimer {
  font-family: var(--font-display); font-size: .9rem; color: var(--brown);
  background: #fbeccb; border: 1.5px dashed var(--gold-deep);
  padding: .65rem .85rem; border-radius: 12px; margin: .4rem auto 1rem;
  max-width: 560px; text-align: center;
}
.card {
  background: var(--cream);
  border: 2px solid var(--brown-edge);
  border-radius: var(--radius);
  padding: 1.25rem 1.15rem;
  margin: 0 auto; max-width: 560px;
  box-shadow: var(--shadow-card);
}

.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field > span { font-weight: 600; font-size: .95rem; color: var(--brown-dark); }
input[type="text"], input[type="number"], select {
  width: 100%; padding: .72rem .8rem; font-size: 1rem; font-family: var(--font-display);
  color: var(--ink); border: 2px solid var(--wood-line); border-radius: 10px; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(247,174,36,.3);
}

.kids { border: none; padding: 0; margin: 0 0 1rem; }
.kids legend { font-weight: 700; padding: 0; margin-bottom: .55rem; color: var(--brown-dark); font-size: 1.02rem; }
.kid-row {
  display: grid; grid-template-columns: 1fr; gap: .55rem;
  padding: .8rem; border: 2px dashed var(--wood-line); border-radius: 12px;
  margin-bottom: .6rem; background: #fffdf8;
}
.kid-row .remove-kid {
  justify-self: start; background: none; border: none; color: var(--red);
  cursor: pointer; padding: .2rem 0; font-size: .85rem; font-weight: 600; font-family: var(--font-display);
}
.kid-row .remove-kid:hover { text-decoration: underline; }

.btn {
  font-family: var(--font-display); font-weight: 700; font-size: 1.02rem;
  padding: .8rem 1.1rem; border-radius: 999px; cursor: pointer;
  border: 2px solid transparent; transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--red); color: #fff; width: 100%;
  border-color: var(--red-deep);
  box-shadow: 0 5px 0 -1px var(--red-deep), 0 10px 18px -8px rgba(187,42,38,.7);
}
.btn-primary:hover { filter: brightness(1.04); }
.btn-primary:disabled { filter: saturate(.5) brightness(1.05); cursor: default; box-shadow: none; }
.btn-secondary {
  background: var(--cream); border-color: var(--brown-edge); color: var(--brown);
}
.btn-secondary:hover { background: #fff; }
#add-kid { width: 100%; }
.actions { display: flex; gap: .6rem; margin-top: 1.1rem; }
.actions .btn { flex: 1; }

/* ---------- meal table ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.meal-table { width: 100%; border-collapse: collapse; }
.meal-table th, .meal-table td {
  padding: .6rem .5rem; border-bottom: 2px solid var(--wood-line); text-align: left; vertical-align: middle;
}
.meal-table thead th { color: var(--brown-dark); font-weight: 700; }
.meal-table th.meal-col, .meal-table td.meal-col { text-align: center; width: 4.6rem; }
.meal-table input[type="text"] { padding: .5rem .6rem; }
.meal-table input[type="checkbox"] {
  width: 1.4rem; height: 1.4rem; accent-color: var(--green); cursor: pointer;
}
.eater-name-fixed { color: var(--brown-dark); }
.role-tag { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }

.form-note { font-size: .9rem; color: var(--brown-dark); font-weight: 700; line-height: 1.45; margin: -.1rem auto 1.1rem; max-width: 560px; text-align: center; }
.form-error { color: var(--red-deep); min-height: 1.2em; font-size: .92rem; margin: .55rem 0 0; font-weight: 600; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* success */
#success { text-align: center; }
#success h3 { font-size: 1.6rem; color: var(--green-dark); margin: .2rem 0 .4rem; }

/* ---------- grass + fence footer ---------- */
.site-footer { position: relative; margin-top: 2rem; }
.footer-scene {
  position: relative; height: 96px;
  /* back grass layer (transparent above shows the wood background) */
  background: url("/assets/img/grass.svg") repeat-x bottom left;
  background-size: auto 64px;
}
.footer-scene .fence {
  position: absolute; right: 22px; bottom: 16px;
  width: 104px; height: auto; z-index: 1;
  filter: drop-shadow(0 3px 4px rgba(74, 48, 23, .3));
}
.footer-scene::after {
  /* front grass row: overlaps the fence base so it looks planted */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 46px;
  background: url("/assets/img/grass.svg") repeat-x bottom left;
  background-size: auto 64px; background-position: -34px bottom; z-index: 2;
}
.footer-inner {
  position: relative; z-index: 3;
  background: var(--green); color: #f4fff1;
  text-align: center; font-size: .9rem; padding: .85rem 1rem; font-weight: 700;
  border-top: 3px solid var(--green-dark);
}

/* ---------- responsive ---------- */
@media (min-width: 600px) {
  body { font-size: 18px; }
  .poster { max-width: 460px; }
  .section-title .sign { font-size: 1.55rem; }
  .menu-list li { font-size: 2.2rem; }
  .kid-row { grid-template-columns: 1fr 13rem auto; align-items: end; }
  .kid-row .remove-kid { align-self: center; }
}
