/* =====================================================================
   Energía distribuida — Grupo Iberdrola (infografía estática)
   Fuente: Figma Q6TW65Cfj52oXN47LeXvGa (Estáticos 3T2026)

   Responsive por breakpoints, FUENTES FIJAS por tamaño (sin escala) y que
   LLENA el ancho (fluido) hasta un máximo de 980.
   Clave: cada tarjeta + su conector forman un GRUPO rígido (.edm__cg--X)
   anclado al punto del país en el mapa. Al escalar/llenar el mapa, el grupo
   se mueve con su país y la tarjeta va siempre pegada al conector (cero deriva).
   - #edm = contenedor de medición (container query), llena la columna.
   - .edm__frame = tarjeta visual (marco).
     · <565: apilado (móvil), fluido → grupos en `display:contents`.
     · 565–979: callout fluido que llena; grupos anclados al país (geom. 565).
     · ≥980: callout, marco max 980; grupos anclados al país (geom. 980).
   ===================================================================== */

/* ---- Fuentes reales (mismos woff2 del sitio) ---- */
@font-face { font-family: "IberPangea"; src: url("/wcorp/gc/prod/es_ES/estaticos/str_mapa_home/fonts/IberPangea-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IberPangea"; src: url("/wcorp/gc/prod/es_ES/estaticos/str_mapa_home/fonts/IberPangea-SmBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IberPangea"; src: url("/wcorp/gc/prod/es_ES/estaticos/str_mapa_home/fonts/IberPangea-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IberPangeaText"; src: url("/wcorp/gc/prod/es_ES/estaticos/str_mapa_home/fonts/IberPangeaText-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IberPangeaText"; src: url("/wcorp/gc/prod/es_ES/estaticos/str_mapa_home/fonts/IberPangeaText-SmBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IberPangeaText"; src: url("/wcorp/gc/prod/es_ES/estaticos/str_mapa_home/fonts/IberPangeaText-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IberPangeaText"; src: url("/wcorp/gc/prod/es_ES/estaticos/str_mapa_home/fonts/IberPangeaText-SmBoldItalic.woff2") format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }

#edm {
  --edm-green-1: #007F33;
  --edm-forest: #00402A;
  --edm-sand-3: #D8CFC7;
  --edm-sand-7: #3A3735;
  --edm-white: #FFFFFF;
  --edm-serif: "IberPangea", Arial, sans-serif;
  --edm-sans: "IberPangeaText", Arial, sans-serif;
}

/* ---- Contenedor de medición ---- */
#edm.edm { box-sizing: border-box; width: 100%; container-type: inline-size; text-align: left; color: var(--edm-sand-7); font-family: var(--edm-sans); }
#edm.edm * { box-sizing: border-box; margin: 0; padding: 0; }

/* ---- Marco visual ---- */
#edm .edm__frame { max-width: 565px; margin: 0 auto; background: var(--edm-white); border: 1px solid var(--edm-sand-3); border-radius: 15px; overflow: hidden; position: relative; }

/* ============================ BASE = 290 (móvil, flujo) ============================ */
#edm .edm__head { padding: 32px 16px 0; }
#edm .edm__title { font-family: var(--edm-serif); font-weight: 400; font-size: 30px; line-height: 34px; color: var(--edm-green-1); }
#edm .edm__title strong { font-weight: 600; }
#edm .edm__intro { margin-top: 24px; font-family: var(--edm-serif); font-weight: 400; font-size: 21px; line-height: 24px; color: var(--edm-forest); }
#edm .edm__intro strong { font-weight: 600; white-space: nowrap; }
#edm .edm__br-980 { display: none; }   /* salto del intro solo en desktop (como Figma) */

#edm .edm__stage { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 0 16px; margin-top: 24px; }
#edm .edm__map { display: block; width: 100%; height: auto; aspect-ratio: 839.09 / 425.806; margin-bottom: 16px; }
#edm .edm__cg { display: contents; }            /* móvil: la tarjeta fluye apilada */
#edm .edm__connector { display: none; }

#edm .edm__card { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 16px; background: var(--edm-white); box-shadow: inset 0 0 0 1px var(--edm-sand-3); border-radius: 15px; }
#edm .edm__flag { flex: 0 0 auto; width: 32px; height: 31px; border-radius: 50%; object-fit: cover; display: block; }
#edm .edm__card--us .edm__flag { width: 31px; }
#edm .edm__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#edm .edm__country { font-family: var(--edm-sans); font-weight: 400; font-size: 16px; line-height: 20px; color: var(--edm-forest); white-space: normal; overflow-wrap: anywhere; }
#edm .edm__note-mark { font-size: 10.32px; vertical-align: super; line-height: 0; }
#edm .edm__value { font-family: var(--edm-serif); font-weight: 400; font-size: 24px; line-height: 28px; color: var(--edm-green-1); white-space: normal; overflow-wrap: anywhere; }
#edm .edm__donut { flex: 0 0 auto; width: 44px; height: 44px; margin-left: auto; display: block; }

#edm .edm__notes { padding: 16px 16px 32px; }
#edm .edm__note { font-family: var(--edm-sans); font-weight: 400; font-style: italic; font-size: 12px; line-height: 16px; color: var(--edm-sand-7); }
#edm .edm__note strong { font-weight: 600; font-style: italic; }

/* ---- Grupo callout (compartido por 565 y 980) ---- */
@container (min-width: 565px) {
  #edm .edm__head { padding: 40px 24px 0 32px; }
  #edm .edm__title { font-size: 32px; line-height: 36px; }
  #edm .edm__intro { margin-top: 24px; font-size: 24px; line-height: 28px; }
  #edm .edm__notes { padding: 24px 26px 40px 32px; }
  #edm .edm__note { font-size: 14px; line-height: 18px; }

  #edm .edm__stage { display: block; padding: 0; margin-top: 24px; position: relative; width: 100%; }
  #edm .edm__map { position: absolute; margin: 0; aspect-ratio: auto; }

  #edm .edm__cg { display: block; position: absolute; width: 0; height: 0; }
  #edm .edm__cg .edm__card { position: absolute; width: auto; }
  #edm .edm__connector { display: block; position: absolute; z-index: 0; background-repeat: no-repeat; background-size: 100% 100%; }
  #edm .edm__cg .edm__card { z-index: 1; }

  /* callout: tarjetas de ancho automático → una línea y donut a tamaño Figma (52) */
  #edm .edm__country, #edm .edm__value { white-space: nowrap; overflow-wrap: normal; }
  #edm .edm__donut { width: 52px; height: 52px; }
}

/* ============================ 565 (llena el ancho; geometría 565) ============================ */
@container (min-width: 565px) and (max-width: 979.98px) {
  #edm .edm__frame { max-width: none; }                 /* llena el ancho disponible */
  #edm .edm__stage { aspect-ratio: 565 / 339; }
  #edm .edm__map { left: 5.664%; top: 6.195%; width: 90.088%; height: 76.106%; }

  #edm .edm__cg--us { left: 20.310%; top: 38.569%; }
  #edm .edm__cg--us .edm__connector { left: -45.25px; top: -58.25px; width: 49.25px;  height: 62.25px;  background-image: url("/wcorp/gc/prod/es_ES/estaticos/mapa-energia-distribuida-grupo-iberdrola/images/conector565-eeuu.svg"); }
  #edm .edm__cg--us .edm__card { left: -82.7px; top: -130.7px; }

  #edm .edm__cg--uk { left: 50.531%; top: 30.014%; }
  #edm .edm__cg--uk .edm__connector { left: -4px; top: -29.25px; width: 71.75px; height: 33.25px; background-image: url("/wcorp/gc/prod/es_ES/estaticos/mapa-energia-distribuida-grupo-iberdrola/images/conector565-reino-unido.svg"); }
  #edm .edm__cg--uk .edm__card { left: 0.5px; top: -101.7px; }

  #edm .edm__cg--es { left: 51.150%; top: 38.643%; }
  #edm .edm__cg--es .edm__connector { left: -4px; top: -4px; width: 68.75px; height: 43.75px; background-image: url("/wcorp/gc/prod/es_ES/estaticos/mapa-energia-distribuida-grupo-iberdrola/images/conector565-espana.svg"); }
  #edm .edm__cg--es .edm__card { left: -3px; top: 35px; }

  #edm .edm__cg--br { left: 34.203%; top: 62.832%; }
  #edm .edm__cg--br .edm__connector { left: -122.25px; top: -4px; width: 126.25px; height: 62.75px; background-image: url("/wcorp/gc/prod/es_ES/estaticos/mapa-energia-distribuida-grupo-iberdrola/images/conector565-brasil.svg"); }
  #edm .edm__cg--br .edm__card { left: -161.2px; top: 54px; }
}

/* ============================ 980 (marco max 980; geometría 980) ============================ */
@container (min-width: 980px) {
  #edm .edm__frame { max-width: 980px; }
  #edm .edm__br-980 { display: inline; }
  #edm .edm__stage { aspect-ratio: 980 / 442; margin-top: 33px; }
  #edm .edm__head { padding: 39px 87px 0 31px; }
  #edm.edm-en .edm__head, #edm.edm-pt .edm__head { padding-right: 39px; }   /* head EN/PT más ancho (910), como Figma */
  #edm .edm__notes { padding: 31px 38px 39px 31px; }
  #edm .edm__map { left: 9.898%; top: 3.846%; width: 85.510%; height: 96.211%; }

  #edm .edm__cg--us { left: 22.832%; top: 42.308%; }
  #edm .edm__cg--us .edm__connector { left: -101.75px; top: -115px; width: 105.75px; height: 119px; background-image: url("/wcorp/gc/prod/es_ES/estaticos/mapa-energia-distribuida-grupo-iberdrola/images/conector-eeuu.svg"); }
  #edm .edm__cg--us .edm__card { left: -178.7px; top: -187px; }

  #edm .edm__cg--uk { left: 49.694%; top: 29.129%; }
  #edm .edm__cg--uk .edm__connector { left: -4px; top: -35.75px; width: 89px; height: 39.75px; background-image: url("/wcorp/gc/prod/es_ES/estaticos/mapa-energia-distribuida-grupo-iberdrola/images/conector-reino-unido.svg"); }
  #edm .edm__cg--uk .edm__card { left: 81px; top: -73.8px; }

  #edm .edm__cg--es { left: 49.286%; top: 50.453%; }
  #edm .edm__cg--es .edm__connector { left: -4px; top: -4px; width: 176px; height: 50.75px; background-image: url("/wcorp/gc/prod/es_ES/estaticos/mapa-energia-distribuida-grupo-iberdrola/images/conector-espana.svg"); }
  #edm .edm__cg--es .edm__card { left: 167.5px; top: 2px; }

  #edm .edm__cg--br { left: 37.219%; top: 74.208%; }
  #edm .edm__cg--br .edm__connector { left: -42.75px; top: -4px; width: 46.75px; height: 8px; background-image: url("/wcorp/gc/prod/es_ES/estaticos/mapa-energia-distribuida-grupo-iberdrola/images/conector-brasil.svg"); }
  #edm .edm__cg--br .edm__card { left: -319.7px; top: -40px; }
}
