/* TAFA Media: page styles on top of the kit in assets/. */

/* ------------------------------------------------ floating nav (the client's request, after tasteskill.dev) */
.nav--float {
  --bar-ink: #fff;
  --ink: var(--bar-ink);
  background: none; border: 0; pointer-events: none; color: var(--bar-ink);
  transition: translate .32s cubic-bezier(.2, .8, .2, 1);
}
.nav--float[data-tucked="true"] { translate: 0 calc(-100% - 56px); }
.nav--float.on-light { --bar-ink: var(--p-ink); }
.nav--float .nav__bar {
  position: relative; pointer-events: auto; isolation: isolate;
  width: min(100% - 24px, 880px); height: 56px; margin: 12px auto 0; padding: 0 8px 0 10px;
  border-radius: 16px; gap: var(--s-4);
}
/* The glass sits on a pseudo-element: backdrop-filter on the bar itself would trap the fixed phone sheet. */
.nav--float .nav__bar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: rgb(20 12 8 / .74); box-shadow: inset 0 1px 0 rgb(255 255 255 / .1);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  transition: background-color .3s, box-shadow .3s;
}
.nav--float.on-light .nav__bar::before {
  background: rgb(255 255 255 / .86);
  box-shadow: 0 0 0 1px rgb(10 10 10 / .08), 0 10px 28px -16px rgb(10 10 10 / .4);
}
.nav--float .nav__logo img { height: 40px; width: auto; display: block; }
.nav--float .nav__link { font-size: 15px; color: var(--bar-ink); transition: color .3s; }
.nav--float .nav__actions .btn { height: 40px; border-radius: 10px; padding-inline: var(--s-4); }
.nav--float .nav__toggle { color: var(--bar-ink); border-color: color-mix(in srgb, var(--bar-ink) 28%, transparent); border-radius: 10px; width: 40px; height: 40px; }

/* the dropdown hangs from the bar as one card, not a full-width panel */
.nav--float .nav__item { position: static; }
.nav--float .nav__menu {
  --ink: var(--p-ink); --bg: var(--p-bg); --muted: var(--p-muted);
  top: calc(100% + 8px); padding: var(--s-5); color: var(--p-ink); background: var(--p-bg);
  border: 1px solid rgb(10 10 10 / .08); border-radius: 16px; box-shadow: 0 20px 44px -24px rgb(10 10 10 / .45);
}
.nav--float .nav__menu::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 9px; }
.nav--float .nav__menu .wrap { width: 100%; }
.nav--float .menu-col a { color: var(--p-ink); }
.nav--float .menu-col a:hover { color: var(--p-action); }

@media (max-width: 1023px) {
  .nav--float .nav__bar { display: flex; }
  .nav--float .nav__actions { margin-left: auto; }
  .nav--float .nav__links { flex: none; }
  /* the sheet: opaque, ink on ground */
  .nav--float.is-open { --bar-ink: var(--p-ink); --bg: var(--p-bg); translate: none; }
  .nav--float.is-open .nav__bar::before { background: var(--p-bg); box-shadow: 0 0 0 1px rgb(10 10 10 / .08); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav--float.is-open .nav__links { pointer-events: auto; top: 0; padding-top: calc(var(--nav) + var(--s-5)); color: var(--p-ink); }
  .nav--float.is-open :is(.nav__logo, .nav__toggle) { position: relative; z-index: 1; }
  .nav--float.is-open .nav__menu { border: 0; border-radius: 0; box-shadow: none; padding: 0 0 var(--s-4); }
  .nav--float.is-open .nav__menu::before { display: none; }
}
@media (max-width: 639px) {
  .nav--float .nav__bar { height: 48px; margin-top: 8px; padding: 0 6px 0 8px; gap: var(--s-2); }
  .nav--float .nav__logo img { height: 34px; }
  .nav--float .nav__actions .btn { height: 36px; padding-inline: var(--s-3); }
  .nav--float .nav__toggle { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav--float, .nav--float[data-tucked="true"] { translate: none; transition: none; }
}

/* ------------------------------------------------ hero: words on the calm sky above the bus */
.hero--photo .hero__lead { max-width: 56ch; }
@media (min-width: 1024px) {
  .hero--photo .hero__text { width: min(100%, 760px, 52vw); }
  .hero--photo h1 { max-width: none; font-size: clamp(56px, 5.2vw, 76px); }
}

/* ------------------------------------------------ sections */
.values { margin-top: var(--s-5); }
.values .rows__name { font-weight: 500; }
.values p { margin: var(--s-1) 0 0; }

.channels .panel, .projects .panel, .sites .panel, .partners .panel {
  flex: none; height: var(--p-h); min-height: 0; aspect-ratio: auto;
}
.channels .panel { --p-h: clamp(200px, 100svh - 560px, 340px); }
.channels--tall .panel { --p-h: clamp(220px, 100svh - 420px, 480px); }
.channel-link { margin-top: var(--s-3); width: max-content; }
.projects .panel { --p-h: clamp(170px, 100svh - 600px, 300px); }
.sites { row-gap: var(--s-6); align-content: start; }
.sites .panel { --p-h: clamp(120px, 100svh - 670px, 230px); }
.sites .card > h4 { margin: 0; font-size: var(--t-body); font-weight: 500; line-height: 1.4; }
.sites .card > .panel--top, .partners .card > .panel--top { margin-bottom: var(--s-3); }
.sites .card > p { margin-top: var(--s-1); color: var(--muted); font-size: var(--t-small); }
.sub-h { font: 500 var(--t-card)/1.3 var(--font-text); letter-spacing: -0.01em; margin: 0 0 var(--s-5); }
.partners .panel { --p-h: clamp(220px, 100svh - 480px, 420px); }
.partner-logo { height: 56px; width: auto; max-width: 70%; object-fit: contain; object-position: left center; }

.figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-7) var(--s-5); margin: 0; }
.figures > div { display: flex; flex-direction: column; gap: var(--s-1); }
.figures dd { margin: 0; }
.figures dt { font-size: var(--t-body); line-height: 1.5; color: var(--ink); }
.figures__note { margin-top: var(--s-7); max-width: 56ch; }
.map-frame { background: none; border: 0; }
.map-frame > .frame__img { object-fit: contain; }

.tel { font-weight: 500; white-space: nowrap; text-decoration: underline; text-underline-offset: 4px; }
.footer .nav__logo img { height: 48px; width: auto; }

/* ------------------------------------------------ each card group keeps to its screens at every width */
/* !important: the kit's 1024-1279 rule stretches an odd last card with an :nth-child(of) selector no plain rule can outrank */
@media (min-width: 1024px) and (max-width: 1279px) {
  .projects .card.span-4 { grid-column: auto / span 4 !important; }
}
@media (min-width: 640px) and (max-width: 1279px) {
  .sites .card.span-3 { grid-column: auto / span 3; }
  .partners .card.span-3 { grid-column: auto / span 3; }
  .channels .card.span-6 { grid-column: auto / span 6; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .channels .panel { --p-h: max(180px, calc(100svh - 640px)); }
  /* the second screen: the LED and bus cards run full width, one above the other */
  .channels--tall .card.span-6:has(> .panel):nth-child(n) { grid-column: 1 / -1; }
  .channels--tall .panel { --p-h: max(180px, calc((100svh - 576px) / 2)); }
  /* one project across, two beneath, so the first screen of the section has no hole */
  .grid.projects > .card.span-4:has(> .panel):nth-child(n) { grid-column: auto / span 6; }
  .grid.projects > .card.span-4:has(> .panel):first-child { grid-column: 1 / -1; }
  .projects .panel { --p-h: 170px; }
  .projects .card:first-child .panel { --p-h: max(180px, calc(100svh - 798px)); }
  .sites .card.span-3 { grid-column: auto / span 6; }
  .sites .panel { --p-h: 110px; }
  .partners .card.span-3 { grid-column: auto / span 6; }
  .partners .panel { --p-h: 220px; }
  .map-frame { min-height: 320px; }
  /* the footer's link row stays inside its one screen */
  .footer.closing .closing__links .grid > .stack-4 { grid-column: 1 / -1; }
  .footer.closing .closing__links .grid > .footer__col { grid-column: auto / span 4; }
}
@media (max-width: 639px) {
  .channels .panel, .channels--tall .panel { --p-h: 120px; }
  .projects .panel { --p-h: 130px; }
  .sites .card.span-3, .partners .card.span-3 { grid-column: auto / span 6; }
  .sites .panel { --p-h: 90px; }
  .partners .panel { --p-h: 130px; }
  .partner-logo { height: 40px; }
  .figures { gap: var(--s-4) var(--s-3); }
  .figures__note { margin-top: var(--s-4); }
  .map-frame { min-height: 150px; height: 150px; flex: none; }
  .footer .nav__logo img { height: 40px; }
}

/* ------------------------------------------------ every section fits its content at every screen size
   The kit fixes each section at one or two screens, so on a short screen the content runs into the next
   section. Here a section is at least that tall and grows when its content needs more: at 1440x900 and
   other screens with room it is still exactly one or two screens. The extra html body outranks the kit's
   rules without editing its files. */
html body main > :is(section, .section):is(.section, .hero), html body footer.footer.closing {
  display: flex; flex-direction: column; height: auto;
  min-height: calc(var(--h, 1) * 100vh); min-height: calc(var(--h, 1) * 100svh);
}
html body main > :is(section, .section):is(.section, .hero) > .wrap, html body footer.footer.closing > .wrap {
  flex: 1 0 auto; height: auto; min-height: 0;
}
/* the block under the heading takes the room that's left, but never less than its content */
html body main > :is(section, .section):is(.section, .hero) > .wrap > .fill { flex: 1 0 auto; }
/* two-screen sections: each group keeps its share, and a row is never shorter than its content */
html body main > :is(section, .section).g2 > .wrap { grid-template-rows: minmax(min-content, 1fr) minmax(min-content, 1fr); }
html body footer.footer.closing > .wrap { grid-template-rows: minmax(min-content, 1fr) auto; }
@media (min-width: 1024px) {
  .grid.fill > .frame--fill { min-height: 240px; }
}
/* a phone keeps the kit's larger screen measure and its own screen count (--hm) */
@media (max-width: 639px) {
  html body main > :is(section, .section):is(.section):not(.hero), html body footer.footer.closing {
    min-height: calc(var(--hm, var(--h, 1)) * 100vh); min-height: calc(var(--hm, var(--h, 1)) * 100lvh);
  }
}

/* ------------------------------------------------ phone navigation: a full-width bar with the menu button only.
   Upright phones, and phones on their side, which are wider but very short. */
@media (max-width: 639px), (max-width: 1023px) and (max-height: 500px) {
  .nav--float .nav__bar { width: 100%; height: var(--nav); margin: 0; padding: 0 var(--gut); border-radius: 0; }
  .nav--float .nav__bar::before { border-radius: 0; }
  .nav--float.nav--float .nav__actions, .nav--float.nav--float.is-open .nav__actions { display: none; }
  /* Repeated class: the kit's ".nav:not(.is-open) .nav__actions + .nav__toggle" resets this margin even with the actions hidden. 44px is the kit's tap size. */
  .nav--float.nav--float.nav--float .nav__toggle { margin-left: auto; width: 44px; height: 44px; }
  .nav--float[data-tucked="true"] { translate: 0 -100%; }
}
