/* ==========================================================================
   Thème mdhp — reproduction du design MH Magazine (variante bleue) de mdhp.fr
   Palette d'origine :
     fond de page        #9bbac9
     header              #d9f0fc
     bleu foncé          #38687d  (nav, footer, légendes, étiquettes)
     bleu vif            #1c8cbc  (accents, survols, pagination, ticker)
     texte               #2a2a2a  — filets #ebebeb
   Typographie : Merriweather (site d'origine), corps 14px.
   ========================================================================== */

:root {
    --bg-page: #9bbac9;
    --bg-header: #d9f0fc;
    --blue-dark: #38687d;
    --blue: #1c8cbc;
    --text: #2a2a2a;
    --muted: #949494;
    --line: #ebebeb;
    --content-width: 1080px;
}

/* --------------------------------------------------------- base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-page);
    word-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--text); text-decoration: none; transition: color .15s; }
a:hover { color: var(--blue); }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-family: 'Merriweather', Georgia, serif; line-height: 1.3; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--blue-dark); color: #fff; padding: 8px 16px;
}
.skip-link:focus { left: 0; color: #fff; }
[hidden] { display: none !important; }

/* --------------------------------------------------------- boîte générale */
.site-boxed {
    max-width: var(--content-width);
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 0 12px rgba(0, 0, 0, .12);
}
.site-main {
    padding: 20px;
    background: #fff;
}

/* --------------------------------------------------------- header */
.site-header { background: var(--bg-header); }
.header-inner { padding: 30px 20px 26px; }
.site-logo { display: inline-block; }
.site-name {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #000;
    letter-spacing: .5px;
}
.site-tagline {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--blue);
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid rgba(56, 104, 125, .25);
}
.logo-img { max-height: 90px; width: auto; }

/* --------------------------------------------------------- navigation */
.main-nav-wrap { background: var(--blue-dark); position: relative; }
.menu-toggle {
    display: none;
    width: 100%;
    padding: 12px 20px;
    font: 700 13px/1 'Merriweather', Georgia, serif;
    letter-spacing: 1px;
    color: #fff;
    background: var(--blue-dark);
    border: 0;
    text-align: left;
    cursor: pointer;
}
.menu-toggle-bars { display: inline-block; vertical-align: -3px; margin-right: 8px; }
.menu-toggle-bars i {
    display: block; width: 18px; height: 2px; background: #fff; margin: 3px 0;
}
.main-nav { display: flex; align-items: stretch; }
.main-nav > ul { display: flex; flex-wrap: wrap; flex: 1; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a {
    display: block;
    padding: 13px 18px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #fff;
}
.main-nav > ul > li:hover,
.main-nav > ul > li:focus-within { background: var(--blue); }
.sub-toggle { display: none; }
.main-nav li.has-sub > a::after { content: ' ▾'; font-size: 9px; opacity: .8; }
.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: var(--blue-dark);
    z-index: 50;
    display: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .2);
}
.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu { display: block; }
.sub-menu li a {
    display: block;
    padding: 10px 18px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.sub-menu li a:hover { background: var(--blue); color: #fff; }

.nav-search { display: flex; align-items: center; padding-right: 8px; }
.nav-search input {
    width: 150px;
    padding: 6px 10px;
    font: 12px 'Merriweather', Georgia, serif;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--blue-dark);
    border-radius: 0;
}
.nav-search button {
    padding: 6px 10px;
    background: var(--blue);
    color: #fff;
    border: 0;
    cursor: pointer;
    line-height: 0;
}
.nav-search button:hover { background: #166f96; }

/* --------------------------------------------------------- ticker */
.ticker {
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #eaf5fb;
    border-bottom: 1px solid var(--line);
}
.ticker-label {
    flex: none;
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #fff;
    background: var(--blue);
}
.ticker-label::after { content: ' ▸'; }
.ticker-items { position: relative; flex: 1; height: 33px; margin-left: 12px; }
.ticker-item {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s;
}
.ticker-item.is-active { opacity: 1; visibility: visible; }
.ticker-date { color: var(--blue); font-weight: 700; flex: none; }

/* --------------------------------------------------------- titres de widgets */
.widget { margin-bottom: 28px; }
.widget-title {
    display: flex;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 16px;
    background: rgba(28, 140, 188, .55);
    color: #fff;
}
.widget-title a { color: #fff; display: flex; flex: 1; }
.widget-title span {
    display: inline-block;
    padding: 9px 15px;
    background: var(--blue);
    color: #fff;
}
.page-title {
    display: flex;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 18px;
    background: rgba(28, 140, 188, .55);
    color: #fff;
}
.page-title span { display: inline-block; padding: 9px 15px; background: var(--blue-dark); }

/* --------------------------------------------------------- grilles accueil */
.home-top {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}
.home-cols-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}
.home-cols-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
}
.widget-wide { margin-bottom: 28px; }

/* --------------------------------------------------------- slider */
.slider { position: relative; overflow: hidden; }
.slides { position: relative; aspect-ratio: 678 / 381; }
.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .6s;
}
.slide.is-active { opacity: 1; visibility: visible; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 12px 16px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: rgba(56, 104, 125, .85);
    line-height: 1.35;
}
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 38px; height: 48px;
    font-size: 26px;
    color: #fff;
    background: rgba(56, 104, 125, .7);
    border: 0;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s;
}
.slider:hover .slider-arrow, .slider-arrow:focus { opacity: 1; }
.slider-arrow.prev { left: 0; }
.slider-arrow.next { right: 0; }
.slider-arrow:hover { background: var(--blue); }
.slider-dots {
    position: absolute;
    right: 12px; top: 12px;
    z-index: 5;
    display: flex;
    gap: 6px;
}
.slider-dots button {
    width: 10px; height: 10px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, .6);
    cursor: pointer;
    padding: 0;
}
.slider-dots button.is-active { background: var(--blue); }

/* --------------------------------------------------------- listes de posts */
.post-list > li { border-bottom: 1px solid var(--line); }
.post-list > li:last-child { border-bottom: 0; }
.post-small {
    display: flex;
    gap: 12px;
    padding: 12px 0;
}
.post-small-thumb { flex: none; width: 85px; }
.post-small-thumb img, .thumb-placeholder {
    width: 85px; height: 60px; object-fit: cover;
    border: 1px solid var(--line);
    background: #eef4f8;
    display: block;
}
.thumb-placeholder-card { width: 100%; aspect-ratio: 326 / 245; height: auto; }
.post-small-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}
.post-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--muted);
    margin-top: 5px;
}
.post-meta .mi { width: 12px; height: 12px; color: var(--blue); flex: none; }
.post-meta time { color: var(--muted); }

/* --------------------------------------------------------- focus (pleine largeur) */
.focus-row {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 24px;
}
.focus-hero { margin-bottom: 20px; }
.focus-hero-link img { width: 100%; aspect-ratio: 678 / 381; object-fit: cover; }
.focus-hero-title {
    font-size: 22px;
    font-weight: 700;
    margin-top: 12px;
    line-height: 1.35;
}
.focus-hero-excerpt { margin-top: 8px; font-size: 13px; color: #444; }
.focus-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.focus-cell img { width: 100%; aspect-ratio: 326 / 245; object-fit: cover; }
.focus-cell-title {
    font-size: 14px;
    font-weight: 700;
    margin-top: 8px;
    line-height: 1.4;
}
.focus-side { border-top: 3px solid var(--blue); }
.read-more { color: var(--blue); font-weight: 700; white-space: nowrap; }

/* --------------------------------------------------------- carrousel */
.carousel { position: relative; overflow: hidden; }
.carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-item { flex: 0 0 calc(25% - 12px); min-width: 200px; position: relative; }
.carousel-item img { width: 100%; aspect-ratio: 326 / 245; object-fit: cover; }
.carousel-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
    background: rgba(28, 140, 188, .9);
    display: block;
}
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 34px; height: 44px;
    font-size: 24px;
    color: #fff;
    background: rgba(56, 104, 125, .8);
    border: 0;
    cursor: pointer;
}
.carousel-arrow.prev { left: 0; }
.carousel-arrow.next { right: 0; }
.carousel-arrow:hover { background: var(--blue); }

/* --------------------------------------------------------- sidebar / partenaire */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 28px;
}
.partner-link { text-align: center; padding: 8px 0 4px; }
.partner-link a { color: var(--blue); font-weight: 700; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tagcloud a {
    display: inline-block;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    background: var(--blue-dark);
}
.tagcloud a:hover { background: var(--blue); color: #fff; }

/* --------------------------------------------------------- fil d'Ariane */
.breadcrumb {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.breadcrumb a { color: var(--blue); }
.breadcrumb-current {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60ch;
}

/* --------------------------------------------------------- article */
.entry-header { border-bottom: 1px solid var(--line); margin-bottom: 18px; padding-bottom: 14px; }
.entry-title {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}
.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: var(--muted);
}
.entry-meta-item { display: inline-flex; align-items: center; gap: 5px; }
.entry-meta .mi { width: 13px; height: 13px; color: var(--blue); }
.entry-meta a { color: var(--muted); }
.entry-meta a:hover { color: var(--blue); }
.entry-thumbnail { margin-bottom: 20px; }
.entry-thumbnail img { width: 100%; height: auto; }

.article-body { font-size: 14px; line-height: 1.75; }
.article-body > * + * { margin-top: 16px; }
.article-body h2 {
    font-size: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    margin-top: 28px;
}
.article-body h3 { font-size: 16px; margin-top: 24px; }
.article-body h4 { font-size: 14px; margin-top: 20px; }
.article-body a { color: var(--blue); }
.article-body a:hover { text-decoration: underline; }
.article-body ul, .article-body ol { padding-left: 24px; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li + li { margin-top: 6px; }
.article-body blockquote {
    border-left: 4px solid var(--blue);
    background: #f2f8fb;
    padding: 14px 18px;
    font-style: italic;
}
.article-body img { margin: 0 auto; }
.article-body figure { margin: 20px 0; }
.article-body figcaption { font-size: 12px; color: var(--muted); text-align: center; padding-top: 6px; }
.article-body hr { border: 0; border-top: 1px solid var(--line); }
.article-body .encadre,
.article-body .encadre-info {
    background: #eaf5fb;
    border-left: 4px solid var(--blue);
    padding: 14px 18px;
}
.article-body .encadre-attention {
    background: #fdf3f2;
    border-left: 4px solid #c0392b;
    padding: 14px 18px;
}

/* tableaux */
.table-wrap { overflow-x: auto; }
.article-body table { border-collapse: collapse; width: 100%; font-size: 13px; }
.article-body th, .article-body td {
    border: 1px solid var(--line);
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}
.article-body thead th, .article-body table tr:first-child th {
    background: var(--blue-dark);
    color: #fff;
    font-weight: 700;
}
.article-body tbody tr:nth-child(even) { background: #f5fafd; }
.article-body caption {
    caption-side: top;
    font-weight: 700;
    padding-bottom: 8px;
    text-align: left;
}

/* table des matières */
.toc {
    background: #f5fafd;
    border: 1px solid #d5e8f2;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.toc-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.toc ol { counter-reset: toc; }
.toc li { font-size: 13px; padding: 3px 0; }
.toc li.toc-l3 { padding-left: 18px; }
.toc a { color: var(--blue); }
.toc a:hover { text-decoration: underline; }

/* étiquettes */
.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}
.entry-tags li a {
    display: inline-block;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    background: var(--blue-dark);
}
.entry-tags li a:hover { background: var(--blue); color: #fff; }

/* navigation précédent / suivant */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.post-nav a { display: block; }
.post-nav-next { text-align: right; grid-column: 2; }
.post-nav-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 4px;
}
.post-nav-title { font-size: 13px; font-weight: 700; line-height: 1.4; }

/* vous aimerez aussi */
.related { margin-top: 32px; }
.card-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.card-img { width: 100%; aspect-ratio: 326 / 245; object-fit: cover; }
.card-title { font-size: 14px; font-weight: 700; line-height: 1.4; margin-top: 8px; }

/* aperçu brouillon */
.preview-banner {
    background: #fff3cd;
    border: 1px solid #ffe08a;
    color: #664d03;
    padding: 10px 16px;
    margin-bottom: 18px;
    font-weight: 700;
}

/* --------------------------------------------------------- listes catégorie / recherche */
.posts-list-item {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}
.posts-list-item:first-child { padding-top: 0; }
.posts-list-thumb img { width: 100%; aspect-ratio: 326 / 245; object-fit: cover; }
.posts-list-title { font-size: 17px; font-weight: 700; line-height: 1.35; }
.posts-list-excerpt { font-size: 13px; color: #444; margin-top: 8px; }
.term-description { margin-bottom: 16px; color: #444; }
.result-count { margin-bottom: 14px; font-weight: 700; }

/* pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 24px;
    align-items: center;
}
.page-numbers {
    display: inline-block;
    min-width: 34px;
    padding: 7px 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    background: #f0f0f0;
    color: var(--text);
}
a.page-numbers:hover { background: var(--blue); color: #fff; }
.page-numbers.current { background: var(--blue); color: #fff; }
.page-dots { padding: 0 4px; color: var(--muted); }

/* --------------------------------------------------------- pages statiques / erreurs */
.static-page, .error-page, .search-results { max-width: 820px; }
.error-page p { margin-bottom: 14px; }
.btn {
    display: inline-block;
    padding: 9px 18px;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}
.btn:hover { background: var(--blue-dark); color: #fff; }

/* formulaire de contact */
.contact-form { margin-top: 24px; max-width: 560px; }
.contact-form label { display: block; margin-bottom: 14px; font-weight: 700; font-size: 13px; }
.contact-form input, .contact-form textarea {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 9px 12px;
    font: 13px 'Merriweather', Georgia, serif;
    border: 1px solid #ccc;
}
.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--blue);
}
.hp-field { position: absolute; left: -9999px; }
.flash-public { padding: 12px 16px; margin: 18px 0; font-weight: 700; }
.flash-ok { background: #e9f7ec; border: 1px solid #b8e2c3; color: #1e6b34; }
.flash-err { background: #fdf3f2; border: 1px solid #f0c4c0; color: #a33025; }

/* --------------------------------------------------------- footer */
.site-footer { background: var(--blue-dark); }
.footer-nav-wrap { padding: 14px 20px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.footer-nav a {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.footer-nav a:hover { color: #cde9f5; }
.copyright { padding: 16px 20px; }
.copyright p { color: #fff; font-size: 12px; }

/* --------------------------------------------------------- bouton retour en haut */
.scroll-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 60;
    width: 42px; height: 42px;
    font-size: 20px;
    color: #fff;
    background: var(--blue);
    border: 0;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.scroll-top:hover { background: var(--blue-dark); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
    .home-top { grid-template-columns: 1fr; }
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .focus-row { grid-template-columns: 1fr; }
    .focus-side { border-top: 0; }
    .home-cols-3 { grid-template-columns: 1fr; }
    .carousel-item { flex-basis: calc(40% - 10px); }

    /* menu mobile */
    .menu-toggle { display: block; }
    .main-nav { display: none; flex-direction: column; }
    .main-nav.open { display: flex; }
    .main-nav > ul { flex-direction: column; }
    .main-nav > ul > li > a { border-top: 1px solid rgba(255, 255, 255, .08); }
    .main-nav li.has-sub { display: flex; flex-wrap: wrap; }
    .main-nav li.has-sub > a { flex: 1; }
    .main-nav li.has-sub > a::after { content: ''; }
    .sub-toggle {
        display: block;
        width: 48px;
        background: transparent;
        color: #fff;
        border: 0;
        border-top: 1px solid rgba(255, 255, 255, .08);
        font-size: 14px;
        cursor: pointer;
    }
    .sub-menu {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        background: rgba(0, 0, 0, .15);
    }
    .main-nav li:hover > .sub-menu { display: none; }
    .main-nav li.sub-open > .sub-menu { display: block !important; }
    .nav-search { padding: 10px 20px 14px; }
    .nav-search input { flex: 1; width: auto; }

    .ticker-items { display: none; }
    .ticker-label::after { content: ''; }
}

@media (max-width: 640px) {
    .home-cols-2 { grid-template-columns: 1fr; }
    .posts-list-item { grid-template-columns: 1fr; }
    .posts-list-thumb { max-width: 420px; }
    .entry-title { font-size: 21px; }
    .slide-caption { font-size: 14px; }
    .card-grid-3 { grid-template-columns: 1fr; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav-next { grid-column: auto; text-align: left; }
    .focus-grid { grid-template-columns: 1fr; }
    .carousel-item { flex-basis: calc(75% - 8px); }
    .site-main { padding: 14px; }
    .header-inner { padding: 22px 14px 18px; }
    .site-name { font-size: 26px; }
}
