/* ==========================================================
   ESPACE KYUBO — Design system
   ========================================================== */

:root {
    --kyubo-teal: #0f6e6a;
    --kyubo-teal-dark: #0a4f4c;
    --kyubo-amber: #e8a13a;
    --kyubo-ink: #10221f;
    --kyubo-paper: #faf8f3;
    --kyubo-line: #e4ded0;
    --kyubo-muted: #6b7a76;
    --radius: 14px;
    --shadow: 0 12px 30px -14px rgba(15, 42, 39, 0.25);
    --font-display: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--kyubo-ink);
    background: var(--kyubo-paper);
    line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.2;
    margin: 0 0 .5em;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------------- HEADER / NAV ---------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 248, 243, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--kyubo-line);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark-img { height: 42px; width: auto; display: block; }
.logo-text { font-family: var(--font-display); font-size: 17px; color: var(--kyubo-ink); }
.logo-text strong { color: var(--kyubo-teal); }

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 14.5px;
    color: var(--kyubo-ink);
    transition: background .2s, color .2s;
}
.main-nav a:hover, .main-nav a.active { background: var(--kyubo-teal); color: #fff; }
.main-nav a.btn-nav {
    background: var(--kyubo-amber);
    color: var(--kyubo-ink);
    font-weight: 600;
}
.main-nav a.btn-nav:hover, .main-nav a.btn-nav.active { background: var(--kyubo-teal); color: #fff; }

.nav-toggle, .nav-burger, .main-nav-mobile { display: none; }

/* ---------------- HERO ---------------- */

.hero {
    position: relative;
    padding: 90px 0 110px;
    background:
        radial-gradient(circle at 15% 20%, rgba(232,161,58,.18), transparent 45%),
        radial-gradient(circle at 85% 0%, rgba(15,110,106,.18), transparent 40%),
        var(--kyubo-paper);
    overflow: hidden;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 50px;
    align-items: center;
}
.hero-eyebrow {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--kyubo-line);
    font-size: 13px;
    font-weight: 600;
    color: var(--kyubo-teal);
    margin-bottom: 18px;
}
.hero h1 {
    font-size: clamp(32px, 4.2vw, 50px);
    font-weight: 800;
}
.hero h1 span { color: var(--kyubo-teal); }
.hero p.lead { font-size: 18px; color: var(--kyubo-muted); margin-bottom: 30px; max-width: 540px; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-visual { position: relative; }
.hero-photo-card {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 4/5;
    border: 6px solid #fff;
}
.hero-photo-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-logo-badge {
    position: absolute;
    bottom: -26px;
    left: -26px;
    width: 110px;
    height: 110px;
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}
.hero-logo-badge img { width: 100%; height: 100%; object-fit: contain; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--kyubo-teal); color: #fff; box-shadow: 0 10px 24px -10px rgba(15,110,106,.6); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-outline { background: #fff; color: var(--kyubo-ink); border: 1px solid var(--kyubo-line); }
.btn-outline:hover { border-color: var(--kyubo-teal); color: var(--kyubo-teal); }

/* ---------------- STATS / TYPES ---------------- */

.stat-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 40px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--kyubo-line);
    border-radius: var(--radius);
    padding: 16px 10px;
    text-align: center;
}
.stat-card .num { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--kyubo-teal); }
.stat-card .label { font-size: 12.5px; color: var(--kyubo-muted); }

/* ---------------- SECTIONS ---------------- */

section { padding: 72px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 36px; gap: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: 30px; font-weight: 800; }
.section-head p { color: var(--kyubo-muted); margin: 6px 0 0; }
.section-alt { background: #fff; border-top: 1px solid var(--kyubo-line); border-bottom: 1px solid var(--kyubo-line); }

.link-more { font-weight: 600; color: var(--kyubo-teal); white-space: nowrap; }
.link-more:hover { text-decoration: underline; }

/* ---------------- CARDS: établissements ---------------- */

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }

.etab-card {
    background: #fff;
    border: 1px solid var(--kyubo-line);
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: block;
    transition: transform .18s ease, box-shadow .18s ease;
}
.etab-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px -14px rgba(15,42,39,.3); }
.etab-card-logo {
    width: 100%; height: 150px; background: var(--kyubo-paper);
    border-bottom: 1px solid var(--kyubo-line);
    display: flex; align-items: center; justify-content: center; padding: 18px;
}
.etab-card-logo img { max-width: 80%; max-height: 100%; object-fit: contain; }
.etab-card-body { padding: 22px 26px 26px; }
.etab-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 5px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.badge-ecole { background: #e6f2ea; color: #1c7a4d; }
.badge-universite { background: #e8eefc; color: #2a4fc9; }
.badge-centre_medical { background: #fdecec; color: #c93a3a; }
.badge-culturel { background: #fdf3e0; color: #a9720f; }

.etab-card h3 { font-size: 19px; margin-bottom: 8px; }
.etab-card p { color: var(--kyubo-muted); font-size: 14.5px; margin: 0 0 14px; }
.etab-card .card-readmore { font-weight: 600; font-size: 14px; color: var(--kyubo-teal); }

/* ---------------- CARDS: communiqués / actualités ---------------- */

.card {
    background: #fff;
    border: 1px solid var(--kyubo-line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-img { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--kyubo-teal), var(--kyubo-teal-dark)); position: relative; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-tag {
    position: absolute; top: 14px; left: 14px;
    background: rgba(255,255,255,.92);
    color: var(--kyubo-teal);
    font-size: 12px; font-weight: 700;
    padding: 5px 11px; border-radius: 999px;
}
.card-body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.card-meta { font-size: 12.5px; color: var(--kyubo-muted); margin-bottom: 8px; display: flex; gap: 10px; flex-wrap: wrap; }
.card-body h3 { font-size: 18px; margin-bottom: 8px; }
.card-body p { color: var(--kyubo-muted); font-size: 14.5px; flex: 1; }
.card-readmore { margin-top: 14px; font-weight: 600; font-size: 14px; color: var(--kyubo-teal); }

.list-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* ---------------- DETAIL PAGE ---------------- */

.detail-hero { padding: 60px 0 30px; }
.detail-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--kyubo-muted); font-size: 14px; margin-bottom: 18px; }
.detail-title { font-size: clamp(28px, 4vw, 42px); font-weight: 800; max-width: 820px; }
.detail-cover { border-radius: var(--radius); overflow: hidden; margin: 30px 0; box-shadow: var(--shadow); }
.detail-content { max-width: 760px; font-size: 17px; }
.detail-content p { margin: 0 0 1.2em; }
.rich-content h2 { font-size: 24px; margin: 1.4em 0 .5em; }
.rich-content h3 { font-size: 20px; margin: 1.3em 0 .5em; }
.rich-content ul, .rich-content ol { margin: 0 0 1.2em; padding-left: 22px; }
.rich-content li { margin-bottom: .4em; }
.rich-content img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 1.2em 0; box-shadow: var(--shadow); display: block; }
.rich-content blockquote {
    margin: 1.4em 0; padding: 4px 20px; border-left: 4px solid var(--kyubo-teal);
    color: var(--kyubo-muted); font-style: italic;
}
.rich-content a { color: var(--kyubo-teal); text-decoration: underline; }

.etab-detail-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.etab-detail-logo {
    width: 84px; height: 84px; border-radius: 18px; background: #fff;
    border: 1px solid var(--kyubo-line); box-shadow: var(--shadow);
    display: flex; align-items: center; justify-content: center; padding: 10px; flex-shrink: 0;
}
.etab-detail-logo img { width: 100%; height: 100%; object-fit: contain; }

.etab-detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 46px; align-items: start; }
.etab-detail-main { min-width: 0; }
.etab-detail-sidebar { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 20px; }

.sidebar-widget { background: #fff; border: 1px solid var(--kyubo-line); border-radius: var(--radius); padding: 22px; }
.sidebar-widget h4 { font-size: 15px; margin: 0 0 16px; font-family: var(--font-display); }
.sidebar-etab-list { display: flex; flex-direction: column; gap: 4px; }
.sidebar-etab-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px;
    transition: background .15s ease;
}
.sidebar-etab-item:hover { background: var(--kyubo-paper); }
.sidebar-etab-logo {
    width: 42px; height: 42px; border-radius: 10px; background: var(--kyubo-paper);
    border: 1px solid var(--kyubo-line); display: flex; align-items: center; justify-content: center;
    padding: 5px; flex-shrink: 0;
}
.sidebar-etab-logo img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-etab-logo-empty { font-family: var(--font-display); font-weight: 800; color: var(--kyubo-teal); background: #e6f2ea; }
.sidebar-etab-name { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.sidebar-etab-type { display: block; font-size: 12px; color: var(--kyubo-muted); margin-top: 2px; }

.sidebar-widget-cta { background: var(--kyubo-paper); }
.sidebar-widget-cta p { font-size: 13.5px; color: var(--kyubo-muted); margin: 0 0 16px; }

@media (max-width: 900px) {
    .etab-detail-grid { grid-template-columns: 1fr; }
    .etab-detail-sidebar { position: static; }
}
.attachments { margin-top: 30px; padding: 20px; background: #fff; border: 1px solid var(--kyubo-line); border-radius: var(--radius); }
.attachments a { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-weight: 600; color: var(--kyubo-teal); border-bottom: 1px solid var(--kyubo-line); }
.attachments a:last-child { border-bottom: none; }

/* ---------------- TIMELINE (historique) ---------------- */

.timeline { position: relative; max-width: 760px; margin: 0 auto; padding-left: 40px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--kyubo-line); }
.timeline-item { position: relative; padding-bottom: 42px; }
.timeline-item::before {
    content: ''; position: absolute; left: -40px; top: 4px;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--kyubo-teal); border: 4px solid var(--kyubo-paper);
    box-shadow: 0 0 0 2px var(--kyubo-teal);
}
.timeline-year { font-family: var(--font-display); font-weight: 800; color: var(--kyubo-teal); font-size: 22px; }
.timeline-item h3 { margin: 4px 0 8px; font-size: 19px; }
.timeline-item p { color: var(--kyubo-muted); margin: 0; }

/* ---------------- CURSUS ---------------- */

.cursus-group { margin-bottom: 46px; }
.cursus-group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.cursus-group-head h3 { font-size: 21px; margin: 0; }
.programme-row {
    display: flex; justify-content: space-between; align-items: center;
    background: #fff; border: 1px solid var(--kyubo-line); border-radius: 12px;
    padding: 16px 20px; margin-bottom: 10px; gap: 16px; flex-wrap: wrap;
}
.programme-row .p-name { font-weight: 600; }
.programme-row .p-desc { color: var(--kyubo-muted); font-size: 14px; }
.programme-row .p-meta { display: flex; gap: 10px; flex-shrink: 0; }
.pill { background: var(--kyubo-paper); border: 1px solid var(--kyubo-line); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: var(--kyubo-teal); }

/* ---------------- CONTACT ---------------- */

.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 46px; align-items: start; }
.contact-info-card { background: var(--kyubo-teal); color: #fff; border-radius: var(--radius); padding: 34px; }
.contact-info-card h3 { font-size: 22px; }
.contact-info-card ul { list-style: none; padding: 0; margin: 22px 0 0; }
.contact-info-card li { padding: 10px 0; border-top: 1px solid rgba(255,255,255,.18); font-size: 14.5px; }
.btn-whatsapp {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 26px; padding: 13px 20px; border-radius: 999px;
    background: #25D366; color: #fff; font-weight: 700; font-size: 14.5px;
    text-align: center; transition: transform .15s ease, box-shadow .15s ease;
}
.btn-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px rgba(0,0,0,.35); }

form.contact-form { background: #fff; border: 1px solid var(--kyubo-line); border-radius: var(--radius); padding: 32px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 14px; border-radius: 10px;
    border: 1px solid var(--kyubo-line); font-family: var(--font-body); font-size: 14.5px;
    background: var(--kyubo-paper);
}
.form-group textarea { min-height: 130px; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: 2px solid var(--kyubo-teal); outline-offset: 1px; }

.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 14.5px; font-weight: 500; }
.alert-success { background: #e6f2ea; color: #1c7a4d; }
.alert-error { background: #fdecec; color: #c93a3a; }

/* Honeypot anti-spam : hors champ visuel, mais toujours "visible" pour les
   robots qui ignorent display:none. Les lecteurs d'écran l'ignorent via aria-hidden. */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------------- PAGINATION ---------------- */

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination a, .pagination span {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border-radius: 10px; border: 1px solid var(--kyubo-line); font-weight: 600; font-size: 14px;
}
.pagination a:hover { border-color: var(--kyubo-teal); color: var(--kyubo-teal); }
.pagination .current { background: var(--kyubo-teal); color: #fff; border-color: var(--kyubo-teal); }

/* ---------------- MISC ---------------- */

.page-header { padding: 70px 0 40px; text-align: center; }
.page-header h1 { font-size: clamp(30px, 4vw, 46px); }
.page-header p { color: var(--kyubo-muted); max-width: 620px; margin: 12px auto 0; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--kyubo-muted); }

/* ---------------- FOOTER ---------------- */

.site-footer { background: var(--kyubo-ink); color: #cfe0dc; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; padding: 60px 0 40px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-col p { font-size: 14px; color: #9fb3ae; margin-top: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { padding: 5px 0; font-size: 14px; color: #b9cac6; }
.footer-col a:hover { color: #fff; }
.site-footer .logo-text, .site-footer .logo-text strong { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0; font-size: 13px; color: #7f948f; text-align: center; }

/* ---------------- RESPONSIVE ---------------- */

@media (max-width: 900px) {
    .grid-3, .list-cards { grid-template-columns: repeat(2, 1fr); }
    .stat-strip { grid-template-columns: 1fr 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-visual { order: -1; max-width: 380px; margin: 0 auto 20px; }
    .hero-logo-badge { width: 80px; height: 80px; bottom: -18px; left: -18px; }
}

@media (max-width: 720px) {
    .main-nav-desktop { display: none; }

    .main-nav-mobile {
        display: flex;
        position: fixed;
        inset: 76px 0 0 0;
        z-index: 999;
        background-color: #faf8f3;
        background: var(--kyubo-paper);
        flex-direction: column;
        align-items: stretch;
        padding: 10px 20px 30px;
        transform: translateX(100%);
        transition: transform .25s ease;
        overflow-y: auto;
        box-shadow: -8px 0 30px -10px rgba(15,42,39,.25);
    }
    .nav-toggle:checked ~ .main-nav-mobile { transform: translateX(0); }

    .main-nav-mobile a {
        padding: 16px 8px;
        border-bottom: 1px solid var(--kyubo-line);
        border-radius: 0;
        font-size: 16px;
    }
    .main-nav-mobile a:hover, .main-nav-mobile a.active { background: transparent; color: var(--kyubo-teal); }
    .main-nav-mobile a.btn-nav {
        margin-top: 14px;
        border-bottom: none;
        border-radius: 999px;
        text-align: center;
    }
    .main-nav-mobile a.btn-nav:hover, .main-nav-mobile a.btn-nav.active { color: var(--kyubo-ink); }

    .nav-burger {
        display: flex; flex-direction: column; justify-content: center; gap: 5px;
        cursor: pointer; padding: 8px; width: 40px; height: 40px; z-index: 1000; position: relative;
    }
    .nav-burger span { width: 24px; height: 2px; background: var(--kyubo-ink); transition: transform .2s ease, opacity .2s ease; }
    .nav-toggle:checked ~ .site-header .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle:checked ~ .site-header .nav-burger span:nth-child(2) { opacity: 0; }
    .nav-toggle:checked ~ .site-header .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .grid-3, .list-cards, .grid-2 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}
