/**
 * Borne Hub — werkplek shell (mobiel + desktop)
 * Gebruikt borne design tokens; wijzigt tokens.css niet.
 */
@import url('tokens.css');
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
    --hub-sidebar-w: 260px;
    --hub-bottom-h: 72px;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body.hub-app {
    margin: 0;
    font-family: var(--font-body);
    background: var(--canvas);
    color: var(--ink);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

.hub-layout {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ── Sidebar (desktop) ─────────────────────────────────────────── */
.hub-sidebar {
    display: none;
    width: var(--hub-sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #fff;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 20;
}

.hub-sidebar-brand {
    padding: 28px 22px 22px;
    border-bottom: 1px solid var(--navy-line);
}

.hub-sidebar-brand img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px;
}

.hub-sidebar-brand h1 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 14px 0 4px;
    line-height: 1.25;
}

.hub-sidebar-brand p {
    font-size: 0.78rem;
    color: var(--navy-soft);
    margin: 0;
}

.hub-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 14px;
    flex: 1;
}

.hub-sidebar-footer {
    padding: 18px 20px;
    border-top: 1px solid var(--navy-line);
    font-size: 0.78rem;
}

.hub-sidebar-footer a {
    color: var(--navy-soft);
    text-decoration: none;
}

.hub-sidebar-footer a:hover {
    color: var(--gold-bright);
}

/* ── Main column ───────────────────────────────────────────────── */
.hub-main-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar: alleen Safari-mobiel, niet in PWA */
.hub-topbar {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
    min-height: calc(52px + env(safe-area-inset-top, 0px));
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

@media (min-width: 769px) {
    .hub-topbar { display: none; }
}

@media (display-mode: standalone) {
    .hub-topbar { display: none; }
}

.hub-topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.hub-topbar-brand img {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: contain;
    background: var(--surface-2);
    padding: 3px;
}

.hub-topbar-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.hub-topbar-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.15;
    color: var(--ink);
}

.hub-topbar-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.hub-main {
    flex: 1;
    padding: 20px 18px 24px;
    padding-bottom: calc(28px + var(--hub-bottom-h) + env(safe-area-inset-bottom, 0px));
    width: 100%;
}

@media (min-width: 769px) {
    .hub-main {
        padding: 36px 48px 56px;
        max-width: 960px;
    }

    .hub-bottom-nav { display: none; }
    .hub-sidebar { display: flex; }
}

/* ── Page header ───────────────────────────────────────────────── */
.hub-page-header {
    margin-bottom: 22px;
}

.hub-greeting {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 5vw, 2rem);
    font-weight: 800;
    color: var(--navy);
    margin: 0 0 6px;
    line-height: 1.15;
}

.hub-date {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
}

.hub-page-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 1.85rem);
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--ink);
}

.hub-page-lead {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0 0 22px;
    max-width: 48ch;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .hub-page-lead--desktop-only {
        display: none;
    }
}

/* ── Bottom nav (mobiel) ───────────────────────────────────────── */
.hub-bottom-nav {
    display: flex;
    align-items: stretch;
    gap: 4px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--hub-bottom-h) + env(safe-area-inset-bottom, 0px));
    padding: 8px 8px env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    z-index: 30;
    box-shadow: 0 -8px 32px rgba(16, 29, 56, 0.08);
}

.hub-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    min-height: 48px;
    padding: 6px 4px;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.hub-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.hub-nav-svg {
    width: 22px;
    height: 22px;
}

.hub-nav-item--active {
    color: var(--navy);
    background: color-mix(in srgb, var(--navy) 8%, var(--surface));
}

.hub-nav-item--active .hub-nav-icon {
    color: var(--gold);
}

.hub-nav-item--sidebar {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--navy-soft);
    font-size: 0.9rem;
    min-height: 44px;
}

.hub-nav-item--sidebar .hub-nav-svg {
    width: 20px;
    height: 20px;
}

.hub-nav-item--sidebar:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.hub-nav-item--sidebar.hub-nav-item--active {
    background: color-mix(in srgb, var(--gold) 22%, transparent);
    color: var(--gold-bright);
}

/* ── Tiles / launcher ──────────────────────────────────────────── */
.hub-section {
    margin-bottom: 28px;
}

.hub-section-title {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 12px;
}

.hub-tile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.hub-tile-grid--favorites {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 600px) {
    .hub-tile-grid--favorites {
        gap: 14px;
    }
}

@media (min-width: 900px) {
    .hub-tile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .hub-tile-grid--favorites {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.hub-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 16px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    min-height: 120px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.hub-tile::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--navy);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.hub-tile--form::before { background: var(--domain-form-accent); }
.hub-tile--bev::before { background: var(--domain-bev-accent); }
.hub-tile--beh::before { background: var(--domain-beh-accent); }

.hub-tile:active {
    transform: scale(0.98);
}

@media (hover: hover) {
    .hub-tile:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-hover);
    }

    .hub-tile--form:hover { border-color: var(--domain-form-accent); }
    .hub-tile--bev:hover { border-color: var(--domain-bev-accent); }
    .hub-tile--beh:hover { border-color: var(--domain-beh-accent); }
}

.hub-tile--wide {
    grid-column: 1 / -1;
    min-height: 88px;
    flex-direction: row;
    align-items: center;
    gap: 14px;
}

@media (min-width: 900px) {
    .hub-tile--launcher:not(.hub-tile--wide) {
        min-height: 132px;
    }
}

.hub-tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--navy);
}

.hub-tile--form .hub-tile-icon {
    background: var(--domain-form-accent-soft);
    color: var(--domain-form-accent-ink);
}

.hub-tile--bev .hub-tile-icon {
    background: var(--domain-bev-accent-soft);
    color: var(--domain-bev-accent-ink);
}

.hub-tile--beh .hub-tile-icon {
    background: var(--domain-beh-accent-soft);
    color: var(--domain-beh-accent-ink);
}

.hub-tile-svg {
    width: 24px;
    height: 24px;
}

.hub-tile--wide .hub-tile-icon {
    width: 44px;
    height: 44px;
}

.hub-tile-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.hub-tile-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.25;
    color: var(--ink);
}

.hub-tile-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Zoeken ────────────────────────────────────────────────────── */
.hub-search {
    margin-bottom: 18px;
}

.hub-search input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-body);
    box-shadow: inset 0 1px 2px rgba(16, 29, 56, 0.04);
}

.hub-search input:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 12%, transparent);
}

.hub-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 16px;
    font-size: 0.95rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@supports (padding: max(0px)) {
    @media (min-width: 769px) {
        body.hub-app {
            padding-left: max(0px, env(safe-area-inset-left));
            padding-right: max(0px, env(safe-area-inset-right));
        }
    }
}
