/*
    COPIA GENERADA. No editar a mano.

    La fuente es `public-site/src/styles/shell.css`; los cambios se
    hacen alli y se traen con `php artisan sosward:site:sync-shell`.
    Lo que se toque en este archivo se pierde en la siguiente copia.
*/

/*
    El cascaron del sitio: lo que envuelve a cualquier pagina de sosward.cl.

    Tokens, tipografia base, cabecera, migas, cabecera de pagina y pie. Todo lo
    que tiene que verse IGUAL se venga de donde se venga.

    Este archivo es la FUENTE. Laravel sirve una copia literal en
    `backend/public/css/shell.css`, porque sus paginas —directorio, blog,
    legales— viven en el mismo dominio y para quien navega son la misma web.
    Esa copia la hace `php artisan sosward:site:sync-shell`, y un test falla si
    se queda vieja: cuando las dos cabeceras se editaron por separado acabaron
    con logos, alturas de barra y tamanos de titular distintos, y el salto se
    notaba al pasar de /emergencias a /servicios.

    Lo que solo usa una pagina concreta NO va aqui: eso vive en
    `components.css` y `pages.css` (Astro) o en `site.css` (Laravel).
*/

/* ---------------------------------------------------------------- Tokens */

@font-face {
  font-family: 'Manrope';
  src: url('/fonts/Manrope.ttf') format('truetype');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --brand-950: #061f36;
  --brand-900: #0b3154;
  --brand-800: #14405f;
  --brand-700: #1d4c6f;
  --brand-600: #27577e;
  --brand-500: #3a6d95;
  --brand-200: #b9cddd;
  --brand-100: #dbe6ef;
  --brand-50: #eff4f8;

  --critical-800: #7a2a1e;
  --critical-700: #963426;
  --critical-600: #bf4835;
  --critical-100: #f7ddd8;
  --critical-50: #fcf1ee;

  --success-700: #1d6a55;
  --success-100: #d3ece4;
  --success-50: #eef8f5;

  --ink-950: #101820;
  --ink-900: #17212b;
  --ink-800: #24303c;
  --ink-700: #3b4855;
  --ink-600: #4e5c69;
  --ink-500: #66727d;
  --ink-400: #96a1ab;
  --ink-300: #c7d0d7;
  --ink-200: #dfe4e8;
  --ink-100: #eaeef1;
  --ink-50: #f5f7f8;

  --sand: #f5f1eb;
  --paper: #fbfaf8;
  --white: #ffffff;
  --surface: var(--white);
  --canvas: var(--paper);
  --border: var(--ink-200);
  --text: var(--ink-900);
  --text-muted: var(--ink-500);

  --font: 'Manrope', 'Segoe UI', sans-serif;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --shadow-sm: 0 8px 30px rgba(11, 49, 84, 0.08);
  --shadow-md: 0 20px 60px rgba(6, 31, 54, 0.15);
  --container: 1200px;
  --reading: 720px;
}

/* ------------------------------------------------------------------ Base */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body,
button,
input,
select,
textarea { font-family: var(--font); }

main { overflow: clip; }

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, p { margin-top: 0; }

h1, h2, h3, h4 {
  color: var(--brand-900);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

h1 { font-size: clamp(2.65rem, 6vw, 5.4rem); }
h2 { font-size: clamp(2rem, 4vw, 3.55rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.55rem); }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

button, input, select, textarea { font-size: 1rem; }
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--critical-600) 60%, white);
  outline-offset: 3px;
}

::selection { color: var(--white); background: var(--brand-700); }

.container {
  width: min(calc(100% - 48px), var(--container));
  margin-inline: auto;
}

.section { padding-block: 104px; }

.eyebrow {
  margin-bottom: 18px;
  color: var(--critical-600);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow--light { color: #f1b4a8; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--white);
  background: var(--critical-600);
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

code {
  padding: 0.14rem 0.35rem;
  border-radius: 4px;
  background: var(--brand-50);
  color: var(--brand-800);
  font-size: 0.9em;
}

/* -------------------------------------------------------------- Cabecera */

.site-header {
  position: relative;
  z-index: 50;
  border-bottom: 1px solid rgba(11, 49, 84, 0.1);
  background: rgba(251, 250, 248, 0.96);
}

.announcement {
  color: var(--white);
  background: var(--brand-900);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.announcement-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-block: 7px;
}

.announcement-note { color: var(--brand-100); }

.header-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 84px;
  gap: 36px;
}

.brand img {
  width: 168px;
  height: auto;
}

.desktop-nav {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 2.2vw, 30px);
}

.desktop-nav a {
  position: relative;
  padding-block: 30px;
  color: var(--ink-700);
  font-size: 0.86rem;
  font-weight: 600;
}

.desktop-nav a::after {
  position: absolute;
  right: 0;
  bottom: 20px;
  left: 0;
  height: 2px;
  background: var(--critical-600);
  content: '';
  opacity: 0;
  transform: scaleX(0.4);
  transition: 160ms ease;
}

.desktop-nav a:hover,
.desktop-nav a[aria-current='page'] { color: var(--brand-900); }
.desktop-nav a:hover::after,
.desktop-nav a[aria-current='page']::after { opacity: 1; transform: none; }

.header-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--brand-900);
  border-radius: var(--radius-sm);
  color: var(--brand-900);
  font-size: 0.82rem;
  font-weight: 700;
  transition: 160ms ease;
}

.header-action:hover { color: var(--white); background: var(--brand-900); }

/* El acceso al panel va relleno y el enlace informativo perfilado: quien viene
   a entrar a su comunidad encuentra su boton sin leer los dos. */
.header-action--primary { color: var(--white); background: var(--brand-900); }
.header-action--primary:hover { background: var(--brand-700, var(--brand-900)); }

.header-actions { display: inline-flex; align-items: center; gap: 10px; }
.mobile-navigation { display: none; }

/* ----------------------------------------------------------------- Migas */

.breadcrumbs { margin-bottom: 44px; }
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-500);
  font-size: 0.75rem;
}
.breadcrumbs li { display: inline-flex; gap: 8px; }
.breadcrumbs a:hover { color: var(--critical-600); }
.breadcrumb-separator { color: var(--ink-300); }

.page-intro--services .breadcrumbs,
.page-intro--critical .breadcrumbs { color: var(--brand-100); }
.page-intro--services .breadcrumbs a,
.page-intro--critical .breadcrumbs a { color: var(--brand-100); }

/* ------------------------------------------------ Cabecera de una pagina */

.page-intro { padding-block: 48px 84px; background: var(--brand-50); }
.page-intro--editorial { padding-bottom: 74px; background: var(--paper); }
.page-intro--services { color: var(--white); background: var(--brand-900); }
.page-intro--critical { color: var(--white); background: linear-gradient(120deg, var(--critical-800), var(--critical-700)); }
.page-intro-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); align-items: end; gap: 80px; }
.page-intro-grid h1 { max-width: 860px; margin: 0; font-size: clamp(2.5rem, 5.5vw, 4.8rem); }
.page-intro-grid > p { margin: 0; color: var(--brand-100); }
.page-intro-grid--light > p { color: var(--ink-600); }
.page-intro--services h1,
.page-intro--critical h1 { color: var(--white); }

/* ------------------------------------------------------------------- Pie */

.site-footer { color: var(--brand-100); background: var(--brand-950); }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.5fr) repeat(4, 1fr);
  gap: 48px 34px;
  padding-block: 74px 64px;
}
.footer-brand { padding-right: 30px; }
.footer-brand img { width: 170px; margin-bottom: 24px; filter: brightness(0) invert(1); }
.footer-brand p { max-width: 390px; margin-bottom: 18px; color: var(--brand-100); font-size: .84rem; }
.footer-brand .official-warning { color: #a9c2d5; font-size: .75rem; }
.footer-brand .official-warning strong { color: #f1b4a8; }
.footer-group h2 { margin-bottom: 20px; color: #91aec4; font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; }
.footer-group ul { margin: 0; padding: 0; list-style: none; }
.footer-group li { margin-bottom: 10px; }
.footer-group a { color: #e7eff5; font-size: .82rem; }
.footer-group a:hover { color: #f1b4a8; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-block: 20px;
  border-top: 1px solid rgba(219,230,239,.12);
  color: #91aec4;
  font-size: .7rem;
  letter-spacing: .03em;
}

/*
    Pantallas mas estrechas.

    Van aqui, junto a lo que modifican, y no en un `responsive.css` aparte: el
    cascaron se copia entero a Laravel, y llevarse una mitad sin la otra deja
    la barra de navegacion sin su menu movil.
*/

@media (max-width: 1100px) {
  .header-main { gap: 22px; }
  .desktop-nav { gap: 15px; }
  .desktop-nav a { font-size: .78rem; }
  .header-actions { display: none; }
  .footer-grid { grid-template-columns: 1.4fr repeat(2, 1fr); }
  .footer-brand { grid-row: span 2; }
}

@media (max-width: 900px) {
  .section { padding-block: 82px; }
  .announcement-note { display: none; }
  .announcement-inner { justify-content: center; }
  .desktop-nav { display: none; }
  .header-main { grid-template-columns: 1fr auto; min-height: 72px; }
  .brand img { width: 150px; }
  .mobile-navigation { position: relative; display: block; }
  .mobile-navigation summary {
    display: flex;
    min-width: 82px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--brand-200);
    border-radius: var(--radius-sm);
    color: var(--brand-900);
    cursor: pointer;
    font-size: .78rem;
    font-weight: 750;
    list-style: none;
  }
  .mobile-navigation summary::-webkit-details-marker { display: none; }
  .mobile-navigation summary i,
  .mobile-navigation summary i::before,
  .mobile-navigation summary i::after { display: block; width: 17px; height: 2px; background: var(--brand-900); content: ''; transition: 160ms ease; }
  .mobile-navigation summary i { position: relative; }
  .mobile-navigation summary i::before { position: absolute; top: -5px; left: 0; }
  .mobile-navigation summary i::after { position: absolute; top: 5px; left: 0; }
  .mobile-navigation[open] summary i { background: transparent; }
  .mobile-navigation[open] summary i::before { top: 0; transform: rotate(45deg); }
  .mobile-navigation[open] summary i::after { top: 0; transform: rotate(-45deg); }
  .mobile-navigation nav {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    display: grid;
    min-width: min(320px, calc(100vw - 48px));
    padding: 12px;
    border: 1px solid var(--brand-200);
    background: var(--white);
    box-shadow: var(--shadow-md);
  }
  .mobile-navigation nav a { padding: 12px 14px; border-bottom: 1px solid var(--ink-100); color: var(--ink-700); font-size: .88rem; font-weight: 650; }
  .mobile-navigation nav a[aria-current='page'] { color: var(--critical-600); }
  .mobile-navigation nav .mobile-panel { margin-top: 8px; border: 0; color: var(--white); background: var(--brand-900); text-align: center; }
  .mobile-navigation nav .mobile-contact { border: 1px solid var(--brand-900); color: var(--brand-900); text-align: center; }
  .page-intro-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-brand { grid-column: 1 / -1; grid-row: auto; }
}

@media (max-width: 680px) {
  .container { width: min(calc(100% - 32px), var(--container)); }
  .section { padding-block: 66px; }
  h1 { font-size: clamp(2.35rem, 12vw, 3.7rem); }
  h2 { font-size: clamp(1.85rem, 9vw, 2.7rem); }
  .announcement { text-align: center; }
  .header-main { min-height: 68px; }
  .brand img { width: 138px; }
  .page-intro { padding-block: 34px 62px; }
  .breadcrumbs { margin-bottom: 34px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 38px 24px; padding-block: 56px 44px; }
  .footer-bottom { flex-direction: column; gap: 6px; }
}

@media (max-width: 420px) {
  .mobile-navigation summary span { display: none; }
  .mobile-navigation summary { min-width: 48px; padding: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
