/**
 * Reset & Base Styles + Layout & Container
 *
 * Global resets, typography defaults, and layout primitives.
 *
 * @package IBCES
 */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    /* clip prevents horizontal overflow (fixed elements like chatbot
       extending beyond viewport on iOS Safari) without creating a scroll
       container — so position:sticky still works inside the page. */
    overflow-x: clip;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-white);
    /* Use clip instead of hidden so position:sticky keeps working.
       overflow-x:hidden on body creates a new scroll container that
       breaks sticky positioning for all descendants. */
    overflow-x: clip;
    width: 100%;
    max-width: 100%;
}

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

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-gold);
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-black);
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-sm);
}

/* ----------------------------------------
   Layout & Container
---------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-narrow {
    max-width: var(--container-narrow);
}

.section {
    padding: var(--spacing-3xl) 0;
}

.section-sm {
    padding: var(--spacing-xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-header h2 {
    position: relative;
    display: inline-block;
    margin-bottom: var(--spacing-sm);
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-gold));
    border-radius: var(--radius-full);
}

.section-header p {
    color: var(--color-text-light);
    font-size: 1.125rem;
    max-width: 600px;
    margin: var(--spacing-md) auto 0;
}

/* ----------------------------------------
   Responsive — Tablet
---------------------------------------- */
@media (max-width: 1024px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    .container {
        padding: 0 var(--spacing-lg);
    }

    .section {
        padding: var(--spacing-2xl) 0;
    }
}

/* ----------------------------------------
   Responsive — Mobile
---------------------------------------- */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }

    .section {
        padding: var(--spacing-xl) 0;
    }
}

/* ----------------------------------------
   Responsive — Small Mobile
---------------------------------------- */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }
}
