/* ==========================================================
   CEAZAMet | Landing de difusión
   Colores y tipografía editables desde estas variables.
   Inspiración: presentación institucional CEAZAMar.
   ========================================================== */
:root {
  --navy: #073449;
  --navy-deep: #052937;
  --navy-soft: #295768;
  --teal: #087f93;
  --teal-bright: #24a7b5;
  --seafoam: #e2f2f3;
  --paper: #f2f8f9;
  --white: #ffffff;
  --muted: #607983;
  --border: #dbe9ed;
  --gold: #efbd79;
  --shadow: 0 16px 44px rgba(5, 49, 67, .075);
  --radius: 18px;
  --font: 'Manrope', 'Avenir Next', 'Segoe UI', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font);
  color: var(--navy);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--teal-bright); outline-offset: 4px; }
button { font: inherit; }

.site-shell {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse 58% 40% at 101% 17%, rgba(18, 151, 170, .10), transparent 74%),
    radial-gradient(ellipse 45% 40% at -5% 65%, rgba(46, 162, 179, .07), transparent 76%),
    linear-gradient(180deg, #f8fbfb 0%, #eff7f8 75%, #eaf4f6 100%);
}
.site-shell::before {
  content: '';
  position: absolute;
  z-index: -1;
  right: -240px;
  top: 74px;
  width: 720px;
  height: 720px;
  border: 1px solid rgba(12, 133, 153, .095);
  border-radius: 42% 58% 55% 45%;
  transform: rotate(-24deg);
  box-shadow:
    0 0 0 38px rgba(12, 133, 153, .017),
    0 0 0 76px rgba(12, 133, 153, .014),
    0 0 0 120px rgba(12, 133, 153, .011),
    0 0 0 166px rgba(12, 133, 153, .009);
  pointer-events: none;
}
.container { width: min(1140px, calc(100% - 64px)); margin-inline: auto; }

/* Logos alineados con el título */
.hero__title-row { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr) minmax(0, 210px); align-items: center; gap: 24px; }
.logo-wrap { display: flex; align-items: center; justify-content: center; min-width: 0; border-radius: 8px; }
.logo-wrap img { display: block; width: 100%; height: auto; max-height: 210px; object-fit: contain; }

/* Main hero */
.page-main { flex: 1; padding-bottom: 70px; }
.hero { text-align: center; padding: clamp(42px, 6.4vw, 80px) 12px 37px; transition: padding .2s ease; }
.hero__eyebrow { display: flex; align-items: center; justify-content: center; gap: 13px; margin: 0 0 23px; font-size: 10px; font-weight: 800; letter-spacing: .26em; color: var(--teal); }
.hero__eyebrow-line { display: inline-block; width: 31px; height: 1px; background: #a8d3d8; }
.hero h1 { margin: 0 auto; max-width: 960px; font-size: clamp(36px, 5vw, 63px); letter-spacing: -.052em; line-height: 1.18; font-weight: 800; text-wrap: balance; }
.hero h1 span { color: var(--teal); }
.hero__location { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 18px 0 0; color: #567582; font-size: 16px; font-weight: 700; }
.hero__location svg { color: var(--teal); }
.hero__description { margin: 20px auto 0; max-width: 680px; font-size: 14px; line-height: 1.85; color: var(--muted); }
body[data-view='inside'] .hero { padding-top: 29px; padding-bottom: 17px; }
body[data-view='inside'] .hero__eyebrow { margin-bottom: 13px; }
body[data-view='inside'] .hero h1 { font-size: clamp(26px, 3.4vw, 41px); }
body[data-view='inside'] .hero__description { display: none; }
body[data-view='inside'] .hero__location { margin-top: 9px; font-size: 13px; }

/* Explorer */
.explorer { width: min(100%, 1070px); margin-inline: auto; }
.view-panel { animation: enter .34s cubic-bezier(.2,.75,.25,1) both; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.explorer__lead { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-caption { margin: 0; color: var(--teal); font-weight: 800; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }

/* Category cards */
.category-card {
  position: relative; text-align: left; display: flex; flex-direction: column;
  min-height: 204px; width: 100%; padding: 28px 30px 24px;
  cursor: pointer; color: var(--navy); background: rgba(255,255,255,.94);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .23s ease, box-shadow .23s ease, border-color .23s ease;
}
.category-card::before { content: ''; position: absolute; width: 160px; height: 160px; right: -75px; top: -85px; border-radius: 50%; background: rgba(12, 134, 153, .055); transition: transform .25s ease; }
.category-card::after { content: ''; position: absolute; bottom: 0; left: 30px; right: 30px; height: 3px; border-radius: 10px 10px 0 0; background: linear-gradient(90deg, var(--teal-bright), transparent 90%); opacity: 0; transition: opacity .2s ease; }
.category-card:hover, .category-card:focus-visible { transform: translateY(-4px); box-shadow: 0 22px 48px rgba(5,49,67,.115); border-color: #abdae0; }
.category-card:hover::before { transform: scale(1.3); }
.category-card:hover::after { opacity: 1; }
.category-card__top { display: flex; justify-content: space-between; align-items: flex-start; }
.icon-box { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 12px; color: var(--teal); background: #e8f5f6; flex-shrink: 0; }
.icon-svg { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.icon-svg svg { display: block; width: 100%; height: 100%; }
.icon-box .icon-svg { width: 28px; height: 28px; }
.category-card__number { color: #a0b9c0; font-size: 12px; letter-spacing: .12em; font-weight: 800; }
.category-card__title { margin: 20px 0 2px; font-size: clamp(21px,2vw,26px); font-weight: 800; letter-spacing: -.045em; }
.category-card__bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.category-card__description { margin: 3px 0 0; color: var(--muted); line-height: 1.55; font-size: 14px; max-width: 360px; }
.category-card__arrow { width: 32px; height: 32px; border: 1px solid #d6e9ec; border-radius: 100%; display: grid; place-items: center; flex-shrink: 0; color: var(--teal); transition: color .2s, background .2s; }
.category-card__arrow .icon-svg { width: 16px; height: 16px; }
.category-card:hover .category-card__arrow { background: var(--teal); color: white; }

/* Inside section header */
.detail-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 6px 0 20px; }
.back-button { display: inline-flex; align-items: center; gap: 9px; border: 1px solid #d0e5e9; border-radius: 100px; padding: 11px 17px; background: #fff; cursor: pointer; font-size: 12px; color: var(--navy); font-weight: 800; transition: border .2s, background .2s; }
.back-button:hover { background: #e7f4f6; border-color: #a6d5dc; }
.back-button .icon-svg { width: 16px; height: 16px; }
.crumb { text-align: right; font-size: 11px; color: #76909a; font-weight: 600; }
.crumb b { color: var(--navy); font-weight: 800; }
.crumb__sep { padding: 0 7px; color: #9eb8c0; }
.section-header { padding: 0 3px 19px; }
.section-header__eyebrow { margin: 0 0 8px; font-size: 10px; color: var(--teal); font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.section-header__title { margin: 0; font-size: clamp(29px, 3.7vw, 41px); line-height: 1.17; font-weight: 800; letter-spacing: -.05em; outline: none; }
.section-header__description { font-size: 13px; max-width: 760px; line-height: 1.75; margin: 10px 0 0; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.detail-grid--links { grid-template-columns: 1fr; gap: 11px; }

/* Subsections; each item is either an actual link, an internal button, or an informational service card */
.detail-card { position: relative; display: flex; align-items: center; gap: 16px; padding: 21px 23px; min-height: 111px; background: rgba(255,255,255,.97); border-radius: 15px; border: 1px solid var(--border); box-shadow: 0 7px 22px rgba(3, 55, 74, .035); text-align: left; }
a.detail-card, button.detail-card { width: 100%; text-decoration: none; cursor: pointer; color: inherit; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
button.detail-card { font: inherit; }
a.detail-card:hover, button.detail-card:hover { transform: translateY(-2px); border-color: #9ed0d7; box-shadow: 0 12px 28px rgba(5,49,67,.09); }
.detail-card__icon { width: 48px; height: 48px; display: grid; place-items: center; flex-shrink: 0; color: var(--teal); background: #e9f5f6; border-radius: 11px; }
.detail-card__icon .icon-svg { width: 27px; height: 27px; }
.detail-card__text { min-width: 0; flex: 1; }
.detail-card__title { display: block; font-size: 17px; font-weight: 800; line-height: 1.4; letter-spacing: -.023em; }
.detail-card__description { display: block; font-size: 13px; color: var(--muted); line-height: 1.55; margin-top: 5px; }
.detail-card__badge { display: inline-block; margin-top: 7px; font-size: 9px; letter-spacing: .1em; font-weight: 800; text-transform: uppercase; color: #7a601a; background: #fff1d6; border: 1px solid #f8e1af; padding: 4px 7px; border-radius: 5px; }
.detail-card__arrow { flex-shrink: 0; color: #4d8b97; }
.detail-card__arrow .icon-svg { width: 18px; height: 18px; }
.detail-card--service { cursor: default; }
.detail-card--service .detail-card__icon { color: var(--navy-soft); background: #eef3f4; }
.detail-card--article { min-height: 104px; gap: 16px; padding-block: 18px; }
.detail-card--article .detail-card__title { font-size: 17px; line-height: 1.45; }
.detail-card--article .detail-card__meta { font-size: 11px; margin-bottom: 7px; }
.detail-card--article .detail-card__arrow .icon-svg { width: 21px; height: 21px; }
.detail-card__meta { display: block; margin-bottom: 6px; text-transform: uppercase; font-weight: 800; font-size: 9px; letter-spacing: .09em; color: var(--teal); }
.article-list__note { margin: 16px 4px 0; color: #748c95; font-size: 12px; line-height: 1.6; }

/* Footer */
.footer { border-top: 1px solid #d7e7ea; background: rgba(255,255,255,.42); }
.footer__inner { min-height: 74px; display: flex; justify-content: space-between; align-items: center; gap: 16px; color: #68828c; font-size: 11px; font-weight: 600; }
.footer__separator { padding-inline: 7px; color: #9cb0b6; }

/* Integrated external content viewer */
body[data-view='viewer'] { overflow: hidden; }
body[data-view='viewer'] .site-shell { visibility: hidden; }
.content-viewer {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: var(--navy);
  background: var(--paper);
  animation: viewer-enter .24s ease both;
}
.content-viewer.is-closing {
  pointer-events: none;
  animation: viewer-exit .2s ease both;
}
.content-viewer__toolbar {
  z-index: 1;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 3px 14px rgba(5, 49, 67, .06);
}
.content-viewer__back,
.content-viewer__original {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #d0e5e9;
  border-radius: 100px;
  color: var(--navy);
  background: var(--white);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.content-viewer__back:hover,
.content-viewer__original:hover {
  background: #e7f4f6;
  border-color: #a6d5dc;
}
.content-viewer__back .icon-svg { width: 16px; height: 16px; }
.content-viewer__title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.content-viewer__original {
  color: var(--white);
  background: var(--teal);
  border-color: var(--teal);
}
.content-viewer__original:hover {
  color: var(--white);
  background: var(--navy-soft);
  border-color: var(--navy-soft);
}
.content-viewer__frame-container {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: var(--white);
}
.content-viewer__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.content-viewer__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  background: var(--white);
  font-size: 13px;
  pointer-events: none;
}
.content-viewer__spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #dcecef;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: viewer-spin .8s linear infinite;
}
@keyframes viewer-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes viewer-exit {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(8px); }
}
@keyframes viewer-spin { to { transform: rotate(360deg); } }

@media (max-width: 750px) {
  .container { width: min(100% - 36px, 580px); }
  .hero { padding-top: 47px; padding-bottom: 27px; }
  .hero__title-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero__title-row .logo-wrap { display: none; }
  .hero h1 { font-size: clamp(24px, 4.8vw, 36px); }
  body[data-view='inside'] .hero h1 { font-size: clamp(22px, 4.4vw, 32px); }
  .hero__description { font-size: 13px; }
  .category-grid { grid-template-columns: 1fr; gap: 12px; }
  .category-card { min-height: 168px; padding: 22px 23px; }
  .category-card__title { margin-top: 15px; }
  .detail-grid { grid-template-columns: 1fr; }
  .footer__inner { text-align: center; justify-content: center; flex-wrap: wrap; padding: 22px 0; min-height: 75px; gap: 6px 22px; }
  .page-main { padding-bottom: 50px; }
  .content-viewer__toolbar { gap: 8px; min-height: 58px; padding: 7px 10px; }
  .content-viewer__back,
  .content-viewer__original { min-height: 38px; padding: 7px 10px; font-size: 11px; }
  .content-viewer__title { font-size: 13px; }
}
@media (max-width: 430px) {
  .container { width: calc(100% - 28px); }
  .hero { padding: 35px 0 22px; }
  .hero__eyebrow { font-size: 9px; gap: 9px; margin-bottom: 16px; }
  .hero__eyebrow-line { width: 18px; }
  .hero h1, body[data-view='inside'] .hero h1 { font-size: clamp(22px, 6vw, 26px); }
  .hero__description { margin-top: 14px; }
  .category-card { min-height: 162px; }
  .detail-card { padding: 17px 15px; gap: 12px; }
  .detail-card__icon { width: 44px; height: 44px; }
  .detail-card__icon .icon-svg { width: 25px; height: 25px; }
  .detail-card__title { font-size: 16px; }
  .detail-card__description { font-size: 12.5px; }
  .detail-card--article { min-height: 96px; padding-block: 16px; }
  .detail-card--article .detail-card__title { font-size: 16px; }
  .detail-card--article .detail-card__meta { font-size: 10px; }
  .section-header__title { font-size: 29px; }
  .crumb { font-size: 10px; }
  .content-viewer__toolbar { gap: 6px; padding-inline: 7px; }
  .content-viewer__back,
  .content-viewer__original { gap: 5px; padding-inline: 8px; font-size: 10px; }
  .content-viewer__title { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Distribución ajustada al viewport; el contenido extenso se desplaza dentro del explorador. */
html, body { height: 100%; }
body { overflow: hidden; }
.site-shell { height: 100vh; height: 100dvh; min-height: 0; }
.page-main { display: flex; flex-direction: column; min-height: 0; padding-bottom: clamp(10px, 2vh, 22px); }
.hero, body[data-view='inside'] .hero { flex: 0 0 auto; padding: clamp(12px, 2.5vh, 28px) 0 clamp(12px, 2vh, 22px); }
.hero__title-row { grid-template-columns: minmax(0, 170px) minmax(0, 1fr) minmax(0, 170px); gap: 20px; }
.logo-wrap img { max-height: min(170px, 19dvh); }
.hero h1 { font-size: clamp(30px, 4.2vw, 54px); }
.hero__eyebrow, body[data-view='inside'] .hero__eyebrow { margin-bottom: 10px; }
.hero__location { margin-top: 8px; }
.hero__description { margin-top: 8px; line-height: 1.5; }
.explorer { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; padding: 6px; }
.view-panel { min-height: 100%; }
body[data-view='home'] .view-panel { display: flex; flex-direction: column; }
.explorer__lead { flex: 0 0 auto; margin-bottom: 10px; }
.category-grid { flex: 1; grid-template-rows: repeat(2, minmax(min-content, 1fr)); gap: 12px; }
.category-card { min-height: 0; padding: clamp(12px, 2vh, 22px) 22px; justify-content: center; }
.category-card__title { margin-top: 10px; }
.icon-box { width: 44px; height: 44px; }
.icon-box .icon-svg { width: 26px; height: 26px; }
.footer { flex: 0 0 auto; }
.footer__inner { min-height: 44px; padding-block: 10px; }
body[data-view='inside'] .logo-wrap img { max-height: min(115px, 14dvh); }
.detail-top { margin: 0 0 12px; }
.section-header { padding-bottom: 12px; }
.detail-card { min-height: 88px; padding: 14px 18px; }
.detail-card--article { min-height: 96px; padding-block: 16px; }

@media (max-width: 750px) {
  .hero__title-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero h1 { font-size: clamp(24px, 5vw, 36px); }
  .hero__description { font-size: 12px; max-width: 440px; }
  .category-grid { grid-template-rows: repeat(4, minmax(min-content, 1fr)); gap: 8px; }
  .category-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; column-gap: 12px; row-gap: 4px; padding: 12px 14px; }
  .category-card__top { grid-column: 1; grid-row: 1 / 3; align-self: center; }
  .category-card__number { display: none; }
  .category-card__title { grid-column: 2; margin: 0; font-size: 20px; }
  .category-card__bottom { grid-column: 2; gap: 8px; }
  .category-card__description { margin: 0; font-size: 13px; line-height: 1.45; }
  .category-card__arrow { width: 30px; height: 30px; }
  .footer__inner { min-height: 42px; padding-block: 8px; font-size: 10px; gap: 4px 12px; }
}
@media (max-height: 650px) {
  .hero, body[data-view='inside'] .hero { padding-block: 10px; }
  .hero__description { display: none; }
  .hero__eyebrow, body[data-view='inside'] .hero__eyebrow { margin-bottom: 6px; }
  .logo-wrap img { max-height: 90px; }
  .hero h1, body[data-view='inside'] .hero h1 { font-size: clamp(23px, 3.2vw, 36px); }
  .category-card { padding-block: 9px; }
  .category-card__title { margin-top: 4px; }
}


/* Paisaje vectorial abstracto: cielo, precipitación y cordillera. */
.site-shell {
  background:
    url('../assets/paisaje-meteorologico.svg') center / 100% 100% no-repeat,
    radial-gradient(ellipse at 50% 38%, #ffffff 0%, #f2f8f9 62%, #e2f2f3 100%);
}
.site-shell::before { display: none; }
.footer { background: rgba(255,255,255,.66); }
@media (max-width: 750px) {
  .site-shell { background-size: auto 100%, auto; }
}
