/* Alasivu. The rally page and the guide, in the same skin as the front page.
 * Loaded after kokko.css; only roles from the token contract, so the theme
 * switcher repaints these pages like the rest.
 */

.alasivu {
  /* Paper lighter than the page, lake water for the depth lines: the same
     local tokens the front page defines on .etusivu. */
  --arkki: color-mix(in srgb, var(--pohja) 40%, #fff);
  --kayra: color-mix(in srgb, var(--vesi) 60%, transparent);
  --varjo: var(--jalka-rgb);
  --rako: clamp(1.5rem, 3vw, 2.75rem);
  max-width: 64rem;
  padding: clamp(3rem, 8vh, 5rem) var(--sivu) clamp(3rem, 8vh, 5rem);
}
:root[data-teema="kuusikko"] .alasivu,
:root[data-teema="kesayo"] .alasivu,
:root[data-teema="hamara"] .alasivu,
:root[data-teema="nuotio"] .alasivu {
  --arkki: var(--pinta);
  --varjo: 0 0 0;
}
.alasivu > section + section { margin-top: clamp(3rem, 8vh, 4.5rem); }
.alasivu h2 { max-width: 20ch; }
.alasivu :where(p:not(.iso-teksti):not(.yla)) { margin-top: 1rem; max-width: 62ch; color: var(--teksti-2); line-height: 1.6; }
.alasivu a:not(.varaa-nappi) { color: var(--otsikko); text-underline-offset: 0.2em; text-decoration-color: var(--korostus); }
.alasivu .kehys { margin-top: 2rem; }
.alasivu .korostus {
  padding-left: 1rem;
  border-left: 3px solid var(--korostus);
  color: var(--otsikko);
}

/* --- rally: logo in the photo header ------------------------------------ */
.kansi .ralli-logo {
  display: block;
  width: clamp(4.5rem, 3.5rem + 4vw, 7rem);
  height: auto;
  margin-bottom: 1.1rem;
  border-radius: 0.4rem;
}

/* --- rally: countdown --------------------------------------------------- */
.laskuri {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem clamp(1.5rem, 5vw, 3.5rem);
  margin-top: 1.5rem;
}
.laskuri div { display: grid; }
.laskuri dt {
  order: 1;
  font-size: clamp(2.75rem, 2rem + 4vw, 4.75rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--otsikko);
  font-variant-numeric: tabular-nums;
}
.laskuri dd {
  order: 2;
  margin-top: 0.35rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teksti-3);
}

/* --- rally: the weekend, day by day ------------------------------------- */
.ohjelma { list-style: none; margin-top: 1.75rem; border-top: 1px solid var(--viiva); }
.ohjelma li {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) 1fr;
  gap: 0.35rem 2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--viiva);
}
.ohjelma .paiva { font-weight: 600; color: var(--otsikko); }
.alasivu .ohjelma .kuvaus { margin-top: 0; }

/* --- shore path: the front page amenity cards, on the subpages ----------
   As on the front page: a lake depth chart for a panel, each card an orange
   trail marker, joined to the next by a dashed path. */
.rantapolku {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(1.75rem, 4.5vw, 3.25rem);
  border-radius: clamp(1.25rem, 3vw, 2.5rem);
  background: color-mix(in srgb, var(--pinta) 75%, var(--pohja));
}
.rantapolku::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to right, transparent 8%, var(--kayra) 55%);
  -webkit-mask: url("../assets/img/syvyyskayrat.svg") right top / cover no-repeat;
  mask: url("../assets/img/syvyyskayrat.svg") right top / cover no-repeat;
  opacity: 0.6;
}
.rantapolku .piirteet-ruudukko { gap: clamp(1.75rem, 3.5vw, 2.75rem) var(--rako); }
.rantapolku .piirre { padding: 0; background: none; overflow: visible; }
.rantapolku .piirre-merkki {
  position: relative;
  z-index: 1;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0.75rem;
  border-radius: 50%;
  background: var(--arkki);
  box-shadow: inset 0 0 0 2.5px var(--korostus), 0 6px 14px -8px rgb(var(--varjo) / 0.4);
  color: var(--liekki-ink);
}
/* The path to the next stop. */
.rantapolku .piirre::before {
  content: "";
  position: absolute;
  top: 1.625rem;
  left: 3.75rem;
  right: calc(var(--rako) * -1 + 0.5rem);
  border-top: 2px dashed color-mix(in srgb, var(--korostus) 60%, transparent);
}
.rantapolku .piirre:nth-child(3n)::before,
.rantapolku .piirre:last-child::before { display: none; }
.rantapolku .piirre p { max-width: 32ch; }
.rantapolku > .korostus { margin-top: 2rem; }

.ralli-kuvat {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: end;
  margin-top: 2rem;
}
.ralli-kuvat .kehys { margin-top: 0; }

.yhteys-rivi { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: 1.5rem; }
.yhteys-rivi .numero { font-size: 1.25rem; font-weight: 600; }

/* --- guide: contents beside the text on a wide screen ------------------- */
.opas-runko {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  max-width: 76rem;
  padding: clamp(3rem, 8vh, 5rem) var(--sivu) clamp(3rem, 8vh, 5rem);
}
.opas-runko .alasivu { padding: 0; }
.hakemisto nav { position: sticky; top: 1.5rem; }
.hakemisto h2 {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teksti-3);
}
.hakemisto ol { list-style: none; margin-top: 0.75rem; border-left: 1px solid var(--viiva); }
.hakemisto a {
  display: block;
  padding: 0.35rem 0 0.35rem 0.9rem;
  color: var(--teksti-2);
  text-decoration: none;
  font-size: 0.9375rem;
}
.hakemisto a:hover { color: var(--otsikko); }
.alasivu section[id] { scroll-margin-top: 1.5rem; }

.tiedot, .kysymykset { margin-top: 1.25rem; border-top: 1px solid var(--viiva); }
.tiedot div, .kysymykset div { padding: 0.85rem 0; border-bottom: 1px solid var(--viiva); }
.tiedot div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; }
.tiedot dt, .kysymykset dt { font-weight: 600; color: var(--otsikko); }
.tiedot dd { color: var(--teksti-2); font-variant-numeric: tabular-nums; }
.kysymykset dd { margin-top: 0.3rem; color: var(--teksti-2); line-height: 1.55; }

@media (max-width: 64rem) {
  .rantapolku .piirre:nth-child(3n)::before { display: block; }
  .rantapolku .piirre:nth-child(2n)::before,
  .rantapolku .piirre:last-child::before { display: none; }
}
@media (max-width: 48rem) {
  .opas-runko { grid-template-columns: 1fr; }
  .hakemisto nav { position: static; }
  .ohjelma li { grid-template-columns: 1fr; }
  .ralli-kuvat { grid-template-columns: 1fr; }
}
@media (max-width: 46rem) {
  /* One column: the path runs down from marker to marker instead. */
  .rantapolku .piirre { padding-left: 4.25rem; }
  .rantapolku .piirre-merkki { position: absolute; left: 0; top: 0; }
  .rantapolku .piirre h3 { margin-top: 0.7rem; }
  .rantapolku .piirre::before,
  .rantapolku .piirre:nth-child(3n)::before,
  .rantapolku .piirre:nth-child(2n)::before {
    display: block;
    top: 3.75rem;
    bottom: -1.5rem;
    left: 1.625rem;
    right: auto;
    border-top: 0;
    border-left: 2px dashed color-mix(in srgb, var(--korostus) 60%, transparent);
  }
  .rantapolku .piirre:last-child::before { display: none; }
}
