/* flaner.css
 *
 * Structure only. Every color, font, radius and size comes from a --fln-* token,
 * so applying your design system means editing the TOKENS block below (or
 * overriding it from your own stylesheet). Selectors are single-class and
 * prefixed with fln-, so they will not collide with site styles.
 */

/* ============================== TOKENS ==============================
 * Declared with :where() so they have zero specificity: any rule you write,
 * in any order, wins. Point each one at your design system's variable, e.g.
 *   .fln { --fln-surface: var(--color-surface); --fln-accent: var(--color-brand); }
 * If your tokens already switch for dark mode, the media query below is moot.
 */
:where(.fln) {
  /* typography */
  --fln-font-body: system-ui, sans-serif;
  --fln-font-heading: Georgia, "Times New Roman", serif;

  /* surfaces and text */
  --fln-surface: #ffffff;        /* card and control background */
  --fln-text: #231f1b;
  --fln-muted: #6f665d;          /* labels, secondary text */
  --fln-border: #e7e0d6;
  --fln-accent: #1f6f78;         /* links, notice rule */
  --fln-danger: #b3261e;
  --fln-chip-bg: #efe8dc;        /* neutral pill */

  /* shape and layout */
  --fln-radius-card: 14px;
  --fln-radius-field: 8px;
  --fln-radius-pill: 999px;
  --fln-gap: 24px;
  --fln-card-min: 320px;         /* minimum card width in the grid */
  --fln-photo-height: 150px;

  /* photo header: the name and badges are drawn over the image (or a gradient when there is none) */
  --fln-photo-fallback: linear-gradient(135deg, #1f6f78, #8ec5c9);            /* museums */
  --fln-photo-fallback-monument: linear-gradient(135deg, #6b4a1f, #d9a85a);   /* monuments */
  --fln-photo-fallback-closed: linear-gradient(135deg, #5b6264, #aab3b4);     /* closed places */
  --fln-photo-fallback-pass: linear-gradient(135deg, #3a5f8a, #9db8d6);       /* pass cards */
  --fln-photo-text: #ffffff;
  --fln-photo-text-shadow: 0 1px 3px rgba(0,0,0,.6), 0 0 12px rgba(0,0,0,.35);
  --fln-scrim: linear-gradient(to top, rgba(0,0,0,.7) 0%, rgba(0,0,0,.35) 40%, rgba(0,0,0,0) 75%);
  --fln-badge-bg: rgba(20,60,66,.82);
  --fln-badge-text: #ffffff;
  --fln-badge-border: rgba(255,255,255,.35);
  --fln-badge-closed-bg: rgba(160,28,20,.92);
  --fln-badge-closed-text: #ffffff;

  /* Petermeter stars */
  --fln-star-on: #c98b0a;
  --fln-star-off: #d3cbbd;
}

@media (prefers-color-scheme: dark) {
  :where(.fln) {
    --fln-surface: #1c2425;
    --fln-text: #e8eeec;
    --fln-muted: #94a5a1;
    --fln-border: #2f3b3c;
    --fln-accent: #7cc3cb;
    --fln-danger: #ff9b92;
    --fln-chip-bg: #2a3536;
    --fln-star-on: #f0b429;
    --fln-star-off: #3d4543;
  }
}

/* ============================== BASE ============================== */
.fln, .fln *, .fln *::before, .fln *::after { box-sizing: border-box; }
.fln { font-family: var(--fln-font-body); color: var(--fln-text); }
.fln a { color: var(--fln-accent); text-decoration: none; }
.fln a:hover { text-decoration: underline; }
.fln [hidden] { display: none !important; }
.fln-label {
  display: block; font-size: .72rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--fln-muted);
}
.fln-status, .fln-empty, .fln-intro { color: var(--fln-muted); }
.fln-error { color: var(--fln-danger); }
.fln-link {
  font: inherit; font-size: .85rem; color: var(--fln-accent); background: none; border: 0; padding: 0; cursor: pointer;
}
.fln-link:hover { text-decoration: underline; }

/* ============================ SEARCH, NOTICE ============================ */
.fln-notice {
  margin: 0 0 20px; padding: 10px 14px; font-size: .92rem;
  background: var(--fln-surface); border: 1px solid var(--fln-border);
  border-left: 4px solid var(--fln-accent); border-radius: var(--fln-radius-field);
}
.fln-search {
  display: block; width: 100%; max-width: 28rem; min-height: 40px; margin: 0 0 8px; padding: 8px 12px;
  font: inherit; font-size: .95rem; color: var(--fln-text); background: var(--fln-surface);
  border: 1px solid var(--fln-border); border-radius: var(--fln-radius-field);
}
.fln-search:focus-visible, .fln-field select:focus-visible, .fln-acc__toggle:focus-visible, .fln-link:focus-visible {
  outline: 2px solid var(--fln-accent); outline-offset: 2px;
}

/* ============================ ACCORDIONS ============================
 * The header bar holds the +/- toggle and the count. The section's own Filter and Sort sit at the
 * top of its body, right-aligned, the same bar as on the restaurants and jazz pages.
 */
.fln-acc { margin-top: 28px; }
.fln-acc__title { margin: 0; font: inherit; }
.fln-acc__bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--fln-border);
}
.fln-acc__toggle {
  display: flex; align-items: center; gap: 10px; flex: 1 1 14rem; padding: 0; text-align: left; cursor: pointer;
  font: inherit; font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--fln-muted); background: none; border: 0;
}
.fln-acc__toggle:hover { color: var(--fln-text); }
.fln-pm {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 1.5rem; height: 1.5rem;
  font-weight: 700; line-height: 1; border: 1px solid var(--fln-border); border-radius: var(--fln-radius-field);
}
.fln-meta { margin-left: 4px; font-size: .8rem; letter-spacing: 0; text-transform: none; }
.fln-acc__body { margin-top: 16px; }

.fln-controls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 10px 14px; margin: 0 0 20px; font-size: .9rem;
}
.fln-field { display: inline-flex; align-items: center; gap: 8px; color: var(--fln-muted); }
.fln-field select {
  font: inherit; color: var(--fln-text); background: var(--fln-surface); max-width: 100%;
  border: 1px solid var(--fln-border); border-radius: var(--fln-radius-field); padding: 5px 8px;
}
.fln-geomsg { font-size: .82rem; color: var(--fln-muted); }
.fln-geomsg:empty { display: none; }

/* ============================== GRID ============================== */
.fln__grid {
  display: grid; gap: var(--fln-gap);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--fln-card-min)), 1fr));
}
.fln-empty { grid-column: 1 / -1; margin: 0; }

/* ============================== CARD ============================== */
.fln-card {
  display: flex; flex-direction: column; overflow: hidden; scroll-margin-top: 16px;
  background: var(--fln-surface); border: 1px solid var(--fln-border);
  border-radius: var(--fln-radius-card);
}

/* photo header: image (or gradient), then a scrim so the name reads on any photo */
.fln-photo { position: relative; min-height: var(--fln-photo-height); background: var(--fln-photo-fallback); }
.fln-card--monument .fln-photo { background: var(--fln-photo-fallback-monument); }
.fln-card.is-closed .fln-photo { background: var(--fln-photo-fallback-closed); }
.fln-photo--pass { min-height: 80px; background: var(--fln-photo-fallback-pass); }
.fln-photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--fln-scrim); }
.fln-photo__img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.fln-photo__title {
  position: absolute; left: 20px; right: 20px; bottom: 14px; z-index: 1; margin: 0;
  font-family: var(--fln-font-heading); font-size: 1.4rem; line-height: 1.2; color: var(--fln-photo-text);
  text-shadow: var(--fln-photo-text-shadow);
}
.fln-badges { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.fln-badge {
  padding: 3px 12px; border-radius: var(--fln-radius-pill); color: var(--fln-badge-text);
  background: var(--fln-badge-bg); border: 1px solid var(--fln-badge-border); box-shadow: 0 1px 4px rgba(0,0,0,.35);
  font-size: .72rem; font-weight: 600; letter-spacing: .06em; line-height: 1.4; text-transform: uppercase;
}
.fln-badge--closed { background: var(--fln-badge-closed-bg); color: var(--fln-badge-closed-text); }
.fln-badge--distance { margin-left: auto; font-size: .78rem; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }

.fln-body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }
.fln-tagline { margin: 0 0 14px; font-size: .92rem; color: var(--fln-muted); }
.fln-credit { margin: -8px 0 12px; font-size: .7rem; text-align: right; color: var(--fln-muted); }
.fln-credit a { color: inherit; text-decoration: underline; }
.fln-row { margin: 8px 0; font-size: .95rem; }
.fln-note { margin: 12px 0 0; font-size: .8rem; color: var(--fln-muted); }
.fln-about { max-width: 75ch; margin: 0 0 10px; font-size: .92rem; color: var(--fln-muted); }

.fln-info { margin: 4px 0 0; padding: 0; list-style: none; }
.fln-info li { margin: 3px 0; }

.fln-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.fln-chip {
  padding: 2px 10px; border-radius: var(--fln-radius-pill); font-size: .85rem;
  background: var(--fln-chip-bg);
}
.fln a.fln-chip { color: var(--fln-text); }
.fln-none { font-size: .85rem; color: var(--fln-muted); }

/* a pass card targeted from a pass tag */
.fln-pass:target { outline: 2px solid var(--fln-accent); outline-offset: 2px; }

/* ============================ PETERMETER ============================
 * CSS-only stars. --r on .fln-meter is 0 to 5 in half steps. Each star works out
 * its own fill (--p) from --r and its index (--i), so 3.5 fills three stars and
 * half of the fourth. The meter sits at the bottom of the card so cards line up.
 */
.fln-meter { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin: auto 0 0; padding-top: 14px; }
.fln-meter .fln-label { font-weight: 600; }
.fln-stars { display: inline-flex; font-size: 22px; line-height: 1.1; user-select: none; }
.fln-star {
  --p: clamp(0%, calc((var(--r) - var(--i)) * 100%), 100%);
  display: inline-block; width: 1.2em; text-align: center; color: transparent;
  background: linear-gradient(90deg, var(--fln-star-on) var(--p), var(--fln-star-off) var(--p));
  -webkit-background-clip: text; background-clip: text;
}
.fln-star::before { content: "\2605"; }
.fln-star:nth-child(1) { --i: 0; } .fln-star:nth-child(2) { --i: 1; } .fln-star:nth-child(3) { --i: 2; }
.fln-star:nth-child(4) { --i: 3; } .fln-star:nth-child(5) { --i: 4; }
