/* /css/common.css — app-wide globals shared by explore/, survey/, admin/.
   Load this BEFORE any sub-route stylesheet so the variables and font rules
   are defined when downstream rules consume them. */

/* Self-hosted fonts — offline-first; no third-party network dependency.
   Both are variable fonts; one woff2 each covers the full 400-700 weight range. */
@font-face {
    font-family: 'Lora';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/webfonts/lora-latin.woff2') format('woff2');
}
@font-face {
    font-family: 'Noto Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/webfonts/noto-sans-latin.woff2') format('woff2');
}

:root {
    /* Color palette (single source of truth) */
    --primary-color: #006054;
    --primary-hover: #007365;
    --primary-light: #d8f5f7;
    --primary-medium: #83edf5;
    --primary-dark: #0d5459;
    --secondary-color: #6c757d;
    --background-color: #fafbfc;
    --card-background: #ffffff;
    --border-color: #176F75;
    --text-primary: #176F75;
    --text-secondary: #5a6c7d;
    --text-muted: #8492a6;
    --selected-color: #c44100;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --warning-light: #f5cc8a;
    --danger-color: #e74c3c;
    --danger-light: #e69187;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-strong: 0 10px 25px rgba(0, 0, 0, 0.1);
    --border-radius: 5px;
    --border-radius-large: 5px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography roles. */
    --font-title: 'Lora', serif;
    --font-body:  'Noto Sans', sans-serif;
}

html, body {
    font-family: var(--font-body);
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-title);
}
h6 {
    font-family: var(--font-body);
}

/* Header buttons (Survey shortcut + hamburger): consistent height so the
   profile icon, Survey link, and hamburger line up visually in the
   top-right cluster. */
.menu-overflow-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    margin-left: 6px;
}
.menu-overflow-btn,
.header-link-btn {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    height: 40px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    padding: 0 12px;
    text-decoration: none;
    transition: var(--transition);
}
.menu-overflow-btn {
    width: 40px;       /* square icon-only */
    padding: 0;
    font-size: 18px;
}
.header-link-btn {
    gap: 6px;
    margin-left: 6px;
    white-space: nowrap;
}
.header-link-btn:hover {
    background-color: var(--primary-light);
}
.menu-overflow-btn:hover {
    background-color: var(--primary-light);
}
.menu-overflow-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    min-width: 220px;
    max-width: calc(100vw - 16px);
    padding: 4px 0;
}
.menu-overflow-panel.show { display: block; }
.menu-overflow-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    padding: 10px 16px;
    font-size: 15px;
    color: var(--primary-color);
    cursor: pointer;
    white-space: nowrap;
}
.menu-overflow-item:hover {
    background-color: var(--primary-light);
}
.menu-overflow-divider {
    margin: 4px 0;
    border: none;
    border-top: 1px solid #eee;
}
.menu-overflow-heading {
    padding: 6px 16px 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #888;
}
@media (max-width: 480px) {
    .menu-overflow-item {
        white-space: normal;
        word-break: break-word;
    }
}

/* Dev-environment header tint + DEV pill. Activated by .dev-mode on <html>
   (set in /js/app.js when location.host contains "dev"). Scoped to the
   header so the rest of the UI keeps its normal colors. */
.dev-badge {
    display: none;
    background: #d97706;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
}
.dev-mode .dev-badge { display: inline-block; }

.dev-mode .survey-header {
    background: #fff4e0;
    border-bottom: 2px solid #d97706;
}
.dev-mode header .controls-top,
.dev-mode header.controls-top,
.dev-mode .explore-header {
    background: #fff4e0;
    border-bottom: 2px solid #d97706;
}
