/*
Theme Name: La Croix du Sud – Andes solidaires
Theme URI: https://example.org/
Author: La Croix du Sud
Description: Thème associatif chaleureux inspiré des paysages et des textiles andins : bandeau photo, bandeau latéral de vignettes, sections papier déchiré et pied de page tissé.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: croix-du-sud
*/

:root{
  --cds-red:#b3261a;
  --cds-teal:#0e6c7e;
  --cds-orange:#dc780e;
  --cds-paper:#fbf0d8;
  --cds-paper-light:#fff8e8;
  --cds-ink:#2a2018;
  --cds-wine:#5b1a1f;
  --cds-rail:70px;
  --cds-max:1340px;
  --cds-sans:"CDS Sans","Source Sans 3","Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;
  --cds-script:"CDS Script","CDS Lora",Georgia,"Times New Roman",serif;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;color:var(--cds-ink);background:#f6ead0;font-family:var(--cds-sans);font-size:17px;line-height:1.55;-webkit-font-smoothing:antialiased}
img{max-width:100%;height:auto}
a{color:var(--cds-red)}a:hover{color:var(--cds-teal)}
.screen-reader-text{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.cds-svg-defs{position:absolute;width:0;height:0}

/* ---------- Structure : bandeau latéral + colonne principale ---------- */
.site-shell{display:flex;max-width:var(--cds-max);margin:0 auto;background:var(--cds-paper-light);box-shadow:0 0 30px rgba(70,40,10,.18)}
.site-rail{flex:0 0 var(--cds-rail);display:flex;flex-direction:column;background:var(--cds-paper-light)}
.rail-top,.rail-bottom{display:block;width:100%;background-size:100% 100%;background-repeat:no-repeat}
.rail-top{aspect-ratio:70/80;background-image:url('assets/images/rail-top.jpg')}
.rail-bottom{aspect-ratio:70/156;background-image:url('assets/images/rail-bottom.jpg')}
.rail-strip{flex:1;background:url('assets/images/rail-strip.jpg') 0 0/100% auto repeat-y}
.site-column{flex:1;min-width:0;display:flex;flex-direction:column}
.site-main{flex:1}

/* Bandeau latéral alimenté par la médiathèque */
.rail-strip--media{position:relative;display:block;overflow:hidden;background:var(--cds-paper-light)}
.rail-thumbs{position:absolute;inset:0;margin:0;padding:6px 7px;list-style:none;display:flex;flex-direction:column;gap:7px;overflow:hidden}
.rail-thumbs li{flex:0 0 auto;aspect-ratio:3/4;border:4px solid #d9541e;border-radius:3px;background:#fff;box-shadow:0 1px 2px rgba(60,30,10,.25);overflow:hidden}
.rail-thumbs li:nth-child(5n+2){border-color:#e8a317}
.rail-thumbs li:nth-child(5n+3){border-color:#0e8aa0}
.rail-thumbs li:nth-child(5n+4){border-color:#4f9a3c}
.rail-thumbs li:nth-child(5n){border-color:#c0261a}
.rail-thumbs img{display:block;width:100%;height:100%;object-fit:cover}

/* ---------- Bandeau ---------- */
.header-banner{position:relative;aspect-ratio:1428/393;min-height:200px;background:#cfe3f2 url('assets/images/header-bg.jpg') center/cover no-repeat;overflow:hidden}
.brand{position:absolute;left:29%;right:9%;top:4%;bottom:3%;display:flex;flex-direction:column;align-items:center;text-align:center}
.brand-logo{display:block;width:clamp(46px,7.2vw,100px);margin:0 0 auto;line-height:0}
.brand-logo img,.brand-logo svg{width:100%;height:auto;display:block}
.brand-text{display:block;text-decoration:none}
.site-title{margin:0;font-family:var(--cds-sans);font-weight:900;text-transform:uppercase;letter-spacing:.035em;line-height:1;font-size:clamp(1.55rem,5.5vw,4.4rem);color:var(--cds-red);text-shadow:0 2px 0 rgba(255,255,255,.25);filter:url(#cds-rough);white-space:nowrap}
.site-title a{color:inherit;text-decoration:none}
.site-tagline{position:relative;margin:.2em 0 0;padding-bottom:.55em;font-family:var(--cds-script);font-style:italic;font-weight:700;color:#0b6a7c;font-size:clamp(.9rem,2.5vw,2.05rem);line-height:1.15}
.site-tagline::after{content:"";position:absolute;left:22%;right:30%;bottom:0;height:.4em;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 14' preserveAspectRatio='none'%3E%3Cpath d='M2 10 C60 3 150 2 298 9' fill='none' stroke='%23e8820c' stroke-width='4.5' stroke-linecap='round'/%3E%3C/svg%3E") center/100% 100% no-repeat}

/* ---------- Navigation ---------- */
.main-nav{position:relative;z-index:20;background:linear-gradient(#fff8ea,#fbf0d9);border-bottom:1px solid #ead7ae}
.nav-inner{display:flex;align-items:center;gap:6px;min-height:58px;padding:0 14px 0 6px}
.home-link{flex:0 0 auto;display:grid;place-items:center;width:50px;height:46px;background:var(--cds-red);border-radius:3px;color:#fff;text-decoration:none}
.home-link svg{width:26px;height:26px;fill:currentColor}
.home-link:hover{background:#8f1d13;color:#fff}
.nav-menu{display:flex;align-items:center;flex-wrap:nowrap;flex:1;list-style:none;margin:0;padding:0}
.nav-menu li{position:relative}
.nav-menu>li>a{display:block;padding:18px 12px;color:#26190f;font-size:.74rem;font-weight:700;letter-spacing:.01em;text-transform:uppercase;text-decoration:none;white-space:nowrap}
.nav-menu>li>a:hover,.nav-menu>li.current-menu-item>a,.nav-menu>li.current-menu-ancestor>a{color:var(--cds-red)}
.nav-menu .sub-menu{display:none;position:absolute;top:100%;left:0;min-width:230px;margin:0;padding:6px 0;list-style:none;background:var(--cds-paper-light);border:1px solid #e5c98f;box-shadow:0 8px 18px rgba(67,39,12,.18);z-index:30}
.nav-menu li:hover>.sub-menu,.nav-menu li:focus-within>.sub-menu{display:block}
.nav-menu .sub-menu a{display:block;padding:10px 16px;color:#26190f;font-size:.8rem;font-weight:600;text-decoration:none;border-bottom:1px solid #f0e1c2}
.nav-menu .sub-menu a:hover{background:#fff0d0;color:var(--cds-red)}
.lang-switch{flex:0 0 auto;display:flex;align-items:center;list-style:none;margin:0 0 0 4px;padding:0}
.lang-switch a{display:block;line-height:0}
.lang-switch svg,.lang-switch img{width:26px;height:26px;border-radius:50%}
.menu-toggle{display:none;border:0;border-radius:4px;background:var(--cds-red);color:#fff;padding:10px 16px;font:700 .9rem var(--cds-sans);cursor:pointer}

/* ---------- Accueil : sections photo + papier déchiré ---------- */
.home-main{padding:6px 0 0}
.cds-section{position:relative;display:flex;min-height:clamp(300px,31vw,420px);margin:0 0 12px;overflow:hidden;background:var(--cds-paper)}
.cds-section__photo{position:absolute;top:0;right:0;bottom:0;width:62%;background-size:cover;background-position:center right;background-repeat:no-repeat}
.cds-section__panel{position:relative;z-index:2;flex:0 0 51%;display:flex;filter:drop-shadow(3px 0 3px rgba(80,45,10,.22))}
.cds-section__paper{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;padding:clamp(20px,3.4vw,44px) clamp(24px,5vw,72px) clamp(20px,3.4vw,44px) clamp(16px,3.2vw,44px);background:linear-gradient(rgba(255,247,226,.62),rgba(255,247,226,.62)),url('assets/images/paper-texture.jpg') center/cover;clip-path:polygon(0 0, 100% 0, 98.2% 0.0%, 97.4% 2.4%, 99.6% 4.0%, 98.2% 5.6%, 96.6% 7.2%, 99.6% 9.6%, 97.4% 11.2%, 99.6% 15.3%, 99.6% 17.7%, 99.6% 21.8%, 99.0% 23.4%, 96.6% 25.0%, 99.6% 29.1%, 99.6% 31.5%, 98.2% 33.9%, 99.0% 38.0%, 96.6% 39.6%, 96.6% 42.8%, 99.6% 45.2%, 98.2% 47.6%, 96.6% 49.2%, 96.6% 50.8%, 96.6% 52.4%, 97.4% 54.8%, 94.5% 58.9%, 97.4% 62.1%, 98.2% 66.2%, 99.0% 69.4%, 95.4% 71.8%, 99.6% 74.2%, 96.6% 77.4%, 98.2% 81.5%, 98.2% 85.6%, 99.6% 87.2%, 99.0% 91.3%, 99.0% 94.5%, 97.4% 98.6%, 100% 100%, 0 100%)}
.cds-section--teal .cds-section__paper{background:linear-gradient(105deg,rgba(255,247,226,.55),rgba(255,247,226,.62) 55%,rgba(214,236,232,.6)),url('assets/images/paper-texture.jpg') center/cover}
.cds-section--teal .cds-section__photo{width:58%}
.cds-section--third .cds-section__panel{flex-basis:46%}

.brush-title{display:flex;align-items:center;gap:0;margin:0 0 clamp(10px,1.6vw,20px);max-width:100%}
.brush-title__icon{flex:0 0 auto;width:clamp(36px,5.6vw,68px);height:auto;margin-right:-10px;position:relative;z-index:2}
.brush-title__text{margin:0;text-wrap:balance;padding:.28em 1.3em .34em 1em;font-family:var(--cds-script);font-style:italic;font-weight:600;font-size:clamp(1.3rem,2.9vw,2.45rem);line-height:1.12;color:#fff;background:url('assets/images/brush-red.png') 0 0/100% 100% no-repeat;text-shadow:0 1px 1px rgba(0,0,0,.2)}
.brush-title--teal .brush-title__text{background-image:url('assets/images/brush-teal.png')}
.brush-title--teal .brush-title__icon{width:clamp(30px,4.2vw,50px);margin-right:-4px}
.cds-section__text{font-size:clamp(.95rem,1.35vw,1.12rem);line-height:1.6;max-width:36em;color:#241a12}
.cds-section__text p{margin:0 0 .85em}
.cds-btn{display:inline-flex;align-items:center;gap:.7em;margin-top:.5em;padding:.62em 1.9em .66em;border-radius:999px;background:var(--cds-orange);color:#fff;font-weight:600;font-size:clamp(1rem,1.5vw,1.22rem);text-decoration:none;box-shadow:0 2px 0 rgba(0,0,0,.12);transition:transform .18s,filter .18s}
.cds-btn:hover{color:#fff;filter:brightness(1.1);transform:translateY(-2px)}
.cds-btn svg{width:1.15em;height:1.15em;stroke:currentColor;fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.cds-links{list-style:none;margin:.5em 0 0;padding:0;display:flex;flex-wrap:wrap;gap:10px}.cds-links .cds-btn{margin-top:0}
.cds-btn--teal{background:#0d6377}.cds-btn--red{background:#9b1b13}

/* ---------- Pied de page ---------- */
.site-footer{position:relative;margin-top:0;background:var(--cds-paper) url('assets/images/paper-texture.jpg') center/cover;text-align:center}
.footer-top{position:relative;padding:clamp(18px,2.6vw,34px) 70px clamp(30px,4vw,58px)}
.footer-quote{margin:0 0 .4em;display:flex;align-items:center;justify-content:center;gap:16px;font-family:var(--cds-script);font-style:italic;font-weight:700;color:var(--cds-wine);font-size:clamp(1.25rem,2.8vw,2.1rem);line-height:1.2}
.footer-quote .dash{flex:0 0 clamp(18px,3vw,40px);height:3px;background:var(--cds-wine);border-radius:2px}
.footer-credit{margin:0;font-size:.78rem;color:#3a2a1d}
.footer-social{position:absolute;right:16px;top:50%;transform:translateY(-70%);display:flex;gap:8px}
.footer-social a{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#1f5fc0;color:#fff}
.footer-social a+a{background:#127086}
.footer-social svg{width:16px;height:16px;fill:#fff}
.footer-pattern{height:clamp(60px,8.4vw,116px);background:url('assets/images/footer-pattern.jpg') 0 100%/auto 100% repeat-x}

/* ---------- Pages / articles ---------- */
.content-main{padding:22px clamp(14px,3vw,36px) 36px}
.page-content{background:linear-gradient(rgba(255,250,238,.85),rgba(255,250,238,.85)),url('assets/images/paper-texture.jpg') center/cover;border:1px solid #ead7ae;border-radius:6px;padding:clamp(20px,4vw,46px);box-shadow:0 2px 8px rgba(80,45,10,.08)}
.page-content h1,.page-content h2{font-family:var(--cds-script);font-style:italic;color:var(--cds-red);line-height:1.2}
.page-content h1{font-size:clamp(1.8rem,3.4vw,2.6rem);margin-top:0}
.page-content img{border-radius:6px}
.page-content article+article{margin-top:1.6em;padding-top:1.2em;border-top:1px solid #ead7ae}
.pagination{margin:24px 0}
.pagination .nav-links{display:flex;gap:10px;flex-wrap:wrap}

/* ---------- Adaptations ---------- */
@media(max-width:1100px){
  .nav-menu>li>a{padding:18px 8px;font-size:.68rem}
  .cds-section__panel{flex-basis:56%}
}
@media(max-width:860px){
  :root{--cds-rail:0px}
  .site-rail{display:none}
  .header-banner{aspect-ratio:auto;height:clamp(190px,40vw,270px);background-position:30% center}
  .brand{left:4%;right:4%;top:6%;bottom:2%}
  .nav-inner{flex-wrap:wrap;justify-content:space-between;padding:6px 10px}
  .menu-toggle{display:block;margin-left:auto}
  .nav-menu{display:none;flex-basis:100%;flex-direction:column;align-items:stretch;order:5;border-top:1px solid #e5c98f}
  .nav-menu.is-open{display:flex}
  .nav-menu>li>a{padding:12px 6px;border-bottom:1px solid #f0e1c2;white-space:normal}
  .nav-menu .sub-menu{position:static;box-shadow:none;border:0;background:#fff2d7;padding-left:12px}
  .nav-menu li:hover>.sub-menu,.nav-menu li:focus-within>.sub-menu{display:none}
  .nav-menu li.submenu-open>.sub-menu{display:block}
  .cds-section,.cds-section--teal{flex-direction:column;min-height:0}
  .cds-section__photo,.cds-section--teal .cds-section__photo{position:relative;order:0;width:100%;height:clamp(190px,52vw,300px);background-position:center}
  .cds-section__panel,.cds-section--third .cds-section__panel{order:1;flex:1 1 auto;filter:none}
  .cds-section__paper{clip-path:none;padding:22px 20px 26px}
  .footer-top{padding:20px 14px 40px}
  .footer-social{position:static;transform:none;justify-content:center;margin-top:10px}
}
@media(max-width:520px){
  .site-title{white-space:normal}
  .footer-quote{gap:8px}
}
