/* ============================================================
   Entangle — sdílený design systém (jeden zdroj pravdy).

   Whitelabel: layout injektuje inline `:root{--accent:<brand.color>}`,
   který přebije fallback níže. Šablony staví JEN na tokenech —
   žádné hardcoded barvy. Font Inter se načítá v <head>.
   ============================================================ */

:root {
    /* Značka (přebito inline v <head> z config('brand.color')). */
    --accent:      #002FA7;                                        /* International Klein Blue */
    --accent-ink:  color-mix(in srgb, var(--accent), #000 20%);   /* hover / tmavší */
    --accent-wash: color-mix(in srgb, var(--accent) 8%, #fff);    /* jemný podklad */

    /* Neutrály */
    --ink:   #111111;   /* text (černá) */
    --muted: #585858;   /* sekundární text */
    --faint: #6e6e6e;   /* terciární text */
    --line:  #e7e7e7;   /* vlasové linky / rámečky */
    --bg:    #ffffff;   /* podklad stránky */

    /* Rozměry */
    --radius:    10px;
    --radius-sm: 6px;
    --maxw:      1200px;
    --nav-h:     56px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Základ ────────────────────────────────────────────────── */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
}
h1, h2, h3 { font-weight: 600; line-height: 1.25; color: var(--ink); }
h1 { font-size: 24px; margin-bottom: 8px; }
h2 { font-size: 20px; margin-bottom: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }

/* ── Navbar — plná šířka, bílé pozadí, vlasová linka ───────── */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    height: var(--nav-h);
    padding: 0 24px;
    display: flex;
    align-items: center;
}
.navbar-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.navbar-brand {
    display: flex; align-items: center; gap: 8px;
    font-weight: 600; font-size: 18px;
    color: var(--ink); text-decoration: none;
}
.navbar-brand svg { color: var(--accent); }   /* Klein Blue globe */
.navbar-nav { display: flex; align-items: center; gap: 8px; list-style: none; }
.navbar-nav a {
    color: var(--muted); font-size: 14px;
    padding: 6px 12px; border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
}
.navbar-nav a:hover { background: #f4f4f5; color: var(--ink); }
.navbar-nav .btn { width: auto; padding: 6px 14px; font-size: 14px; }

/* Uživatelský chip (přihlášený) */
.nav-user {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 6px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; color: var(--ink);
}
.nav-user:hover { background: #f4f4f5; }
.nav-user-avatar {
    flex: none; width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
}

/* ── Layout ────────────────────────────────────────────────── */
.container { max-width: var(--maxw); margin: 0 auto; padding: 32px 24px; }

/* ── Karty ─────────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.card-sm { max-width: 440px; margin: 48px auto; }

/* ── Text ──────────────────────────────────────────────────── */
p.subtitle, .subtitle { color: var(--muted); margin-bottom: 24px; }

/* ── Formuláře ─────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.form-group input {
    width: 100%; padding: 10px 14px;
    border: 1px solid #d1d5db; border-radius: 8px;
    font-size: 15px; font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.checkbox-label input { width: auto; }

/* ── Tlačítka ──────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border-radius: 8px;
    font-size: 15px; font-weight: 500; font-family: inherit;
    border: none; cursor: pointer; text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border: 1px solid #d1d5db; }
.btn-outline:hover { background: #f9fafb; }

/* ── Hlášky ────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 20px; }
.alert-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* ── Utility ───────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-sm { font-size: 14px; }
.text-muted { color: var(--muted); }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ── Verified badge ────────────────────────────────────────── */
.verified-badge { display: inline-flex; align-items: center; justify-content: center; vertical-align: -2px; margin-left: 4px; cursor: help; }
.verified-badge svg { display: block; }

/* ── Avatar dropdown (přihlášený) ──────────────────────────── */
.nav-menu-li { position: relative; }
.nav-menu > summary { list-style: none; cursor: pointer; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-caret { color: var(--muted); }
.nav-menu[open] > summary { background: #f4f4f5; }
.nav-menu-panel {
    position: absolute; right: 0; top: calc(100% + 8px);
    min-width: 210px; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: 0 10px 28px rgba(0,0,0,.10);
    padding: 6px; z-index: 1200; display: flex; flex-direction: column; gap: 2px;
}
.nav-menu-panel a, .nav-menu-panel button {
    display: block; width: 100%; text-align: left;
    padding: 9px 12px; border-radius: var(--radius-sm);
    font-size: 14px; color: var(--ink); background: none; border: none;
    cursor: pointer; font-family: inherit; text-decoration: none;
}
.nav-menu-panel a:hover, .nav-menu-panel button:hover { background: #f4f4f5; color: var(--ink); }
.nav-menu-panel form { margin: 0; }

/* ── Hero / landing ────────────────────────────────────────── */
.hero { max-width: 760px; margin: 0 auto; padding: 76px 24px 44px; text-align: center; }
.hero h1 { font-size: 42px; line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 18px; }
.hero-sub { font-size: 19px; color: var(--muted); max-width: 620px; margin: 0 auto 30px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-cta .btn { width: auto; padding: 11px 24px; }
@media (max-width: 640px) {
    .hero { padding: 48px 20px 32px; }
    .hero h1 { font-size: 30px; }
    .hero-sub { font-size: 17px; }
}

/* ── Prose (markdown obsah) ────────────────────────────────── */
.prose { max-width: 720px; }
.prose h1 { font-size: 28px; margin: 0 0 12px; }
.prose h2 { font-size: 22px; margin: 32px 0 12px; }
.prose h3 { font-size: 18px; margin: 24px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose a { color: var(--accent); text-decoration: underline; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose img { max-width: 100%; border-radius: var(--radius); }
.prose blockquote { border-left: 3px solid var(--line); padding-left: 16px; color: var(--muted); margin: 0 0 16px; }
.prose code { background: #f4f4f5; padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }

/* ── App-home (přihlášený): taby + seznamy ─────────────────── */
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 26px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs button {
    padding: 12px 2px; margin-right: 24px; background: none; border: none;
    border-bottom: 2px solid transparent; font-size: 15px; font-weight: 600;
    color: var(--muted); cursor: pointer; font-family: inherit;
}
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-badge {
    display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
    border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600;
    align-items: center; justify-content: center; vertical-align: 1px;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 8px 0 12px; }

.item-list { display: flex; flex-direction: column; gap: 10px; }
.item-card {
    display: block; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit;
    transition: border-color .15s;
}
a.item-card:hover { border-color: var(--accent); }
.item-card.unread { border-left: 3px solid var(--accent); }
.item-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.item-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.item-title { font-weight: 600; font-size: 15px; color: var(--ink); }
.item-body { font-size: 14px; color: var(--ink); margin-top: 3px; }
.item-link { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--accent); }

.ev-mini { display: flex; gap: 14px; align-items: center; }
.ev-mini-date { flex: none; width: 54px; text-align: center; background: var(--accent-wash); border-radius: 8px; padding: 7px 0; }
.ev-mini-day { font-size: 20px; font-weight: 700; color: var(--accent); line-height: 1.1; }
.ev-mini-mon { font-size: 11px; font-weight: 600; color: var(--accent); text-transform: uppercase; }

.empty-state { text-align: center; color: var(--muted); font-size: 15px; padding: 44px 20px; }
.empty-state a { color: var(--accent); font-weight: 500; }
.section-gap { margin-top: 32px; }

.btn-link { background: none; border: none; padding: 0; color: var(--accent); font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; }
.btn-link:hover { color: var(--accent-ink); text-decoration: underline; }
img.nav-user-avatar { object-fit: cover; }

/* ── Navbar na mobilu ──────────────────────────────────────── */
@media (max-width: 640px) {
    .navbar { padding: 0 14px; }
    .navbar-nav { gap: 2px; }
    .navbar-nav a { padding: 6px 8px; }
    .nav-user-name { display: none; }
}
