/* Saint-Malo.info : l'émeraude de la côte, le granit des remparts, l'encre des cartes marines */

:root {
    --emeraude: #0E4D4A;
    --emeraude-nuit: #0A3634;
    --lagon: #2E8C83;
    --encre: #13212B;
    --granit: #8A8578;
    --embruns: #F1F4F1;
    --balise: #C8372D;
    --blanc: #FFFFFF;
    --ligne: #D9DFDA;

    --f-titre: "IM Fell English", Georgia, serif;
    --f-texte: "Public Sans", system-ui, sans-serif;
    --f-carte: "IBM Plex Mono", ui-monospace, monospace;

    --largeur: 1200px;
    --lecture: 44rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--embruns);
    color: var(--encre);
    font-family: var(--f-texte);
    font-size: 1.0625rem;
    line-height: 1.65;
}

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

a { color: var(--emeraude); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--balise); }
:focus-visible { outline: 2px solid var(--balise); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--f-titre); font-weight: 400; line-height: 1.15; margin: 0; }

.sm-wrap { max-width: var(--largeur); margin: 0 auto; padding: 0 16px; }

.sm-skip { position: absolute; left: -999px; }
.sm-skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--blanc); padding: .5rem 1rem; }

/* Annotation façon carte marine */
.sm-carte {
    font-family: var(--f-carte);
    font-size: .75rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--granit);
}

/* ---------- En-tête : la mer, puis les remparts ---------- */

.sm-header {
    position: relative;
    background: var(--emeraude) url("../img/sondes.svg") center 30% / cover no-repeat;
    color: var(--blanc);
    padding-top: 1.25rem;
    overflow: hidden;
    /* masque le liseré d'anticrénelage sous les remparts */
    box-shadow: inset 0 -3px 0 var(--embruns);
}

.sm-header__top {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .25rem 1.5rem;
}

.sm-logo {
    font-family: var(--f-titre);
    font-size: 2rem;
    line-height: 1;
    color: var(--blanc);
    text-decoration: none;
}
.sm-logo span { font-family: var(--f-carte); font-size: .8rem; letter-spacing: .08em; color: #9fd3c7; margin-left: .15rem; }
.sm-logo:hover { color: var(--blanc); }

.sm-header .sm-carte { color: #9fd3c7; }

.sm-nav { margin-top: 1rem; }
.sm-nav ul {
    list-style: none;
    margin: 0;
    padding: 0 0 .25rem;
    display: flex;
    gap: .25rem 1.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.sm-nav ul::-webkit-scrollbar { display: none; }
.sm-nav a {
    display: inline-block;
    padding: .2rem 0;
    color: #d8ece7;
    text-decoration: none;
    font-size: .9rem;
    white-space: nowrap;
    border-bottom: 1px solid transparent;
}
.sm-nav a:first-letter { text-transform: uppercase; }
.sm-nav a:hover, .sm-nav a[aria-current="page"] { color: var(--blanc); border-bottom-color: var(--balise); }

.sm-header__titre { padding-top: 2.5rem; }
.sm-header__titre > * { max-width: 40rem; }
.sm-header__titre h1 { font-size: clamp(2.4rem, 6vw, 4.25rem); }
.sm-header__titre p { margin: .75rem 0 0; color: #d8ece7; font-size: 1.1rem; }

/* Silhouette mise à l'échelle sur sa hauteur : jamais rognée en haut (flèche de Saint-Vincent).
   Le mur, dessiné au-delà du cadre, remplit les écrans larges ; les côtés sont coupés sur mobile. */
.sm-skyline {
    --sky-h: clamp(101px, 10.1vw, 160px);
    display: block;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    height: var(--sky-h);
    width: auto;
    aspect-ratio: 1440 / 250;
    margin-top: .25rem;
    overflow: visible;
    pointer-events: none;
    fill: var(--embruns);
}
.sm-header--home .sm-skyline { --sky-h: clamp(146px, 16.7vw, 290px); margin-top: .5rem; }

/* Accueil sur grand écran : la flèche monte à côté du titre au lieu d'agrandir l'en-tête
   (un tiers du dessin se trouve au-dessus des toits). Pas sur les autres pages : elle passerait sur le menu. */
@media (min-width: 1100px) {
    .sm-header--home .sm-skyline { margin-top: calc(var(--sky-h) * -0.3); }
}

/* ---------- Sections ---------- */

.sm-main { padding-bottom: 4rem; }

.sm-section { margin-top: 3.5rem; }
.sm-section:first-child { margin-top: 1rem; }

.sm-section__titre {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.sm-section__titre h2 { font-size: 1.9rem; color: var(--emeraude); }
.sm-section__titre::after { content: ""; flex: 1; border-top: 1px solid var(--ligne); transform: translateY(-.35rem); }

/* ---------- Article à la une ---------- */

.sm-une {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    background: var(--blanc);
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 0 var(--ligne), 0 12px 32px -20px rgba(19, 33, 43, .35);
}
.sm-une__image { overflow: hidden; }
.sm-une__image img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 10; transition: transform .6s ease; }
.sm-une__texte { padding: 2rem 2.25rem; display: flex; flex-direction: column; justify-content: center; }
.sm-une h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); color: var(--encre); margin: .5rem 0 1rem; }
.sm-une p { margin: 0; color: #3b4a52; }
.sm-une__lire { margin-top: 1.5rem; font-weight: 600; color: var(--emeraude); }
.sm-une:hover .sm-une__image img { transform: scale(1.03); }
.sm-une:hover h2 { color: var(--emeraude); }

/* ---------- Grille de cartes ---------- */

.sm-grille {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 2.5rem 2rem;
}
.sm-grille--deux { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }

.sm-carte-article { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.sm-carte-article__image { overflow: hidden; border-radius: 3px; background: var(--ligne); }
.sm-carte-article__image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .6s ease; }
.sm-carte-article h3 {
    font-size: 1.45rem;
    margin: 1rem 0 .5rem;
    color: var(--encre);
    transition: color .2s;
}
.sm-carte-article p { margin: 0; font-size: .95rem; color: #4a5860; }
.sm-carte-article:hover img { transform: scale(1.04); }
.sm-carte-article:hover h3 { color: var(--emeraude); text-decoration: underline; text-decoration-color: var(--balise); text-decoration-thickness: 1px; text-underline-offset: .2em; }

/* ---------- Thèmes ---------- */

.sm-themes {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    border-top: 1px solid var(--ligne);
}
.sm-themes a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: .9rem .25rem;
    border-bottom: 1px solid var(--ligne);
    text-decoration: none;
    color: var(--encre);
    font-family: var(--f-titre);
    font-size: 1.3rem;
}
.sm-themes a:first-letter { text-transform: uppercase; }
.sm-themes a:hover { color: var(--emeraude); }
.sm-themes .sm-carte { font-size: .7rem; }

/* ---------- Pages article, catégorie, auteur ---------- */

.sm-entete-page { max-width: var(--lecture); margin: 1rem auto 0; }
.sm-entete-page h1 { font-size: clamp(2.3rem, 5.5vw, 3.6rem); color: var(--encre); margin: .6rem 0 1rem; }
.sm-entete-page .sm-chapeau { font-size: 1.2rem; line-height: 1.55; color: #33434c; margin: 0; }
.sm-entete-page .sm-carte a { color: var(--emeraude); text-decoration: none; }
.sm-entete-page .sm-carte a:hover { color: var(--balise); }

.sm-visuel { max-width: 62rem; margin: 2.5rem auto 0; }
.sm-visuel img { width: 100%; border-radius: 4px; }

.sm-prose { max-width: var(--lecture); margin: 2.5rem auto 0; }
.sm-prose > :first-child { margin-top: 0; }
.sm-prose p, .sm-prose ul, .sm-prose ol { margin: 0 0 1.15rem; }
.sm-prose h2 { font-size: 2rem; color: var(--emeraude); margin: 2.75rem 0 1rem; }
.sm-prose h3 { font-size: 1.5rem; margin: 2rem 0 .75rem; }
.sm-prose h4 { font-size: 1rem; margin: 1.5rem 0 .5rem; }
.sm-prose li { margin-bottom: .35rem; }
.sm-prose li::marker { color: var(--lagon); }
.sm-prose strong { font-weight: 650; }
.sm-prose img { border-radius: 3px; margin: 1.75rem 0; }
.sm-prose blockquote {
    margin: 2rem 0;
    padding: 0 0 0 1.25rem;
    border-left: 3px solid var(--lagon);
    font-family: var(--f-titre);
    font-size: 1.35rem;
    font-style: italic;
    color: var(--emeraude);
}
.sm-prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .95rem; }
.sm-prose th, .sm-prose td { padding: .55rem .5rem; border-bottom: 1px solid var(--ligne); text-align: left; }
.sm-prose th { font-weight: 600; }
.sm-prose iframe { max-width: 100%; }
.sm-prose hr { border: 0; border-top: 1px solid var(--ligne); margin: 2rem 0; }

.sm-signature {
    max-width: var(--lecture);
    margin: 2.5rem auto 0;
    padding-top: 1rem;
    border-top: 1px solid var(--ligne);
}

.sm-apercu {
    max-width: var(--lecture);
    margin: 1rem auto 0;
    padding: .6rem 1rem;
    background: #fff4d6;
    border-left: 3px solid var(--balise);
    font-size: .9rem;
}

.sm-liste-simple { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--ligne); }
.sm-liste-simple li { border-bottom: 1px solid var(--ligne); }
.sm-liste-simple a { display: block; padding: .8rem 0; font-family: var(--f-titre); font-size: 1.3rem; text-decoration: none; color: var(--encre); }
.sm-liste-simple a:hover { color: var(--emeraude); }

.sm-vide { color: var(--granit); font-style: italic; }

/* ---------- Pages de données (prix de l'immobilier…) ---------- */

.sm-chiffres {
    max-width: var(--lecture);
    margin: 2rem auto 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 1rem;
}
.sm-chiffre {
    background: var(--blanc);
    border-radius: 4px;
    border-top: 3px solid var(--lagon);
    padding: 1.1rem 1.25rem 1rem;
    box-shadow: 0 1px 0 var(--ligne);
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.sm-chiffre:last-child { border-top-color: var(--granit); }
.sm-chiffre strong { font-family: var(--f-titre); font-weight: 400; font-size: 2.6rem; line-height: 1.1; color: var(--emeraude); }
.sm-chiffre > span:last-child { font-size: .9rem; color: #4a5860; }
.sm-chiffre__evolution { font-weight: 600; }
.sm-hausse { color: var(--emeraude); }
.sm-baisse { color: var(--balise); }

.sm-prose th small { font-weight: 400; color: var(--granit); }
.sm-tableau-barres th, .sm-tableau-barres td { vertical-align: bottom; }
.sm-tableau-barres td { white-space: nowrap; }
.sm-barre {
    display: block;
    height: 6px;
    width: var(--part);
    border-radius: 3px;
    background: var(--lagon);
    margin-bottom: .3rem;
}
.sm-barre--maison { background: var(--granit); }

/* ---------- Pied de page ---------- */

.sm-footer {
    background: var(--encre);
    color: #c5ccd0;
    padding: 3.5rem 0 2rem;
    font-size: .95rem;
}
.sm-footer__grille { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem; }
.sm-footer p { margin: 0 0 1rem; }
.sm-footer h2 { font-family: var(--f-carte); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: #9fd3c7; margin-bottom: .9rem; }
.sm-footer ul { list-style: none; margin: 0; padding: 0; }
.sm-footer li { margin-bottom: .45rem; }
.sm-footer a { color: var(--blanc); text-decoration: none; }
.sm-footer a:hover { color: #9fd3c7; text-decoration: underline; }
.sm-footer__bas {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .12);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem 1.5rem;
}
.sm-footer__bas .sm-carte { color: #8b979e; }
.sm-footer__logo { font-family: var(--f-titre); font-size: 1.5rem; color: var(--blanc); }

/* ---------- Mobile ---------- */

@media (max-width: 860px) {
    .sm-une { grid-template-columns: 1fr; }
    .sm-une__texte { padding: 1.5rem 1.25rem 1.75rem; }
    .sm-footer__grille { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 560px) {
    .sm-prose table { font-size: .82rem; }
    .sm-prose th, .sm-prose td { padding: .5rem .3rem; }
    .sm-tableau-barres td { white-space: normal; }
    .sm-chiffre strong { font-size: 2.2rem; }
}

@media (max-width: 560px) {
    body { font-size: 1rem; }
    .sm-header .sm-carte { display: none; }
    .sm-header__titre { padding-top: 1.75rem; }
    .sm-section { margin-top: 2.75rem; }
    .sm-grille { gap: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
