/* / — homepage: intro, hero photo, programme cards, visit invitation, FAQ accordion, photo gallery. */

/* ---------- Intro heading ---------- */
.home-intro { height: 18.35rem; padding-top: 2.75rem; background: var(--paper); text-align: center; }
.home-intro h1 { font-size: 5.2rem; line-height: 6.24rem; }
.home-intro__lead {
  width: 58.7rem; margin: 1.2rem 0 0 19.5rem;
  font-size: 2rem; line-height: 2.8rem; color: var(--purple);
}

/* ---------- Full-width photos ---------- */
.home-hero { margin: 3.9rem 7.2rem 0; border-radius: 2rem; overflow: hidden; }
.home-hero img { display: block; width: 100%; height: auto; aspect-ratio: 1238 / 519; object-fit: cover; }
.home-photo img { width: 100%; height: 50rem; object-fit: cover; }

/* ---------- About paragraph with highlighted phrases ---------- */
.home-about { padding: 5.6rem 0 1rem; }
.home-about__text {
  width: 96.7rem; margin-left: .6rem;
  font-size: 2.2rem; line-height: 3.52rem; color: var(--purple); text-align: justify;
}
.home-about__text mark { background: none; color: var(--lilac-500); }

/* ---------- Programme cards ---------- */
.home-cards {
  --home-green: #03b262;        /* "Individuālās nodarbības" card */
  --home-shadow: #280e49;       /* hover shadow of the pill links */
  --home-navy: #2f2f72;         /* link text of the first card on phones */
  padding: 4.4rem 0 18.4rem;
}
.home-cards__grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 7.2rem 4rem; }

.home-card {
  position: relative;
  width: 30rem; height: 50.7rem; padding: 2.6rem 0 0 2.6rem;
  border-radius: 2rem; color: var(--white);
  background-image: linear-gradient(rgba(0, 0, 0, .095), rgba(0, 0, 0, 0) 10rem); /* soft shade at the top */
}
.home-card__title { font-size: 3.5rem; line-height: 3.5rem; }
.home-card__age { display: block; margin-top: .2rem; font-size: 2.5rem; }
.home-card__motto { margin-top: 2.1rem; font-size: 2.1rem; line-height: 2.94rem; }
.home-card__text { width: 23rem; margin-top: 2.9rem; font-size: 1.7rem; line-height: 2.38rem; }
.home-card__mobile { display: none; }

.home-card__more {
  position: relative; z-index: 1;
  width: 16.9rem; height: 4.8rem; margin-top: 2.2rem; padding-right: .4rem;
  border: 1px solid transparent; background: var(--white);
  font-size: 1.8rem; line-height: 1.8rem; color: var(--green-900);
}
.home-card__more:hover {
  background: var(--cream); color: var(--ink);
  box-shadow: .707rem .707rem 0 var(--home-shadow);
}

.home-card__art { position: absolute; }
.home-card__art svg { width: 100%; height: 100%; }

.home-card--toddlers { height: 50.9rem; padding-left: 4.1rem; background-color: var(--lilac-300); }
.home-card--toddlers .home-card__title,
.home-card--toddlers .home-card__text { color: var(--purple); }
.home-card--toddlers .home-card__age { color: var(--white); }
.home-card--toddlers .home-card__motto { margin-top: 2.3rem; }
.home-card--toddlers .home-card__text { margin-top: 2.4rem; }
.home-card--toddlers .home-card__more:hover {
  background: var(--white); border-color: var(--ink); box-shadow: .3rem .3rem 0 #000;
}
.home-card__art--flower { left: 19.9rem; top: 2rem; width: 11.3rem; height: 18.9rem; }

.home-card--preschool { background-color: var(--purple); }
.home-card--preschool .home-card__title { color: var(--paper); }
.home-card--preschool .home-card__age { color: var(--lilac-500); }
.home-card--preschool .home-card__more { margin-top: 4.8rem; }
.home-card__art--hand { left: 22.4rem; top: 41.9rem; width: 8.7rem; height: 8.8rem; }

.home-card--school { padding-left: 2.7rem; background-color: var(--green-700); background-image: none; }
.home-card--school .home-card__title,
.home-card--school .home-card__text { color: var(--paper); }
.home-card--school .home-card__age { color: var(--lime); }
.home-card--school .home-card__more { margin-top: 2.3rem; color: var(--green-700); }
.home-card--school .home-card__more:hover { border-color: var(--ink); color: var(--ink); box-shadow: .707rem .707rem 0 #000; }
.home-card__art--zigzag { left: 19.6rem; top: 9rem; width: 10.3rem; height: 7rem; }

.home-card--wide { width: 47rem; height: 50.9rem; padding: 4.2rem 0 0 3.8rem; }
.home-card--wide .home-card__text { width: 37.5rem; margin-top: 3rem; }
.home-card--wide .home-card__more { width: 25rem; height: 7rem; }

.home-card--lessons { background-color: var(--home-green); }
.home-card--lessons .home-card__title { font-size: 3.3rem; }
.home-card--lessons .home-card__age { color: var(--purple); }
.home-card--lessons .home-card__motto { margin-top: .5rem; }
.home-card--lessons .home-card__more { margin-top: 9.4rem; }
.home-card__art--planet { left: 27.8rem; top: 33.9rem; width: 16.3rem; height: 10.3rem; }

.home-card--training {
  height: 51.1rem; margin: -.2rem 0 0 -.1rem; padding-left: 5.8rem;
  background-color: var(--lilac-100);
}
.home-card--training .home-card__title { font-size: 3.2rem; line-height: 3.2rem; color: var(--purple); }
.home-card--training .home-card__age { color: var(--white); }
.home-card--training .home-card__motto { margin-top: 1.3rem; color: var(--purple); }
.home-card--training .home-card__more { margin: 3.9rem 0 0 -1.3rem; }
.home-card__art--pencil { left: 37.1rem; top: -1.8rem; width: 12rem; height: 11.8rem; }

/* ---------- "Nāc ciemos" invitation ---------- */
.home-visit { height: 46.9rem; padding-top: 3.8rem; background: var(--paper); }
.home-visit h2 { font-size: 3.5rem; line-height: 4.2rem; text-align: center; }
.home-visit__text {
  width: 69.4rem; margin: 3.7rem 0 0 14.3rem;
  font-size: 2rem; line-height: 3.6rem; color: var(--purple);
}
.home-visit__text p + p { margin-top: 3.6rem; }
.home-visit__button {
  display: flex; align-items: center; justify-content: flex-start; gap: .8rem;
  width: 22.6rem; height: 7rem; margin: 4.6rem auto 0; padding: 0 0 0 4.3rem;
  border-radius: 5rem; line-height: 1.8rem;
}
.home-visit__button svg { width: 3.7rem; height: 3.7rem; fill: currentColor; }

/* ---------- FAQ accordion ---------- */
.home-faq { margin-top: .3rem; padding: 2.9rem 0 8.4rem; background: var(--lilac-500); }
.home-faq > .column { padding-left: 3.2rem; }
.home-faq__pin { position: absolute; left: -2.1rem; top: -1.2rem; width: 4.2rem; height: 7.8rem; }
.home-faq__pin svg { width: 100%; height: 100%; }
.home-faq h2 { font-size: 3.5rem; line-height: 4.2rem; color: var(--paper); }
.home-faq__label {
  width: 13.9rem; height: 5.2rem; margin-top: 2.4rem; padding-top: 1.4rem;
  border-bottom: .3rem solid var(--paper);
  font-size: 1.6rem; line-height: 2.4rem; color: var(--paper); text-align: center;
}
.home-faq__list { display: grid; gap: 1.2rem; width: 91.6rem; margin-top: 2.4rem; }
.home-faq__item { /* hairline frame drawn as a shadow so the box itself scales with the layout */
  padding: .1rem; background: var(--cream); box-shadow: inset 0 0 0 1px var(--purple);
}
.home-faq__question { font-weight: var(--bold); font-size: 2rem; line-height: 2.4rem; color: var(--green-700); }
.home-faq__question button {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem;
  width: 100%; min-height: 8rem; padding: 2.4rem;
  border: 0; background: none; text-align: left;
}
.home-faq__question span { align-self: center; }
.home-faq__question svg { flex: none; width: 3rem; height: 3rem; transition: transform .3s ease; }
.home-faq__question button[aria-expanded="true"] svg { transform: rotate(180deg); }

.home-faq__panel { /* collapsed: zero-height grid row; home.js toggles .is-open */
  display: grid; grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows .3s ease, visibility 0s .3s;
}
.home-faq__panel.is-open { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }
.home-faq__answer {
  min-height: 0; overflow: hidden; padding: 0 2.4rem 2.4rem;
  font-size: 1.6rem; line-height: 2.072rem; color: var(--purple); text-align: justify;
}
.home-faq__answer p { white-space: pre-wrap; } /* the original keeps its double spaces */
.home-faq__answer p + p { margin-top: 2.072rem; }

/* ---------- Photo gallery: horizontally scrolling mosaic ---------- */
.home-gallery { padding-bottom: 7.1rem; }
.home-gallery__frame { position: relative; margin-inline: 16rem; } /* fills the window, 160px margins */
.home-gallery__track {
  display: flex; gap: .5rem; height: 86.3rem; padding-left: .3rem;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.home-gallery__track::-webkit-scrollbar { display: none; }
.home-gallery__group { flex: none; display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; gap: .5rem; height: 100%; }
.home-gallery__group img { width: auto; max-width: none; height: 86.3rem; }
/* one wide photo above two narrow ones */
.home-gallery__group--wide-top { display: grid; grid-template-columns: auto auto; justify-content: start; }
.home-gallery__group--wide-top picture:first-child { grid-column: 1 / -1; }
.home-gallery__group--wide-top img { height: 46rem; }
.home-gallery__group--wide-top picture:first-child img { height: 39.8rem; }
/* two narrow photos above one wide one */
.home-gallery__group--wide-bottom { display: grid; grid-template-columns: auto auto; justify-content: start; }
.home-gallery__group--wide-bottom picture:last-child { grid-column: 1 / -1; }
.home-gallery__group--wide-bottom img { height: 45.5rem; }
.home-gallery__group--wide-bottom picture:last-child img { height: 40.3rem; }

.home-gallery__arrow {
  position: absolute; top: 41.4rem; width: 4rem; height: 3.3rem; padding: 0;
  border: 0; background: none; color: var(--lilac-500); opacity: .9; transition: opacity .2s ease;
}
.home-gallery__arrow:hover { opacity: 1; }
.home-gallery__arrow[hidden] { display: none; }
.home-gallery__arrow svg { width: 4rem; height: 3.3rem; }
.home-gallery__arrow--prev { left: -6rem; }
.home-gallery__arrow--prev svg { transform: scaleX(-1); }
.home-gallery__arrow--next { right: -6rem; }

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 600px) {
  .home-intro { height: 19rem; padding: 1.25rem 2rem 0; }
  .home-intro h1 { font-size: 2.6rem; line-height: 3.12rem; }
  .home-intro__lead { width: 28rem; margin: 2rem 0 0 .5rem; font-size: 1.6rem; line-height: 2.24rem; }

  .home-hero { margin: 0 1.6rem; border-radius: 1.6rem; }
  .home-hero img { aspect-ratio: auto; height: 24rem; }
  .home-photo { display: none; }

  .home-about { padding: 2.1rem 0 .9rem; }
  .home-about__text { width: 28rem; margin-left: 2.6rem; font-size: 1.4rem; line-height: 2.24rem; text-align: left; }
  .home-about__text mark { color: inherit; }

  .home-cards { padding: .7rem 0 1.7rem; }
  .home-cards__grid { flex-direction: column; flex-wrap: nowrap; gap: 1rem; margin-left: 1.2rem; }
  .home-card, .home-card--wide { width: 29.5rem; padding: 3rem 0 0 1.8rem; }
  .home-card__desktop { display: none; }
  .home-card__mobile { display: inline; }
  .home-card__title { font-size: 2.6rem; line-height: 2.6rem; }
  .home-card__age { margin-top: 0; font-size: 2.2rem; }
  .home-card__motto { width: 26rem; font-size: 2rem; line-height: 2.8rem; }
  .home-card__text, .home-card--wide .home-card__text { width: 26rem; margin-top: 2.8rem; font-size: 1.6rem; line-height: 2.24rem; }
  .home-card__more, .home-card--wide .home-card__more { width: 16.4rem; height: 3.8rem; }

  .home-card--toddlers { height: 40.2rem; padding-top: 1.2rem; }
  .home-card--toddlers .home-card__title { font-size: 2.2rem; line-height: 2.9rem; }
  .home-card--toddlers .home-card__age { margin-top: .3rem; font-size: 1.9rem; }
  .home-card--toddlers .home-card__motto { margin-top: 1.2rem; line-height: 2.94rem; color: var(--purple); }
  .home-card--toddlers .home-card__text { margin-top: 2.4rem; line-height: 2.486rem; }
  .home-card--toddlers .home-card__more { margin-top: 2.1rem; background: var(--cream); font-size: 1.6rem; color: var(--home-navy); }
  .home-card__art--flower { left: 22.3rem; top: 1rem; width: 7.2rem; height: 12rem; }

  .home-card--preschool { height: 51.5rem; }
  .home-card--preschool .home-card__title { margin-left: -.2rem; }
  .home-card--preschool .home-card__motto { margin-top: 3.2rem; }
  .home-card--preschool .home-card__more { margin-top: 9.7rem; }
  .home-card__art--hand { left: 17.2rem; top: 36.5rem; width: 12rem; height: 12rem; }

  .home-card--school { height: 46.6rem; margin-left: -.1rem; padding-top: 2.7rem; }
  .home-card--school .home-card__title { margin-left: -.2rem; font-size: 2.2rem; line-height: 2.2rem; }
  .home-card--school .home-card__age { font-size: 1.9rem; }
  .home-card--school .home-card__motto { margin-top: 2.9rem; }
  .home-card--school .home-card__more { margin-top: 6.3rem; }
  .home-card__art--zigzag { left: 18.8rem; top: 36.8rem; width: 8.9rem; height: 6rem; }

  .home-card--lessons { height: 50.1rem; margin-top: .1rem; }
  .home-card--lessons .home-card__title { width: 26rem; margin-left: -.2rem; font-size: 2.5rem; }
  .home-card--lessons .home-card__motto { margin-top: 3.3rem; }
  .home-card--lessons .home-card__more { margin: 1.5rem 0 0 -.2rem; }
  .home-card__art--planet { left: 15.7rem; top: -1rem; width: 15rem; height: 9.5rem; }

  .home-card--training { height: 52.4rem; margin: .2rem 0 0; padding-left: 1.6rem; }
  .home-card--training .home-card__title { width: 26rem; font-size: 2.5rem; line-height: 2.5rem; }
  .home-card--training .home-card__motto { margin-top: 1.7rem; }
  .home-card--training .home-card__more { width: 18.7rem; height: 4.6rem; margin: 1.6rem 0 0; }
  .home-card__art--pencil { left: 21.5rem; top: -.5rem; width: 8rem; height: 7.9rem; }

  .home-visit { height: 47.1rem; padding: 2rem 2rem 0; }
  .home-visit h2 { font-size: 2.2rem; line-height: 2.64rem; }
  .home-visit__text { width: 28rem; margin: 1rem 0 0; font-size: 1.7rem; line-height: 3.06rem; }
  .home-visit__text p + p { margin-top: 3.06rem; }
  .home-visit__nudge { display: block; } /* the original breaks the line before the last word */
  .home-visit__button { gap: .8rem; width: 16rem; height: 4.2rem; margin-top: 1.9rem; padding-left: 1rem; }

  .home-faq { margin-top: -.1rem; padding: 4.1rem 0 3.4rem; }
  .home-faq > .column { padding: 0 3.6rem; }
  .home-faq__pin { left: .8rem; top: -3.1rem; width: 2.9rem; height: 5.3rem; }
  .home-faq h2 { font-size: 2rem; line-height: 2.4rem; }
  .home-faq__label { width: auto; height: 5.4rem; margin-top: 2rem; font-size: 1.8rem; line-height: 2.57rem; }
  .home-faq__list { width: auto; margin-top: 2rem; }
  .home-faq__question { font-size: 1.4rem; line-height: 1.96rem; }
  .home-faq__question button { gap: 0; min-height: 0; padding: 2rem; }
  .home-faq__question span { width: 18.5rem; }
  .home-faq__question svg { width: 2.1rem; height: 2.1rem; }
  .home-faq__answer { padding: 0 2rem 2rem; font-size: 1.4rem; line-height: 1.813rem; }
  .home-faq__answer p + p { margin-top: 1.813rem; }

  .home-gallery { padding: 5.5rem 0 0; }
  .home-gallery::after { content: ""; display: block; height: 5rem; background: var(--white); }
  .home-gallery__frame { width: 28rem; margin-inline: auto; }
  .home-gallery__track { gap: .4rem; height: 36.9rem; padding-left: 0; }
  .home-gallery__group { gap: .4rem; }
  .home-gallery__group img { height: 36.9rem; }
  .home-gallery__group--wide-top img { height: 19.5rem; }
  .home-gallery__group--wide-top picture:first-child img { height: 17rem; }
  .home-gallery__group--wide-bottom img { height: 19.3rem; }
  .home-gallery__group--wide-bottom picture:last-child img { height: 17.2rem; }
  .home-gallery__arrow {
    display: grid; place-items: center; top: 15.95rem; width: 5rem; height: 5rem;
    border-radius: 50%; background: var(--green-900);
  }
  .home-gallery__arrow svg { width: 2.1rem; height: 1.7rem; }
  .home-gallery__arrow--prev { left: 2.3rem; }
  .home-gallery__arrow--next { right: 2.2rem; }
}

/* Wider phones: the 320px design stays centred (--gutter in base.css) */
@media (max-width: 600px) {
  .home-intro__lead, .home-about__text, .home-visit__text { translate: var(--gutter) 0; }
  .home-cards__grid { margin-left: calc(1.2rem + var(--gutter)); }
}
