/* =============================================================================
   SAI ERP — main.css
   Brand: SAI ERP Sàrl · sai-erp.net · Do what you do.
   ============================================================================= */

/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
    /* Brand colors */
    --color-orange-light:  #F4A030;
    --color-orange:        #F07830;
    --color-orange-dark:   #c2410c;
    --color-black:         #0a0a0a;
    --color-black-card:    #111111;
    --color-white:         #ffffff;

    /* Verticals */
    --color-daycare:    #16a34a;
    --color-people:     #1e3799;
    --color-care:       #7e22ce;
    --color-build:      #f59e0b;
    --color-management: #0f766e;
    --color-industry:   #334155;
    --color-finances:   #0369a1;
    --color-ai:         #3730a3;

    /* Dark theme (site default) */
    --bg:          #0a0a0a;
    --bg-card:     #111111;
    --accent:      #F07830;
    --text:        #ffffff;
    --text-muted:  rgba(255,255,255,.55);

    /* Light theme (admin areas, cards) */
    --bg-light:    #f8f9fa;
    --text-dark:   #111111;
    --text-mid:    #555555;

    /* Layout */
    --max-width:   1200px;
    --radius:      12px;
    --radius-lg:   16px;

    /* Typography */
    --font:        'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

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

body {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.75;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ── Typography ────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font);
    line-height: 1.2;
    font-weight: 700;
}

/* Display */
.display { font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 900; letter-spacing: -2px; }

/* H1 */
h1, .h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -1px; }

/* H2 */
h2, .h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.5px; }

/* H3 */
h3, .h3 { font-size: 1.125rem; font-weight: 600; }

/* Body */
p { font-size: 1rem; line-height: 1.75; }

/* Small */
.small { font-size: .8125rem; font-weight: 500; }

/* Caption */
.caption { font-size: .75rem; font-weight: 500; }

/* Numbers / ERP data */
.number-display {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
}

/* ── Layout helpers ─────────────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

@media (min-width: 768px) {
    .container { padding-inline: 2rem; }
}

@media (min-width: 1200px) {
    .container { padding-inline: 2.5rem; }
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .625rem 1.25rem;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1;
    transition: opacity .2s ease, transform .15s ease;
    white-space: nowrap;
}

.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
    background-color: var(--accent);
    color: var(--color-white);
}

.btn--white {
    background-color: var(--color-white);
    color: var(--color-black);
}

.btn--outline {
    background-color: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn--lg { padding: .875rem 1.75rem; font-size: 1rem; }

/* ── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg);
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: var(--max-width);
    margin-inline: auto;
    padding: .875rem 1.5rem;
}

.site-header__brand { flex-shrink: 0; }

.site-header__logo { height: 36px; width: auto; }

.site-header__site-name {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    color: var(--color-orange);
}

.site-nav { flex: 1; }

.site-nav__menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-nav__menu a {
    font-size: .9375rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color .2s;
}

.site-nav__menu a:hover,
.site-nav__menu .current-menu-item > a { color: var(--text); }

.site-header__burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: .25rem;
    margin-left: auto;
}

.site-header__burger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
}

@media (max-width: 767px) {
    .site-header__burger { display: flex; }
    .site-nav, .site-header__cta { display: none; }
}

/* ── Hero section ───────────────────────────────────────────────────────────── */
.section-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 80vh;
    padding: 6rem 0;
    background-color: var(--bg);
    background-image: var(--hero-bg, none);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.section-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10,10,10,.85) 0%, rgba(10,10,10,.55) 100%);
}

.section-hero__content {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.section-hero__title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 1.25rem;
    color: var(--color-white);
}

.section-hero__subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 560px;
}

.section-hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── Text block ─────────────────────────────────────────────────────────────── */
.section-text-block { padding: 5rem 0; }

.section-text-block__title {
    margin-bottom: 2rem;
    color: var(--text);
}

.wysiwyg { color: var(--text-muted); }
.wysiwyg p + p { margin-top: 1rem; }
.wysiwyg h2, .wysiwyg h3 { color: var(--text); margin-bottom: .75rem; margin-top: 2rem; }
.wysiwyg a { color: var(--accent); text-decoration: underline; }
.wysiwyg ul, .wysiwyg ol { padding-left: 1.5rem; list-style: revert; }

/* ── Image + Text ───────────────────────────────────────────────────────────── */
.section-image-text { padding: 5rem 0; }

.section-image-text__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.section-image-text--right .section-image-text__media { order: 2; }
.section-image-text--right .section-image-text__content { order: 1; }

.section-image-text__media img { border-radius: var(--radius-lg); width: 100%; object-fit: cover; }

.section-image-text__title { margin-bottom: 1rem; }
.section-image-text__text { color: var(--text-muted); }

@media (max-width: 767px) {
    .section-image-text__inner { grid-template-columns: 1fr; gap: 2rem; }
    .section-image-text--right .section-image-text__media,
    .section-image-text--right .section-image-text__content { order: unset; }
}

/* ── Cards grid ─────────────────────────────────────────────────────────────── */
.section-cards { padding: 5rem 0; }

.section-cards__title { text-align: center; margin-bottom: 3rem; }

.section-cards__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid rgba(255,255,255,.06);
    transition: border-color .2s, transform .2s;
}

.card:hover {
    border-color: rgba(240,120,48,.3);
    transform: translateY(-3px);
}

.card__icon { margin-bottom: 1.25rem; }
.card__title { margin-bottom: .75rem; font-size: 1.125rem; }
.card__text { color: var(--text-muted); font-size: .9375rem; }

/* ── CTA Banner ─────────────────────────────────────────────────────────────── */
.section-cta { padding: 5rem 0; }

.section-cta__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.section-cta__title { font-size: 1.75rem; font-weight: 800; }

.section-cta--orange {
    background: linear-gradient(135deg, #92400e, #c2410c, #ea580c);
    border-radius: var(--radius-lg);
}

.section-cta--dark { background-color: var(--bg-card); border-radius: var(--radius-lg); }

.section-cta--light {
    background-color: var(--bg-light);
    color: var(--text-dark);
    border-radius: var(--radius-lg);
}

/* ── Post grid ──────────────────────────────────────────────────────────────── */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
}

.post-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
    transition: border-color .2s, transform .2s;
}

.post-card:hover { border-color: rgba(240,120,48,.3); transform: translateY(-3px); }

.post-card__thumbnail img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.post-card__body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }

.post-card__title { font-size: 1.125rem; margin-bottom: .5rem; }
.post-card__title a:hover { color: var(--accent); }

.post-card__meta { font-size: .8125rem; color: var(--text-muted); margin-bottom: 1rem; }

.post-card__excerpt { color: var(--text-muted); font-size: .9375rem; flex: 1; margin-bottom: 1.25rem; }

.post-card__link { color: var(--accent); font-size: .875rem; font-weight: 600; }

/* ── Single post ────────────────────────────────────────────────────────────── */
.single-post { padding: 0; }

.single-post__header { margin-bottom: 2rem; }
.single-post__title { margin-bottom: .75rem; }
.single-post__meta { color: var(--text-muted); font-size: .875rem; display: flex; gap: 1rem; }

.single-post__thumbnail { margin-bottom: 2rem; border-radius: var(--radius-lg); overflow: hidden; }
.single-post__thumbnail img { width: 100%; }

.single-post__content { color: var(--text-muted); }

/* ── Archive header ─────────────────────────────────────────────────────────── */
.archive-header { padding: 3rem 0 0; }
.archive-header__title { margin-bottom: 1rem; }
.archive-header__description { color: var(--text-muted); }

/* ── 404 ────────────────────────────────────────────────────────────────────── */
.error-404 {
    text-align: center;
    padding: 8rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.error-404__title { font-size: 8rem; font-weight: 900; color: var(--accent); line-height: 1; }
.error-404__subtitle { font-size: 1.5rem; font-weight: 700; }

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
    background-color: var(--bg-card);
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: 6rem;
}

.site-footer__inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 3rem;
    max-width: var(--max-width);
    margin-inline: auto;
    padding: 4rem 1.5rem 3rem;
}

.site-footer__logotype {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    color: var(--accent);
}

.site-footer__tagline {
    color: var(--text-muted);
    font-size: .875rem;
    margin-top: .5rem;
}

.site-footer__menu {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.site-footer__menu a {
    color: var(--text-muted);
    font-size: .9375rem;
    transition: color .2s;
}

.site-footer__menu a:hover { color: var(--text); }

.site-footer__contact {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.site-footer__address,
.site-footer__email,
.site-footer__phone {
    color: var(--text-muted);
    font-size: .875rem;
    font-style: normal;
}

.site-footer__email:hover,
.site-footer__phone:hover { color: var(--accent); }

.site-footer__social {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.site-footer__social-link {
    color: var(--accent);
    display: flex;
    align-items: center;
    transition: opacity .2s;
}

.site-footer__social-link:hover { opacity: .7; }

.site-footer__bottom {
    border-top: 1px solid rgba(255,255,255,.08);
}

.site-footer__bottom-inner {
    max-width: var(--max-width);
    margin-inline: auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-footer__copy { font-size: .8125rem; color: var(--text-muted); }
.site-footer__copy a:hover { color: var(--accent); }

.site-footer__legal { display: flex; gap: 1.5rem; }
.site-footer__legal a { font-size: .8125rem; color: var(--text-muted); transition: color .2s; }
.site-footer__legal a:hover { color: var(--text); }

@media (max-width: 1023px) {
    .site-footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 599px) {
    .site-footer__inner { grid-template-columns: 1fr; gap: 2rem; }
}

/* ── Accessibility ──────────────────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--accent);
    color: var(--color-white);
    padding: .5rem 1rem;
    border-radius: 0 0 var(--radius) var(--radius);
    font-weight: 600;
    z-index: 9999;
}

.skip-link:focus { top: 0; }

/* ── Utility classes ────────────────────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

.text-orange  { color: var(--accent); }
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.mt-auto      { margin-top: auto; }
