/*
Theme Name:   GlobeCapture
Theme URI:    https://globecapture.local
Description:  Thème enfant de Neve pour GlobeCapture — Portfolio photographe voyage
Author:       GlobeCapture
Template:     neve
Version:      1.0.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  neve-globecapture
*/

/* ============================================================
   IMPORTS GOOGLE FONTS — Cormorant Garamond + Inter
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Inter:wght@200;300;400;500&display=swap');

/* ============================================================
   VARIABLES GLOBALES
   ============================================================ */
:root {
  --gc-white:       #ffffff;
  --gc-black:       #1a1a1a;
  --gc-gray:        #6b6b6b;
  --gc-light-gray:  #f5f5f5;
  --gc-border:      #e8e8e8;
  --gc-font-serif:  'Cormorant Garamond', Georgia, serif;
  --gc-font-sans:   'Inter', -apple-system, sans-serif;
}

/* ============================================================
   BASE TYPOGRAPHIE
   ============================================================ */
body {
  font-family: var(--gc-font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--gc-black);
  background-color: var(--gc-white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--gc-font-serif);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--gc-black);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }

p {
  font-family: var(--gc-font-sans);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--gc-gray);
}

a {
  color: var(--gc-black);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.6;
}

/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */
.nv-nav-wrapper,
.header-main-inner {
  background-color: var(--gc-white) !important;
  border-bottom: 1px solid var(--gc-border);
}

/* Alignement menu à gauche dans son slot */
.hfg-slot.left .nav-menu-primary,
.hfg-slot.left .nv-nav-wrap,
.hfg-slot.left ul.nav-ul {
  justify-content: flex-start !important;
}

/* Logo : Globe Capture */
.site-logo a.brand {
  font-family: var(--gc-font-serif) !important;
  font-size: 1.7rem !important;
  font-weight: 400 !important;
  font-style: normal;
  letter-spacing: 0.08em;
  color: var(--gc-black) !important;
  text-decoration: none;
  line-height: 1;
}

.site-logo .site-title {
  font-family: var(--gc-font-serif);
  font-size: 1.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--gc-black);
  margin: 0;
}

/* Masquer la tagline dans le header */
.site-logo small,
.site-logo .site-description {
  display: none;
}

/* Menu principal */
.nv-nav-wrapper ul.nav-menu > li > a,
.nv-nav-wrapper .nav-menu-item > a {
  font-family: var(--gc-font-sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gc-black) !important;
  padding: 0.5rem 1rem;
}

.nv-nav-wrapper ul.nav-menu > li > a:hover {
  color: var(--gc-gray) !important;
}

/* ============================================================
   HERO / COVER BLOCK
   ============================================================ */
.wp-block-cover {
  min-height: 100vh !important;
  min-height: 100dvh !important; /* iOS Safari 15.4+ : exclut la barre d'adresse */
}

.wp-block-cover__inner-container h1,
.wp-block-cover__inner-container h2 {
  color: var(--gc-white);
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  font-weight: 300;
}

.wp-block-cover__inner-container p {
  color: rgba(255,255,255,0.85);
  font-family: var(--gc-font-sans);
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ============================================================
   EN-TÊTE DE PAGE (Portfolio, Catégorie, Post)
   ============================================================ */
.gc-page-header {
  text-align: center;
  padding: 5rem 2rem 3rem;
  max-width: 700px;
  margin: 0 auto;
}

.gc-page-header .section-subtitle {
  margin-bottom: 0.75rem;
}

.gc-page-header .section-subtitle a {
  color: var(--gc-gray);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.gc-page-header .section-subtitle a:hover {
  color: var(--gc-black);
  opacity: 1;
}

.gc-category-preamble {
  max-width: 680px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
  color: var(--gc-gray);
  font-size: 1rem;
  line-height: 1.85;
  text-align: center;
  font-style: italic;
}

.gc-category-preamble p {
  margin-bottom: 1em;
}

.gc-category-description {
  color: var(--gc-gray);
  font-size: 0.95rem;
  max-width: 520px;
  margin: 0.75rem auto 0;
}

/* ============================================================
   GRILLE DESTINATIONS (Portfolio + Home)
   ============================================================ */
.gc-destinations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

.gc-destinations-home {
  margin-top: 2rem;
}

.gc-destination-card {
  display: block;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  background-color: var(--gc-light-gray);
  aspect-ratio: 3 / 2;
}

.gc-destination-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}

.gc-destination-placeholder {
  width: 100%;
  height: 100%;
  background-color: var(--gc-light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gc-destination-card:hover .gc-destination-image {
  transform: scale(1.05);
}

.gc-destination-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 60%);
}

/* Gradient au survol : on anime l'opacité du ::after plutôt que le background
   (les gradients ne peuvent pas être interpolés par le navigateur) */
.gc-destination-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.05) 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gc-destination-card:hover .gc-destination-overlay::after {
  opacity: 1;
}

/* Les textes doivent passer au-dessus du ::after */
.gc-destination-name,
.gc-destination-count {
  position: relative;
  z-index: 1;
}

.gc-destination-name {
  font-family: var(--gc-font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--gc-white);
  margin: 0;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.gc-destination-count {
  font-family: var(--gc-font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-top: 0.3rem;
}

/* ============================================================
   GRILLE POSTS PAR CATÉGORIE (category.php)
   ============================================================ */
.gc-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Variante compacte — 4 colonnes, aperçu miniature */
.gc-posts-grid--compact {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-width: 1200px;
  padding: 0 2rem;
}

.gc-post-card--compact {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background-color: var(--gc-light-gray);
}

/* Le lien occupe tout l'espace de la carte */
.gc-post-thumb-link {
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
}

/* L'image remplit le lien — on force height pour contrer height:auto de WordPress */
.gc-post-thumb-link img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.gc-post-thumb-placeholder {
  position: absolute;
  inset: 0;
  background-color: var(--gc-light-gray);
}

.gc-post-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gc-post-card--compact:hover .gc-post-thumb-overlay {
  opacity: 1;
}

.gc-post-card--compact:hover .gc-post-thumb-link img {
  transform: scale(1.04);
}

.gc-post-thumb-title {
  font-family: var(--gc-font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--gc-white);
  margin: 0;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ============================================================
   LISTE POSTS PAR CATÉGORIE (category.php)
   ============================================================ */
.gc-posts-list {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

.gc-post-entry {
  padding-bottom: 5rem;
  margin-bottom: 5rem;
  border-bottom: 1px solid var(--gc-border);
}

.gc-post-entry:last-child {
  border-bottom: none;
}

.gc-entry-image {
  width: 100%;
  margin-bottom: 2rem;
}

.gc-entry-image img {
  width: 100%;
  height: auto;
  display: block;
}

.gc-entry-title {
  font-family: var(--gc-font-serif);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--gc-black);
  margin: 0 0 1.25rem;
}

.gc-entry-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--gc-gray);
}

.gc-entry-content p {
  margin-bottom: 1rem;
}

/* ============================================================
   POST INDIVIDUEL (single.php)
   ============================================================ */
.gc-single-post {
  max-width: 100%;
}

.gc-single-hero {
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
}

.gc-single-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-height: 80vh;
}

.gc-single-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

.gc-single-header {
  margin-bottom: 2.5rem;
}

.gc-single-title {
  font-family: var(--gc-font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.2;
  margin: 0.5rem 0 0;
}

.gc-single-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--gc-gray);
}

.gc-single-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gc-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.gc-back-link {
  font-family: var(--gc-font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gc-gray);
}

.gc-back-link:hover {
  color: var(--gc-black);
  opacity: 1;
}

.gc-post-nav {
  display: flex;
  gap: 2rem;
  font-family: var(--gc-font-sans);
  font-size: 0.82rem;
}

.gc-nav-prev,
.gc-nav-next {
  color: var(--gc-gray);
}

.gc-nav-prev:hover,
.gc-nav-next:hover {
  color: var(--gc-black);
  opacity: 1;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.gc-pagination {
  max-width: 1200px;
  margin: 4rem auto 5rem;
  padding: 0 2rem;
  text-align: center;
}

.gc-pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gc-pagination .page-numbers {
  font-family: var(--gc-font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  padding: 0.5rem 1rem;
  color: var(--gc-gray);
  border: 1px solid var(--gc-border);
}

.gc-pagination .page-numbers.current,
.gc-pagination .page-numbers:hover {
  background-color: var(--gc-black);
  color: var(--gc-white);
  border-color: var(--gc-black);
  opacity: 1;
}

/* ============================================================
   MESSAGE VIDE
   ============================================================ */
.gc-empty-message {
  text-align: center;
  color: var(--gc-gray);
  font-size: 0.9rem;
  padding: 3rem 2rem;
}

/* ============================================================
   BOUTONS
   ============================================================ */
.wp-block-button__link,
.btn,
button[type="submit"],
.wpcf7-form input[type="submit"] {
  font-family: var(--gc-font-sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-radius: 0;
  padding: 0.9rem 2.5rem;
  background-color: var(--gc-black);
  color: var(--gc-white) !important;
  border: 1px solid var(--gc-black);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.wp-block-button__link:hover,
button[type="submit"]:hover,
.wpcf7-form input[type="submit"]:hover {
  background-color: var(--gc-white);
  color: var(--gc-black) !important;
}

/* Variante outline */
.wp-block-button.is-style-outline .wp-block-button__link {
  background-color: transparent;
  color: var(--gc-black) !important;
  border: 1px solid var(--gc-black);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background-color: var(--gc-black);
  color: var(--gc-white) !important;
}

/* ============================================================
   FORMULAIRE CONTACT (Contact Form 7)
   ============================================================ */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea {
  font-family: var(--gc-font-sans);
  font-size: 0.9rem;
  border: none;
  border-bottom: 1px solid var(--gc-border);
  border-radius: 0;
  padding: 0.75rem 0;
  width: 100%;
  background-color: transparent;
  color: var(--gc-black);
  outline: none;
  transition: border-color 0.2s ease;
}

.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form textarea:focus {
  border-bottom-color: var(--gc-black);
}

.wpcf7-form textarea {
  min-height: 120px;
  resize: none;
}

.wpcf7-form label {
  font-family: var(--gc-font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gc-gray);
  display: block;
  margin-bottom: 0.25rem;
}

.wpcf7-form input[type="submit"] {
  cursor: pointer;
  margin-top: 1.5rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background-color: var(--gc-black) !important;
  color: rgba(255,255,255,0.5) !important;
  padding: 2.5rem 0;
  font-family: var(--gc-font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-align: center;
}

.site-footer a {
  color: rgba(255,255,255,0.5) !important;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--gc-white) !important;
  opacity: 1;
}

/* ============================================================
   LAYOUT — SECTIONS
   ============================================================ */
.wp-block-group.alignfull,
.wp-block-cover.alignfull {
  padding-left: 0;
  padding-right: 0;
}

/* Espacement vertical entre sections */
.entry-content > * + * {
  margin-top: 5rem;
}

/* Titre de section centré */
.section-title {
  font-family: var(--gc-font-serif);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 400;
  text-align: center;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  color: var(--gc-black);
}

.section-subtitle {
  font-family: var(--gc-font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gc-gray);
  text-align: center;
  margin-bottom: 3rem;
}

/* ============================================================
   ANIMATIONS AU SCROLL (Intersection Observer)
   ============================================================ */

/* --- Fade + montée (titres, textes, cartes) --- */
.gc-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity  600ms ease-out,
    transform 600ms ease-out;
  will-change: opacity, transform;
}

.gc-entry-title.gc-reveal  { transition-duration: 500ms; transform: translateY(14px); }
.gc-entry-content.gc-reveal { transition-duration: 500ms; transform: translateY(14px); transition-delay: 80ms; }
.gc-destination-card.gc-reveal { transform: translateY(26px); transition-duration: 650ms; }

.gc-reveal.gc-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* --- Ouverture fenêtre (photos) --- */
/* L'image est masquée des deux côtés, comme deux volets fermés.
   On utilise @keyframes plutôt qu'une transition : l'animation démarre
   depuis le from défini dans les keyframes, indépendamment de l'état
   précédemment peint par le navigateur (plus fiable dans Chrome). */

@keyframes gc-window-open {
  from { clip-path: inset(0 50% 0 50%); }
  to   { clip-path: inset(0 0% 0 0%); }
}

.gc-reveal--window {
  opacity: 1 !important;      /* pas de fade, l'effet clip suffit */
  transform: none !important; /* pas de translate */
  will-change: clip-path;
  /* fill-mode: both → le 'from' s'applique immédiatement (état masqué).
     play-state: paused → on attend l'ajout de gc-revealed pour démarrer. */
  animation: gc-window-open 700ms cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-play-state: paused;
}

.gc-reveal--window.gc-revealed {
  animation-play-state: running;
}

/* Légère décélération de l'image intérieure pendant l'ouverture */
.gc-reveal--window img {
  transform: scale(1.04);
  transition: transform 900ms ease-out;
}

.gc-reveal--window.gc-revealed img {
  transform: scale(1);
}

/* Respect du mode "préférence réduite de mouvement" */
@media (prefers-reduced-motion: reduce) {
  .gc-reveal             { transition: opacity 300ms ease-out; transform: none; }
  .gc-reveal--window     { animation: none; clip-path: none !important; }
  .gc-reveal--window img { transition: none; transform: none; }
}

/* ============================================================
   ACCUEIL — HERO COVER
   Titre "Globe Capture" positionné en haut, taille éditoriale
   ============================================================ */

/* Masquer le titre de page "Accueil" (classe Neve) et supprimer l'espace résiduel */
.home .nv-page-title-wrap {
  display: none !important;
}

.home .nv-single-page-wrap {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Aligner le contenu interne en haut du cover */
.home .wp-block-cover.alignfull {
  align-items: flex-start !important;
}

.home .wp-block-cover__inner-container {
  padding-top: 4.5rem;
  width: 100%;
}

/* Titre principal : grand format éditorial */
.home .wp-block-cover h1.wp-block-heading {
  font-family: var(--gc-font-sans) !important;
  font-size: clamp(3rem, 6.5vw, 8rem) !important;
  font-weight: 200 !important;
  line-height: 1 !important;
  letter-spacing: 0.18em;
  margin-bottom: 2rem;
}

/* Tagline (sous-titre) : plus fin, légèrement espacé du titre */
.home .wp-block-cover p {
  margin-top: 1rem;
  letter-spacing: 0.35em;
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* ============================================================
   PAGE PORTFOLIO
   ============================================================ */
.page-template-portfolio .entry-title {
  display: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .wp-block-cover {
    min-height: 70vh !important;
    min-height: 70dvh !important;
  }

  .home .wp-block-cover__inner-container {
    padding-top: 3rem;
  }

  .home .wp-block-cover h1.wp-block-heading {
    font-size: clamp(2.5rem, 10vw, 4rem) !important;
    letter-spacing: 0.12em;
  }

  .entry-content > * + * {
    margin-top: 3rem;
  }

  .gc-destinations-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0 1rem 3rem;
  }

  .gc-posts-grid--compact {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 0 1rem;
  }

  .gc-single-content {
    padding: 2.5rem 1.5rem 4rem;
  }

  .gc-single-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
