/*
Theme Name: TDM Enfant
Theme URI:
Description: Thème enfant pour le blog Tour du Monde en Famille
Author: Toi
Template: twentytwentyfive
Version: 1.0.0
Text Domain: tdm-enfant
*/

/* =============================================
   VARIABLES — Aventure & Nature
   ============================================= */

:root {
  /* Palette lumineuse aventure */
  --fond:    #F7F9F4;          /* blanc végétal, lumineux           */
  --encre:   #1B2D22;          /* vert très sombre, lisible         */
  --foret:   #2D6A4F;          /* vert forêt — couleur principale   */
  --nuit:    #264653;          /* bleu-vert nuit / indigo profond   */
  --or:      #E9C46A;          /* or doux, accent chaud             */
  --corail:  #F4A261;          /* corail-saumon, accent vivant      */
  --vivid:   #1A936F;          /* vert vif, highlights              */
  --clair:   #E8F0E9;          /* gris-vert clair, fonds section    */
  --blanc:   #FFFFFF;
  --ombre:   rgba(27, 45, 34, 0.10);

  /* Aliases sémantiques (compatibilité avec le HTML existant) */
  --kraft:   var(--fond);
  --ocre:    var(--or);
  --terre:   var(--foret);
  --jungle:  var(--vivid);
  --ocean:   var(--nuit);
  --sable:   var(--clair);

  /* Typographie */
  --serif:  'Playfair Display', Georgia, serif;
  --sans:   'Lato', system-ui, sans-serif;
  --script: 'Caveat', cursive;           /* accents manuscrits     */

  /* Espacements */
  --gap-sm: 1rem;
  --gap-md: 2rem;
  --gap-lg: 4rem;

  /* Largeurs */
  --max-width:     1140px;
  --content-width: 760px;

  /* UI */
  --radius:       4px;
  --radius-lg:    12px;
  --shadow:       0 2px 14px var(--ombre);
  --shadow-hover: 0 8px 32px rgba(27, 45, 34, 0.18);
}

/* =============================================
   RESET & BASE
   ============================================= */

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background-color: var(--fond);
  /* Grille de carte très subtile, comme papier millimétré */
  background-image:
    linear-gradient(rgba(45, 106, 79, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 106, 79, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--encre);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.75;
  min-height: 100vh;
}

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

/* =============================================
   TYPOGRAPHIE
   ============================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  color: var(--encre);
  line-height: 1.2;
  margin-bottom: 0.5em;
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.2rem; }

p { margin-bottom: 1.2em; }

a {
  color: var(--foret);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
a:hover { color: var(--vivid); }

/* Note manuscrite style carnet */
.note-manuscrite {
  font-family: var(--script);
  font-size: 1.3em;
  color: var(--foret);
  line-height: 1.4;
}

blockquote {
  border-left: 3px solid var(--or);
  padding: 0.8em 1.4em;
  margin: 1.5em 0;
  font-style: italic;
  font-family: var(--serif);
  color: var(--foret);
  background: rgba(45, 106, 79, 0.05);
  border-radius: 0 var(--radius) var(--radius) 0;
  position: relative;
}
blockquote::before {
  content: '"';
  font-family: var(--script);
  font-size: 3rem;
  color: var(--or);
  position: absolute;
  top: -0.3em;
  left: 0.3em;
  opacity: 0.4;
  line-height: 1;
}

/* =============================================
   LAYOUT UTILITAIRES
   ============================================= */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gap-md);
}

.content-width {
  max-width: var(--content-width);
  margin: 0 auto;
}

.section { padding: var(--gap-lg) 0; }

/* Séparateur style tracé GPS */
.section-divider {
  border: none;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--foret) 0,
    var(--foret) 6px,
    transparent 6px,
    transparent 12px
  );
  opacity: 0.25;
  margin: 0;
}

/* =============================================
   HEADER
   ============================================= */

.site-header {
  background: var(--encre);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(27, 45, 34, 0.4);
  /* Légère texture de carte sur le header */
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Logo */
.site-logo {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 2px;
}
.site-logo .logo-main {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--or);
  letter-spacing: 0.02em;
}
.site-logo .logo-sub {
  font-family: var(--script);
  font-size: 0.85rem;
  color: var(--clair);
  opacity: 0.65;
  letter-spacing: 0.05em;
}

/* Navigation principale */
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.site-nav a {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--clair);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4em 0.9em;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--or);
  background: rgba(233, 196, 106, 0.12);
}

/* Lien Instagram — style badge */
.site-nav .nav-instagram a {
  color: var(--or);
  border: 1px solid rgba(233, 196, 106, 0.5);
  border-radius: 20px;
  padding: 0.35em 1em;
}
.site-nav .nav-instagram a:hover {
  background: var(--or);
  color: var(--encre);
  border-color: var(--or);
}

/* Burger mobile */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--clair);
  transition: all 0.3s;
}

/* =============================================
   HERO — GLOBE + FOND PHOTO ALÉATOIRE
   ============================================= */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--encre);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(27, 45, 34, 0.25) 0%,
    rgba(27, 45, 34, 0.45) 55%,
    rgba(27, 45, 34, 0.72) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: var(--gap-md);
}

.hero-content .hero-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.hero-content .hero-btns .btn {
  width: 100%;
  max-width: 280px;
  text-align: center;
}

/* Coordonnées GPS déco dans les coins du hero */
.hero::before,
.hero::after {
  position: absolute;
  font-family: var(--script);
  font-size: 0.85rem;
  color: var(--or);
  opacity: 0.4;
  z-index: 3;
  letter-spacing: 0.05em;
  pointer-events: none;
}
.hero::before {
  content: '↗ 45°N · 2°E';
  top: 1.2rem;
  left: 1.5rem;
}
.hero::after {
  content: '↙ 0° · 180°W';
  bottom: 1.2rem;
  right: 1.5rem;
}

/* Eyebrow manuscrit */
.hero-eyebrow {
  font-family: var(--script);
  font-size: 1.3rem;
  color: var(--or);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}

.hero h1 {
  font-family: var(--serif);
  color: var(--blanc);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  text-shadow: 0 2px 24px rgba(27, 45, 34, 0.6);
  margin-bottom: 0.4em;
}

.hero-subtitle {
  font-family: var(--sans);
  color: var(--clair);
  font-size: 1rem;
  opacity: 0.85;
  margin-bottom: 2rem;
}

.hero-scroll {
  margin-top: 2.5rem;
  font-family: var(--script);
  color: var(--or);
  font-size: 1rem;
  animation: bounce 2.2s ease-in-out infinite;
}
.hero-scroll::after {
  content: '';
  display: block;
  width: 1px;
  height: 40px;
  background: var(--or);
  margin: 0.4rem auto 0;
  opacity: 0.45;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* Globe canvas */
#globe-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  z-index: 2;
}

/* Tooltip pays survolé */
#globe-tooltip {
  position: fixed;
  background: var(--encre);
  color: var(--or);
  font-family: var(--script);
  font-size: 1.1rem;
  padding: 0.4em 1em;
  border: 1px solid rgba(233, 196, 106, 0.5);
  border-radius: var(--radius);
  pointer-events: none;
  z-index: 999;
  display: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(27,45,34,0.3);
}

/* =============================================
   SECTIONS — TITRES & INTROS
   ============================================= */

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--encre);
  margin-bottom: 0.3em;
  display: inline-block;
  position: relative;
}
/* Soulignement style tampon */
.section-title::after {
  content: '';
  display: block;
  width: 54px;
  height: 3px;
  background: var(--foret);
  margin-top: 0.4em;
  border-radius: 2px;
}

/* Numéro de section manuscrit */
.section-num {
  font-family: var(--script);
  font-size: 0.95rem;
  color: var(--foret);
  opacity: 0.55;
  display: block;
  margin-bottom: 0.2rem;
  letter-spacing: 0.06em;
}

.section-intro {
  color: var(--nuit);
  font-size: 0.95rem;
  margin-bottom: var(--gap-md);
  max-width: 560px;
  opacity: 0.8;
}

/* =============================================
   CARDS — STYLE CARNET DE VOYAGE
   ============================================= */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap-md);
}

.card {
  background: var(--blanc);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
  text-decoration: none;
  color: var(--encre);
  display: flex;
  flex-direction: column;
  /* Légère bordure verte qui évoque un rabat de carnet */
  border-left: 3px solid transparent;
}
.card:hover {
  transform: translateY(-5px) rotate(0.3deg);
  box-shadow: var(--shadow-hover);
  color: var(--encre);
  border-left-color: var(--foret);
}

.card-thumb {
  aspect-ratio: 4/3;
  background: var(--clair);
  overflow: hidden;
  position: relative;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}
.card:hover .card-thumb img {
  transform: scale(1.06);
}

/* Tampon pays sur la photo */
.card-country-stamp {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  background: var(--foret);
  color: var(--blanc);
  font-family: var(--script);
  font-size: 0.8rem;
  padding: 0.2em 0.6em;
  border-radius: 2px;
  transform: rotate(2deg);
  box-shadow: 0 2px 6px rgba(27,45,34,0.3);
}

.card-body {
  padding: 1.2rem 1.4rem 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Tags style étiquette / tampon */
.card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.card-tag {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.2em 0.65em;
  border-radius: 2px;
  border: 1px dashed currentColor;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.card-tag:hover { opacity: 1; }

.card-tag.tag-pays      { color: var(--nuit);   border-color: var(--nuit); }
.card-tag.tag-cuisine   { color: var(--corail);  border-color: var(--corail); }
.card-tag.tag-jeux      { color: var(--vivid);   border-color: var(--vivid); }
.card-tag.tag-transport { color: var(--foret);   border-color: var(--foret); }
.card-tag.tag-bonsplans { color: var(--vivid);   border-color: var(--vivid); }
.card-tag.tag-ecole     { color: var(--nuit);    border-color: var(--nuit); }

.card h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin-bottom: 0.3em;
  flex: 1;
  color: var(--encre);
}

/* Date manuscrite */
.card-meta {
  font-family: var(--script);
  font-size: 0.9rem;
  color: var(--foret);
  opacity: 0.65;
  margin-top: 0.8rem;
}

/* =============================================
   THÉMATIQUES — BADGES EXPLORATEUR
   ============================================= */

.thematiques {
  background: var(--encre);
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 32px 32px;
}
.thematiques .section-title { color: var(--blanc); }
.thematiques .section-intro { color: var(--clair); }
.thematiques .section-num   { color: var(--or); }

.thematiques-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.thematique-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--clair);
  padding: 1.4rem 1.6rem;
  /* Style badge hexagonal simulé avec border */
  border: 2px solid rgba(233, 196, 106, 0.25);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  min-width: 110px;
  text-align: center;
  transition: all 0.22s;
  position: relative;
  overflow: hidden;
}
.thematique-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--foret);
  opacity: 0;
  transition: opacity 0.22s;
}
.thematique-item:hover {
  border-color: var(--or);
  transform: translateY(-4px);
  color: var(--blanc);
}
.thematique-item:hover::before { opacity: 1; }

.thematique-icon {
  font-size: 2rem;
  line-height: 1;
  position: relative;
  z-index: 1;
}
.thematique-label {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* =============================================
   SECTION PAYS
   ============================================= */

.section-pays {
  background: var(--clair);
}

/* =============================================
   BANDEAU INSTAGRAM
   ============================================= */

.instagram-bandeau {
  background: var(--foret);
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 30px,
      rgba(255,255,255,0.025) 30px,
      rgba(255,255,255,0.025) 31px
    );
  padding: var(--gap-lg) 0;
  text-align: center;
}

.instagram-bandeau h2 {
  color: var(--blanc);
  margin-bottom: 0.5rem;
}

.instagram-bandeau p {
  color: var(--clair);
  opacity: 0.85;
  margin-bottom: var(--gap-md);
  font-size: 0.95rem;
}

.instagram-lock-icon {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
  display: block;
}

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

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.8em 2.2em;
  border-radius: 3px;
  text-decoration: none;
  transition: all 0.22s;
  cursor: pointer;
}

.btn-foret {
  background: var(--foret);
  color: var(--blanc);
  border: 2px solid var(--foret);
}
.btn-foret:hover {
  background: var(--vivid);
  border-color: var(--vivid);
  color: var(--blanc);
}

/* Alias pour les occurrences existantes */
.btn-ocre {
  background: var(--or);
  color: var(--encre);
  border: 2px solid var(--or);
}
.btn-ocre:hover {
  background: transparent;
  color: var(--or);
}

.btn-outline {
  background: transparent;
  color: var(--clair);
  border: 2px solid rgba(232, 240, 233, 0.35);
}
.btn-outline:hover {
  border-color: var(--or);
  color: var(--or);
}

.btn-blanc {
  background: var(--blanc);
  color: var(--foret);
  border: 2px solid var(--blanc);
}
.btn-blanc:hover {
  background: transparent;
  color: var(--blanc);
}

/* =============================================
   FOOTER
   ============================================= */

.site-footer {
  background: var(--encre);
  color: var(--clair);
  padding: var(--gap-md) 0;
  text-align: center;
  font-size: 0.85rem;
  border-top: 3px solid var(--foret);
}
.site-footer a {
  color: var(--or);
}
.site-footer a:hover {
  color: var(--vivid);
}

/* =============================================
   ARTICLES — CARNETS DE BORD
   ============================================= */

.single-carnet .entry-header {
  padding: var(--gap-lg) 0 var(--gap-md);
  max-width: var(--content-width);
  margin: 0 auto;
  text-align: center;
}

.entry-meta-tags {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--gap-sm);
}

.entry-date {
  font-family: var(--script);
  color: var(--foret);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.entry-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--gap-md) var(--gap-lg);
}
.entry-content p { margin-bottom: 1.4em; }

/* Galeries inline dans les carnets */
.gallery-inline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin: var(--gap-md) 0;
}
.gallery-inline img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}
.gallery-inline img:hover {
  transform: scale(1.02);
  opacity: 0.92;
}

/* Video embed responsive */
.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: var(--gap-md) 0;
  border-radius: var(--radius);
}
.video-embed iframe,
.video-embed video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
  :root {
    --gap-lg: 2.5rem;
    --gap-md: 1.2rem;
  }

  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--encre);
    padding: 1rem 0 1.5rem;
    border-top: 1px solid rgba(233, 196, 106, 0.2);
  }
  .site-nav.open { display: block; }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
    padding: 0 var(--gap-md);
  }
  .site-nav li { width: 100%; }
  .site-nav a {
    display: block;
    padding: 0.7em 0;
    font-size: 1rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

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

  .thematiques-grid { gap: 0.6rem; }
  .thematique-item  { min-width: 85px; padding: 1rem; }

  .hero::before,
  .hero::after { display: none; }

  /* boutons hero déjà gérés globalement via .hero-btns */
}
