/* ==========================================================================
   Thème Marée pour guiriec.com
   Activé par le sélecteur (theme.js) : <html data-theme="maree">.
   Change la palette, mais aussi les formes et la mise en page :
   ciel et mer animés en en-tête, photo en hublot, cartes postales,
   pied de page en vagues.
   ========================================================================== */

html[data-theme="maree"] {
    --primary-red: #5B8DB8;
    --primary-blue: #1D4F7A;
    --primary-yellow: #E3C98E;
    --black: #0F1214;
    --white: #F6F4EF;
    --grey-light: #DCE6EE;
    --grey-mid: #B5C0C8;
    --grey-dark: #565C60;
    --font-display: Georgia, 'Times New Roman', serif;
    --mr-title-font: 'Avenir Next Condensed', 'Roboto Condensed', 'Arial Narrow', sans-serif;
    --mr-serif: Georgia, 'Times New Roman', serif;
    --mr-line: 1.5px solid var(--black);
    --mr-wave-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14'%3E%3Cpath d='M0 7 Q 15 0 30 7 T 60 7 T 90 7 T 120 7' fill='none' stroke='%231D4F7A' stroke-width='2.5'/%3E%3C/svg%3E");
}

/* ---------- Navigation : marinière, logo en hublot, liens en italique ---------- */

html[data-theme="maree"] .nav {
    border-bottom: 0;
    padding-bottom: 9px;
    background:
        linear-gradient(var(--white), var(--white)) top / 100% calc(100% - 9px) no-repeat,
        repeating-linear-gradient(to bottom, var(--primary-blue) 0 3px, var(--white) 3px 6px);
}

html[data-theme="maree"] .logo {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: var(--mr-line);
    border-radius: 50%;
    font-family: var(--mr-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.15rem;
    letter-spacing: 0;
    background: var(--primary-yellow);
}

html[data-theme="maree"] .logo::before { display: none; }

html[data-theme="maree"] .nav-links a {
    font-family: var(--mr-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.1rem;
    text-transform: none;
    letter-spacing: 0;
}

html[data-theme="maree"] .nav-links a::after {
    height: 8px;
    bottom: -4px;
    background: var(--mr-wave-line) left center / 40px 8px repeat-x;
}

html[data-theme="maree"] .theme-toggle { border-width: 1.5px; border-radius: 999px; }
html[data-theme="maree"] .theme-swatch {
    border-radius: 50%;
    background: linear-gradient(to bottom, var(--grey-light) 0 35%, var(--primary-blue) 35% 70%, var(--primary-yellow) 70% 100%);
}

/* ---------- Titres ---------- */

html[data-theme="maree"] .section-title-large,
html[data-theme="maree"] .page-header h1,
html[data-theme="maree"] .block-header h2,
html[data-theme="maree"] .ds-gallery-body h2 {
    font-family: var(--mr-title-font);
    letter-spacing: 0.01em;
}

html[data-theme="maree"] .accent-bar {
    width: 160px;
    height: 14px;
    background: var(--mr-wave-line) left center / 60px 14px repeat-x;
}

/* ---------- Accueil : la scène de bord de mer ---------- */

html[data-theme="maree"] .hero {
    min-height: 82vh;
    padding: var(--space-md) 0 220px;
    text-align: center;
}

/* Ciel (derrière le soleil) */
html[data-theme="maree"] .hero::before {
    content: '';
    position: absolute;
    top: -64px;
    bottom: 0;
    left: 50%;
    width: 100vw;
    margin-left: -50vw;
    background: linear-gradient(to bottom, var(--grey-light) 0%, var(--white) 92%);
    z-index: -1;
}

html[data-theme="maree"] .hero-content {
    flex-direction: column;
    gap: var(--space-md);
}

html[data-theme="maree"] .hero-image {
    width: 180px;
    height: 180px;
    border: var(--mr-line);
    border-radius: 50%;
    box-shadow: 0 0 0 10px var(--white), 0 0 0 11.5px var(--black);
}

html[data-theme="maree"] .hero-title { margin-bottom: var(--space-sm); }

html[data-theme="maree"] .hero-title .title-line { display: block; }

html[data-theme="maree"] .hero-title .title-line:not(.accent) {
    font-family: var(--mr-title-font);
    font-size: 0.32em;
    font-weight: 700;
    letter-spacing: 0.45em;
    text-transform: uppercase;
    margin-bottom: 0.15em;
    padding-left: 0.45em;
}

html[data-theme="maree"] .hero-title .title-line.accent {
    font-family: var(--mr-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.35em;
    letter-spacing: -0.01em;
    text-transform: none;
}

html[data-theme="maree"] .hero-subtitle {
    margin-left: 0;
    font-size: 0.8rem;
    letter-spacing: 0.3em;
}

/* Le soleil (rond rouge en Bauhaus) se couche derrière la mer au défilement */
html[data-theme="maree"] .shape-1 {
    display: block;
    width: 150px;
    height: 150px;
    top: 4%;
    right: 6%;
    background: var(--primary-yellow);
    opacity: 1;
}

html[data-theme="maree"] .shape-2,
html[data-theme="maree"] .shape-3 { display: none; }

html[data-theme="maree"] .sea-scene {
    display: block;
    position: absolute;
    top: -64px;
    bottom: 0;
    left: 50%;
    width: 100vw;
    margin-left: -50vw;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.sea-cloud { position: absolute; width: 130px; animation: sea-drift 26s ease-in-out infinite alternate; }
.sea-cloud-1 { top: 18%; left: 6%; }
.sea-cloud-2 { top: 34%; left: 70%; width: 96px; animation-duration: 34s; animation-delay: -10s; }
.sea-cloud-3 { top: 10%; left: 44%; width: 70px; animation-duration: 22s; animation-delay: -6s; }

@keyframes sea-drift {
    from { transform: translateX(-30px); }
    to { transform: translateX(50px); }
}

.sea-gull { position: absolute; width: 38px; animation: sea-glide 9s ease-in-out infinite alternate; }
.sea-gull path { transform-box: fill-box; transform-origin: center; animation: sea-flap 0.9s ease-in-out infinite alternate; }
.sea-gull-1 { top: 22%; left: 26%; }
.sea-gull-2 { top: 30%; left: 31%; width: 26px; animation-delay: -3s; }
.sea-gull-2 path { animation-duration: 0.7s; }
.sea-gull-3 { top: 16%; left: 60%; width: 30px; animation-delay: -5s; }
.sea-gull-3 path { animation-duration: 1.1s; }

@keyframes sea-glide {
    from { transform: translate(0, 0); }
    to { transform: translate(60px, -14px); }
}

@keyframes sea-flap {
    from { transform: scaleY(1); }
    to { transform: scaleY(0.45); }
}

.sea-wave {
    position: absolute;
    left: 0;
    width: calc(100% + 240px);
    height: 70px;
    background-repeat: repeat-x;
    background-size: 240px 70px;
    animation: sea-roll 14s linear infinite;
}

.sea-wave-1 { bottom: 78px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 70' preserveAspectRatio='none'%3E%3Cpath d='M0 14 Q 30 0 60 14 T 120 14 T 180 14 T 240 14 V70 H0 Z' fill='%235B8DB8'/%3E%3Cpath d='M0 14 Q 30 0 60 14 T 120 14 T 180 14 T 240 14' fill='none' stroke='%23DCE6EE' stroke-width='3'/%3E%3C/svg%3E"); animation-duration: 18s; }
.sea-wave-2 { bottom: 56px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 70' preserveAspectRatio='none'%3E%3Cpath d='M0 14 Q 30 0 60 14 T 120 14 T 180 14 T 240 14 V70 H0 Z' fill='%231D4F7A'/%3E%3Cpath d='M0 14 Q 30 0 60 14 T 120 14 T 180 14 T 240 14' fill='none' stroke='%23F6F4EF' stroke-width='3'/%3E%3C/svg%3E"); animation-duration: 11s; animation-direction: reverse; }
.sea-wave-3 { bottom: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 70' preserveAspectRatio='none'%3E%3Cpath d='M0 14 Q 30 0 60 14 T 120 14 T 180 14 T 240 14 V70 H0 Z' fill='%231D4F7A'/%3E%3Cpath d='M0 14 Q 30 0 60 14 T 120 14 T 180 14 T 240 14' fill='none' stroke='%23F6F4EF' stroke-width='3'/%3E%3C/svg%3E"); animation-duration: 7s; }

@keyframes sea-roll {
    from { transform: translateX(-240px); }
    to { transform: translateX(0); }
}

.sea-sand {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 48px;
    background: var(--primary-yellow);
    border-top: var(--mr-line);
    border-radius: 60% 40% 0 0 / 18px 12px 0 0;
}

.sea-board {
    position: absolute;
    bottom: 18px;
    right: 14%;
    width: 30px;
    transform: rotate(8deg);
    transform-origin: bottom center;
}

/* ---------- Cartes postales (intro, mentions légales) ---------- */

html[data-theme="maree"] .intro {
    gap: var(--space-lg) var(--space-md);
    margin-top: var(--space-lg);
}

html[data-theme="maree"] .intro-block {
    position: relative;
    border: var(--mr-line);
    border-radius: 8px;
    padding: calc(var(--space-md) + 10px) var(--space-md) var(--space-md);
    overflow: hidden;
    rotate: -1.2deg;
    box-shadow: 0 12px 0 -6px var(--grey-light), 0 12px 0 -4.5px var(--black);
    transition: rotate 0.4s ease, box-shadow 0.4s ease, opacity 0.6s ease, transform 0.6s ease;
}

html[data-theme="maree"] .intro-block:nth-child(2) { rotate: 0.9deg; }
html[data-theme="maree"] .intro-block:nth-child(3) { rotate: -0.5deg; }

html[data-theme="maree"] .intro-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: repeating-linear-gradient(to right, var(--primary-blue) 0 14px, var(--white) 14px 28px);
    border-bottom: var(--mr-line);
}

html[data-theme="maree"] .intro-block:hover {
    rotate: 0deg;
    box-shadow: 0 16px 0 -6px var(--primary-yellow), 0 16px 0 -4.5px var(--black);
}

@media (min-width: 900px) {
    html[data-theme="maree"] .intro .intro-block:nth-child(2) { margin-top: var(--space-lg); }
}

html[data-theme="maree"] .block-number,
html[data-theme="maree"] .intro-block .block-number {
    width: auto;
    height: auto;
    background: none;
    color: var(--primary-blue);
    font-family: var(--mr-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.6rem;
    border-radius: 0;
}

html[data-theme="maree"] .block-number::before { content: 'n°'; font-size: 0.7em; }

/* ---------- Publications : polaroïd et affiche de nuit ---------- */

html[data-theme="maree"] .publications {
    position: relative;
    border-top: 0;
    padding-top: var(--space-xl);
}

html[data-theme="maree"] .publications::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 14px;
    background: var(--mr-wave-line) left center / 60px 14px repeat-x;
}

html[data-theme="maree"] .publications .section-header { text-align: center; }
html[data-theme="maree"] .publications .accent-bar { margin: 0 auto; }

html[data-theme="maree"] .publications-grid { gap: var(--space-lg); }

html[data-theme="maree"] .publication-card {
    border: var(--mr-line);
    border-radius: 10px;
    transition: rotate 0.4s ease, box-shadow 0.4s ease;
}

html[data-theme="maree"] .publication-card:hover {
    transform: none;
    rotate: 0deg;
    box-shadow: 0 18px 0 -8px var(--primary-yellow), 0 18px 0 -6.5px var(--black);
}

html[data-theme="maree"] .video-card {
    padding: 14px 14px 0;
    rotate: 1deg;
}

html[data-theme="maree"] .video-container { border-radius: 4px; border: var(--mr-line); }
html[data-theme="maree"] .video-card .publication-info { border-top: 0; text-align: center; }
html[data-theme="maree"] .video-card .publication-info h3 { font-family: var(--mr-serif); font-style: italic; font-weight: 400; font-size: 1.5rem; }

html[data-theme="maree"] .publication-type {
    border-radius: 999px;
    padding-left: 0.9rem;
    padding-right: 0.9rem;
}

html[data-theme="maree"] .podcast-card {
    background: var(--primary-blue);
    color: var(--white);
    rotate: -1deg;
}

html[data-theme="maree"] .podcast-card .publication-type { background: var(--primary-yellow); color: var(--black); }
html[data-theme="maree"] .podcast-year { border: 1.5px solid var(--white); border-radius: 999px; }
html[data-theme="maree"] .podcast-number { color: var(--primary-yellow); font-style: italic; font-weight: 400; }
html[data-theme="maree"] .podcast-play { background: var(--primary-yellow); border: 2px solid var(--white); box-shadow: 0 0 0 6px rgba(246, 244, 239, 0.18); }
html[data-theme="maree"] .podcast-play::after { background: var(--black); }
html[data-theme="maree"] .podcast-card:hover .podcast-play { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(246, 244, 239, 0.18); }
html[data-theme="maree"] .podcast-wave { fill: var(--grey-light); }
html[data-theme="maree"] .podcast-body h3 { font-family: var(--mr-title-font); text-transform: uppercase; }
html[data-theme="maree"] .podcast-cta { background: var(--white); color: var(--black); border-top: var(--mr-line); }
html[data-theme="maree"] .podcast-card:hover .podcast-cta,
html[data-theme="maree"] .podcast-card:focus-visible .podcast-cta { background: var(--primary-yellow); }

/* ---------- CV : bouées le long du fil de l'eau ---------- */

html[data-theme="maree"] .cv-photo {
    border: var(--mr-line);
    border-radius: 50%;
    box-shadow: 0 0 0 8px var(--white), 0 0 0 9.5px var(--black);
}

html[data-theme="maree"] .cv-section {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    border-bottom: 0;
    padding-bottom: var(--space-lg);
    background: var(--mr-wave-line) left bottom / 60px 14px repeat-x;
}

html[data-theme="maree"] .cv-section:last-child { background: none; }

html[data-theme="maree"] .section-title { flex-direction: row; align-items: baseline; gap: var(--space-sm); }

html[data-theme="maree"] .section-number {
    font-family: var(--mr-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 2.4rem;
    color: var(--primary-blue);
}

html[data-theme="maree"] .section-title h2 { font-family: var(--mr-title-font); }

html[data-theme="maree"] .cv-item {
    position: relative;
    border-left: 0;
    padding-left: var(--space-md);
}

html[data-theme="maree"] .cv-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.35rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-yellow);
    border: var(--mr-line);
}

html[data-theme="maree"] .cv-item::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 1.5rem;
    bottom: -0.75rem;
    border-left: 2px dotted var(--primary-blue);
}

html[data-theme="maree"] .cv-list li::before { border-radius: 50%; }

html[data-theme="maree"] .skill-category {
    border-radius: 8px;
}

/* ---------- Mentions légales et design systems ---------- */

html[data-theme="maree"] .legal-facts,
html[data-theme="maree"] .legal-button,
html[data-theme="maree"] .ds-gallery-card {
    border-radius: 8px;
}

html[data-theme="maree"] .legal-facts { overflow: hidden; }
html[data-theme="maree"] .legal-tags li { border-radius: 999px; }
html[data-theme="maree"] .ds-gallery-card { overflow: hidden; }

/* La vignette Bauhaus de la galerie garde ses couleurs d'origine */
html[data-theme="maree"] .ds-gallery-art:not(.mr-gallery-art) {
    --primary-red: #E1251B;
    --primary-blue: #004C97;
    --primary-yellow: #FFD100;
    --black: #1a1a1a;
    --grey-light: #E8E8E8;
}

/* ---------- Pied de page : la mer ---------- */

html[data-theme="maree"] .footer {
    position: relative;
    border-top: 0;
    margin-top: calc(var(--space-xl) + 30px);
    padding: var(--space-lg) var(--space-md) var(--space-md);
    background: var(--primary-blue);
}

html[data-theme="maree"] .footer::before {
    content: '';
    position: absolute;
    top: -29px;
    left: 0;
    right: 0;
    height: 30px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 30' preserveAspectRatio='none'%3E%3Cpath d='M0 15 Q 40 0 80 15 T 160 15 V30 H0 Z' fill='%231D4F7A'/%3E%3Cpath d='M0 15 Q 40 0 80 15 T 160 15' fill='none' stroke='%23F6F4EF' stroke-width='2.5'/%3E%3C/svg%3E") left top / 160px 30px repeat-x;
    animation: sea-swell 12s linear infinite;
}

@keyframes sea-swell {
    from { background-position-x: 0; }
    to { background-position-x: 160px; }
}

html[data-theme="maree"] .footer p { color: var(--grey-light); }
html[data-theme="maree"] .footer a { color: var(--primary-yellow); }

/* ---------- Petits écrans ---------- */

@media (max-width: 768px) {
    html[data-theme="maree"] .hero { min-height: 0; padding-bottom: 170px; }
    html[data-theme="maree"] .hero::before,
    html[data-theme="maree"] .sea-scene { top: -40px; }
    html[data-theme="maree"] .hero-image { width: 140px; height: 140px; }
    html[data-theme="maree"] .shape-1 { width: 80px; height: 80px; top: 0; right: 2%; }
    .sea-cloud { width: 90px; }
    .sea-cloud-2 { width: 64px; top: 34%; left: auto; right: -12px; }
    .sea-cloud-3 { display: none; }
    .sea-gull-3 { display: none; }
    .sea-board { right: 8%; width: 22px; }
    html[data-theme="maree"] .intro-block,
    html[data-theme="maree"] .intro-block:nth-child(n) { rotate: 0deg; }
}

@media (prefers-reduced-motion: reduce) {
    .sea-cloud, .sea-gull, .sea-gull path, .sea-wave,
    html[data-theme="maree"] .footer::before { animation: none; }
}
