/* ============================================================
   L'Amie Rayonne — thème pictural v2
   Une couleur par discipline : théâtre (vermillon), écriture
   (violet), photographie (émeraude), liés par le magenta et
   l'ambre. Tout est exprimé via des variables CSS (theme.json).
   ============================================================ */

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

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* Lavis de couleur très léger dans les angles de la page */
body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(560px 380px at 4% -4%, color-mix(in srgb, var(--color-ecriture) 7%, transparent), transparent 70%),
        radial-gradient(620px 420px at 102% 12%, color-mix(in srgb, var(--color-theatre) 7%, transparent), transparent 70%),
        radial-gradient(700px 480px at 50% 108%, color-mix(in srgb, var(--color-photo) 6%, transparent), transparent 70%);
}

h1, h2, h3, h4 { font-family: var(--font-title); line-height: 1.15; color: var(--color-text); }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--color-accent); color: var(--color-text); }

.yw-container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.yw-muted { color: var(--color-muted); }

/* --- En-tête / navigation ------------------------------------------- */
/* Filet tricolore peint au sommet du site */
.yw-header::before {
    content: ""; display: block; height: 5px;
    background: linear-gradient(90deg,
        var(--color-theatre) 0 22%, var(--color-primary) 30% 46%,
        var(--color-ecriture) 54% 72%, var(--color-photo) 80% 100%);
}
.yw-header {
    background: color-mix(in srgb, var(--color-bg) 88%, transparent);
    backdrop-filter: blur(8px) saturate(1.3);
    -webkit-backdrop-filter: blur(8px) saturate(1.3);
    border-bottom: 1px solid var(--color-border);
    position: sticky; top: 0; z-index: 50;
}
.yw-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 70px; }
.yw-brand {
    font-family: var(--font-title); font-weight: 700; font-size: 1.45rem; color: var(--color-text);
    display: inline-flex; align-items: center; gap: 10px; letter-spacing: .01em;
}
.yw-brand-mark { flex: none; transition: transform .5s ease; }
.yw-brand:hover { text-decoration: none; color: var(--color-primary); }
.yw-brand:hover .yw-brand-mark { transform: rotate(90deg); }
.yw-nav { display: flex; flex-wrap: wrap; gap: 2px; }
.yw-nav a {
    color: var(--color-text); padding: 8px 13px; border-radius: 999px;
    font-size: .93rem; font-weight: 600; position: relative;
}
.yw-nav a:hover { background: var(--color-surface); text-decoration: none; color: var(--color-primary); }
.yw-nav a[aria-current="page"] { color: #fff; background: var(--color-text); }

/* --- Bandeau d'accueil : toile peinte --------------------------------- */
.yw-main { min-height: 50vh; }
.yw-page { padding: 44px 20px 64px; }
.yw-section { margin-bottom: 44px; }

.yw-hero {
    position: relative; overflow: hidden; text-align: center;
    padding: 92px 0 76px;
    background:
        radial-gradient(720px 340px at 50% 118%, color-mix(in srgb, var(--color-accent) 26%, transparent), transparent 65%),
        linear-gradient(160deg, var(--color-surface), var(--color-bg) 68%);
    border-bottom: 1px solid var(--color-border);
}
.yw-hero-inner { position: relative; z-index: 2; }
.yw-hero h1 {
    font-size: clamp(2.6rem, 7vw, 4.2rem); margin: 0 0 .35em; letter-spacing: -.015em;
}
.yw-hero h1 strong {
    font-style: italic;
    background: linear-gradient(100deg, var(--color-theatre), var(--color-primary) 45%, var(--color-ecriture));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.yw-hero p { font-size: 1.2rem; color: var(--color-muted); max-width: 700px; margin: 0 auto; }

/* Taches de peinture flottantes */
.lar-blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55; z-index: 1; }
.lar-blob-1 {
    width: 240px; height: 240px; left: -70px; top: -60px;
    background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--color-theatre) 45%, transparent), transparent 70%);
    animation: lar-drift 11s ease-in-out infinite alternate;
}
.lar-blob-2 {
    width: 320px; height: 320px; right: -90px; top: 8%;
    background: radial-gradient(circle at 60% 40%, color-mix(in srgb, var(--color-ecriture) 40%, transparent), transparent 70%);
    animation: lar-drift 14s ease-in-out infinite alternate-reverse;
}
.lar-blob-3 {
    width: 200px; height: 200px; left: 14%; bottom: -90px;
    background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--color-photo) 42%, transparent), transparent 70%);
    animation: lar-drift 9s ease-in-out infinite alternate;
}
@keyframes lar-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(24px, -18px) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .lar-blob { animation: none; } }

/* Étiquettes-stickers, une couleur par art, légèrement de travers */
.yw-hero-tags { margin-top: 30px !important; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.yw-tag {
    display: inline-block; border-radius: 999px; padding: 9px 20px;
    font-size: 1rem; font-weight: 700; color: #fff;
    box-shadow: 0 4px 14px rgba(36, 31, 49, .18);
    transition: transform .25s ease;
}
.yw-tag:hover { transform: rotate(0deg) scale(1.06) !important; }
.yw-tag-theatre  { background: var(--color-theatre);  transform: rotate(-2.5deg); }
.yw-tag-ecriture { background: var(--color-ecriture); transform: rotate(1.5deg); }
.yw-tag-photo    { background: var(--color-photo);    transform: rotate(-1.5deg); }

/* --- Texte riche : titres à coup de pinceau --------------------------- */
.yw-rte > :first-child { margin-top: 0; }
.yw-rte > :last-child { margin-bottom: 0; }
.yw-rte h2 {
    font-size: clamp(1.7rem, 3.5vw, 2.2rem); margin: 1.4em 0 .6em;
    display: table; position: relative; padding-bottom: 10px;
}
.yw-rte h2::after {
    content: ""; position: absolute; left: 0; right: -14px; bottom: 0; height: 9px;
    border-radius: 999px 4px 999px 6px / 7px 999px 5px 999px;
    background: linear-gradient(92deg, var(--color-accent), var(--color-primary) 85%);
    opacity: .85; transform: rotate(-.6deg);
}
.yw-rte h3 { font-size: 1.35rem; margin: 1.2em 0 .4em; }
.yw-rte h3::before { content: "— "; color: var(--color-accent); font-weight: 700; }
.yw-rte blockquote {
    margin: 1.4em 0; padding: 1em 1.4em 1em 1.8em; position: relative;
    border-left: 6px solid var(--color-accent);
    background: var(--color-surface);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-family: var(--font-title); font-style: italic; font-size: 1.08rem;
}

/* Grands titres de pages intérieures */
.lar-page-head h1, .yw-blog-head h1, .yw-gallery-head h1 {
    display: table; position: relative; padding-bottom: 12px;
}
.lar-page-head h1 { font-size: clamp(2.1rem, 5vw, 3rem); margin: 0 0 32px; }
.lar-page-head h1::after, .yw-blog-head h1::after, .yw-gallery-head h1::after {
    content: ""; position: absolute; left: 0; right: -16px; bottom: 0; height: 10px;
    border-radius: 999px 5px 999px 6px / 7px 999px 5px 999px;
    background: linear-gradient(92deg, var(--color-theatre), var(--color-primary) 50%, var(--color-ecriture));
    opacity: .8; transform: rotate(-.6deg);
}
.yw-gallery-head h1 { margin-left: auto; margin-right: auto; }

/* --- Cartes d'activités : une toile par discipline --------------------- */
.lar-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px; margin: 18px 0; padding: 0; list-style: none;
}
.lar-card {
    position: relative; overflow: hidden;
    background: #fff; border: 1px solid var(--color-border);
    border-radius: var(--radius); padding: 28px 24px 24px;
    box-shadow: 0 6px 22px rgba(36, 31, 49, .08);
    transition: transform .25s ease, box-shadow .25s ease;
}
.lar-card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 7px;
    background: var(--lar-c, var(--color-primary));
}
.lar-card::after {
    content: ""; position: absolute; right: -46px; bottom: -46px; width: 130px; height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--lar-c, var(--color-primary)) 16%, transparent), transparent 70%);
}
.lar-card:nth-child(1) { --lar-c: var(--color-theatre);  transform: rotate(-1deg); }
.lar-card:nth-child(2) { --lar-c: var(--color-ecriture); transform: rotate(.7deg); }
.lar-card:nth-child(3) { --lar-c: var(--color-photo);    transform: rotate(-.7deg); }
.lar-card:hover { transform: rotate(0deg) translateY(-6px); box-shadow: 0 14px 34px rgba(36, 31, 49, .14); }
.lar-card h3 { margin: 0 0 .45em; font-size: 1.35rem; color: var(--lar-c, var(--color-text)); }
.lar-card p { margin: 0; color: var(--color-muted); font-size: .97rem; position: relative; z-index: 1; }
.lar-card-emoji {
    font-size: 1.8rem; display: inline-grid; place-items: center;
    width: 58px; height: 58px; margin-bottom: 14px; border-radius: 50%;
    background: color-mix(in srgb, var(--lar-c, var(--color-primary)) 14%, #fff);
    border: 2px solid color-mix(in srgb, var(--lar-c, var(--color-primary)) 40%, transparent);
}

/* --- Documents à télécharger : intercalaires colorés ------------------- */
.lar-docs { list-style: none; padding: 0; margin: 16px 0; }
.lar-docs li { margin-bottom: 12px; }
.lar-docs a {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1px solid var(--color-border);
    border-left: 7px solid var(--lar-c, var(--color-primary));
    border-radius: var(--radius); padding: 14px 18px; font-weight: 700;
    box-shadow: 0 3px 12px rgba(36, 31, 49, .06);
    transition: transform .2s ease, box-shadow .2s ease;
}
.lar-docs li:nth-child(3n+1) a { --lar-c: var(--color-theatre); }
.lar-docs li:nth-child(3n+2) a { --lar-c: var(--color-ecriture); }
.lar-docs li:nth-child(3n+3) a { --lar-c: var(--color-photo); }
.lar-docs a::before { content: "📄"; font-size: 1.3rem; }
.lar-docs a:hover { text-decoration: none; transform: translateX(6px); box-shadow: 0 6px 18px rgba(36, 31, 49, .12); }
.lar-docs small { font-weight: 400; color: var(--color-muted); }

/* --- Encarts d'information : post-it d'atelier -------------------------- */
.lar-note {
    background: color-mix(in srgb, var(--color-accent) 13%, #fff);
    border: 1px solid color-mix(in srgb, var(--color-accent) 38%, transparent);
    border-radius: 4px var(--radius) 4px var(--radius);
    padding: 16px 20px; margin: 1.4em 0; transform: rotate(-.4deg);
    box-shadow: 0 4px 14px rgba(36, 31, 49, .07);
}
.lar-note p { margin: 0; }

/* --- Galerie : accrochage de polaroids ---------------------------------- */
.yw-gallery {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 22px;
}
.yw-gallery-item {
    margin: 0; overflow: hidden; aspect-ratio: 4 / 3;
    background: #fff; padding: 8px 8px 26px; border-radius: 4px;
    box-shadow: 0 6px 18px rgba(36, 31, 49, .14);
    transition: transform .25s ease, box-shadow .25s ease;
}
.yw-gallery-item:nth-child(3n+1) { transform: rotate(-1.6deg); }
.yw-gallery-item:nth-child(3n+2) { transform: rotate(1.2deg); }
.yw-gallery-item:nth-child(3n+3) { transform: rotate(-.6deg); }
.yw-gallery-item:hover { transform: rotate(0deg) scale(1.04); box-shadow: 0 14px 30px rgba(36, 31, 49, .2); z-index: 2; }
.yw-gallery-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }

/* --- Article ------------------------------------------------------------- */
.yw-article { margin-bottom: 44px; padding-bottom: 30px; border-bottom: 1px dashed var(--color-border); }
.yw-article-cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; box-shadow: 0 8px 24px rgba(36, 31, 49, .1); }
.yw-article-date { display: block; color: var(--color-muted); font-size: .85rem; margin-bottom: 8px; }

/* --- Widget « avancement » (addon regie) -------------------------------- */
.yw-progress { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 22px 24px; box-shadow: 0 4px 16px rgba(36, 31, 49, .06); }
.yw-progress h3 { margin: 0 0 16px; }
.yw-progress-line { margin-bottom: 14px; }
.yw-progress-line:last-child { margin-bottom: 0; }
.yw-progress-head { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 5px; }
.yw-progress-head .pct { font-weight: 700; color: var(--color-primary); }
.yw-progress-bar { height: 9px; background: var(--color-border); border-radius: 999px; overflow: hidden; }
.yw-progress-fill { height: 100%; background: linear-gradient(90deg, var(--color-accent), var(--color-primary)); border-radius: 999px; transition: width .4s; }
.yw-progress-global .yw-progress-fill { background: linear-gradient(90deg, var(--color-theatre), var(--color-ecriture)); }
.yw-progress-dates { margin-top: 16px; font-size: .9rem; color: var(--color-muted); display: flex; gap: 22px; flex-wrap: wrap; }
.yw-progress-dates b { color: var(--color-text); }

/* Bloc « Projet (Régie) » : fiche, description et images (polaroids) */
.yw-regie-infos { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0 0 14px; padding: 0; list-style: none; font-size: .93rem; }
.yw-regie-infos b { color: var(--color-primary); font-weight: 700; margin-right: 4px; }
.yw-regie-desc { margin: 0 0 18px; color: var(--color-muted); font-family: var(--font-title); font-style: italic; font-size: 1.02rem; }
.yw-regie-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-top: 20px; }
.yw-regie-images figure {
    margin: 0; background: #fff; padding: 6px 6px 8px; border-radius: 4px;
    box-shadow: 0 5px 14px rgba(36, 31, 49, .14);
    transition: transform .25s ease;
}
.yw-regie-images figure:nth-child(2n) { transform: rotate(1.2deg); }
.yw-regie-images figure:nth-child(2n+1) { transform: rotate(-1.2deg); }
.yw-regie-images figure:hover { transform: rotate(0deg) scale(1.05); }
.yw-regie-images img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 2px; }
.yw-regie-images figcaption { font-size: .8rem; color: var(--color-muted); padding: 6px 4px 0; text-align: center; }

/* --- Formulaires ----------------------------------------------------------- */
.yw-form { max-width: 640px; margin-top: 12px; }
.yw-field { margin-bottom: 16px; }
.yw-field-row { display: flex; gap: 16px; }
.yw-field-row .yw-field { flex: 1; }
.yw-field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 5px; }
.yw-field input, .yw-field textarea {
    width: 100%; padding: 12px 14px; font: inherit; color: var(--color-text);
    border: 2px solid var(--color-border); border-radius: var(--radius); background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.yw-field input:focus, .yw-field textarea:focus {
    outline: none; border-color: var(--color-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 15%, transparent);
}
.yw-btn {
    display: inline-block; color: #fff; border: none;
    background: linear-gradient(100deg, var(--color-primary), var(--color-theatre));
    padding: 14px 30px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 1.02rem;
    cursor: pointer; box-shadow: 0 6px 18px color-mix(in srgb, var(--color-primary) 38%, transparent);
    transition: transform .2s ease, box-shadow .2s ease;
}
.yw-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px color-mix(in srgb, var(--color-primary) 45%, transparent); text-decoration: none; color: #fff; }

.yw-alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; }
.yw-alert-ok { background: #e6f6ee; border: 1px solid #b6e2cc; color: #1e7a4d; }
.yw-alert-err { background: #fdecea; border: 1px solid #f5c6cb; color: #a02; }

/* --- Pied de page : encre et couleurs ---------------------------------------- */
.yw-footer {
    margin-top: 56px; color: #cfc9dc;
    background: var(--color-text); position: relative;
}
.yw-footer::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
    background: linear-gradient(90deg,
        var(--color-theatre) 0 22%, var(--color-primary) 30% 46%,
        var(--color-ecriture) 54% 72%, var(--color-photo) 80% 100%);
}
.yw-footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 34px 20px; }
.yw-footer-brand { font-family: var(--font-title); font-weight: 700; font-size: 1.1rem; margin: 0 0 3px; color: #fff; }
.yw-footer p { margin: 0; font-size: .9rem; }
.yw-footer .yw-muted { color: #a89fbd; }
.yw-footer a { color: var(--color-accent); }

@media (max-width: 640px) {
    .yw-field-row { flex-direction: column; gap: 0; }
    .yw-header-inner { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 0; }
    .yw-footer-inner { flex-direction: column; align-items: flex-start; }
    .lar-card, .lar-note { transform: none; }
}

/* Layouts blog (colonne de lecture) & galerie (pleine largeur) */
.yw-blog { max-width: 740px; padding-top: 44px; padding-bottom: 64px; }
.yw-blog-head h1 { font-size: clamp(2rem, 4.5vw, 2.6rem); margin: 0 0 28px; }
.yw-gallery-page { max-width: 1280px; padding-top: 44px; padding-bottom: 64px; }
.yw-gallery-head { text-align: center; }
.yw-gallery-head h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); margin: 0 auto 30px; }
