/* ==========================================================
   Marca ONMPRI · se carga después de styles.css
   Colores y tipografía según la Guía de aplicaciones ONMPRI
   ========================================================== */
:root {
  --ink: #24182f; --muted: #5d5168; --line: #e4dbe9; --paper: #fbf8fc; --white: #fff;
  --wine: #532b7d; --wine-dark: #3e1f5f; --violet: #804694; --pink: #c266a4; --lilac: #f3c9f9;
  --magenta: #d848d8; --sage: #efe4f4; --blush: #f6ecf8; --mint: #f3e8f7; --red: #e21518;
  --display: Anton, "Arial Narrow", Impact, sans-serif;
  --body: Poppins, "Segoe UI", Arial, sans-serif;
}
body { font-family: var(--body); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
.search-box:focus-within, .select-box:focus-within { outline-color: var(--magenta); }

/* Tipografía de títulos (sustituto web de la tipografía del eslogan) */
.hero h1, .section-heading h2, .emergency-card h2, .route-detail h3, .access-criteria h2, .situation-panel h3, .qr-panel h3 {
  font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .005em; color: var(--wine);
}
.hero h1 { line-height: .98; font-size: clamp(54px, 6.4vw, 104px); }
.hero h1 em { font-style: normal; color: var(--pink); }
.section-heading h2 { line-height: 1; }
.emergency-card h2 { line-height: 1.02; }
.route-detail h3 { line-height: 1.04; font-size: clamp(30px, 2.8vw, 42px); letter-spacing: .01em; }
.access-criteria h2 { line-height: 1.02; }
.situation-panel h3 { font-size: 30px; line-height: 1.05; }
.directory-card h3 { font: 600 19px/1.3 var(--body); letter-spacing: -.01em; color: var(--wine); }
.access-grid h3 { color: var(--wine); }
.route-icon, .search-box > span[aria-hidden] { font-family: var(--body); }
.access-inner button, .access-inner a, .print-button { font-family: var(--body); }

/* Neutros con tono lila (antes verdosos) */
nav a { color: #4a3d57; }
.lead, .detail-note, .safety-note { color: #43384f; }
.detail-intro, .emergency-card p, .service { color: #4f4560; }
.steps, .steps li { border-color: #dccbe5; }
.small-note, .hours, .city, .source-note, footer, .quiet { color: #6b5f78; }
.address { color: #43384f; }
.source { border-top-color: #ece3f1; }
.source span { color: #8a7d97; }
.directory-card, .search-box, .select-box, .route-option { border-color: #e6dcec; }
.access-message { color: #43384f; }

/* Componentes */
.button, .emergency-button, .header-call, .print-button { border-radius: 999px; }
.primary, .emergency-button { background: linear-gradient(90deg, var(--wine), var(--violet)); }
.primary:hover, .emergency-button:hover { background: var(--wine-dark); }
.header-call { border-color: var(--pink); }
.live-dot { background: var(--red); }
.emergency-top { color: #b0122a; }
.emergency-card:before { border-color: #f1e4f6; box-shadow: 0 0 0 36px #f8f0fb, 0 0 0 72px #fcf8fd; }
.emergency-card { border-color: #eadff0; box-shadow: 0 16px 44px #3e1f5f14; }
.eyebrow { color: var(--violet); }
.eyebrow-line { background: var(--pink); }
.step-num { color: var(--pink); }
.route-icon { background: var(--blush); color: var(--violet); font-size: 19px; }
.route-option:hover { border-color: var(--pink); }
.route-option.active { border-color: var(--violet); box-shadow: inset 4px 0 var(--violet); background: #fdf9fe; }
.route-arrow { color: var(--violet); }
.route-detail { background: linear-gradient(160deg, #f8eefb 0%, #f1e3f6 100%); border-color: #e8d6ef; }
.safety-note { border-left-color: var(--pink); }
.safety-note > span { color: var(--pink); }
.situation-cards button:hover { border-color: var(--violet); background: var(--blush); }
.directory-section { background: #f4ebf7; }
.category { color: var(--wine); }
.category.emergencia { color: #b0122a; }
.category.orientacion { color: var(--violet); }
.category.regional { color: #8a2f73; }
.phone { color: var(--wine); }

/* Barra de ayuda rápida y de accesibilidad */
.quick-help { background: #f3e6f7; border-bottom-color: #e2cdea; }
.access-bar { box-shadow: 0 2px 12px #3e1f5f12; }
.access-inner button, .access-inner a { background: var(--paper); border-color: #d9c6e3; color: var(--wine); }
.access-inner button:hover, .access-inner a:hover, .access-inner button[aria-pressed="true"] { background: #efe0f5; }

/* Logos en el encabezado */
.brand { gap: 14px; }
.brand-logos { height: 54px; width: auto; display: block; }
.brand-text { padding-left: 14px; border-left: 1px solid var(--line); color: var(--wine); }

/* Esferas decorativas de la guía de marca */
.hero { position: relative; overflow: hidden; }
.hero > * { position: relative; z-index: 1; }
.bubble { position: absolute; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff 0%, var(--lilac) 45%, #b98ad0 100%); opacity: .55; pointer-events: none; z-index: 0; }
.b1 { width: 230px; height: 230px; right: 32%; top: -70px; }
.b2 { width: 70px; height: 70px; left: 46%; bottom: 60px; opacity: .45; }
.b3 { width: 130px; height: 130px; left: -50px; bottom: -40px; opacity: .35; }

/* Pie de página con marca */
.brand-footer { background: linear-gradient(120deg, var(--wine-dark) 0%, var(--wine) 45%, var(--violet) 100%); color: #fff; position: relative; overflow: hidden; }
.brand-footer-inner { max-width: 1440px; margin: auto; padding: 56px clamp(22px, 5vw, 76px) 30px; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; position: relative; z-index: 1; }
.slogan { font: 400 clamp(38px, 5vw, 64px)/.95 var(--display); text-transform: uppercase; color: var(--lilac); margin: 0; }
.logo-pill { background: #fff; border-radius: 999px; padding: 12px 26px; display: inline-flex; box-shadow: 0 10px 30px rgba(20, 5, 35, .25); }
.logo-pill img { height: 70px; width: auto; display: block; }
.brand-footer footer { color: #eadcf2; border-top: 1px solid rgba(255, 255, 255, .18); position: relative; z-index: 1; }
.brand-footer footer a { color: #fff; }
.brand-footer .bubble { opacity: .18; }
.bf1 { width: 320px; height: 320px; right: -90px; top: -120px; }
.bf2 { width: 90px; height: 90px; left: 38%; bottom: -30px; }

/* Alto contraste: mantiene la legibilidad por encima de la marca */
.high-contrast { --ink: #12081c; --muted: #2e2338; --line: #5d4f69; --paper: #fff; --wine: #35124f; --wine-dark: #22093a; --violet: #35124f; --pink: #6b1f5c; --blush: #fff; --mint: #fff; --sage: #fff; }
.high-contrast .bubble { display: none; }
.high-contrast .hero h1 em { color: #6b1f5c; }
.high-contrast .route-option.active, .high-contrast .primary, .high-contrast .emergency-button { background: #35124f; }
.high-contrast .lead, .high-contrast .detail-intro, .high-contrast .service, .high-contrast .small-note,
.high-contrast .hours, .high-contrast .address, .high-contrast .source-note, .high-contrast .city { color: #2e2338; }

/* Tres recuadros en la sección de acceso */
@media (min-width: 901px) { .access-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@media (max-width: 760px) {
  .brand-logos { height: 40px; }
  .brand-text { display: none; }
  .b1 { width: 150px; height: 150px; right: -40px; top: -40px; }
  .b2 { display: none; }
  .logo-pill img { height: 54px; }
}
@media print {
  .brand-footer, .bubble { display: none !important; }
}

/* Botón ? y ventana emergente "Acceso a la ayuda" */
.help-button { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 1px solid var(--pink); background: var(--blush); color: var(--wine); font: 700 18px/1 var(--body); cursor: pointer; display: grid; place-items: center; margin-right: -18px; }
.help-button:hover { background: #efe0f5; }
.access-inner button[data-open-access] { cursor: pointer; }
.access-dialog { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 48px); max-height: calc(100dvh - 32px); overflow: auto; border: 0; border-radius: 14px; padding: clamp(22px, 4vw, 40px); background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(36, 10, 60, .35); }
.access-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.access-dialog .eyebrow { margin: 0 0 10px; }
.access-dialog h2 { font: 400 clamp(30px, 3.6vw, 46px)/1.02 var(--display); text-transform: uppercase; color: var(--wine); margin: 0; text-wrap: balance; }
.access-close { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--wine); font: 600 16px/1 var(--body); cursor: pointer; }
.access-close:hover { background: var(--blush); }
.access-dialog .access-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .access-dialog .access-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .help-button { width: 36px; height: 36px; font-size: 16px; margin-left: auto; margin-right: -22px; } }
.high-contrast .help-button, .high-contrast .access-close { background: #fff; border-color: #5d4f69; }
@media print { .help-button, .access-dialog { display: none !important; } }

/* Rutas en celular: la información se abre en una ventana emergente */
@media (max-width: 760px) {
  .route-layout.popup .route-list { grid-template-columns: 1fr; }
  .route-layout.popup .route-option { min-height: 0; padding: 14px 16px; gap: 12px; }
  .route-layout.popup .route-copy strong { font-size: 14px; }
  .route-layout.popup .route-copy small { font-size: 11px; }
  .route-layout.popup .route-arrow { display: block; font-size: 15px; }
  .route-layout.popup .route-option.active { border-color: #e6dcec; box-shadow: none; background: #fff; }
}
.route-dialog { display: flex; flex-direction: column; width: calc(100vw - 24px); max-width: 560px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 14px; background: #f6ecf9; color: var(--ink); box-shadow: 0 30px 80px rgba(36, 10, 60, .35); overflow: hidden; }
.route-dialog-bar { display: flex; justify-content: flex-end; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line); flex: none; }
.route-hide { font: 700 13px/1 var(--body); color: var(--wine); background: var(--blush); border: 1px solid var(--pink); border-radius: 999px; padding: 10px 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.route-hide:hover { background: #efe0f5; }
.route-dialog-body { overflow: auto; overscroll-behavior: contain; }
.route-dialog .route-detail { border: 0; border-radius: 0; min-height: 0; padding: 22px 20px 26px; }
.high-contrast .route-dialog, .high-contrast .route-hide { background: #fff; }
@media print { .route-dialog { display: none !important; } }

/* Capa de las ventanas emergentes (funciona en cualquier navegador) */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); background: rgba(36, 18, 52, .55); }
.modal-overlay[hidden] { display: none !important; }
.modal-overlay > [role="dialog"]:focus { outline: none; }
body.modal-open { overflow: hidden; }
@media print { .modal-overlay { display: none !important; } }
