/*
Theme Name: Canton de Percy
Theme URI: https://cc-percy.fr
Description: Thème enfant éditorial pour le Canton de Percy — inspiré du bocage normand. Typographie serif, palette sobre, animations discrètes au scroll.
Author: cc-percy.fr
Template: generatepress
Version: 1.0.0
Text Domain: percy-child
*/

/* =========================================================
   Tokens
   ========================================================= */
:root {
  --green: #4A5D4E;
  --green-dark: #3a4a3d;
  --green-soft: rgba(74, 93, 78, 0.3);
  --stone: #FAFAF9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-900: #1c1917;
  --white: #ffffff;

  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 1280px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* =========================================================
   Reset / base (scoped to front page body class)
   ========================================================= */
body.percy-home {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--stone-900);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.percy-home * { box-sizing: border-box; }
body.percy-home img { max-width: 100%; display: block; }
body.percy-home a { color: inherit; text-decoration: none; }
body.percy-home ul { list-style: none; padding: 0; margin: 0; }
body.percy-home h1, body.percy-home h2, body.percy-home h3, body.percy-home h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.01em;
}

.percy-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* =========================================================
   Reveal animation (IntersectionObserver)
   ========================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal-delay="1"].is-visible { transition-delay: 0.1s; }
[data-reveal-delay="2"].is-visible { transition-delay: 0.2s; }
[data-reveal-delay="3"].is-visible { transition-delay: 0.3s; }

/* =========================================================
   Scroll progress bar
   ========================================================= */
.percy-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 60;
  transition: transform 0.08s linear;
}

/* =========================================================
   Navbar
   ========================================================= */
.percy-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 1.5rem 0;
  transition: background 0.3s var(--ease), padding 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.percy-nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.percy-nav__menu {
  display: none;
  gap: 2rem;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.9);
  transition: color 0.3s var(--ease);
}
.percy-nav__menu a:hover { color: var(--green); }
.percy-nav.is-scrolled {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.85rem 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.percy-nav.is-scrolled .percy-nav__menu { color: var(--stone-600); }

@media (min-width: 768px) {
  .percy-nav__menu { display: flex; }
}

/* =========================================================
   Hero
   ========================================================= */
.percy-hero {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--white);
}
.percy-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.percy-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.percy-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}
.percy-hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 1.5rem;
  max-width: 960px;
  animation: fadeUp 1s var(--ease) both;
}
.percy-eyebrow {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 1.25rem;
}
.percy-hero h1 {
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 300;
  line-height: 1;
  margin-bottom: 2rem;
}
.percy-hero__lead {
  max-width: 620px;
  margin: 0 auto 3rem;
  font-size: 1.125rem;
  font-weight: 300;
  color: rgba(255,255,255,0.9);
  line-height: 1.7;
}
.percy-hero__scroll {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.6;
  transition: opacity 0.3s var(--ease);
  animation: fadeIn 1s 1s var(--ease) both;
}
.percy-hero__scroll:hover { opacity: 1; }
.percy-hero__scroll svg { animation: bounce 2s infinite; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 0.6; } }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* =========================================================
   Section heading
   ========================================================= */
.percy-heading { margin-bottom: 4rem; }
.percy-heading__title {
  font-size: clamp(2.25rem, 4vw, 3rem);
  margin-bottom: 1rem;
}
.percy-heading__subtitle {
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--stone-500);
  max-width: 640px;
  line-height: 1.6;
}
.percy-heading__subtitle--wide { max-width: none; }
.percy-heading__rule {
  width: 80px;
  height: 1px;
  background: var(--green-soft);
  margin-top: 2rem;
}
.percy-heading--light .percy-heading__title { color: var(--white); }
.percy-heading--light .percy-heading__subtitle { color: rgba(255,255,255,0.7); }
.percy-heading--light .percy-heading__rule { background: rgba(255,255,255,0.3); }

/* =========================================================
   Edito
   ========================================================= */
.percy-edito { padding: 6rem 1.5rem; }
.percy-edito__grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  align-items: center;
}
.percy-edito__text p {
  color: var(--stone-600);
  font-weight: 300;
  line-height: 1.75;
  margin: 0 0 1.5rem;
}
.percy-edito__media {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}
.percy-edito__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.percy-edito__quote {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  max-width: 280px;
  padding: 1.5rem;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--stone-600);
  line-height: 1.5;
}

@media (min-width: 768px) {
  .percy-edito__grid { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   Chroniques
   ========================================================= */
.percy-chroniques {
  padding: 6rem 0;
  background: var(--stone-100);
}
.percy-chroniques__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
.percy-card {
  background: var(--white);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: box-shadow 0.5s var(--ease), transform 0.5s var(--ease);
}
.percy-card:hover {
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
  transform: translateY(-4px);
}
.percy-card__media {
  height: 260px;
  overflow: hidden;
}
.percy-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.percy-card:hover .percy-card__media img { transform: scale(1.08); }
.percy-card__body { padding: 2rem; }
.percy-card__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--stone-100);
  color: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.percy-card h3 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}
.percy-card p {
  color: var(--stone-500);
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.7;
  margin: 0;
}

@media (min-width: 768px) {
  .percy-chroniques__grid { grid-template-columns: repeat(3, 1fr); }
}

/* =========================================================
   Initiatives
   ========================================================= */
.percy-initiatives {
  padding: 6rem 1.5rem;
  overflow: hidden;
}
.percy-initiatives__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  align-items: center;
}
.percy-initiatives__collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.percy-initiatives__col { display: flex; flex-direction: column; gap: 1rem; }
.percy-initiatives__col--offset { padding-top: 2rem; }
.percy-initiatives__collage img {
  width: 100%;
  border-radius: 1rem;
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.percy-feature {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.percy-feature__icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: rgba(250,250,249,1);
  border: 1px solid var(--stone-200);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}
.percy-feature h4 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--stone-900);
}
.percy-feature p {
  margin: 0;
  color: var(--stone-500);
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .percy-initiatives__inner { grid-template-columns: 1fr 1fr; }
  .percy-initiatives__collage-wrap { order: 1; }
  .percy-initiatives__content { order: 2; }
}

/* =========================================================
   Réseau
   ========================================================= */
.percy-reseau {
  padding: 6rem 0;
  background: var(--green);
  color: var(--white);
}
.percy-reseau__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
.percy-reseau h4 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.percy-reseau ul li {
  padding: 0.5rem 0;
  font-size: 0.95rem;
  font-weight: 300;
  color: rgba(255,255,255,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.percy-reseau ul li:last-child { border-bottom: 0; }

@media (min-width: 768px) {
  .percy-reseau__grid { grid-template-columns: 1fr 1fr; gap: 4rem; }
}

/* =========================================================
   Footer
   ========================================================= */
.percy-footer {
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--stone-200);
  text-align: center;
}
.percy-footer p {
  color: var(--stone-400);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: 0;
}

/* =========================================================
   Utility — hide parent theme header/footer on front page
   (belt-and-braces; front-page.php already bypasses them)
   ========================================================= */
body.percy-home .site-header,
body.percy-home .site-footer,
body.percy-home .main-navigation,
body.percy-home #masthead,
body.percy-home #colophon { display: none !important; }
