/*
Theme Name: Bidasoa Ecogestión
Author: Bidasoa Ecogestión
Description: Tema de una página con portada editable por secciones, carrusel y diseño de Bidasoa Ecogestión.
Version: 1.1.0
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: bidasoa-ecogestion
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

@font-face {
  font-family: Manrope;
  src: url("assets/manrope-variable.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  /* Paleta */
  --white: #fff;
  --paper: #f2f2f2;
  --tile: #e2e2e2;
  --ink: #1d1d1b;
  --muted: #494949;
  --line: #ccc;
  --control: #767676;
  --pine: #002c14;
  --forest: #015a2a;
  --leaf: #11a647;
  --lime: #D0F088;
  --shade: 17 22 23;
  --rule: 1px solid var(--line);

  /* Tipografía fluida */
  --type-scale: 1;
  --sans: Manrope, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --hero-size: calc(clamp(3.15rem, 5.28vw, 9.25rem) * var(--type-scale));
  --title: calc(clamp(2.5rem, 3.25vw, 6rem) * var(--type-scale));
  --lead: calc(clamp(1.9rem, 2.72vw, 4.8rem) * var(--type-scale));
  --subtitle: calc(clamp(1.65rem, 2.1vw, 3.3rem) * var(--type-scale));
  --card-title: calc(clamp(1.15rem, 1.65vw, 2.3rem) * var(--type-scale));
  --text: calc(clamp(1rem, 1.12vw, 1.38rem) * var(--type-scale));
  --small: calc(clamp(.875rem, 1.05vw, 1.25rem) * var(--type-scale));
  --label: calc(clamp(.78rem, .96vw, 1.32rem) * var(--type-scale));
  --tracking: -.065em;

  /* Composición */
  --edge: clamp(.65rem, 1.2vw, 2rem);
  --gap: clamp(.35rem, .58vw, .9rem);
  --space: clamp(5rem, 11.5vw, 17rem);
  --card-pad: clamp(1.2rem, 1.8vw, 2.8rem);
  --radius: .22rem;
  --motion-ease: cubic-bezier(.2, .74, .2, 1);
  --reveal-time: 720ms;
  --cursor-lime: url("assets/cursor-lima.svg") 10 10;
  --footer-text: color-mix(in srgb, var(--white) 70%, transparent);
  --hero-min: 31rem;
  --anchor-offset: clamp(5.5rem, 6.8vw, 9.5rem);

  font-family: var(--sans);
  font-weight: 450;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  scroll-behavior: smooth;
  scroll-padding-top: var(--anchor-offset);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body, figure, h1, h2, h3, p, dl, dd { margin: 0; }
body { font-size: var(--text); }
h1, h2, h3, strong { font-weight: 500; line-height: 1.18; }
img { display: block; width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .2em; }
button { font: inherit; color: inherit; padding: 0; border: 0; background: transparent; }
button, summary { cursor: pointer; }
button, a, summary { touch-action: manipulation; }
button:disabled { cursor: default; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--forest); outline-offset: 4px; }
:is(.hero, .image-banner, footer) :focus-visible { outline-color: var(--lime); }
main:focus, section[tabindex="-1"]:focus { outline: none; }
.sr-only, .sprite { position: absolute; overflow: hidden; }
.sr-only { width: 1px; height: 1px; clip-path: inset(50%); white-space: nowrap; }
.sprite { width: 0; height: 0; }
.icon, .drawing { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.icon { width: 1.1em; height: 1.1em; stroke-width: 1.6; flex: none; }
.skip-link { position: fixed; z-index: 30; inset: .8rem auto auto 1rem; padding: 1rem; background: var(--white); transform: translateY(-180%); }
.skip-link:focus { transform: none; }

/* Navegación y botones */
.masthead, .nav-contact { position: fixed; top: var(--edge); }
.masthead, #menu { display: flex; align-items: center; }
.masthead {
  z-index: 10; left: var(--edge); gap: clamp(1rem, 2vw, 2.7rem);
  min-height: clamp(3.35rem, 4.3vw, 5.45rem); padding: .53rem clamp(.95rem, 1.45vw, 2rem);
  background: var(--white); border-radius: var(--radius); box-shadow: 0 1px 4px rgb(var(--shade) / 8%);
}
.brand { flex: none; }
.brand img { width: clamp(5.7rem, 7.2vw, 10rem); }
#menu { gap: clamp(1rem, 1.7vw, 2.5rem); }
#menu a, .menu-toggle, .tag {
  text-transform: uppercase;
}

#menu a, .menu-toggle {
  font: 400 calc(var(--label) * 0.92)/1.2 var(--sans);
}

.tag {
  font: 400 var(--label)/1.2 var(--mono);
}#menu a { padding: .55em 0; }
#menu a, .button, address a { text-decoration: none; }
#menu a:is(:hover, [aria-current]) { text-decoration: underline var(--leaf); text-underline-offset: .34em; }
address a:hover { text-decoration: underline; }
.menu-toggle { display: none; }
.nav-contact { right: var(--edge); }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .65em;
  width: fit-content; min-height: 2.8rem; padding: .74em 1.05em; border-radius: var(--radius);
  font-weight: 500; line-height: 1.25; letter-spacing: -.035em; transition: background-color .2s;
}
.dark, footer { color: var(--white); background: var(--pine); }
.dark:hover { background: var(--forest); }
.action-mark, .gallery-tools button { display: grid; place-items: center; }
.action-mark { width: 1.32em; aspect-ratio: 1; border-radius: .1rem; background: var(--white); color: var(--ink); }
.action-mark .icon { width: .94em; height: .94em; }
.glass { margin-top: clamp(1.25rem, 1.9vw, 2.5rem); background: rgb(var(--shade) / 43%); backdrop-filter: blur(6px); }
.glass:hover { background: rgb(var(--shade) / 72%); }

/* Portada y fotografía panorámica */
.hero, .image-banner, .gallery-item { position: relative; isolation: isolate; overflow: hidden; color: var(--white); }
.hero, .image-banner, .numbers-cover { display: grid; place-items: center; text-align: center; }
.hero { background: var(--muted); }
.hero-slide { grid-area: 1 / 1; position: relative; isolation: isolate; width: 100%; min-height: var(--hero-min); min-height: max(var(--hero-min), 100svh); display: grid; place-items: center; padding: clamp(6.5rem, 10vw, 13rem) var(--edge); }
.hero-controls { position: absolute; z-index: 1; bottom: max(1.25rem, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: .4rem; padding: .25rem .5rem; border-radius: var(--radius); background: rgb(var(--shade) / 72%); }
.hero-controls button { min-width: 2.75rem; min-height: 2.75rem; display: grid; place-items: center; }
.hero-controls .rotation { padding-inline: .5rem; font-size: var(--small); }
.hero-position { font: 400 .875rem var(--mono); }
.hero-position b { font-weight: 500; }
.standard-header, .standard-page { padding: var(--card-pad) var(--edge); }
.standard-header { background: var(--white); }
.standard-header img { width: 8rem; }
.standard-page { min-height: 60vh; max-width: 76ch; margin: auto; }
.standard-page article { margin-block: 2rem; }
.standard-page h1, .standard-page h2 { margin-bottom: .75em; }
.standard-page p + p { margin-top: 1em; }
.admin-bar :is(.masthead, .nav-contact) { top: calc(var(--edge) + var(--wp-admin--admin-bar--height, 32px)); }

.hero-photo, .image-banner > img, .gallery-item img { height: 100%; object-fit: cover; }
.hero-photo, .image-banner > img { position: absolute; inset: 0; z-index: -3; }
.hero-photo { object-position: 58% 60%; }
.hero-slide::before, .image-banner::before, .gallery-item::after {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
}
.hero-slide::before { background: linear-gradient(rgb(var(--shade) / 41%), rgb(var(--shade) / 56%) 59%, rgb(var(--shade) / 33%)); }
.hero-copy { width: 100%; }
.hero .slide-heading, .statement, .section-title, .contact h2, .banner-copy h2 { font-weight: 450; letter-spacing: var(--tracking); }
.hero .slide-heading { font-size: var(--hero-size); line-height: 1.04; text-wrap: balance; }
.hero .slide-heading > .phrase-break, .number-grid strong { display: block; }
.hero-copy > p { max-width: 48ch; margin: clamp(.95rem, 1.65vw, 2.25rem) auto 0; font-size: calc(clamp(1rem, 1.25vw, 1.85rem) * var(--type-scale)); line-height: 1.38; letter-spacing: -.045em; }
.image-banner { min-height: clamp(24rem, 39vw, 54rem); padding: 4rem var(--edge); }
.image-banner > img { object-position: 50% 53%; }
.image-banner::before { background: rgb(var(--shade) / 55%); }
.banner-copy h2 { max-width: 21ch; font-size: var(--title); line-height: 1.12; }

/* Secciones y retículas */
.editorial { padding-inline: var(--edge); }
.introduction, .services, .gallery { padding-top: var(--space); }
.tag { display: inline-block; padding: .48em .62em; color: var(--pine); background: var(--lime); }
.tag.inverse, .number-grid { color: var(--lime); background: var(--pine); }
.statement { max-width: min(69vw, 40ch); margin-block: clamp(1.1rem, 1.85vw, 2.5rem); font-size: var(--lead); line-height: 1.16; }
.company-details[open] .icon { transform: rotate(45deg); }
.company-copy, .materials-grid, .service-grid, .contact-grid, .foot-top, .numbers, .number-grid { display: grid; }
.company-copy, .materials-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 7vw, 11rem); }
.company-copy { margin-top: 2.4rem; padding-block: 2rem; border-block: var(--rule); }
.company-copy h3, .office h3 { font-size: var(--card-title); letter-spacing: -.045em; }
.company-copy p, .materials-grid p { margin-top: .65em; max-width: 65ch; }
.section-title, .contact h2 { margin-block: var(--card-pad) clamp(1.35rem, 2.15vw, 3.5rem); font-size: var(--title); line-height: 1.06; }

/* Servicios */
.service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); padding-bottom: var(--gap); }
.service-card { position: relative; min-width: 0; min-height: clamp(18rem, 24vw, 33rem); background: var(--tile); transition: background-color .2s; }
.service-card > summary {
  min-height: inherit; height: 100%; padding: 3.6rem var(--card-pad);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(.9rem, 1.65vw, 2rem); text-align: center;
}
.card-title { max-width: 25ch; font-size: var(--card-title); line-height: 1.23; letter-spacing: -.055em; }
.card-sign { position: absolute; inset: clamp(.6rem, 1.15vw, 1.55rem) clamp(.6rem, 1.15vw, 1.55rem) auto auto; width: clamp(2rem, 2.4vw, 3.2rem); aspect-ratio: 1; border-radius: 50%; background: var(--line); }
.card-sign, .detail-toggle { display: grid; place-items: center; }
.card-sign::before, .card-sign::after, .detail-toggle::before, .detail-toggle::after { content: ""; grid-area: 1 / 1; height: 1.5px; width: 36%; background: currentColor; }
.card-sign::after, .detail-toggle::after { transform: rotate(90deg); }
.drawing { width: clamp(6.3rem, 8.5vw, 11rem); color: var(--muted); stroke-width: 1.3; }
.service-card[open] { background: var(--lime); }
.service-card[open] > summary { min-height: 0; height: auto; align-items: start; text-align: left; padding: var(--card-pad) 4.2rem var(--card-pad) var(--card-pad); }
.service-card[open] .drawing, .service-card[open] .card-sign::after, details[open] .detail-toggle::after { display: none; }
.service-card[open] .card-title { font-size: var(--text); max-width: none; }
.service-card[open] .card-sign { background: color-mix(in srgb, var(--pine) 13%, transparent); }
.card-copy { padding: 0 var(--card-pad) var(--card-pad); }
.card-copy p { margin-top: .9em; line-height: 1.48; letter-spacing: -.025em; }

/* Cifras y galería */
.numbers, .number-grid { grid-template-columns: 1fr 1fr; }
.numbers { gap: var(--gap); padding: var(--gap) var(--edge) 0; }
.numbers-cover, .number-grid { min-height: clamp(26rem, 44vw, 62rem); }
.numbers-cover h3 { font-size: var(--title); letter-spacing: var(--tracking); }
.number-grid { place-content: center; text-align: center; gap: clamp(2.3rem, 4.2vw, 6.5rem) clamp(.85rem, 2.1vw, 3rem); padding: clamp(1.3rem, 3.55vw, 6rem); }
.number-grid strong { font-size: calc(clamp(2.2rem, 3.8vw, 6.7rem) * var(--type-scale)); line-height: 1.06; letter-spacing: var(--tracking); white-space: nowrap; }
.number-grid small { font-size: .58em; }
.number-grid p { max-width: 25ch; margin: .85em auto 0; line-height: 1.38; }
.gallery .section-title { margin-bottom: .4em; }
.gallery-intro { margin-bottom: 1.3em; color: var(--muted); }
.gallery-track { display: flex; overflow-x: auto; gap: var(--gap); scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--control) var(--paper); }
.enhanced .gallery-track { scrollbar-width: none; }
.enhanced .gallery-track::-webkit-scrollbar { display: none; }
.gallery-item { flex: 0 0 45%; scroll-snap-align: start; aspect-ratio: 1.39;  }
.gallery-item::after { top: 38%; z-index: 0; background: linear-gradient(to top, rgb(var(--shade) / 65%), transparent 75%); }
.gallery-item figcaption { position: absolute; z-index: 1; bottom: 1em; left: 1.1em; }
.gallery-tools { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 3rem; margin-top: .75rem; }
.gallery-dots, .gallery-buttons { display: flex; }
.gallery-dots { grid-column: 2; gap: .1rem; }
.gallery-dots button { width: 1.6rem; height: 2.6rem; }
.gallery-dots button::before { content: ""; width: .55rem; aspect-ratio: 1; border-radius: 50%; background: var(--control); }
.gallery-dots button[aria-pressed=true]::before { background: var(--ink); }
.gallery-buttons { justify-self: end; gap: .35rem; }
.gallery-buttons button { width: 2.75rem; aspect-ratio: 1; border: 1px dotted var(--muted); border-radius: 50%; }
.gallery-buttons button:hover:enabled { background: var(--tile); }
.gallery-buttons button:disabled { opacity: .35; }

/* Materiales, contacto y pie */
.materials { padding-block: calc(var(--space) * .7); }
.materials-grid { margin-top: 1.7rem; }
.materials-grid article { padding-top: 1.45rem; border-top: var(--rule); }
.materials-grid h3 { font-size: var(--subtitle); letter-spacing: var(--tracking); }
.contact { padding: clamp(4.5rem, 8vw, 10rem) var(--edge); background: var(--white); }
.contact-grid { grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr); align-items: center; gap: clamp(2rem, 5vw, 7rem); }
.contact h2 { margin-top: .55em; }
.office + .office { margin-top: 1.75rem; }
address { display: grid; gap: .44rem; margin-top: .7rem; font-style: normal; }
address > * { display: flex; align-items: start; gap: .7rem; width: fit-content; }
address .icon { width: 1rem; height: 1rem; margin-top: .34rem; color: var(--forest); }
/* Mapa vectorial local y contacto directo */
.write-us { margin-top: 1.75rem; }
.contact-map { min-width: 0; background: var(--paper); }
.contact-map svg { display: block; width: 100%; height: auto; }
.map-outline, .map-province { fill: none; stroke: var(--control); stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.map-outline { stroke-width: 1.15; }
.map-province { stroke: var(--line); stroke-width: .72; }
.map-halo { fill: var(--lime); }
.map-dot { fill: var(--pine); }
.map-label, .map-note { fill: var(--ink); stroke: var(--paper); stroke-width: 4; paint-order: stroke; stroke-linejoin: round; }
.map-label { font: 600 23px var(--sans); letter-spacing: -.04em; }
.map-note { font: 450 15px var(--sans); }
.contact-map figcaption { padding: 0 1rem .75rem; color: var(--muted); font-size: .78rem; text-align: right; }
footer { font-size: var(--small); color: var(--footer-text); padding: clamp(2rem, 4.7vw, 7rem) var(--edge) 1.5rem; }
.foot-top { grid-template-columns: .8fr 1.2fr; gap: 2.5rem; padding-bottom: 2.5rem; }
.foot-brand { width: fit-content; }
.foot-brand img { width: clamp(9rem, 13vw, 17rem); filter: brightness(0) invert(1); }
.foot-top h3 { margin-bottom: .25rem; font-size: 1.05em; }
footer details, .funding, .credits { border-top: var(--rule); }
footer a { color: var(--lime); }
.funding h3 { padding-block: 1rem; font-size: 1em; }
footer summary { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.detail-toggle { width: 1rem; height: 1rem; margin-top: .22rem; flex: none; }
.detail-toggle::before, .detail-toggle::after { width: 100%; height: 1px; }
.funding p, .legal dd { max-width: 100ch; margin-bottom: 1rem; }
.legal dt { font-weight: 650; }
.credits { padding-top: 1.3rem; font-size: .93em; }
.sep { color: var(--lime); margin-inline: .2rem; }

/* Las máscaras solo se crean durante la entrada. El contenido inicial es legible sin JavaScript. */
.line-mask { display: block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.line-text { display: block; white-space: pre; }
.number-grid strong { overflow: hidden; }
.number-live { display: inline-block; font-variant-numeric: tabular-nums; }

@media (hover: hover) and (pointer: fine) and (forced-colors: none) {
  body { cursor: var(--cursor-lime), auto; }
  :is(a, button, summary) { cursor: var(--cursor-lime), pointer; }
  button:disabled { cursor: default; }
}

@media (max-width: 900px) {
  .statement { max-width: 86%; }
  .number-grid { padding: 1.4rem; }
  .contact-grid { gap: 2rem; }
}

@media (max-width: 740px) {
  :root {
    --edge: .8rem; --gap: .45rem; --anchor-offset: 5rem;
    --hero-min: 29rem; --hero-size: calc(clamp(3rem, 8.8vw, 4.8rem) * var(--type-scale));
    --lead: calc(clamp(1.85rem, 4.75vw, 2.7rem) * var(--type-scale));
  }
  .masthead, .nav-contact { min-height: 2.95rem; }
  .masthead { gap: .85rem; padding: .48rem .75rem; }
  .brand img { width: 5.5rem; }
  .enhanced .menu-toggle { display: inline-flex; align-items: center; gap: .35rem; min-height: 2rem; padding: .2rem; }
  #menu { position: absolute; top: calc(100% + .3rem); left: 0; flex-direction: column; align-items: stretch; gap: .15rem; min-width: 12rem; padding: .65rem 1rem; background: var(--white); border-radius: var(--radius); box-shadow: 0 1px 4px rgb(var(--shade) / 8%); }
  .enhanced #menu:not(.open) { display: none; }
  #menu a { font-size: calc(.83rem * var(--type-scale)); padding: .75em .2em; }
  .hero-photo { object-position: 76% bottom; }
  .hero-copy > p { max-width: 34ch; }

  .statement { max-width: 100%; }
  .company-copy, .materials-grid, .service-grid, .contact-grid, .foot-top, .numbers { grid-template-columns: 1fr; }
  .service-card { min-height: 12.5rem; }
  .service-card > summary { gap: .65rem; padding: 2.3rem 1.4rem; }
  .drawing { width: 6.2rem; }
  .card-title { max-width: 28ch; }
  .card-copy p { max-width: 66ch; }
  .image-banner { min-height: 26rem; }
  .numbers-cover { min-height: 15rem; }
  .number-grid { min-height: 20rem; padding: 2rem 1rem; }
  .gallery-item { flex-basis: 86%; }
  .materials-grid { gap: 2rem; }
  .contact { padding-block: 4rem; }
  .foot-top { gap: 1.5rem; }
}

@media (max-width: 480px) {
  :root { --hero-size: calc(clamp(2.7rem, 10.1vw, 3.35rem) * var(--type-scale)); }
  .hero .slide-heading > .phrase-break { display: inline; }
  .hero-copy { padding-inline: .4rem; }
  .number-grid strong { font-size: calc(2.35rem * var(--type-scale)); }
  .map-label { font-size: 29px; }
  .map-note { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
}

@media print {
  .hero-controls, .masthead, .gallery-tools, .hero .button, .banner-copy .button,
  .hero-photo, .image-banner > img, .hero-slide::before, .image-banner::before { display: none !important; }
  .hero, .image-banner, footer { color: var(--ink); background: var(--white); }
  .foot-brand img { filter: none; }
  footer a { color: var(--ink); }
  .hero, .hero-slide, .image-banner { min-height: auto; padding-block: 1.5rem; }
  .numbers-cover, .number-grid { min-height: 10rem; }
  .introduction, .services, .gallery, .materials, .contact { padding-block: 1.4rem; }
  .service-grid, .numbers { display: block; }
  .service-card, .service-card > summary { min-height: 0; }
}

:is(.hero-copy, .card-copy, .company-copy, .materials-grid, .funding) p, .statement, .legal dd { white-space: pre-line; }

.uploaded-drawing { aspect-ratio: 6 / 5; height: auto; object-fit: contain; }
