/*
Theme Name:   Mourèze
Theme URI:    https://moureze.fr
Description:  Thème bloc natif (FSE) — Commune de Mourèze
Version:      0.1.0
Requires at least: 6.6
Requires PHP: 8.4
Text Domain:  moureze
*/

/* Bilingual navigation */
.pll-nav {
  display: inline-flex;
  align-items: center;
}
.pll-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.pll-nav li {
  display: flex;
  align-items: center;
}
.pll-nav a {
  display: block;
  padding: 0.25rem 0.75rem;
  color: var(--wp--preset--color--base, #fff);
  text-decoration: none;
  font-size: var(--wp--preset--font-size--sm, 0.875rem);
  white-space: nowrap;
}
.pll-nav a:hover {
  color: var(--wp--preset--color--green-light, #B4CEAF);
}
/* Show only one nav based on page language */
body.lang-en .pll-nav-fr { display: none !important; }
body.lang-fr  .pll-nav-en { display: none !important; }

/* Bilingual page sections (front-page template) */
body.lang-en .pll-section-fr { display: none !important; }
body.lang-fr  .pll-section-en { display: none !important; }

/* Header layout */
.header-logo-link { display: inline-flex; align-items: center; }
.header-logo { display: block; height: auto; }

.site-header-row { width: 100%; }
/* Logo group stretches to fill available width → switcher + hamburger s'alignent à droite */
.site-header-row > .wp-block-group { flex: 1 1 auto; }

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--wp--preset--color--base, #fff);
}

.header-search-form {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.header-search-input {
  width: 8rem;
  min-width: 0;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--wp--preset--color--green-light, #B4CEAF);
  border-radius: 4px;
  background: var(--wp--preset--color--base, #fff);
  color: var(--wp--preset--color--contrast, #1A2820);
}
.header-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--wp--preset--color--base, #fff);
  cursor: pointer;
  padding: 0.25rem;
}

/* Mobile nav: collapse links behind a hamburger toggle */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: var(--wp--preset--spacing--sm, 1rem);
    text-align: center;
  }
  .site-nav.is-open { display: flex; }

  .pll-nav { display: flex; width: 100%; }
  .pll-nav ul { flex-direction: column; width: 100%; align-items: center; gap: 0; }
  .pll-nav li { width: 100%; }
  .pll-nav a { width: 100%; padding: 0.6rem 0; text-align: center; }

  .site-nav .header-search-form {
    width: 100%;
    margin-top: var(--wp--preset--spacing--sm, 1rem);
  }
  .site-nav .header-search-input { flex: 1 1 auto; width: auto; }
}
