/* =========================================
   SCHEDULE + FAQ (tri-fold brochure)
========================================= */

#information {
  scroll-margin-top: -50px;
}

.info-section {
  --paper: #e8e4da;
  --ink: #2a2740;
  --ink-muted: #5b5875;
  --crayon: #b9a98a;
  --accent: #8a5a12;

  /* Where the brochure sits inside the artwork, as a fraction (0 to 1) of the image */
  --bro-cx: 0.521;
  --bro-cy: 0.473;
  --bro-ratio: 0.75;     /* brochure width / image width */
  --bro-hratio: 0.822;   /* brochure height / image height */
  --bro-angle: 0deg;  /* tilt baked into the art */

  --brochure-heading-font: "Patrick Hand", var(--font-display), cursive;

  padding-bottom: clamp(2rem, 3vw, 3rem);
  overflow-x: clip;
}

/* The art has empty margin around the brochure, so the stage is wider than
   the content column; the brochure itself spans exactly the column. */
.info-stage {
  position: relative;
  width: calc(100% / var(--bro-ratio));
  margin-left: calc(50% - var(--bro-cx) * 100% / var(--bro-ratio));
  aspect-ratio: 1920 / 1080;
  background: url("../img/redesign/brochurenewmaybe.png") center / 100% 100% no-repeat;
  animation: brochure-float 8s ease-in-out infinite;
  rotate: -2deg;
}

@keyframes brochure-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-10px) rotate(0.35deg); }
}

/* Three folds laid over the art, tilted to match */
.info-grid {
  position: absolute;
  left: calc(var(--bro-cx) * 100%);
  top: calc(var(--bro-cy) * 100%);
  width: calc(var(--bro-ratio) * 100%);
  height: calc(var(--bro-hratio) * 100%);
  transform: translate(-50%, -50%) rotate(var(--bro-angle));

  display: grid;
  grid-template-columns: 31.8fr 32.7fr 35.5fr;
  grid-template-rows: minmax(0, 1fr);
  color: var(--ink);
}

/* Each fold scrolls instead of growing */
.schedule-panel,
.faq-questions,
.faq-answer-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--crayon) transparent;
}

.schedule-panel,
.faq-questions {
  overflow-y: auto;
}

.schedule-panel > *,
.faq-questions > *,
.faq-answer-panel > * {
  flex-shrink: 0;
}

/* Heading stays put, only the answer text scrolls */
.faq-answer-panel {
  align-items: flex-start;
  overflow: hidden;
}

#faq-answer-text {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  margin-bottom: 0;
  overflow-y: auto;
  padding-right: 0.5rem;
  color: var(--ink-muted);
  line-height: 1.8;
  white-space: pre-line;
  scrollbar-width: thin;
  scrollbar-color: var(--crayon) transparent;
}

/* Optional mascot spot: add .has-mascot to the section and set
   --mascot-img: url("../img/redesign/robot_mascot.png") on .info-section */
.faq-mascot {
  display: none;
  flex: 0 0 34%;
  width: 100%;
  background: var(--mascot-img, none) right bottom / contain no-repeat;
}

.has-mascot .faq-mascot {
  display: block;
}

.faq-answer-note {
  display: none;
}

/* ---------- Typography ---------- */

.info-grid h2,
.info-grid h3 {
  font-family: var(--brochure-heading-font);
  color: var(--ink);
}

.info-grid h2 {
  font-size: clamp(1.5rem, 2.4vw, 2.4rem);
}

.info-grid .text-link {
  margin-top: auto;
  padding-top: 1.5rem;
  align-self: flex-start;
}

/* ---------- Fold 1: schedule ---------- */

.timeline-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px dashed rgba(42, 39, 64, 0.25);
}

.timeline-item a {
  color: var(--ink);
  text-decoration: underline;
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-date {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
}

.timeline-item h3 {
  margin-bottom: 0.4rem;
}

.timeline-item p {
  margin-bottom: 0;
  color: var(--ink-muted);
}

/* ---------- Fold 2: FAQ questions ---------- */

.faq-instruction {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.faq-question {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 0.5rem;
  border: 0;
  border-bottom: 1px solid rgba(42, 39, 64, 0.2);
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 90%;
  text-align: left;
  cursor: pointer;
  transition: color 180ms ease, padding 180ms ease, background 180ms ease;
}

.faq-question > span:first-child {
  color: var(--accent);
  font-size: 0.8rem;
  padding-top: 0.2rem;
}

.faq-questions .faq-question:last-of-type {
  border-bottom: none;
}

.faq-question.is-active,
.faq-question:hover {
  color: var(--ink);
}

.faq-question.is-active {
  padding-left: 0.9rem;
  background: rgba(42, 39, 64, 0.07);
}

.faq-question:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Fold 3: answer ---------- */

.faq-answer-panel h3 {
  font-size: clamp(1.3rem, 2vw, 1.9rem);
  line-height: 1.2;
}

.faq-answer-divider {
  width: 3rem;
  height: 3px;
  margin: 0.5rem 0 1rem;
  background: var(--accent);
}

/* ---------- Narrow screens: drop the art, stack the folds ---------- */

@media (max-width: 1000px) {
  .info-stage {
    width: auto;
    margin-left: 0;
    aspect-ratio: auto;
    background: none;
    animation: none;
    rotate: none;
  }

  .info-grid {
    position: static;
    width: auto;
    height: auto;
    transform: none;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    background: var(--paper);
    border: 3px solid var(--crayon);
    border-radius: 4px;
  }

  .schedule-panel,
  .faq-questions,
  .faq-answer-panel {
    max-height: 28rem;
    overflow-y: auto;
  }

  .faq-questions,
  .faq-answer-panel {
    border-top: 2px solid var(--crayon);
  }

  #faq-answer-text {
    flex: none;
    overflow: visible;
  }

  .faq-mascot {
    display: none;
  }

  .faq-answer-note {
    display: block;
    margin-top: 1.5rem;
    color: var(--ink-muted);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .info-stage {
    animation: none !important;
  }
}
