/* ===== Variables & base ===== */
:root {
    --color-primary: #0d7377;
    --color-primary-dark: #095456;
    --color-primary-light: #14a3a8;
    --color-accent: #e8b86d;
    --color-bg: #f8fafb;
    --color-bg-card: #ffffff;
    --color-text: #1a2b2c;
    --color-text-muted: #5a6b6c;
    --color-border: #e2e8ea;
    --font-sans: 'DM Sans', system-ui, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --shadow-sm: 0 2px 8px rgba(13, 115, 119, 0.06);
    --shadow-md: 0 4px 20px rgba(13, 115, 119, 0.08);
    --radius: 12px;
    --radius-lg: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

img { max-width: 100%; height: auto; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 720px; margin-left: auto; margin-right: auto; }

/* ===== Header ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}
.logo {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    text-decoration: none;
}
.logo:hover { text-decoration: none; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
}
.nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}
.nav a {
    color: var(--color-text);
    font-weight: 500;
    padding: 0.25rem 0;
}
.nav a:hover,
.nav a.active { color: var(--color-primary); text-decoration: none; }

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav { display: none; }
    .nav.is-open { display: block; position: absolute; top: 100%; left: 0; right: 0; background: var(--color-bg-card); border-bottom: 1px solid var(--color-border); padding: 1rem; }
    .nav.is-open ul { flex-direction: column; }
}

/* ===== Hero ===== */
.hero {
    position: relative;
    padding: 4rem 0 5rem;
    background: linear-gradient(160deg, #e8f5f5 0%, #f0f9f9 50%, var(--color-bg) 100%);
    overflow: hidden;
}
.hero-decoration {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, var(--color-bg), transparent);
    pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--color-primary-dark);
    margin: 0 0 1rem;
    line-height: 1.2;
}
.hero-subtitle {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    max-width: 580px;
    margin: 0 0 1.5rem;
}
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary {
    background: var(--color-primary);
    color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ===== Sections preview ===== */
.sections-preview { padding: 4rem 0; }
.sections-preview h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--color-primary-dark);
    margin: 0 0 2rem;
    text-align: center;
}
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}
.card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}
.card h3 {
    font-size: 1.2rem;
    color: var(--color-primary-dark);
    margin: 0 0 0.5rem;
}
.card p {
    color: var(--color-text-muted);
    margin: 0 0 1rem;
    font-size: 0.95rem;
}
.card-link {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.95rem;
}
.card-link:hover { text-decoration: none; }

/* ===== Intro text ===== */
.intro-text {
    padding: 3rem 0 4rem;
    background: var(--color-bg-card);
    border-top: 1px solid var(--color-border);
}
.intro-text .lead {
    font-size: 1.15rem;
    color: var(--color-text);
    margin: 0 0 1rem;
}
.intro-text p:last-child {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* ===== Page content (inner pages) ===== */
.page-hero {
    padding: 2.5rem 0 2rem;
    background: linear-gradient(160deg, #e8f5f5 0%, var(--color-bg) 100%);
}
.page-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: var(--color-primary-dark);
    margin: 0 0 0.5rem;
}
.page-hero .subtitle {
    color: var(--color-text-muted);
    margin: 0;
}
.page-content {
    padding: 2rem 0 4rem;
}
.page-content .container { padding: 0 1.25rem; }
.page-content h2 {
    font-size: 1.4rem;
    color: var(--color-primary-dark);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary-light);
}
.page-content h2:first-child { margin-top: 0; }
.page-content h3 { font-size: 1.15rem; color: var(--color-text); margin: 1.5rem 0 0.5rem; }
.page-content p { margin: 0 0 1rem; color: var(--color-text); }
.page-content ul, .page-content ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}
.page-content li { margin-bottom: 0.35rem; }
.block-tip {
    background: linear-gradient(135deg, #e8f5f5, #f0f9f9);
    border-left: 4px solid var(--color-primary);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.5rem 0;
}
.block-tip strong { color: var(--color-primary-dark); }
.block-warning {
    background: #fff8e8;
    border-left: 4px solid var(--color-accent);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.5rem 0;
}
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
.page-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.page-content th, .page-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}
.page-content th {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}
.page-content tr:nth-child(even) { background: #f5f9f9; }
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-primary);
    font-weight: 500;
    margin-bottom: 1rem;
}
.back-link:hover { text-decoration: none; }

/* ===== Urgence banner ===== */
.urgence-banner {
    background: #fff3e0;
    border-bottom: 2px solid var(--color-accent);
    padding: 0.75rem 1.25rem;
}
.urgence-inner {
    font-size: 0.95rem;
    color: var(--color-text);
}
.urgence-banner a { font-weight: 600; color: var(--color-primary-dark); }
.urgence-banner a:hover { text-decoration: underline; }

/* ===== FAQ ===== */
.faq-list { max-width: 720px; }
.faq-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}
.faq-item:last-child { border-bottom: none; margin-bottom: 0; }
.faq-item h2 {
    font-size: 1.15rem;
    margin: 0 0 0.75rem;
    color: var(--color-primary-dark);
    border: none;
    padding: 0;
}
.faq-item p { margin: 0; }

/* ===== Glossaire ===== */
.glossaire-list {
    max-width: 720px;
    margin: 0;
}
.glossaire-list dt {
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.35rem;
}
.glossaire-list dt:first-child { margin-top: 0; }
.glossaire-list dd {
    margin: 0 0 0 1rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--color-primary-light);
    color: var(--color-text);
}

/* ===== Block urgence (ressources page) ===== */
.block-urgence {
    background: #fff3e0;
    border: 2px solid var(--color-accent);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}
.block-urgence h2 { margin-top: 0; border: none; }
.block-urgence a { font-weight: 600; }

/* ===== Skip link (accessibilité) ===== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius);
    z-index: 200;
    transition: top 0.2s;
}
.skip-link:focus { top: 1rem; outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ===== Print ===== */
@media print {
    .skip-link, .header, .nav-toggle, .nav, .hero-decoration, .urgence-banner, .btn, .back-link, .footer { display: none !important; }
    body { background: #fff; color: #000; }
    .hero { padding: 1rem 0; background: none; }
    .hero h1 { color: #000; }
    .hero-subtitle, .intro-text .lead { color: #333; }
    a[href^="http"]:after { content: " (" attr(href) ")"; font-size: 0.85em; }
    .card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}

/* ===== Footer ===== */
.footer {
    padding: 1.5rem 1.25rem;
    background: var(--color-primary-dark);
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    text-align: center;
}
.footer a { color: #fff; }
.footer p { margin: 0; }
.footer p + p { margin-top: 0.5rem; font-size: 0.9rem; opacity: 0.95; }
