/*
 * Linnuriik landing — warm "storybook" redesign.
 * Recreated from design/design_handoff_linnuriik. All styles are namespaced
 * under .lr-root so they never leak into the rest of the (vendored) theme.
 */

/* Visually hidden but available to screen readers & crawlers. */
.lr-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.lr-root {
    --lr-ink: #2e2418;
    --lr-ink-soft: #5a4a32;
    --lr-ink-soft2: #6e5a36;
    --lr-muted: #a08a5e;
    --lr-muted2: #9a865c;
    --lr-paper: #f4e7cd;
    --lr-paper-map: #efe6d2;
    --lr-canvas: #e9dcc0;
    --lr-card: #fffaf0;
    --lr-coin: #fbf6ea;
    /* category colours — keep these in sync with linnuriik.js meta() */
    --lr-coffee: #bd732e;
    --lr-garage: #4f8a73;
    --lr-both: #cca766;
    --lr-sport: #7d8c3f;
    /* hero accent blocks */
    --lr-slate: #4f7d8c;
    --lr-gold: #d49a3a;

    box-sizing: border-box;
    background: var(--lr-paper);
    color: var(--lr-ink);
    font-family: 'Hanken Grotesk', sans-serif;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
    /* Break out of any constrained/centred theme container to go full-bleed.
     * The active block theme's `is-layout-constrained` adds
     * `margin-left:auto !important` + a max-width to direct children, so these
     * need !important to win and pin the section to the real viewport edges. */
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    overflow-x: hidden;
}

.lr-root *,
.lr-root *::before,
.lr-root *::after { box-sizing: border-box; }

/* ============================ Keyframes ============================ */
@keyframes lr-drift { from { transform: translateX(-16vw); } to { transform: translateX(120vw); } }
@keyframes lr-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-16px) rotate(3deg); } }
@keyframes lr-bob2 { 0%, 100% { transform: translateY(0) rotate(2deg); } 50% { transform: translateY(13px) rotate(-2deg); } }
@keyframes lr-float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-20px) rotate(4deg); } }
@keyframes lr-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes lr-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes lr-pulse { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.25); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .lr-root [class*="lr-anim"],
    .lr-root .lr-marquee-track,
    .lr-root .lr-pulse { animation: none !important; }
}

/* ============================ Nav ============================ */
.lr-nav {
    position: absolute; top: 0; left: 0; right: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px clamp(20px, 5vw, 64px);
}
.lr-brand {
    display: flex; align-items: center; gap: 11px;
    font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
    font-size: 22px; letter-spacing: -.02em; color: var(--lr-ink);
}
.lr-nav-links {
    display: flex; align-items: center; gap: clamp(14px, 2.5vw, 30px);
    font-weight: 600; font-size: 16px;
}
.lr-nav-links a { color: var(--lr-ink); text-decoration: none; }
.lr-nav-links a:hover { color: var(--lr-coffee); }
.lr-nav-links a.lr-date-pill {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--lr-ink); color: #f3e4c4; text-decoration: none;
    font-weight: 700; padding: 10px 20px; border-radius: 999px;
}
.lr-nav-links a.lr-date-pill:hover { color: #f3e4c4; }

/* ============================ Hero ============================ */
.lr-hero {
    position: relative; min-height: 100vh; display: flex; align-items: center;
    padding: 92px clamp(20px, 5vw, 64px) 96px; overflow: hidden;
}
.lr-blob { position: absolute; border-radius: 50%; z-index: 1; }
.lr-blob--terracotta { bottom: -160px; right: -120px; width: 560px; height: 560px; background: var(--lr-coffee); opacity: .92; }
.lr-blob--teal { top: 120px; right: 14%; width: 170px; height: 170px; background: var(--lr-garage); animation: lr-float 9s ease-in-out infinite; }
.lr-blob--slate { top: 64px; left: -120px; width: 240px; height: 240px; background: var(--lr-slate); opacity: .85; }
.lr-square { position: absolute; top: 38%; right: 6%; width: 120px; height: 120px; border-radius: 28px; background: var(--lr-gold); transform: rotate(14deg); z-index: 1; animation: lr-sway 10s ease-in-out infinite; }

/* flying flock — positions/durations are set inline per bird in the template */
.lr-fly { position: absolute; left: 0; }
.lr-bird-img { display: block; filter: drop-shadow(0 5px 9px rgba(46, 36, 24, .16)); }

/* photo cards */
.lr-photos {
    position: absolute; bottom: 130px; right: clamp(40px, 12vw, 200px); z-index: 6;
    display: flex; gap: 18px; align-items: flex-end;
}
.lr-photo {
    background: var(--lr-card); padding: 12px 12px 14px; border-radius: 6px;
    box-shadow: 0 22px 40px -18px rgba(46, 36, 24, .55);
}
.lr-photo--a { transform: rotate(-5deg); }
.lr-photo--b { transform: rotate(4deg); }
.lr-photo-img {
    display: flex; align-items: center; justify-content: center;
    border-radius: 3px; background: var(--lr-paper); overflow: hidden;
    color: var(--lr-muted); font-size: 13px; font-weight: 600; text-align: center;
}
.lr-photo-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lr-photo--a .lr-photo-img { width: 172px; height: 200px; }
.lr-photo--b .lr-photo-img { width: 150px; height: 176px; }
.lr-photo-cap {
    display: flex; align-items: center; gap: 7px; margin-top: 9px; padding: 0 2px;
    font-family: 'Caveat', cursive; font-size: 24px;
}
.lr-photo-cap span.dot { width: 10px; height: 10px; border-radius: 50%; }

/* text column */
.lr-hero-content { position: relative; z-index: 10; max-width: 660px; }
.lr-ribbon {
    display: inline-flex; align-items: center; gap: 10px;
    background: var(--lr-ink); color: #f3e4c4; font-weight: 700;
    font-size: clamp(12px, 1.35vw, 14px); letter-spacing: .14em;
    padding: 10px 18px; border-radius: 999px;
}
.lr-ribbon .lr-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--lr-gold); animation: lr-pulse 2s ease-in-out infinite; }
.lr-title {
    font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
    font-size: clamp(78px, 13vw, 184px); line-height: .82; margin: 18px 0 0;
    letter-spacing: -.04em; color: var(--lr-ink);
}
.lr-subhead {
    font-size: clamp(18px, 2vw, 23px); font-weight: 500; line-height: 1.5;
    color: var(--lr-ink-soft); margin: 26px 0 0; max-width: 560px;
}
.lr-subhead strong { color: var(--lr-ink); }
.lr-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.lr-btn {
    display: inline-flex; align-items: center; gap: 12px; text-decoration: none;
    font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700;
    font-size: clamp(16px, 1.7vw, 20px); padding: 17px 34px; border-radius: 14px;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.lr-btn--primary { background: var(--lr-ink); color: #f3e4c4; box-shadow: 0 16px 30px -14px rgba(46, 36, 24, .6); }
.lr-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 22px 36px -14px rgba(46, 36, 24, .7); color: #f3e4c4; }
.lr-btn--ghost { background: transparent; color: var(--lr-ink); padding: 17px 30px; border: 2px solid var(--lr-ink); }
.lr-btn--ghost:hover { background: var(--lr-ink); color: #f3e4c4; }

/* legend (shared between hero + map) */
.lr-legend { display: flex; flex-wrap: wrap; gap: 18px 22px; margin-top: 38px; }
.lr-legend--map { flex-direction: column; gap: 10px; margin-top: 0; }
.lr-legend-item { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; color: #3a3326; }
.lr-legend--map .lr-legend-item { font-size: 16px; }
.lr-legend-dot { width: 12px; height: 12px; border-radius: 50%; }
.lr-legend-ring { width: 13px; height: 13px; border-radius: 50%; background: var(--lr-coin); }

/* marquee */
/* Sits at the bottom of the FIRST viewport on load, independent of how tall the
 * hero content grows (i.e. of screen size). It is absolutely positioned (not
 * fixed) and stays in the page, so you simply scroll past it — it does not pin
 * to the viewport or slide away. */
.lr-marquee {
    position: absolute; left: 0; right: 0; bottom: auto;
    top: 100vh; transform: translateY(-100%);
    background: var(--lr-ink); color: #f3e4c4; padding: 15px 0; overflow: hidden; z-index: 20;
}
.lr-marquee-track {
    display: flex; width: max-content; animation: lr-marquee 30s linear infinite;
    font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 18px;
    letter-spacing: .06em; white-space: nowrap;
}
.lr-marquee-track > span { display: flex; }
.lr-marquee-name { padding: 0 20px; }
.lr-marquee-sep { opacity: .4; }

/* ============================ Map section ============================ */
.lr-section { max-width: 1080px; margin: 0 auto; padding: 64px 28px 90px; }
.lr-section-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 24px; flex-wrap: wrap; margin-bottom: 26px;
}
.lr-eyebrow {
    display: flex; align-items: center; gap: 11px; font-size: 13px;
    letter-spacing: .2em; text-transform: uppercase; color: var(--lr-muted); font-weight: 700;
}
.lr-h2 {
    font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
    font-size: clamp(38px, 5.5vw, 60px); line-height: .96; letter-spacing: -.03em;
    margin: 12px 0 8px;
}
.lr-intro { font-size: 19px; color: var(--lr-ink-soft2); max-width: 520px; line-height: 1.55; margin: 0; }
.lr-map-frame {
    position: relative; width: 100%; aspect-ratio: 16 / 11; border-radius: 20px;
    overflow: hidden; background: var(--lr-canvas);
    box-shadow: 0 30px 60px -28px rgba(60, 46, 31, .5), inset 0 0 0 1px rgba(120, 96, 60, .2);
}
.lr-map-canvas { position: absolute; inset: 0; }
.lr-footnote { font-size: 13px; color: var(--lr-muted); margin: 16px 0 0; text-align: center; }

/* ============================ Bird cast ============================ */
.lr-cast { max-width: 1180px; margin: 0 auto; padding: 24px 32px 96px; }
.lr-cast-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 38px 24px; }
.lr-cast-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.lr-cast-coin {
    width: 150px; height: 150px; border-radius: 50%; background: var(--lr-coin);
    display: flex; align-items: center; justify-content: center;
}
.lr-cast-coin img { width: 112px; height: 112px; display: block; }
.lr-cast-street { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.lr-cast-bird { font-size: 14px; color: #90825f; font-weight: 600; margin-top: 2px; }

/* ============================ Kava (day programme) ============================ */
.lr-kava { max-width: 880px; margin: 0 auto; padding: 72px 28px 96px; }
.lr-kava-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 24px; flex-wrap: wrap; margin-bottom: 46px;
}
.lr-kava .lr-h2 { line-height: .96; }
.lr-kava-intro { max-width: 540px; }
.lr-kava-datepill {
    display: inline-flex; align-items: center; gap: 9px; padding: 12px 20px;
    border: 1.5px solid #c4ab78; border-radius: 999px; font-weight: 700; font-size: 16px;
    color: var(--lr-ink-soft2); background: rgba(255, 250, 238, .5); white-space: nowrap;
}
.lr-kava-datedot { width: 9px; height: 9px; border-radius: 50%; background: var(--lr-coffee); }

.lr-timeline { position: relative; }
.lr-timeline-line {
    position: absolute; left: 106px; top: 46px; bottom: 54px; width: 3px;
    background: repeating-linear-gradient(#cdb887 0 7px, transparent 7px 14px);
}
.lr-timeline-bird { position: absolute; left: 90px; top: -6px; animation: lr-bob 4s ease-in-out infinite; }
.lr-timeline-bird img { display: block; filter: drop-shadow(0 5px 9px rgba(46, 36, 24, .16)); }

.lr-tl-row { display: flex; gap: 20px; align-items: flex-start; margin-top: 22px; }
.lr-timeline-bird + .lr-tl-row { margin-top: 54px; }
.lr-tl-time {
    flex: none; width: 84px; text-align: right; font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800; font-size: 20px; line-height: 1.1; padding-top: 16px;
}
.lr-tl-dotcol { flex: none; width: 24px; display: flex; justify-content: center; padding-top: 20px; }
.lr-tl-dot { width: 17px; height: 17px; border-radius: 50%; }
.lr-tl-card {
    flex: 1; border-radius: 16px; padding: 18px 22px;
    box-shadow: 0 16px 30px -20px rgba(46, 36, 24, .5);
}
.lr-tl-titlerow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lr-tl-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 23px; margin: 0; letter-spacing: -.01em; }
.lr-tl-pill { font-weight: 700; font-size: 12px; padding: 4px 11px; border-radius: 999px; }
.lr-tl-pill--allday { background: #f2e7d0; color: #9a7b44; white-space: nowrap; }
.lr-tl-desc { font-size: 16.5px; color: var(--lr-ink-soft); line-height: 1.55; margin: 8px 0 0; }
.lr-kava-note {
    font-family: 'Caveat', cursive; font-size: 22px; color: var(--lr-muted);
    margin: 40px 0 0; text-align: center;
}

/* ============================ Leaflet overrides ============================ */
/* Subtle warm tint — keep light; stronger sepia washes OSM tiles out. */
.lr-root .leaflet-tile-pane { filter: sepia(.08) saturate(1.08) contrast(1.02); }
.lr-root .leaflet-container { background: var(--lr-canvas); font-family: 'Hanken Grotesk', sans-serif; }
.lr-root .leaflet-popup-content-wrapper { background: var(--lr-card); border-radius: 16px; box-shadow: 0 24px 48px -18px rgba(46, 36, 24, .6); padding: 4px; }
.lr-root .leaflet-popup-content { margin: 15px; }
.lr-root .leaflet-popup-tip { background: var(--lr-card); }
.lr-root .leaflet-bar a { background: var(--lr-card); color: var(--lr-ink-soft2); border-bottom-color: #e3d6ba; }
.lr-root .leaflet-bar a:hover { background: #f4ead4; }
.lr-coin { transition: transform .14s ease; }
.lr-coin:hover { transform: scale(1.14); z-index: 1000; }

/* popup card internals (rendered by linnuriik.js) */
.lr-pop { width: 248px; font-family: 'Hanken Grotesk', sans-serif; }
.lr-pop-head { display: flex; align-items: center; gap: 12px; }
.lr-pop-name { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 19px; line-height: 1.05; color: var(--lr-ink); letter-spacing: -.01em; }
.lr-pop-bird { font-size: 12.5px; color: var(--lr-muted2); font-weight: 600; }
.lr-pop-pill { display: inline-flex; margin-top: 11px; color: #fff; font-weight: 700; font-size: 12.5px; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.lr-pop-desc { font-size: 14px; line-height: 1.5; color: var(--lr-ink-soft); margin: 11px 0 0; }
.lr-pop-menu { margin-top: 11px; border-radius: 10px; overflow: hidden; border: 1px solid #ece0c2; }
.lr-pop-menu img { width: 100%; display: block; }
.lr-pop-note { margin-top: 11px; background: #f4ecd8; border-radius: 10px; padding: 11px; font-size: 13px; color: #8a7350; text-align: center; }

/* ============================ Responsive ============================ */
@media (max-width: 720px) {
    /* Keep the photo cards hidden (they crowd the text on narrow screens),
       but let the flock fly — the birds sit behind the heading (z-index 2–3
       vs 10) so they never obscure it. Scaled down for the small canvas. */
    .lr-photos { display: none; }
    .lr-fly .lr-bird-img { transform: scale(.6); transform-origin: center; }
    .lr-cast-grid { grid-template-columns: repeat(2, 1fr); }
    .lr-blob--terracotta { width: 360px; height: 360px; bottom: -120px; right: -100px; }
    .lr-tl-time { width: 56px; font-size: 17px; }
    .lr-timeline-line { left: 78px; }
    .lr-timeline-bird { left: 62px; }
}
@media (max-width: 480px) {
    .lr-nav-links a:not(.lr-date-pill) { display: none; }
}

/* ============================ Mobile map: tap-to-open + fullscreen ============================ */
/* These elements are injected by linnuriik.js only on mobile viewports, so the
   rules are inert on desktop. The preview map sits behind .lr-map-tap (which
   captures taps) until opened; fullscreen pins the frame to the viewport. */
.lr-map-tap {
    position: absolute; inset: 0; z-index: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(180deg, rgba(40, 30, 20, .04), rgba(40, 30, 20, .22));
    -webkit-tap-highlight-color: transparent;
}
.lr-map-tap-btn {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 17px;
    color: #fff; background: var(--lr-coffee, #bd732e);
    border-radius: 999px; padding: 15px 26px;
    box-shadow: 0 14px 30px -10px rgba(46, 36, 24, .75);
}
.lr-map-tap-btn svg { width: 20px; height: 20px; }

.lr-map-close {
    display: none; position: absolute; z-index: 1200;
    right: calc(16px + env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
    align-items: center; gap: 8px; cursor: pointer;
    font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 16px;
    color: #fff; background: var(--lr-ink, #2e2418); border: none;
    border-radius: 999px; padding: 15px 22px;
    box-shadow: 0 16px 32px -8px rgba(0, 0, 0, .6);
}
.lr-map-close svg { width: 18px; height: 18px; }

.lr-map-frame.lr-fs {
    position: fixed; inset: 0; margin: 0; z-index: 9999;
    width: 100vw; height: 100vh; height: 100dvh;
    aspect-ratio: auto; border-radius: 0;
}
.lr-map-frame.lr-fs .lr-map-tap { display: none; }
.lr-map-frame.lr-fs .lr-map-close { display: inline-flex; }
body.lr-fs-lock { overflow: hidden; }

/* Keep the zoom control clear of the notch and give it thumb-sized targets. */
.lr-map-frame.lr-fs .leaflet-top.leaflet-left { top: calc(8px + env(safe-area-inset-top)); }
.lr-map-frame.lr-fs .leaflet-bar a {
    width: 42px; height: 42px; line-height: 42px; font-size: 24px;
}
