/* =====================================================================
   FC Obermais Stats · Footer "Flutlicht auf der Lahn"
   Scope: everything lives under .fcof (no global rules).
   Scene: the illustrated 16:9 Lahn at blue hour (posters, strike + idle clips
   in footer/media/) is the background of the whole footer: full width, on the
   bottom edge, its sky runs up behind the content; the landscape shows in the
   window below the content. Tunables per breakpoint are the custom properties
   on .fcof (--pr, --fx, --min-ph, --land).
   Type: the site's own Barlow / Barlow Condensed (loaded in template.html),
   one type system for the whole page instead of adding Geist.
   URLs are relative to this file, so the page also works from file://.
   ===================================================================== */

.fcof {
  /* FCO design values (replace the skill's neutral palette, see FCO-OVERRIDES.md) */
  --fcof-bg: #010818;              /* the scene's zenith: footer background above the plate */
  --fcof-ink: #f3f6fb;             /* primary text */
  --fcof-ink-2: #b4c1d6;           /* secondary text, 11:1 on --fcof-bg */
  --fcof-line: rgb(243 246 251 / .14);
  --fcof-blue: #4a86ee;            /* Vereinsblau for accents and focus */
  --fcof-ease: cubic-bezier(.32, .72, 0, 1);
  --fcof-sky: #8db8ec;             /* light club blue for accents on navy (7.9:1) */
  --fcof-font: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --fcof-cond: "Barlow Condensed", "Arial Narrow", sans-serif;

  /* ---- scene tunables ---- */
  --pr: 1.7778;      /* plate aspect ratio (16:9) */
  --fx: .5;          /* horizontal focal point when the plate is wider than the footer, 0..1 */
  --min-ph: 0px;     /* minimum plate height; below it the plate is cropped at the sides */
  --land: .57;       /* share of the plate height shown below the content (ridge to pitch) */

  position: relative;
  margin: 40px 0 0;
  overflow: hidden;
  background: var(--fcof-bg);
  color: var(--fcof-ink);
  font-family: var(--fcof-font);
  font-size: 14px;                 /* text-sm */
  line-height: 20px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.fcof *, .fcof *::before, .fcof *::after { box-sizing: border-box; }
.fcof :where(h2, h3, p, ul, li, figure) { margin: 0; padding: 0; }
.fcof :where(em) { font-style: normal; }
.fcof :where(ul) { list-style: none; }
.fcof :where(a) { color: inherit; text-decoration: none; }
.fcof :where(p) { text-wrap: pretty; }
.fcof :where(h2, h3) { text-wrap: balance; }

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

/* ---------------------------------------------------------------------
   Hero row (crest lockup + section nav, tifo banner) and content grid
   --------------------------------------------------------------------- */
.fcof-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 16px 48px;
}
.fcof-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--fcof-line);
}
.fcof-brand { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.fcof-lockup { display: flex; align-items: center; gap: 24px; }
.fcof-crest {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgb(255 255 255 / .12), 0 12px 32px rgb(0 0 0 / .45);
}
.fcof-crest img { display: block; width: auto; height: 52px; }
.fcof-chant-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.fcof-allez {
  font-family: var(--fcof-cond);
  font-size: 60px;                 /* text-6xl */
  line-height: 1;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #ffffff;
}
.fcof-allez em { color: var(--fcof-sky); }
.fcof-motto {
  font-size: 12px;                 /* text-xs */
  line-height: 16px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #9ec5f4;
}
.fcof-motto span { color: #ffffff; }

.fcof-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.fcof-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgb(255 255 255 / .06);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12);
  font-family: var(--fcof-cond);
  font-size: 16px;                 /* text-base */
  line-height: 24px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fcof-ink);
  transition: background-color 300ms var(--fcof-ease), box-shadow 300ms var(--fcof-ease), transform 300ms var(--fcof-ease);
}
.fcof-nav a:hover { background: rgb(255 255 255 / .14); box-shadow: inset 0 0 0 1px rgb(141 184 236 / .6); }
.fcof-nav a:active { transform: scale(.97); }
.fcof-nav a[aria-current="page"] { background: var(--fcof-ink); color: var(--fcof-bg); box-shadow: none; }

/* the ultras' banner, hung like a tifo on the fence */
.fcof-tifo { justify-self: end; margin: 0; }
.fcof-tifo img {
  display: block;
  width: auto;
  height: 200px;
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgb(0 0 0 / .5), 0 0 0 1px rgb(255 255 255 / .14);
  transform: rotate(-1.5deg);
  transition: transform 700ms var(--fcof-ease);
}
.fcof-tifo:hover img { transform: rotate(0deg) scale(1.02); }

.fcof-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .8fr);
  gap: 40px 48px;
  align-items: start;
  padding-top: 48px;
}
.fcof-grid > section { min-width: 0; }

.fcof-h {
  margin-bottom: 16px;
  font-family: var(--fcof-cond);
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fcof-sky);
}
.fcof-grid p { max-width: 56ch; color: var(--fcof-ink-2); line-height: 24px; }
.fcof-grid p + p { margin-top: 12px; }

.fcof-links { display: grid; gap: 12px; }
.fcof-links li { text-wrap: pretty; }

.fcof-data span { display: block; }
.fcof-data {
  display: grid;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  color: var(--fcof-ink) !important;
}

/* links: faint underline, lifts to full on hover */
.fcof-grid a {
  color: var(--fcof-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: rgb(180 193 214 / .35);
  transition: color 300ms var(--fcof-ease), text-decoration-color 300ms var(--fcof-ease);
}
.fcof-grid a:hover { color: #ffffff; text-decoration-color: var(--fcof-sky); }
.fcof-grid a:active { color: var(--fcof-sky); }
.fcof a:focus-visible,
.fcof button:focus-visible {
  outline: 2px solid var(--fcof-blue);
  outline-offset: 4px;
  border-radius: 4px;
}
.fcof-nav a:focus-visible { border-radius: 999px; }

/* ---------------------------------------------------------------------
   Scene: the floodlit Lahn behind the whole footer, the window below the
   content, pins, bar
   --------------------------------------------------------------------- */
.fcof-scene {
  /* plate box: full width (at least --min-ph tall), centred on --fx, on the bottom edge */
  --pw: max(100cqw, var(--min-ph) * var(--pr));
  --ph: calc(var(--pw) / var(--pr));
  --pl: calc((100cqw - var(--pw)) * var(--fx));
  --pt: calc(100cqh - var(--ph));

  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  container-type: size;
  pointer-events: none;
}

.fcof-plate {
  position: absolute;
  left: var(--pl);
  top: var(--pt);
  width: var(--pw);
  height: var(--ph);
}
.fcof-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.fcof-layer img,
video.fcof-layer {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* posters: "on" is the base layer, "off" sits above it */
.fcof-poster-off { opacity: 0; transition: opacity 700ms var(--fcof-ease); }
.fcof[data-fcof-state="off"] .fcof-poster-off,
.fcof[data-fcof-mode="video"][data-fcof-state="striking"] .fcof-poster-off { opacity: 1; }
/* keeps the dark still under the strike clip until its first frame is painted */
.fcof[data-fcof-mode="video"][data-fcof-state="striking"] .fcof-poster-off { transition: none; }
.fcof[data-fcof-mode="poster"][data-fcof-state="striking"] .fcof-poster-off {
  opacity: 0;
  transition: none;
  animation: fcof-strike 1800ms linear both;
}
@keyframes fcof-strike {
  0%   { opacity: 1; }
  9%   { opacity: .2; }
  14%  { opacity: 1; }
  27%  { opacity: .05; }
  33%  { opacity: .7; }
  48%  { opacity: 0; }
  100% { opacity: 0; }
}

/* videos only exist in video mode; the strike clip sits above the idle loop */
.fcof-vid { display: none; opacity: 0; }
.fcof.is-armed[data-fcof-mode="video"] .fcof-vid { display: block; }
.fcof-vid.is-shown { opacity: 1; }

/* the plate's sky melts into the footer background and stays dark behind the text */
.fcof-scrim {
  background: linear-gradient(to bottom,
    var(--fcof-bg) 0%,
    rgb(1 8 24 / .65) 12%,
    rgb(1 8 24 / .3) 24%,
    rgb(1 8 24 / 0) 36%);
}

/* ---- the window: room below the content where the landscape shows ---- */
.fcof-window {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  height: calc(var(--land) * max(100vw / var(--pr), var(--min-ph)));
  margin: 0 auto;
}

/* ---- panorama pins (plate coordinates) ---- */
.fcof-pins { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.fcof-pin {
  position: absolute;
  left: calc(var(--x) * 100%);
  top: calc(var(--y) * 100%);
  transform: translate(-50%, calc(-100% - 12px));
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;                 /* text-xs */
  line-height: 16px;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgb(3 10 24 / .7), 0 0 12px rgb(3 10 24 / .5);
  opacity: 1;
  transition: opacity 900ms var(--fcof-ease);
}
.fcof-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 2px);
  width: 1px;
  height: 10px;
  background: currentColor;
  opacity: .75;
}
.fcof-pin.is-below { transform: translate(-50%, 14px); }
.fcof-pin.is-below::after { top: auto; bottom: calc(100% + 2px); }
.fcof-pin b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  opacity: .8;
}
.fcof.is-armed:not([data-fcof-state="on"]) .fcof-pin,
.fcof-pin.is-clipped { opacity: 0; }

/* ---- pause (WCAG 2.2.2): stops the loop, the floodlights stay on; only while a clip can play ---- */
.fcof-pause {
  position: absolute;
  z-index: 3;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(5 16 34 / .45);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12);
  color: var(--fcof-ink);
  cursor: pointer;
  opacity: .7;
  transition: opacity 300ms var(--fcof-ease), background-color 300ms var(--fcof-ease), transform 300ms var(--fcof-ease);
}
.fcof-pause:hover,
.fcof-pause:focus-visible { opacity: 1; background: rgb(5 16 34 / .7); }
.fcof-pause:focus-visible { border-radius: 50%; }
.fcof-pause:active { transform: scale(.94); }
.fcof-pause svg { width: 14px; height: 14px; flex: none; }
.fcof-pause[hidden] { display: none; }
.fcof-pause[aria-pressed="true"] .fcof-i-pause,
.fcof-pause:not([aria-pressed="true"]) .fcof-i-play { display: none; }

/* ---------------------------------------------------------------------
   Scroll reveal (skill B7): heavy fade up with blur, IntersectionObserver
   --------------------------------------------------------------------- */
.fcof.is-armed .fcof-rise {
  opacity: 0;
  transform: translateY(64px);
  filter: blur(12px);
}
.fcof.is-armed .fcof-rise.is-in {
  opacity: 1;
  transform: none;
  filter: none;
  transition:
    opacity 900ms var(--fcof-ease) var(--d, 0ms),
    transform 900ms var(--fcof-ease) var(--d, 0ms),
    filter 900ms var(--fcof-ease) var(--d, 0ms);
}

/* ---------------------------------------------------------------------
   Breakpoints (Tailwind sm/lg). Plate tunables are re-set per breakpoint.
   --------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .fcof-inner { padding: 80px 40px 64px; }
  .fcof-pause { right: 40px; bottom: 24px; }
}
@media (max-width: 1023px) {
  .fcof { --min-ph: 520px; }
  .fcof-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fcof-grid > section:first-child { grid-column: 1 / -1; }
  .fcof-tifo img { height: 160px; }
}
@media (max-width: 767px) {
  .fcof-hero { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .fcof-brand { align-items: center; }
  .fcof-lockup { flex-direction: column; gap: 16px; }
  .fcof-chant-txt { align-items: center; }
  .fcof-nav { justify-content: center; }
  .fcof-tifo { justify-self: center; width: min(100%, 420px); }  /* definite width: the lazy banner keeps its height before it loads */
  .fcof-tifo img { width: 100%; height: auto; }
}
@media (max-width: 639px) {
  .fcof-inner { padding: 48px 16px 40px; }
  .fcof-hero { padding-bottom: 40px; }
  .fcof-allez { font-size: 48px; }  /* text-5xl */
  .fcof { --fx: .345; --min-ph: 560px; }  /* phones: pitch lettering and Ifinger in view, flag out */
  .fcof-pause { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }   /* above the lettering */
  .fcof-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 40px; }
  .fcof-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100%, 320px); }
  .fcof-nav li { display: flex; }
  .fcof-nav a { flex: 1; justify-content: center; }
  .fcof-pin-lahn { display: none; }
}

/* ---------------------------------------------------------------------
   Reduced motion: nothing moves on its own
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .fcof.is-armed .fcof-rise { opacity: 1; transform: none; filter: none; }
  .fcof-poster-off, .fcof-pin, .fcof-tifo img { transition: none; }
  .fcof[data-fcof-mode="poster"][data-fcof-state="striking"] .fcof-poster-off { animation: none; }
}

/* ---------------------------------------------------------------------
   Browsers without container query units: full-width plate on the bottom edge
   --------------------------------------------------------------------- */
@supports not (width: 1cqw) {
  .fcof-plate { left: 0; top: auto; bottom: 0; width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .fcof-pins { display: none; }
}
