/* ==========================================================================
   Fonts (self-hosted: no visitor data goes to Google Fonts). Manrope, OFL 1.1.
   ========================================================================== */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --color-bg: #fdf48b;
  --color-ink: #4e3715;
  --color-ink-70: rgba(78, 55, 21, 0.7);
  --color-ink-40: rgba(78, 55, 21, 0.4);
  --color-tag-border: #000;
  --color-overlay: rgba(0, 0, 0, 0.6);
  --color-error: #a8251b;
  --color-placeholder-bg: #ff5a36;
  --color-placeholder-ink: #fff;

  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rule: 1.6px solid var(--color-ink);
  --radius-pill: 40px;

  --gutter: 80px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: clip;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
p,
dl,
dd,
figure {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
}

/* Matches Figma's "trim to cap height" text boxes where supported (Chrome 133+, Safari 18.2+). */
.teaser-title,
.teaser-intro,
.modal-title {
  text-box: trim-both cap alphabetic;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  clip: auto;
  width: auto;
  height: auto;
  margin: 0;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--color-ink);
  color: var(--color-bg);
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   Components
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-ink);
  color: var(--color-bg);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.btn--block {
  width: 100%;
  font-size: 20px;
}

.tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 8px 12px;
  border: 1.5px solid var(--color-tag-border);
  border-radius: var(--radius-pill);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

/* ==========================================================================
   Header / footer
   ========================================================================== */
.site-header {
  position: relative;
  z-index: 1;
  padding: 32px var(--gutter) 0;
}

.site-logo {
  display: inline-block;
}

.site-logo img {
  width: 326px;
  height: auto;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 24px 95px 56px;
  text-align: right;
  font-size: 18px;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Teaser
   ========================================================================== */
.teaser {
  flex: 1;
  display: flex;
}

.teaser-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.teaser-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.teaser-title {
  margin-top: 26px;
  font-weight: 400;
  line-height: 1.147;
  text-wrap: balance;
}

.teaser-intro {
  margin-top: 32px;
  line-height: 1.6;
}

.teaser-intro strong {
  font-weight: 800;
}

.teaser-hero .btn {
  margin-top: 24px;
}

.event-detail {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 12px 0;
  border-top: var(--rule);
}

.event-detail dt {
  flex: 0 0 135px;
}

.event-detail dd {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 14px;
}

/* Venue and city never break mid-name; on narrow columns the city drops to its own line. */
.event-detail dd > span {
  white-space: nowrap;
}

.event-detail-extra {
  text-align: right;
}

.teaser-media {
  position: relative;
}

.teaser-media picture,
.teaser-photo {
  display: block;
  width: 100%;
  height: 100%;
}

.teaser-photo {
  object-fit: cover;
}

/* "70" overhangs the photo to the right and bottom, then is clipped by the viewport. */
.teaser-seventy {
  position: absolute;
  right: -7.38%;
  bottom: -8.53%;
  width: 73.18%;
  height: auto;
  pointer-events: none;
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal {
  width: min(708px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--color-ink-40) transparent;
}

.modal::backdrop {
  background: var(--color-overlay);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.modal[open] {
  animation: modal-in 0.25s ease-out;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.modal-panel {
  position: relative;
  padding: 64px;
}

.modal-close {
  position: absolute;
  top: 30px;
  right: 30px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -4px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.modal-close img {
  width: 24px;
  height: 24px;
}

.modal-step {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.modal-step[hidden] {
  display: none;
}

.modal-title {
  font-size: 56px;
  font-weight: 400;
  line-height: 1.18;
  outline: none;
}

.modal-text {
  font-size: 20px;
  line-height: 1.6;
}

body.modal-is-open {
  overflow: hidden;
}

/* ==========================================================================
   RSVP form (markup from the CICB RSVP plugin)
   ========================================================================== */
.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.rsvp-fields {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.rsvp-row {
  display: flex;
  gap: 16px;
}

.rsvp-row > .rsvp-field {
  flex: 1 1 0;
  min-width: 0;
}

.rsvp-field {
  position: relative;
  /* 14px + 34px line box ≈ Figma's 24px padding around a cap-trimmed line. */
  padding: 14px 0;
  border-bottom: var(--rule);
  transition: border-color 0.2s ease;
}

.rsvp-field.is-invalid {
  border-bottom-color: var(--color-error);
}

.rsvp-input {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-ink);
  font: 500 20px/34px var(--font);
  letter-spacing: -0.01em;
  outline: none;
  resize: none;
  overflow: hidden;
  appearance: none;
}

/* Grows with its content and with a placeholder that wraps on narrow screens. */
textarea.rsvp-input {
  field-sizing: content;
  min-height: 34px;
}

.rsvp-input::placeholder {
  color: var(--color-ink-40);
  opacity: 1;
}

.rsvp-input:-webkit-autofill {
  -webkit-text-fill-color: var(--color-ink);
  box-shadow: 0 0 0 100px var(--color-bg) inset;
}

.rsvp-field:focus-within {
  border-bottom-width: 2.4px;
  padding-bottom: 13.2px;
}

.rsvp-error {
  position: absolute;
  left: 0;
  top: calc(100% + 5px);
  color: var(--color-error);
  font-size: 13px;
  line-height: 1.2;
}

.rsvp-error:empty {
  display: none;
}

.rsvp-topic-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  font-size: 22px;
  line-height: 32px;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.rsvp-topic-title img {
  flex: none;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.rsvp-topic + .rsvp-topic {
  margin-top: 0;
}

.rsvp-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.rsvp-status {
  margin: -8px 0;
  color: var(--color-error);
  font-size: 16px;
  line-height: 1.4;
}

.rsvp-status:empty {
  display: none;
}

/* Consent for sensitive data (shown only when food / accessibility fields have content). */
.rsvp-consent {
  padding: 4px 0 0;
  border-bottom: 0;
}

.rsvp-consent[hidden] {
  display: none;
}

.rsvp-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 16px;
  line-height: 1.45;
  cursor: pointer;
}

.rsvp-check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--color-ink);
  cursor: pointer;
}

.rsvp-consent .rsvp-error {
  position: static;
  margin-top: 8px;
}

.rsvp-consent.is-invalid .rsvp-check {
  color: var(--color-error);
}

.rsvp-privacy {
  margin-top: -16px;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  color: var(--color-ink-70);
}

.rsvp-privacy + .rsvp-legal {
  margin-top: -24px;
}

.rsvp-legal {
  margin-top: -16px;
  color: var(--color-ink-70);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

/* The legal notice above replaces the floating badge, as allowed by Google's terms. */
.grecaptcha-badge {
  visibility: hidden;
}

/* ==========================================================================
   Pages (privacy policy etc.)
   ========================================================================== */
.site-footer a {
  text-underline-offset: 3px;
}

/* Not ".page": WordPress already adds that class to <body> on pages. */
.page-main {
  flex: 1;
  padding: clamp(40px, 6vw, 96px) var(--gutter) 24px;
}

.page-article {
  max-width: 760px;
}

.page-title {
  font-size: clamp(36px, 3.5417vw, 68px);
  font-weight: 400;
  line-height: 1.15;
  text-box: trim-both cap alphabetic;
}

.prose {
  margin-top: clamp(32px, 3vw, 56px);
  font-size: 18px;
  line-height: 1.65;
}

.prose > * + * {
  margin-top: 1em;
}

.prose h2 {
  margin-top: 2em;
  padding-top: 24px;
  border-top: var(--rule);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.3;
}

.prose h3 {
  margin-top: 1.6em;
  font-size: 20px;
  font-weight: 600;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: 0.4em;
}

.prose strong {
  font-weight: 700;
}

.prose a {
  text-underline-offset: 3px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--color-ink-40);
  text-align: left;
  vertical-align: top;
}

/* Draft content the CICB still has to fill in. Search the page for "TROCAR:". */
.prose mark.trocar {
  padding: 0 4px;
  border-radius: 4px;
  background: var(--color-placeholder-bg);
  color: var(--color-placeholder-ink);
  font-weight: 700;
}

/* ==========================================================================
   Desktop stage (≥ 1024px)
   The Figma frame is 1920 × 1030. Every desktop measurement is written as
   N × --px, where --px shrinks or grows so the whole composition fits both the
   width and the height of the window (like zooming the browser). Text has
   minimum sizes so it never gets too small to read.
   ========================================================================== */
@media (min-width: 1024px) {
  :root {
    --px: min(calc(100vw / 1920), calc(100vh / 1030), 1.5px);
    --gutter: calc(80 * var(--px));
  }

  @supports (height: 100dvh) {
    :root {
      --px: min(calc(100vw / 1920), calc(100dvh / 1030), 1.5px);
    }
  }

  body {
    min-height: max(100dvh, calc(1030 * var(--px)));
  }

  .btn {
    min-height: max(44px, calc(56 * var(--px)));
    padding: 0 calc(28 * var(--px));
    font-size: max(14px, calc(18 * var(--px)));
  }

  .btn--block {
    font-size: max(16px, calc(20 * var(--px)));
  }

  .tag {
    padding: calc(8 * var(--px)) calc(12 * var(--px));
    font-size: max(13px, calc(18 * var(--px)));
  }

  .site-header {
    padding: calc(32 * var(--px)) var(--gutter) 0;
  }

  .site-logo img {
    width: max(180px, calc(326 * var(--px)));
  }

  .site-footer {
    padding: calc(24 * var(--px)) calc(95 * var(--px)) calc(56 * var(--px));
    font-size: max(13px, calc(18 * var(--px)));
  }

  .teaser-content {
    width: calc(732 * var(--px));
    margin-left: var(--gutter);
    padding-top: calc(64 * var(--px));
    gap: calc(64 * var(--px));
  }

  .teaser-title {
    margin-top: calc(26 * var(--px));
    font-size: max(34px, calc(68 * var(--px)));
  }

  .teaser-intro {
    margin-top: calc(32 * var(--px));
    font-size: max(14px, calc(20 * var(--px)));
  }

  .teaser-hero .btn {
    margin-top: calc(24 * var(--px));
  }

  .event-details {
    font-size: max(14px, calc(20 * var(--px)));
  }

  .event-detail {
    gap: calc(14 * var(--px));
    min-height: calc(72 * var(--px));
    padding: calc(12 * var(--px)) 0;
  }

  .event-detail dt {
    flex-basis: calc(135 * var(--px));
  }

  /* Photo panel: 1000 × 870 at (900, 20) in the frame, anchored to the right edge. */
  .teaser-media {
    position: absolute;
    top: calc(20 * var(--px));
    right: calc(20 * var(--px));
    width: calc(1000 * var(--px));
    height: calc(870 * var(--px));
  }

  .modal {
    width: min(max(520px, calc(708 * var(--px))), calc(100vw - 32px));
  }

  .modal-panel {
    padding: max(32px, calc(64 * var(--px)));
  }

  .modal-close {
    top: max(20px, calc(30 * var(--px)));
    right: max(20px, calc(30 * var(--px)));
  }

  .modal-step,
  .rsvp-form {
    gap: max(16px, calc(32 * var(--px)));
  }

  .rsvp-fields {
    gap: max(12px, calc(24 * var(--px)));
  }

  .rsvp-row {
    gap: max(12px, calc(16 * var(--px)));
  }

  .modal .btn {
    min-height: max(40px, calc(56 * var(--px)));
  }

  .modal-title {
    font-size: max(30px, calc(56 * var(--px)));
  }

  .modal-text {
    font-size: max(15px, calc(20 * var(--px)));
  }

  .rsvp-field {
    padding: max(10px, calc(14 * var(--px))) 0;
  }

  .rsvp-field:focus-within {
    padding-bottom: calc(max(10px, calc(14 * var(--px))) - 0.8px);
  }

  .rsvp-input {
    font-size: max(14px, calc(20 * var(--px)));
    line-height: 1.6;
  }

  textarea.rsvp-input {
    min-height: 1.6em;
  }

  .rsvp-topic-title {
    gap: max(10px, calc(12 * var(--px)));
    padding: max(8px, calc(12 * var(--px))) 0;
    font-size: max(15px, calc(22 * var(--px)));
    line-height: 1.4;
  }

  .rsvp-topic-title img {
    width: max(22px, calc(32 * var(--px)));
    height: max(22px, calc(32 * var(--px)));
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1023px) {
  :root {
    --gutter: 24px;
  }

  .site-logo img {
    width: 220px;
  }

  .site-header {
    padding-top: 24px;
  }

  .teaser {
    flex-direction: column;
    overflow-x: clip;
  }

  .teaser-content {
    margin: 0 var(--gutter);
    padding-top: 48px;
    gap: 48px;
  }

  .teaser-title {
    margin-top: 20px;
    font-size: clamp(36px, 7.5vw, 56px);
  }

  .teaser-intro {
    margin-top: 24px;
    font-size: 17px;
  }

  .teaser-intro br {
    display: none;
  }

  .tag {
    font-size: 15px;
  }

  .event-details {
    font-size: 17px;
  }

  .event-detail {
    min-height: 64px;
  }

  .event-detail dt {
    flex-basis: 96px;
  }

  .teaser-media {
    position: relative;
    margin: 48px 12px 0;
    aspect-ratio: 1000 / 870;
  }

  .site-footer {
    padding: 72px var(--gutter) 32px;
    font-size: 15px;
  }
}

@media (max-width: 600px) {
  .btn {
    width: 100%;
    font-size: 16px;
  }

  .teaser-hero .btn {
    margin-top: 28px;
  }

  .event-detail {
    align-items: flex-start;
    padding: 20px 0;
  }

  .event-detail dd > span {
    white-space: normal;
  }

  .event-detail dd {
    flex-direction: column;
    gap: 2px;
  }

  .event-detail-extra {
    text-align: left;
    color: var(--color-ink-70);
  }

  .site-footer {
    text-align: left;
  }

  .modal {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    inset: 0;
  }

  .modal-panel {
    padding: 64px 24px 32px;
  }

  .modal-close {
    top: 20px;
    right: 20px;
  }

  .modal-title {
    font-size: 36px;
  }

  .rsvp-row {
    flex-direction: column;
    gap: 24px;
  }

  .rsvp-field {
    padding: 12px 0;
  }

  .rsvp-field:focus-within {
    padding-bottom: 11.2px;
  }

  .rsvp-input {
    font-size: 17px;
    line-height: 28px;
  }

  .rsvp-topic-title {
    font-size: 19px;
  }

  .btn--block {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
