/**
 * Base Styles — assets/css/base.css
 * Reset, CSS custom properties (design tokens), typography, and layout primitives.
 *
 * @package  DEI4SME
 * @used-in  All templates (loaded globally)
 *
 * SELECTORS:
 *   :root                — CSS custom properties (colors, fonts, spacing, misc)
 *   html, body           — Font smoothing, base font-size 17px, line-height 1.5
 *   h1-h6               — Heading scale: 42/35/29/24/20px, weight 400, color --color-primary
 *   a                    — Links with transition
 *   p, ol, ul, li        — Prose elements with 1.5em margins
 *   blockquote           — Left-bordered italic blocks
 *   table, td, th        — Bordered table defaults
 *   code, hr, b, em      — Inline element defaults
 *   button, input, etc.  — Form element resets
 *   .site-container      — Full-height flex column wrapper (header.php → footer.php)
 *   .site-content        — Main content flex:1 area (<main> in header.php)
 *   .container           — Max-width 1200px centered wrapper, padding 40px (20px mobile)
 */

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

:root {
    /* DEI4SME Brand Colors */
    --color-dark-blue: #44546A;
    --color-blue: #426EAE;
    --color-green: #8ECA89;
    --color-orange: #EFB67A;
    --color-yellow: #FEF76C;
    --color-red: #F4797E;
    --color-beige: #E5D1A7;

    /* Semantic Colors */
    --color-primary: #426EAE;
    --color-primary-dark: #44546A;
    --color-primary-light: #5a8ac4;
    --color-secondary: #8ECA89;
    --color-accent: #EFB67A;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-bg: #FFFFFF;
    --color-bg-alt: #F5F7FA;
    --color-border: #E0E0E0;

    /* Text Colors */
    --color-text-heading: #2B3A4A;
    --color-text-body: #4B5563;
    --color-text-muted: #6B7280;
    --color-text-placeholder: #9CA3AF;
    --color-text-nav: #535862;

    /* Background Colors */
    --color-bg-surface: #F0F4F8;
    --color-bg-subtle: #F9FAFB;
    --color-bg-info: #E6F0FA;
    --color-bg-info-light: #DBEAFE;

    /* Border Colors */
    --color-border-light: #E5E7EB;
    --color-border-input: #D1D5DB;

    /* Blue Variants */
    --color-blue-accent: #4F81C9;
    --color-blue-dark: #2C5DB3;
    --color-blue-hover: #3D6DB5;

    /* State Colors */
    --color-error: #c0392b;
    --color-error-bg: #fdf0ef;
    --color-success: #27ae60;
    --color-success-bg: #f0faf4;
    --color-warning: #f39c12;
    --color-danger: #dc3545;

    /* Score Level Colors */
    --color-level-emerging: #C0392B;
    --color-level-developing: #E67E22;
    --color-level-proficient: #2980B9;
    --color-level-advanced: #27AE60;

    /* Gradient */
    --gradient-primary: linear-gradient(90deg, var(--color-blue-dark) 0%, var(--color-blue-accent) 100%);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-logo: 'Carrois Gothic', sans-serif;

    /* Breakpoints (for reference — used in @media queries) */
    /* --bp-sm:  576px   — Small phones → landscape phones */
    /* --bp-md:  768px   — Phones → tablets */
    /* --bp-lg:  992px   — Tablets → desktops */
    /* --bp-xl:  1200px  — Desktops → large screens */

    /* Spacing */
    --max-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 5rem;

    /* Misc */
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.12);
    --transition: 0.2s ease;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-bg);
}

p {
    margin-bottom: 1.5em;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-primary);
    margin-bottom: 20px;
}

h1 {
    font-size: 42px;
}

h2 {
    font-size: 35px;
}

h3 {
    font-size: 29px;
}

h4 {
    font-size: 24px;
}

h5 {
    font-size: 20px;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.1s ease-in-out, background-color 0.1s ease-in-out;
}

a:hover {
    color: var(--color-primary-light);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ol,
ul {
    margin: 0 0 1.5em 3em;
}

ul {
    list-style: disc;
}

ol {
    list-style: decimal;
}

li>ol,
li>ul {
    margin-bottom: 0;
    margin-left: 1.5em;
}

blockquote {
    border-left: 5px solid rgba(0, 0, 0, 0.05);
    padding: 20px;
    font-size: 1.2em;
    font-style: italic;
    margin: 0 0 1.5em;
    position: relative;
}

blockquote p:last-child {
    margin: 0;
}

table,
td,
th {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

table {
    border-collapse: separate;
    border-spacing: 0;
    border-width: 1px 0 0 1px;
    margin: 0 0 1.5em;
    width: 100%;
}

td,
th {
    padding: 8px;
}

th {
    font-weight: 700;
    border-width: 0 1px 1px 0;
}

td {
    border-width: 0 1px 1px 0;
}

hr {
    background-color: rgba(0, 0, 0, 0.1);
    border: 0;
    height: 1px;
    margin-bottom: 40px;
    margin-top: 40px;
}

code,
kbd,
tt,
var {
    font: 15px Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace;
}

b,
strong {
    font-weight: 700;
}

cite,
dfn,
em,
i {
    font-style: italic;
}

button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    margin: 0;
}

input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="url"],
select,
textarea {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 10px 15px;
    max-width: 100%;
}

textarea {
    width: 100%;
}

/* === Layout === */
html {
    overflow-x: hidden;
    /* fallback for Safari (no clip support) */
    overflow-x: clip;
    /* clip: no scroll container → preserves position:sticky */
}

body {
    overflow-x: hidden;
    /* fallback for Safari (no clip support) */
    overflow-x: clip;
    /* clip: no scroll container → preserves position:sticky */
}

.site-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}

/* === Responsive Base === */
@media (max-width: 768px) {
    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 28px;
    }

    h3 {
        font-size: 24px;
    }

    .container {
        padding: 0 20px;
    }
}


/* Center wrapper for images in page content */
.center-img {
    display: flex;
    justify-content: center;
}

/* Dash list — replaces bullet dots with en-dash "–" */
ul.dash-list {
    list-style: none;
    padding-left: 1.25em;
}

ul.dash-list li {
    position: relative;
}

ul.dash-list li::before {
    content: "–";
    position: absolute;
    left: -1.25em;
}
