/*
 Theme Name: Testwe Theme
 Theme URI: https://testwe.com
 Author: Testwe
 Author URI: https://testwe.com
 Description: Thème WordPress sur-mesure pour la vitrine Testwe, conçu pour fonctionner avec Elementor.
 Version: 0.1.0
 License: GNU General Public License v2 or later
 License URI: https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: testwe-theme
*/

/* Point d’entrée principal du CSS du thème.
   L’essentiel du layout sera géré par Elementor,
   mais on laisse ici la place pour la typographie globale,
   les variables CSS, etc. */

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
}

/* -------------------------------------------------------------------------- */
/* Header sticky inspiré du header Astro                                      */
/* -------------------------------------------------------------------------- */

.tw-header-spacer {
  height: 56px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.tw-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 1000;
  display: grid;
  grid-template-areas: "burger logo";
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f1f1f1; /* proche de --color-tw-tierce-4 */
  background-color: #ffffff;
  transition: transform 0.5s ease;
}

.tw-header[data-visible="false"] {
  transform: translateY(-100%);
}

.tw-header__burger {
  grid-area: burger;
  align-self: center;
  justify-self: flex-start;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #d5def5; /* proche de --color-tw-primary-3 */
  background-color: #ffffff;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.tw-header__burger span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background-color: #2c58ce; /* --color-tw-primary */
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.tw-header[data-mobile-open="true"] .tw-header__burger span:nth-child(1) {
  transform: translateY(3px) rotate(45deg);
}

.tw-header[data-mobile-open="true"] .tw-header__burger span:nth-child(2) {
  opacity: 0;
}

.tw-header[data-mobile-open="true"] .tw-header__burger span:nth-child(3) {
  transform: translateY(-3px) rotate(-45deg);
}

.tw-header__logo {
  grid-area: logo;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.tw-header__logo img {
  height: 32px; /* similaire à h-8 */
  width: auto;
  display: block;
}

.tw-header__menu {
  grid-area: menu;
}

.tw-header__logo-widget,
.tw-header__menu-widget {
  width: 100%;
}

.tw-header__menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tw-header__menu-list > li > a {
  text-decoration: none;
  color: #121212; /* proche de --color-tw-text */
  font-size: 0.95rem;
  font-weight: 500;
}

.tw-header__menu-list > li > a:hover,
.tw-header__menu-list > li > a:focus-visible {
  color: #2c58ce;
}

/* État mobile : menu ouvert/fermé */

.tw-header[data-mobile-open="false"] .tw-header__menu {
  display: none;
}

.tw-header[data-mobile-open="true"] {
  grid-template-areas:
    "burger logo"
    "menu menu"
    "login login";
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
}

.tw-header__login {
  grid-area: login;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tw-btn-ghost {
  border-radius: 999px;
  border: 1px solid #2c58ce;
  background-color: #ffffff;
  color: #2c58ce;
  padding: 0.5rem 1.5rem;
  font-size: 0.8rem;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tw-btn-ghost:hover,
.tw-btn-ghost:focus-visible {
  background-color: #2c58ce;
  color: #ffffff;
}

/* Desktop */

@media (min-width: 880px) {
  .tw-header-spacer {
    height: 72px;
  }

  .tw-header {
    padding-inline: 5rem; /* proche de md:px-20 */
    grid-template-areas: "logo menu login";
    grid-template-columns: auto 1fr auto;
  }

  .tw-header__burger {
    display: none;
  }

  .tw-header__menu {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .tw-header__menu-list {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
  }

  .tw-header__login {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
  }
}


