/* Atlas Studio — fichas informativas: menú contextual y ficha (Wikipedia · Wikidata) */
:root {
  --info-panel: #0b1b28;
  --info-panel-2: #0f2434;
  --info-aqua: var(--aqua, #49d6c5);
  --info-gold: var(--gold, #f2b84b);
}

/* ------------------------------------------------------------------ */
/* Menú contextual                                                     */
/* ------------------------------------------------------------------ */
.info-menu {
  position: fixed; z-index: 1300; min-width: 244px; max-width: min(310px, calc(100vw - 16px));
  padding: 6px; border-radius: 14px; border: 1px solid var(--line-strong, rgba(157,190,205,.24));
  background: rgba(11, 27, 40, .97); color: var(--ink, #eaf3f7);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5), 0 0 0 1px rgba(73, 214, 197, .06) inset;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font: 500 13px "DM Sans", sans-serif; animation: infoMenuIn .14s ease-out;
}
@keyframes infoMenuIn { from { opacity: 0; transform: scale(.94); } }
.info-menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line, rgba(157,190,205,.14)); }
.info-menu-head div { display: grid; min-width: 0; }
.info-menu-head strong { font: 800 14px Manrope, sans-serif; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-menu-head small { color: var(--muted, #91a6b4); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-menu-icon { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #06201e;
  background: linear-gradient(135deg, var(--info-aqua), #8fe7c9 55%, var(--info-gold)); box-shadow: 0 4px 14px rgba(73, 214, 197, .25); }
.info-menu-icon svg { width: 17px; height: 17px; }
.info-menu button { width: 100%; min-height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border: 0; border-radius: 9px;
  background: none; color: #d6e5eb; font: 600 13px "DM Sans", sans-serif; text-align: left; cursor: pointer; }
.info-menu button svg { width: 16px; height: 16px; flex: none; color: var(--info-aqua); }
.info-menu button.primary svg { color: var(--info-gold); }
.info-menu button:hover:not([disabled]), .info-menu button:focus-visible { background: rgba(73, 214, 197, .11); color: #fff; outline: none; }
.info-menu button:focus-visible { box-shadow: 0 0 0 2px rgba(73, 214, 197, .55) inset; }
.info-menu button[disabled] { opacity: .4; cursor: default; }
.info-menu.touch button { min-height: 44px; font-size: 14px; }

/* ------------------------------------------------------------------ */
/* Ficha: hoja inferior (teléfonos y tabletas) o lateral (≥ 1100 px)    */
/* ------------------------------------------------------------------ */
.info-card {
  --info-w: 440px;
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: min(760px, 100vw); max-width: 100vw; height: auto; max-height: 90vh;
  padding: 0; border: 1px solid var(--line-strong, rgba(157,190,205,.24)); border-bottom: 0; border-radius: 20px 20px 0 0;
  background: var(--info-panel); color: var(--ink, #eaf3f7); box-shadow: 0 -20px 70px rgba(0, 0, 0, .55); overflow: hidden;
  font-family: "DM Sans", sans-serif;
}
.info-card::backdrop { background: rgba(2, 8, 14, .55); backdrop-filter: blur(3px); }
.info-card[open] { animation: infoSheetUp .26s cubic-bezier(.2, .8, .2, 1); }
.info-card.closing { animation: infoSheetDown .16s ease-in forwards; }
@keyframes infoSheetUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes infoSheetDown { to { transform: translateY(30px); opacity: 0; } }
.info-card.as-sheet {
  inset: 76px 14px 40px auto; width: var(--info-w); max-height: none; height: auto; margin: 0; z-index: 60;
  border: 1px solid var(--line-strong, rgba(157,190,205,.24)); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
.info-card.as-sheet[open] { animation: infoSideIn .24s cubic-bezier(.2, .8, .2, 1); }
.info-card.as-sheet.closing { animation: infoSideOut .16s ease-in forwards; }
@keyframes infoSideIn { from { transform: translateX(28px); opacity: 0; } }
@keyframes infoSideOut { to { transform: translateX(24px); opacity: 0; } }
.info-shell { display: flex; flex-direction: column; height: 100%; max-height: inherit; }
.info-card:not(.as-sheet) .info-shell { max-height: 90vh; }
.info-card:not(.as-sheet) .info-shell::before { content: ""; position: absolute; z-index: 3; top: 7px; left: 50%; width: 42px; height: 4px; margin-left: -21px; border-radius: 4px; background: rgba(255, 255, 255, .35); }

/* Encabezado con imagen */
.info-hero { position: relative; flex: none; padding: 12px 16px 14px; overflow: hidden; border-bottom: 1px solid var(--line, rgba(157,190,205,.14));
  background: radial-gradient(circle at 0 0, rgba(73, 214, 197, .16), transparent 55%), radial-gradient(circle at 100% 0, rgba(242, 184, 75, .1), transparent 50%), var(--info-panel-2); }
.info-hero-media { position: absolute; inset: 0; background-size: cover; background-position: center 35%; opacity: 0; transition: opacity .4s ease; }
.info-hero-media.has-image { opacity: 1; }
.info-hero-media.has-image::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8, 20, 30, .35) 0%, rgba(8, 20, 30, .55) 40%, rgba(11, 27, 40, .96) 88%, var(--info-panel) 100%); }
.info-hero > *:not(.info-hero-media) { position: relative; }
.info-hero-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.info-type { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 99px; font: 700 10.5px Manrope, sans-serif;
  letter-spacing: .08em; text-transform: uppercase; color: #06201e; background: rgba(73, 214, 197, .92); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.info-type svg { width: 13px; height: 13px; }
.info-hero-actions { display: flex; gap: 4px; }
.info-hero-actions .icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(6, 17, 27, .55); color: #e7f1f5; cursor: pointer; backdrop-filter: blur(6px); }
.info-hero-actions .icon-btn:hover { background: rgba(73, 214, 197, .2); border-color: rgba(73, 214, 197, .45); }
.info-hero-actions .icon-btn:focus-visible { outline: 2px solid var(--info-aqua); outline-offset: 1px; }
.info-hero-actions .icon-btn svg { width: 17px; height: 17px; }
.info-hero-title { display: flex; align-items: flex-end; gap: 12px; margin-top: 44px; }
.info-hero-media:not(.has-image) ~ .info-hero-title { margin-top: 18px; }
.info-emblem { flex: none; width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; overflow: hidden; color: #06201e;
  background: linear-gradient(135deg, var(--info-aqua), var(--info-gold)); box-shadow: 0 8px 22px rgba(0, 0, 0, .4); }
.info-emblem svg { width: 26px; height: 26px; }
.info-emblem img { width: 100%; height: 100%; object-fit: contain; }
.info-emblem.is-flag { width: 72px; height: 48px; border-radius: 8px; background: rgba(255, 255, 255, .92); }
.info-emblem.is-flag img { object-fit: cover; }
.info-emblem:not(.is-flag):has(img) { background: rgba(255, 255, 255, .1); padding: 4px; }
.info-heading { min-width: 0; }
.info-heading h2 { margin: 0; font: 800 24px/1.12 Manrope, sans-serif; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); overflow-wrap: anywhere; }
.info-heading h2:focus { outline: none; }
.info-subtitle { margin: 4px 0 0; color: #c4d6de; font-size: 12.5px; line-height: 1.4; text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.info-subtitle::first-letter { text-transform: uppercase; }
.info-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.info-chips:empty { display: none; }
.info-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px 6px 8px; border-radius: 11px; min-width: 0;
  background: rgba(6, 17, 27, .62); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(6px); }
.info-chip svg { width: 15px; height: 15px; color: var(--info-gold); flex: none; }
.info-chip span { display: grid; line-height: 1.15; min-width: 0; }
.info-chip small { font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #91a6b4); font-weight: 700; }
.info-chip b { font: 800 13px Manrope, sans-serif; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

/* Búsqueda y estado */
.info-search { position: relative; flex: none; padding: 10px 16px; border-bottom: 1px solid var(--line, rgba(157,190,205,.14)); }
.info-search[hidden] { display: none; }
.info-search svg { position: absolute; left: 27px; top: 20px; width: 15px; color: var(--muted-2, #617887); }
.info-search input { width: 100%; height: 38px; padding: 0 12px 0 34px; color: var(--ink, #eaf3f7); background: rgba(0, 0, 0, .2);
  border: 1px solid var(--line, rgba(157,190,205,.14)); border-radius: 10px; font: 500 13px "DM Sans", sans-serif; }
.info-search input:focus { outline: none; border-color: rgba(73, 214, 197, .55); box-shadow: 0 0 0 3px rgba(73, 214, 197, .12); }
.info-status { display: none; flex: none; align-items: flex-start; gap: 8px; margin: 10px 16px 0; padding: 8px 11px; border-radius: 10px; font-size: 12px; line-height: 1.45;
  color: #cfe0e6; background: rgba(73, 214, 197, .07); border: 1px solid rgba(73, 214, 197, .22); }
.info-status.show { display: flex; }
.info-status.warn { background: rgba(242, 184, 75, .08); border-color: rgba(242, 184, 75, .3); }
.info-status svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--info-gold); }
.info-spinner { width: 13px; height: 13px; flex: none; margin-top: 2px; border-radius: 50%; border: 2px solid rgba(73, 214, 197, .25); border-top-color: var(--info-aqua); animation: infoSpin .8s linear infinite; }
@keyframes infoSpin { to { transform: rotate(360deg); } }

/* Cuerpo y secciones */
.info-body { flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding: 12px 16px 14px; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--line-strong, rgba(157,190,205,.24)) transparent; }
.info-section { border: 1px solid var(--line, rgba(157,190,205,.14)); border-radius: 12px; margin-bottom: 8px; background: rgba(255, 255, 255, .02); }
.info-section[open] { border-color: rgba(73, 214, 197, .28); background: rgba(73, 214, 197, .03); }
.info-section summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  cursor: pointer; font: 700 14px Manrope, sans-serif; color: #eef6f9; border-radius: 12px; }
.info-section summary::-webkit-details-marker { display: none; }
.info-section summary:focus-visible { outline: 2px solid var(--info-aqua); outline-offset: -2px; }
.info-section summary span { display: flex; align-items: center; gap: 10px; }
.info-section summary span svg { width: 17px; height: 17px; color: var(--info-aqua); }
.info-chevron { width: 16px; color: var(--muted, #91a6b4); transition: transform .2s ease; flex: none; }
.info-section[open] .info-chevron { transform: rotate(180deg); }
.info-content { padding: 0 14px 14px; font-size: 13.5px; line-height: 1.62; color: #cbd9df; }
.info-prose p { margin: 0 0 9px; }
.info-prose h4 { margin: 14px 0 6px; font: 800 12px Manrope, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--info-gold); }
.info-prose h4:first-child { margin-top: 2px; }
.info-prose ul, .info-prose ol { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 4px; }
.info-prose a { color: #7fe6d8; text-decoration: none; border-bottom: 1px solid rgba(127, 230, 216, .3); }
.info-prose a:hover { color: #fff; border-bottom-color: #fff; }
.info-prose b, .info-prose strong { color: #fff; }
.info-prose blockquote { margin: 0 0 10px; padding: 6px 12px; border-left: 3px solid rgba(242, 184, 75, .5); color: #d6e3e8; }
.info-prose figure { margin: 6px 0 12px; padding: 6px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line, rgba(157,190,205,.14)); max-width: 320px; }
.info-prose figure img { display: block; width: 100%; height: auto; max-height: 220px; object-fit: cover; border-radius: 6px; }
.info-prose figcaption { margin-top: 5px; color: var(--muted, #91a6b4); font-size: 11.5px; line-height: 1.4; }
.info-prose.fade-in { animation: infoFade .3s ease; }
@keyframes infoFade { from { opacity: 0; } }
.info-more { margin: 4px 0 0 !important; font-size: 12.5px; }
.info-more a { display: inline-flex; align-items: center; gap: 5px; border: 0 !important; color: var(--info-aqua) !important; font-weight: 700; }
.info-more svg { width: 13px; height: 13px; }
.info-muted { color: var(--muted, #91a6b4); font-style: italic; display: flex; gap: 6px; align-items: center; }
.info-muted svg { width: 14px; height: 14px; }
.info-empty { color: var(--muted, #91a6b4); text-align: center; padding: 18px; }

/* Resumen con mapa de ubicación */
.info-summary { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 14px; align-items: start; }
.info-card.as-sheet .info-summary { grid-template-columns: minmax(0, 1fr); }
.info-card.as-sheet .info-locator-wrap { max-width: 230px; justify-self: center; }
.info-locator-wrap { margin: 0; display: grid; justify-items: center; gap: 2px; }
.info-locator-wrap figcaption { font: 700 9.5px Manrope, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2, #617887); }
.info-locator { width: 100%; height: auto; }
.loc-sphere { fill: #0a2236; stroke: rgba(160, 210, 228, .35); stroke-width: 1; }
.loc-grat { fill: none; stroke: rgba(160, 210, 228, .1); stroke-width: .6; }
.loc-land { fill: #1d3a4c; stroke: rgba(160, 210, 228, .28); stroke-width: .5; }
.loc-parent { fill: rgba(73, 214, 197, .22); stroke: rgba(73, 214, 197, .7); stroke-width: .8; }
.loc-focus { fill: var(--info-gold); stroke: #fff3d6; stroke-width: .8; filter: drop-shadow(0 0 4px rgba(242, 184, 75, .6)); }
.loc-line { fill: none; stroke: #5cc8ff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 3px rgba(92, 200, 255, .7)); }
.loc-pin .dot { fill: var(--info-gold); stroke: #fff; stroke-width: 1.4; }
.loc-pin .pulse { fill: none; stroke: var(--info-gold); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: infoPulse 1.8s ease-out infinite; }
@keyframes infoPulse { from { transform: scale(1); opacity: .9; } to { transform: scale(3.4); opacity: 0; } }

/* Datos clave */
.info-facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.info-card.as-sheet .info-facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.info-fact { padding: 7px 10px; border-radius: 9px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line, rgba(157,190,205,.14)); min-width: 0; }
.info-fact[hidden] { display: none; }
.info-fact dt { font: 700 9.5px Manrope, sans-serif; letter-spacing: .07em; text-transform: uppercase; color: var(--muted, #91a6b4); }
.info-fact dd { margin: 2px 0 0; color: #fff; font-weight: 600; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.info-fact dd small { display: block; color: var(--muted-2, #617887); font-size: 10.5px; font-weight: 500; }
.info-fact.local { background: rgba(242, 184, 75, .045); border-color: rgba(242, 184, 75, .16); }
.info-facts.coords { grid-template-columns: minmax(0, 1fr); }
.info-sub { margin: 12px 0 6px !important; font: 800 11px Manrope, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--info-aqua); }
.info-src { margin: 5px 0 0; font-size: 10.5px; color: var(--muted-2, #617887); text-align: right; }

/* Gráficos */
.info-chart { margin-bottom: 10px; padding: 10px 12px 8px; border-radius: 11px; background: rgba(0, 0, 0, .18); border: 1px solid var(--line, rgba(157,190,205,.14)); }
.info-bars { width: 100%; max-width: 440px; height: auto; display: block; }
.info-bars .lbl { fill: #c9d8de; font: 600 11px "DM Sans", sans-serif; }
.info-bars .val { fill: #fff; font: 800 11px Manrope, sans-serif; }
.info-bars .track { fill: rgba(255, 255, 255, .06); }
.info-bars .bar { fill: rgba(160, 200, 215, .55); }
.info-bars .self .bar { fill: var(--info-gold); }
.info-bars .self .lbl { fill: #fff; font-weight: 800; }
.info-bars .avg .bar { fill: var(--info-aqua); opacity: .8; }
.info-chart-note { margin: 4px 0 0; font-size: 11.5px; color: var(--muted, #91a6b4); }
.info-chart-note strong { color: var(--info-gold); }
.info-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.info-stats div { display: grid; padding: 8px 10px; border-radius: 10px; background: rgba(242, 184, 75, .06); border: 1px solid rgba(242, 184, 75, .18); }
.info-stats small { font: 700 9.5px Manrope, sans-serif; letter-spacing: .07em; text-transform: uppercase; color: var(--muted, #91a6b4); }
.info-stats b { font: 800 14px Manrope, sans-serif; color: #fff; }
.info-stats em { font-size: 10.5px; color: var(--muted-2, #617887); font-style: normal; }

/* Esqueleto de carga */
.info-skeleton { display: grid; gap: 10px; padding: 6px 2px; }
.info-skeleton span { display: block; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, .12) 50%, rgba(255, 255, 255, .05) 100%); background-size: 200% 100%; animation: infoShimmer 1.2s linear infinite; }
.info-skeleton .sk-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-skeleton .sk-row span { height: 44px; border-radius: 10px; }
.info-skeleton.small span { height: 10px; }
@keyframes infoShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Pie de atribución */
.info-footer { flex: none; display: grid; gap: 2px; padding: 9px 16px 11px; border-top: 1px solid var(--line, rgba(157,190,205,.14)); color: var(--muted-2, #7a91a0); font-size: 10.5px; line-height: 1.45; background: rgba(0, 0, 0, .12); }
.info-footer a { color: var(--info-aqua); text-decoration: none; }
.info-footer a:hover { text-decoration: underline; }

/* Teléfonos */
@media (max-width: 560px) {
  .info-card { max-height: 92vh; border-radius: 16px 16px 0 0; }
  .info-card:not(.as-sheet) .info-shell { max-height: 92vh; }
  .info-hero { padding: 14px 12px 12px; }
  .info-hero-title { margin-top: 30px; }
  .info-heading h2 { font-size: 20px; }
  .info-emblem { width: 46px; height: 46px; }
  .info-emblem.is-flag { width: 60px; height: 40px; }
  .info-body { padding: 10px 10px 12px; }
  .info-search { padding: 8px 10px; } .info-search svg { left: 21px; top: 18px; }
  .info-status { margin: 8px 10px 0; }
  .info-content { padding: 0 11px 12px; font-size: 13px; }
  .info-summary { grid-template-columns: minmax(0, 1fr); }
  .info-locator-wrap { max-width: 200px; justify-self: center; }
  .info-facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .info-chip b { max-width: 120px; }
  .info-footer { padding: 8px 12px 10px; }
}
@media (max-width: 380px) {
  .info-facts, .info-stats { grid-template-columns: minmax(0, 1fr); }
  .info-chip { padding: 5px 8px 5px 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .info-menu, .info-card[open], .info-card.closing, .info-prose.fade-in { animation: none !important; }
  .loc-pin .pulse, .info-skeleton span, .info-spinner { animation: none; }
}
