/*
Theme Name: mglcreation-nmf
Description: Thème enfant pour nmf.
Author: MGL Création
Template: mglcreation
Version: 0.1.0
Text Domain: mglcreation-nmf
License: GNU General Public License v2 or later
*/

/* Personnalisation propre au site. La feuille est chargée par le parent. */
/* =========================================
   IDENTITÉ VISUELLE
   Ces variables peuvent varier par thème enfant
   ========================================= */

:root {
    --color-primary: #294b40;
    --color-primary-dark: #19382e;
    --color-accent: #b86344;
    --color-accent-dark: #93482e;

    --color-text: #303a35;
    --color-muted: #66716a;
    --color-background: #faf8f3;
    --color-surface: #ffffff;
    --color-soft: #eee9df;
    --color-border: #dddcd3;

    --font-body: system-ui, -apple-system, BlinkMacSystemFont,
                 "Segoe UI", sans-serif;
    --font-heading: Georgia, "Times New Roman", serif;

    --content-width: 1160px;
    --text-width: 760px;

    --radius: 18px;
    --radius-small: 10px;
    --shadow: 0 12px 36px rgb(34 52 42 / 7%);
}

/* =========================================
   BASE COMMUNE
   ========================================= */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

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

iframe {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: var(--color-primary);
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
}

a:hover {
    color: var(--color-accent-dark);
}

:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
}

h1,
h2,
h3,
h4 {
    color: var(--color-primary);
    font-family: var(--font-heading);
    font-weight: 500;
    line-height: 1.18;
    text-wrap: balance;
}

h1 {
    margin: 0 0 1.5rem;
    font-size: clamp(2.3rem, 5vw, 4.5rem);
    letter-spacing: -0.035em;
}

h2 {
    margin: 3.5rem 0 1.25rem;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    letter-spacing: -0.025em;
}

h3 {
    margin: 2rem 0 1rem;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
}

p {
    margin: 0 0 1.4rem;
}

ul,
ol {
    padding-inline-start: 1.4rem;
}

li {
    margin-block: 0.5rem;
}

::selection {
    background: var(--color-primary);
    color: #fff;
}

/* =========================================
   CONTENEURS ET CONTENU WORDPRESS
   ========================================= */

.container {
    width: min(
        var(--content-width),
        calc(100% - 3rem)
    );
    margin-inline: auto;
}

:where(.entry-content, .wp-block-post-content) {
    width: min(
        var(--content-width),
        calc(100% - 3rem)
    );
    margin-inline: auto;
    padding-block: clamp(2rem, 5vw, 5rem);
}

:where(.entry-content, .wp-block-post-content)
> :where(p, ul, ol, h2, h3, h4) {
    max-width: var(--text-width);
    margin-inline: auto;
}

:where(.entry-content, .wp-block-post-content)
> :first-child {
    margin-top: 0;
}

.intro {
    color: var(--color-primary);
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    line-height: 1.65;
    text-wrap: pretty;
}

.section {
    padding-block: clamp(3rem, 6vw, 6rem);
}

.section-soft {
    background: var(--color-soft);
}

.section-heading {
    max-width: var(--text-width);
    margin: 0 auto 2.5rem;
    text-align: center;
}

/* =========================================
   CARTES DES DESTINATIONS ET LOGEMENTS
   ========================================= */

.cards,
.wp-block-columns.cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.25rem, 3vw, 2.5rem);
    margin-block: 2.5rem 4rem;
}

.card,
.wp-block-column.card {
    min-width: 0;
    margin: 0;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card h3 {
    margin-top: 0;
}

.card > :last-child {
    margin-bottom: 0;
}

.card > figure:first-child {
    margin:
        calc(-1 * clamp(1.5rem, 3vw, 2.5rem))
        calc(-1 * clamp(1.5rem, 3vw, 2.5rem))
        1.75rem;
}

.card > figure:first-child img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* Liens des cartes de l’accueil actuel */

.card > p:last-child a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.7rem 1.25rem;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-small);
    background: var(--color-primary);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}

.card > p:last-child a:hover {
    background: var(--color-primary-dark);
}

/* =========================================
   BOUTONS COMMUNS
   ========================================= */

.button,
.wp-block-button__link,
button[type="submit"],
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    max-width: 100%;
    padding: 0.8rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-small);
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 180ms ease,
        border-color 180ms ease;
}

:is(
    .button,
    .wp-block-button__link,
    button[type="submit"],
    input[type="submit"]
):hover {
    background: var(--color-primary-dark);
    color: #fff;
}

.button-accent {
    background: var(--color-accent);
}

.button-accent:hover {
    background: var(--color-accent-dark);
}

.button-outline,
.is-style-outline > .wp-block-button__link {
    border-color: var(--color-primary);
    background: transparent;
    color: var(--color-primary);
}

.button-outline:hover,
.is-style-outline > .wp-block-button__link:hover {
    background: var(--color-primary);
    color: #fff;
}

/* =========================================
   PHOTOS ET GALERIES
   ========================================= */

.wp-block-image {
    margin-block: 2rem;
}

.wp-block-image img {
    border-radius: var(--radius);
}

figcaption,
.wp-element-caption {
    margin-top: 0.75rem;
    color: var(--color-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.gallery figure {
    margin: 0;
}

.gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-small);
}

.wp-block-gallery {
    margin-block: 2.5rem;
}

.wp-block-gallery img {
    border-radius: var(--radius-small);
}

/* =========================================
   CARACTÉRISTIQUES ET ÉQUIPEMENTS
   ========================================= */

.features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0;
    list-style: none;
}

.features li {
    margin: 0;
    padding: 0.55rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-primary);
    font-size: 0.95rem;
}

/* =========================================
   FORMULAIRES
   ========================================= */

:where(
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    select,
    textarea
) {
    width: 100%;
    min-height: 48px;
    padding: 0.8rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    background: var(--color-surface);
    color: var(--color-text);
}

textarea {
    min-height: 160px;
    resize: vertical;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--color-primary);
}

/* =========================================
   MOBILE ET ACCESSIBILITÉ
   ========================================= */

@media (max-width: 760px) {
    .cards,
    .wp-block-columns.cards {
        grid-template-columns: 1fr;
    }

    .gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    h2 {
        margin-top: 2.5rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 16px;
    } 

    .container,
    :where(.entry-content, .wp-block-post-content) {
        width: calc(100% - 2rem);
    }

    .gallery {
        grid-template-columns: 1fr;
    }

    .card > p:last-child a {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}