/* OFFER MAP public look: two themes (light "Paper", dark "Night"), self-hosted OFL fonts, the public
   layout (no top navbar), the minimal footer. Type: Oswald = big titles, Barlow = smaller titles,
   Geist = text, Geist Mono = numbers. The theme is <html data-theme="light|dark">, set before
   paint by the inline script in p_site_layout.html (Content → Design default, the visitor's toggle,
   or the system setting). Contrast of every text / accent pair is ≥ 4.5:1 in both themes. */



/* ---- tokens ---------------------------------------------------------------------------------- */

:root, :root[data-theme="light"] {
    color-scheme: light;
    --pub-bg: #F4F1EA;            /* unbleached paper */
    --pub-surface: #FBFAF6;
    --pub-surface-2: #ECE8DF;
    --pub-text: #1C1B19;          /* warm ink */
    --pub-dim: #615D55;
    --pub-line: rgba(28, 27, 25, 0.12);
    --pub-line-strong: rgba(28, 27, 25, 0.22);
    --pub-accent: #B83A1B;        /* vermilion, used sparingly */
    --pub-accent-text: #FFFFFF;
    --pub-accent-soft: rgba(184, 58, 27, 0.10);
    --pub-fav-on: #3A573C;        /* the open favourites tab on the map (forest green) */
    --pub-fav-on-text: #FFFFFF;
    --pub-shadow: 0 1px 2px rgba(28, 27, 25, 0.06), 0 12px 32px -12px rgba(28, 27, 25, 0.18);
    --pub-overlay: rgba(28, 27, 25, 0.55);
    --pub-tile-filter: saturate(0.78) contrast(0.96);
    --logo-a1: #B83A1B; --logo-a2: #D2603F; --logo-a3: #E8957A; --logo-pole: #1C1B19; --logo-ring: #615D55;   /* the KAART logo */
    --pub-font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --pub-font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --pub-font-headline: 'Oswald', 'Arial Narrow', 'Roboto Condensed', sans-serif;   /* big titles */
    --pub-font-title: 'Barlow', 'Segoe UI', system-ui, sans-serif;                   /* smaller titles */
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --pub-bg: #121110;            /* warm night, not pure black */
    --pub-surface: #1C1B19;
    --pub-surface-2: #26241F;
    --pub-text: #EDE9E1;
    --pub-dim: #A29D93;
    --pub-line: rgba(237, 233, 225, 0.12);
    --pub-line-strong: rgba(237, 233, 225, 0.22);
    --pub-accent: #FF7A4D;
    --pub-accent-text: #1A0E08;
    --pub-accent-soft: rgba(255, 122, 77, 0.14);
    --pub-fav-on: var(--pub-accent);
    --pub-fav-on-text: var(--pub-accent-text);
    --pub-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
    --pub-overlay: rgba(0, 0, 0, 0.66);
    /* OSM tiles for the night: inverted, hue turned back, dimmed */
    --pub-tile-filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.86) saturate(0.55);
    --logo-a1: #FF7A4D; --logo-a2: #FF9C78; --logo-a3: #FFC2A8; --logo-pole: #EDE9E1; --logo-ring: #A29D93;
}

[hidden] { display: none !important; }

/* ---- base ------------------------------------------------------------------------------------ */

html { height: 100%; -webkit-text-size-adjust: 100%; }

body.pub {
    margin: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--pub-bg);
    color: var(--pub-text);
    font-family: var(--pub-font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'ss01', 'cv11';
}

.pub a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.pub a:hover { color: var(--pub-accent); }
.pub :focus-visible { outline: 2px solid var(--pub-accent); outline-offset: 2px; border-radius: 4px; }
.pub ::selection { background: var(--pub-accent); color: var(--pub-accent-text); }

.pub-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; width: 100%;
            max-width: 1240px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }

/* the header: the logo left, the menu (burger, or the signed-in user's avatar) right - on every size */
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; z-index: 1200;
            padding: clamp(12px, 2vh, 20px) clamp(16px, 2vw, 28px) 0; }
.pub-menu { position: relative; }
.pub-menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 9px; padding: 6px 8px;
                    border-radius: 999px; color: var(--pub-dim); transition: color 0.15s ease, background-color 0.15s ease; }
.pub-menu summary::-webkit-details-marker { display: none; }
.pub-menu summary:hover, .pub-menu[open] summary { color: var(--pub-text); background: var(--pub-surface-2); }
.pub-menu summary:focus-visible { outline: 2px solid var(--pub-accent); outline-offset: 2px; }
.pub-burger { width: 26px; height: 26px; background: currentColor;
              -webkit-mask: url('/static/external/phosphoricons.com/list.svg') center / contain no-repeat;
              mask: url('/static/external/phosphoricons.com/list.svg') center / contain no-repeat; }
.pub-avatar { width: 32px; height: 32px; border-radius: 999px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
              background: var(--pub-accent); color: var(--pub-accent-text); font-family: var(--pub-font-title); font-weight: 600;
              font-size: 0.86rem; letter-spacing: 0.02em; }
.pub-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pub-me { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.94rem; color: var(--pub-text); }
.pub-menu-list { position: absolute; top: calc(100% + 8px); right: 0; min-width: 210px; display: flex; flex-direction: column; padding: 6px;
                 background: var(--pub-surface); border: 1px solid var(--pub-line); border-radius: 14px; box-shadow: var(--pub-shadow); }
.pub-menu-list a { padding: 9px 12px; border-radius: 8px; color: var(--pub-text); text-decoration: none; font-size: 0.95rem; }
.pub-menu-list a:hover { background: var(--pub-surface-2); }

/* the KAART logo */
.pub-logo { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--pub-dim);
            transition: color 0.16s ease; }
/* subtle: the name and the ring in the dim grey (they must not compete with the tagline / search);
   the full text colour only on hover */
.pub-logo:hover { color: var(--pub-text) !important; }
.pub-logo svg { width: 30px; height: 30px; flex: 0 0 auto; transition: transform 0.18s ease; }
.pub-logo:hover svg { transform: translateY(-2px); }
.pub-logo span { font-family: var(--pub-font-headline); font-weight: 600; font-size: 1.15rem; letter-spacing: 0.12em;
                 text-transform: uppercase; line-height: 1; }

/* the tagline is the page's headline: what a new visitor reads first */
.pub-hero { margin: 0; padding: 0 16px clamp(14px, 2.4vh, 26px); text-align: center;
            font-family: var(--pub-font-headline); font-weight: 500; font-size: clamp(2rem, 1.05rem + 3.1vw, 3.6rem);
            line-height: 1.08; letter-spacing: 0.005em; color: var(--pub-text); text-wrap: balance; }

/* the minimal footer: one quiet line */
.pub-foot { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 20px;
            padding: 14px 24px 18px; font-size: 0.84rem; color: var(--pub-dim); }
.pub-foot a { text-decoration: none; color: var(--pub-dim); }
.pub-foot a:hover { color: var(--pub-text); text-decoration: underline; }
.pub-foot .pub-cta { color: var(--pub-text); font-weight: 500; }
.pub-foot .pub-cta:hover { color: var(--pub-accent); }
.pub-foot .pub-note { opacity: 0.85; }
.pub-icon-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--pub-dim);
                font: inherit; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.pub-icon-btn:hover { color: var(--pub-text); }
.pub-icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.pub-market { position: relative; }
.pub-market summary { cursor: pointer; list-style: none; }
.pub-market summary::-webkit-details-marker { display: none; }
.pub-market summary::after { content: ' ▾'; font-size: 0.8em; }
.pub-market-list { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 3000;
                   background: var(--pub-surface); border: 1px solid var(--pub-line); border-radius: 12px; padding: 6px;
                   display: flex; flex-direction: column; min-width: 160px; box-shadow: var(--pub-shadow); }
.pub-market-list a { padding: 7px 10px; border-radius: 8px; color: var(--pub-text) !important; }
.pub-market-list a:hover { background: var(--pub-surface-2); text-decoration: none !important; }
.pub-market-list a.is-on { font-weight: 600; }

/* prose pages (custom pages, the publishers page) */
.pub-prose { width: 100%; max-width: 680px; margin: 0 auto; padding: clamp(12px, 4vh, 48px) 0 48px; }
.pub-prose h1 { font-family: var(--pub-font-headline); font-weight: 500; font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
                line-height: 1.1; letter-spacing: 0.005em; margin: 0 0 20px; }
.pub-prose h2 { font-family: var(--pub-font-title); font-weight: 600; font-size: 1.4rem; line-height: 1.2; margin: 32px 0 8px; }
.pub-prose p { margin: 0 0 14px; font-size: 1.04rem; line-height: 1.65; }
.pub-prose .pub-lead { font-size: 1.16rem; color: var(--pub-dim); }
.pub-back { display: inline-block; margin-bottom: 18px; font-size: 0.9rem; color: var(--pub-dim) !important; text-decoration: none; }
.pub-back:hover { color: var(--pub-text) !important; }

@media (max-width: 900px) {
    .pub-logo svg { width: 26px; height: 26px; }
    .pub-logo span { font-size: 1.02rem; }
    .pub-me { max-width: 110px; }
}
@media (prefers-reduced-motion: reduce) { .pub-menu summary { transition: none; } }

@media (max-width: 700px) {
    .pub-main { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .pub *, .pub *::before, .pub *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
