/* --------------------------------------------------------------------------
   File: style-header.css
   Child Theme: Hello Elementor Cuzgow v1.1.0
   Template: hello-elementor
   Theme URI: https://github.com/cuzgow/hello-elementor-cuzgow
   Author: Cuzgow
   Author URI: https://cuzgow.com/
   Description: Header‑specific styles for the Hello Elementor Cuzgow child theme,
                optimized for Web Performance and scalability.
   Version: 1.1.0
   Requires at least: 6.0
   Tested up to:      6.5
   Requires PHP:      8.1
   License: GNU General Public License v3 or later
   License URI: https://www.gnu.org/licenses/gpl-3.0.html
   Text Domain: hello-elementor-cuzgow
------------------------------------------------------------------------- */

/* Header 
------------------------------------------------------------
------------------------------------------------------------ */
.siteHeader{
	width: 100%;
	position: sticky;         /* Makes the header sticky */
	top: 0;                   /* Sticks to the top of the viewport */
	z-index: 9999;            /* Ensures it's above other content */
  display:grid;
  grid-template-columns: minmax(10px, 1fr) 3fr;
  column-gap: 2em;
  align-items: center;
  align-content: center;
  grid-auto-flow: row;
  font-family: var(--font-family-headings);
	font-size: 1.1em; 
	background: hsla(var(--brand-hue), var(--brand-saturation), 98%, 0.85); /* transparency for glass effect */
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 0 0 .3em .3em;
	padding-inline: 10vw;
  padding-block: max(2%, 20px);
}

@media only screen and (max-width: 1024px){
	.siteHeader{
		padding-inline: 8vw;
	}
}


@media only screen and (max-width: 600px){
	.siteHeader{
		padding-inline: min(1.6rem, 5vw);
	}
}


/* reset del <a> normal 
------------------------ */
.siteHeader a{
	padding: 	0;
	text-shadow: var(--text-shadow-light);
	color: var(--text-dark-2);/* adapt to website */
}

/* Area logo
-----------------------------------------------------
----------------------------------------------------- */
.areaLogo{
  max-width: 100%;
  display: flex;
  flex-flow: row nowrap;
  justify-content: flex-start;
  align-items: center;
	margin: 0;
	padding: 0;
}

/* Reset <a>
   "display: contents" removes the <a> box from the layout tree,
   so the Flexbox parent (.areaLogo) aligns the <img> directly. 
----------------- */
.areaLogo a{
	display: contents;
}
 
/* Tamaño del logo
	* ajustar a cada web
---------------------------- */ 
.siteHeader img.custom-logo{
	max-height: 50px;
  width: auto;
	height: auto;
	display: block;
}

/* Fin area logo */ 

/* Area Menu
-----------------------------------------------------
----------------------------------------------------- */

.areaMenu{
  max-width: 100%;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-orient: horizontal;
	-webkit-box-direction: normal;
	-ms-flex-flow: row nowrap;
	flex-flow: row nowrap;
	-webkit-box-pack: center;
	-ms-flex-pack: center;
	justify-content: center;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	margin: 0;
	padding: 0;
	justify-self: end;

}
/* for aria label purpouse */
.areaMenu button.hamburger .visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap; /* Prevents text from affecting layout */
}

/* Hamburger Button (Hidden on Desktop)
----------------------------------------------------- */
.areaMenu button.hamburger {
  /* Layout & Visibility */
  display: none;             /* Hides completely on desktop */
  position: relative;
  z-index: 500;
  
  /* Flexbox Centering */
  flex-flow: column nowrap;
  justify-content: center;
  align-items: center;
  gap: 0;

  /* Sizing (Touch Target) */
  width: max(8vw, 5em);      /* Ensures large clickable area */
  height: max(8vw, 5em);
  padding: 1em;
  margin: 0;
  
  /* Visuals */
  background: transparent;
  border: none;
  border-radius: .5em;
  color: var(--brand-color);
  
  /* Typography */
  font-size: var(--font-size-p); /* Logic: overrides 1.57rem if var exists */
  
  /* Interaction */
  cursor: pointer;           /* UX: Shows it's clickable */
  touch-action: manipulation; /* Optimizes touch response */

	transform: none;
}


.areaMenu button.hamburger:focus,
.areaMenu button.hamburger:hover{

}
/* Accessibility: Focus States
   FIX: Never use "outline: none" without replacement.
   :focus-visible ensures outline appears ONLY for keyboard navigation,
   keeping it clean for mouse clicks.
----------------------------------------------------- */

.areaMenu button.hamburger:focus {
  outline: none; /* Fallback */
}

.areaMenu button.hamburger:focus-visible {
  outline: 2px solid var(--brand-color);
  outline-offset: 2px;
}


/* Hamburger Lines (Central Line) */
.areaMenu span.hamburger-lines{
  position: absolute;
  width: 2.2em;
  height: 0.5em;
  background-color: var(--brand-color);
  border-radius: 0.2em;
}

/* Top & Bottom Lines (Pseudo-elements) */
.areaMenu span.hamburger-lines::before,
.areaMenu span.hamburger-lines::after{
	content: "";
  display: block;
  position: absolute;
  width: 2.2em;
  height: 0.5em;
  background-color: var(--brand-color);
  border-radius: 0.2em;
  left: 0; /* Ensures alignment */
}

.areaMenu span.hamburger-lines::before {
  top: -10px;
}

.areaMenu span.hamburger-lines::after {
  top: 10px;
}


/* Nav Menu (Desktop)
----------------------------- */
.menuInicio {
  /* We keep flex: 1 here because the menu SHOULD fill the space 
     next to the logo to push links to the far right. */
  flex: 1 1 auto;
  max-width: 100%;
}

.menuInicio ul {
  display: flex;
  flex-flow: row nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 1em; /* Increased slightly for better "white space" balance */
  margin: 0;
  padding: 0;
  list-style: none; /* Core reset for nav menus */
}


.menuInicio li::before{
	display: none;
	content: none;
	padding: 0;
	margin: 0;
}

.menuInicio li{
	padding: 0;
	margin: 0;
}

/* Social Icons
-------------------------------------- */
.menuInicio svg{
	width: 1.1em;
	height: 1.1em;
	vertical-align: top;
}

/* Flags WPML 
--------------------------------------- */
.menuInicio li:last-of-type a:first-of-type {
	margin-inline-end: .5em;
}

.menuInicio a.wpml-lang-link img {
  width: 1.4em;
  height: auto; /* Ensures aspect ratio is maintained during load */
  display: inline-block;
}

.menuInicio li:last-of-type img{
}


/* Media queries
----------------------------------------------------------
---------------------------------------------------------- */
@media only screen and (max-width: 1024px){

	.siteHeader{
		grid-template-columns: repeat(2, minmax(10px, 1fr));
		justify-items: end;
		padding-block: 0;
	}

	.siteHeader a{
		color: var(--text-light);
		text-shadow: var(--text-shadow-dark);
	}

	.areaMenu{
		flex-flow: column nowrap;
		justify-content: center;
	}

	/* Hamburger Toggle */
  .areaMenu button.hamburger {
    display: flex; /* Overrides display: none */
    visibility: visible;
    touch-action: none;
  }

/* Para convertir la hamburguesa en X cuando se activa 
 --------------------------------------------------------- */

/* 1. Base State - Transitions go HERE for bi-directional animation */
.areaMenu span.hamburger-lines,
.areaMenu span.hamburger-lines::before,
.areaMenu span.hamburger-lines::after {
  transition: transform 0.3s ease, background-color 0.3s ease, opacity 0.3s ease;
}

/* 2. Active State (The X) */
.areaMenu button.hamburger[aria-expanded=true] span.hamburger-lines {
  transform: rotate(45deg);
  background-color: var(--color-sat-5);
}

.areaMenu button.hamburger[aria-expanded=true] span.hamburger-lines::before{
	opacity: 0;
	
}

.areaMenu button.hamburger[aria-expanded=true] span.hamburger-lines::after {
  /* Kept your 270deg for the "spinning" effect you like */
  transform: rotate(270deg) translateX(9px); 
  background-color: var(--color-sat-5);
}
/* Fin hamburguesa en X */


/* Mobile Menu Container (Hidden state) */
.areaMenu .menuInicio {
  display: none;
  visibility: hidden; /* Double safety */
}

.areaMenu .menuInicio.menu-open{
	display: block;
	visibility: visible;
	width: 70%;      /* Slightly wider for better readability */
	min-height: 100vh;
	position: absolute;
	left: 0%;
	top:0%;
	z-index: 99;
	background: linear-gradient(
		to right top,
		hsla(var(--brand-hue), var(--brand-saturation), 22%),
		hsla(var(--brand-hue), var(--brand-saturation), 34%),
		hsla(var(--brand-hue), var(--brand-saturation), 46%)
	);	
	margin: 0;
	padding-inline: 8vw; /* Revisar media query 600px */
	animation: slideIn .8s ease forwards;
}

/* Slide-in Keyframes */
@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}


/* List Styling inside Mobile Menu */
.areaMenu nav.menuInicio ul {
  max-width: 100%;
  flex-flow: column nowrap;
  align-items: flex-start; /* Left-aligned usually feels better for mobile lists */
  justify-content: flex-start;
  padding: 0;
}

.areaMenu .menuInicio li {
  width: 100%;
  list-style: none;
}

/* Vertical Spacing */
.areaMenu .menuInicio.menu-open li:first-child {
  margin-block-start: max(15vh, 80px); /* Responsive top gap */
}

.areaMenu .menuInicio.menu-open li{
	padding-block-end: .8em;
	font-size: 1.08em;
	border-bottom: 1px solid rgba(255,255,255,0.1); /* Subtle separator */
}

/* Para fijar el menú (div.menu-principal-container) 
** cuando se abre en versión mobile 
** Esta clase se añade al body al pulsar sobre el menu
*/
body.lock-scrolling {
	position: fixed;
  width: 100%;
}

}

/* Media query mobile
----------------------------------- 
*/
@media only screen and (max-width: 600px){


	.areaMenu .hamburger-lines::after{
		top: 																					9px;
	}

	.areaMenu .menuInicio.menu-open{
		padding-inline: 															min(1.6rem, 5vw);
	}

	/* Flags WPML 
	--------------------------------------- */
	.menuInicio li:last-of-type a:first-of-type {
		margin-inline-end:0;
	}
	.menuInicio a.wpml-lang-link img{
		width: 1.5em;
	}
	
	/* social icons */
	.menuInicio svg {
	width: 1.1em;
	height: 1.1em;
	vertical-align: top;
	fill: var(--color-light-1);
	}
}