/* Import CSS variables (non-color) */
@import "variables.css";

/*
 * Main stylesheet — mobile base styles.
 * Colors are injected by PHP (Ag_Colors) via wp_head.
 * Responsive overrides: main.tablet.css (min-width: 601px), main.desktop.css (min-width: 901px)
 */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== VIEW TRANSITIONS API (MPA) ========== */
/*
 * Opt-in to cross-document view transitions.
 * Chrome 111+, Edge 111+, Safari 18.2+.
 * Graceful degradation: unsupported browsers simply show instant page loads.
 */
@view-transition {
  navigation: auto;
}

/* Page sortante : fade out + glisse vers le bas */
::view-transition-old(root) {
  animation: ag-fade-out-down 0.25s ease-in forwards;
}

/* Page entrante : fade in + remonte vers sa position */
::view-transition-new(root) {
  animation: ag-fade-in-up 0.3s ease-out forwards;
}

@keyframes ag-fade-out-down {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(15px);
  }
}

@keyframes ag-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Accessibilité : désactiver les animations si l'utilisateur le préfère */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* ========== HEADER ========== */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  backdrop-filter: blur(12px);
  background: rgba(250, 250, 248, 0.95);
}

.header-top {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 16px 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.masthead {
  text-align: center;
}

.masthead h1,
.masthead .site-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.7rem;
  font-weight: 400;
  color: var(--burgundy-dark);
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.masthead .tagline {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 4px;
  font-weight: 400;
}

.header-divider {
  width: 60px;
  height: 1px;
  background: var(--burgundy);
  margin: 0 auto;
  opacity: 0.4;
  margin-top: 8px;
}

/* Search */
.search-wrapper {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-light);
  transition: color var(--transition);
}

.search-toggle:hover {
  color: var(--burgundy);
}

.search-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

.search-input {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  padding: 0;
  border: none;
  border-bottom: 1.5px solid var(--burgundy);
  background: transparent;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), padding 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  opacity: 0;
}

.search-input.active {
  width: calc(100vw - 120px);
  padding: 6px 4px;
  opacity: 1;
}

/* Hide masthead when search is active */
.header-top.search-active .masthead {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.header-top .masthead {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* ========== HAMBURGER MENU ========== */
.hamburger-btn {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--burgundy);
  flex-shrink: 0;
}

.hamburger-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(250, 250, 248, 0.98);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.open {
  display: flex;
  opacity: 1;
}

.mobile-menu-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

.mobile-menu-close svg {
  width: 28px;
  height: 28px;
  display: block;
}

.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.mobile-menu-nav a {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  color: var(--burgundy-dark);
  text-decoration: none;
  transition: color var(--transition);
  position: relative;
}

.mobile-menu-nav a:hover {
  color: var(--burgundy);
}

.mobile-menu-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1.5px;
  background: var(--burgundy);
  transition: width var(--transition);
}

.mobile-menu-nav a:hover::after {
  width: 100%;
}

/* Navigation */
.nav-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-bar nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 8px 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-bar nav::-webkit-scrollbar {
  display: none;
}

.nav-bar nav a {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 3px;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
}

.nav-bar nav a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1.5px;
  background: var(--burgundy);
  transition: width var(--transition);
}

.nav-bar nav a:hover {
  color: var(--burgundy);
}

.nav-bar nav a:hover::after {
  width: 60%;
}

/* Scroll animation */
.animate-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--burgundy-dark);
  color: rgba(255,255,255,0.85);
  padding: 60px 24px 32px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.footer-col h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: #fff;
  margin-bottom: 16px;
}

.footer-col p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.65);
}

.footer-social {
  display: flex;
  gap: 14px;
  margin-top: 12px;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: all var(--transition);
}

.footer-social a:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}

.footer-social a svg {
  width: 18px;
  height: 18px;
}

.push-cta-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 24px;
  background: var(--accent-gold);
  color: var(--burgundy-dark);
  border: none;
  border-radius: var(--radius);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition);
}

.push-cta-btn:hover {
  background: #d4b478;
}

.footer-links a {
  display: block;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 8px;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.12);
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
}

/* ========== WORDPRESS NAV MENU RESETS ========== */
/* Reset list styles on WordPress-generated nav menus */
.mobile-menu-nav .mobile-menu-nav__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 0;
}

.mobile-menu-nav .mobile-menu-nav__list li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-bar nav > ul,
.nav-bar nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-bar nav ul li {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Footer links list reset */
.footer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links ul li {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Site name in header link reset */
.masthead a {
  text-decoration: none;
  color: inherit;
}

/* No-posts message */
.no-posts {
  color: var(--text-light);
  font-size: 1rem;
  padding: 2rem;
}
