/* ===== Tokens ===== */
:root {
  --bg: #ffffff;
  --surface: #f4f6f9;
  --line: #d8dee8;
  --line-strong: #b9c3d1;
  --text: #1b2330;
  --muted: #4f5a68;
  --accent: #1f4e79;
  --accent-hover: #173b5c;
  --focus: #2f6fb0;
  --danger: #b42318;
  --radius: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-family: var(--sans); font-weight: 600; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--accent); background: var(--surface); padding: .1rem .4rem; border-radius: 4px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2.5rem); margin-inline: auto; }
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: .6rem; }
.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); max-width: 58ch; }
.section-head { margin-bottom: clamp(2rem, 4vw, 3rem); max-width: 62ch; }
.section-head p:not(.eyebrow) { color: var(--muted); }

.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--accent); color: #fff; padding: .6rem 1rem; border-radius: 8px; }
.skip-link:focus { top: 1rem; }

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

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 1.25rem; min-height: 70px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); text-decoration: none; margin-right: auto; }
.brand-mark { font-weight: 700; font-size: .95rem; background: var(--accent); color: #fff; padding: .3rem .55rem; border-radius: 6px; }
.brand-text { font-weight: 600; font-size: .98rem; }

.site-nav ul { list-style: none; display: flex; gap: 1.2rem; margin: 0; padding: 0; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: .95rem; transition: color .2s var(--ease); }
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--accent); font-weight: 600; }

.lang-switch { display: flex; gap: .35rem; }
.lang-switch button { background: #fff; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .75rem; font: inherit; font-size: .85rem; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.lang-switch button:hover { color: var(--text); border-color: var(--line-strong); }
.lang-switch button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: #eef4fa; font-weight: 600; }

.menu-toggle { display: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; position: relative; }
.bars, .bars::before, .bars::after { display: block; width: 18px; height: 2px; background: var(--text); position: absolute; left: 50%; transform: translateX(-50%); transition: transform .3s var(--ease), opacity .2s; content: ""; }
.bars { top: 50%; margin-top: -1px; }
.bars::before { top: -6px; left: 0; transform: none; }
.bars::after { top: 6px; left: 0; transform: none; }
.menu-toggle[aria-expanded="true"] .bars { opacity: 0; }
.menu-toggle[aria-expanded="true"] .bars::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars::after { top: 0; transform: rotate(-45deg); }

/* ===== Hero / bienvenida ===== */
.hero { padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 4.5rem); background: linear-gradient(180deg, #f4f8fc 0%, #fff 100%); border-bottom: 1px solid var(--line); }
.hero h1 { max-width: 18ch; }
.hero .lead { margin-bottom: 1.25rem; }
.area-note { color: var(--muted); max-width: 60ch; margin: 0 0 2.75rem; font-size: 1.02rem; }

.info-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.info-card { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
.info-card:hover { box-shadow: 0 8px 22px rgba(16, 24, 40, .08); transform: translateY(-2px); }
.info-label { font: 600 .8rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.info-value { font-size: clamp(1.6rem, 2.6vw, 2.05rem); font-weight: 700; line-height: 1.2; color: var(--text); margin: 0 0 .5rem; word-break: break-word; }
.info-sub { font-size: 1.05rem; color: var(--muted); margin: 0 0 .85rem; }
.info-sub a { color: var(--accent); font-weight: 600; }
.info-sub code { font-size: 1rem; }

/* Banner con foto */
.hero.hero-photo {
  background: linear-gradient(180deg, rgba(10, 25, 45, .55) 0%, rgba(10, 25, 45, .85) 100%), url("../img/costanera-center.jpg") center 40% / cover no-repeat;
  color: #fff; border-bottom: none;
}
.hero.hero-photo h1, .hero.hero-photo .lead, .hero.hero-photo .eyebrow { color: #fff; }
.hero.hero-photo .lead, .hero.hero-photo .area-note { color: rgba(255, 255, 255, .9); }
.hero.hero-photo .eyebrow { color: #cfe3f5; }

/* ===== Buttons ===== */
.btn, .btn-ghost { font: inherit; cursor: pointer; border-radius: 8px; padding: .75rem 1.35rem; transition: background .2s, color .2s, border-color .2s; }
.btn { background: var(--accent); color: #fff; border: 1px solid var(--accent); font-weight: 600; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: #fff; color: var(--accent); border: 1px solid var(--line-strong); font-size: .9rem; padding: .5rem 1rem; font-weight: 500; }
.btn-ghost:hover { border-color: var(--accent); background: #eef4fa; }

/* ===== Cards ===== */
.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; gap: .5rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); transition: border-color .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease); }
.card:hover { border-color: var(--line-strong); box-shadow: 0 8px 22px rgba(16, 24, 40, .07); transform: translateY(-2px); }
.card h3 { font-size: 1.25rem; }
.card .tag { align-self: flex-start; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: #eef4fa; padding: .25rem .6rem; border-radius: 999px; }
.card .meta { font-size: .98rem; color: var(--muted); margin: 0; }
.card .meta a { color: var(--text); }
.card-links { margin-top: auto; padding-top: .75rem; display: flex; flex-wrap: wrap; gap: .6rem 1rem; font-size: .95rem; font-weight: 600; }

.cards-food .card { flex-direction: column; }
.food-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.food-head .card-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.food-head .qr { margin: 0; width: 110px; flex: 0 0 auto; }
.qr img { width: 110px; height: 110px; background: #fff; padding: 6px; border: 1px solid var(--line); border-radius: 8px; margin: 0 auto .35rem; }
.qr figcaption { font-size: .72rem; color: var(--muted); text-align: center; line-height: 1.3; }
.placeholder { opacity: .6; font-style: italic; }

.care-title { font-size: 1.4rem; margin: 2.5rem 0 1.25rem; }
.care-cards { margin-bottom: 3rem; }

/* ===== Rules ===== */
.rules-list { list-style: none; counter-reset: r; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.rules-list li { counter-increment: r; position: relative; padding: 1.1rem 0 1.1rem 3.2rem; border-bottom: 1px solid var(--line); color: var(--text); font-size: 1.05rem; }
.rules-list li::before { content: counter(r, decimal-leading-zero); position: absolute; left: 0; top: 1.2rem; font-weight: 700; color: var(--accent); font-size: .95rem; }

/* ===== Emergency ===== */
.emergency-grid { list-style: none; padding: 0; margin: 0 0 2.5rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.emergency-item { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--danger); border-radius: var(--radius); padding: 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .35rem; color: var(--muted); font-size: 1rem; }
.emergency-num { font-size: 2.1rem; font-weight: 700; color: var(--text); line-height: 1; }

/* ===== FAQ ===== */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 1.1rem 2.5rem 1.1rem 0; position: relative; font-weight: 600; font-size: 1.1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .2rem; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 1.5rem; transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 1.1rem; }

/* ===== Form ===== */
.form { display: grid; gap: 1.3rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); }
.field { display: flex; flex-direction: column; gap: .45rem; }
.field label { font-size: .95rem; font-weight: 600; color: var(--text); }
.field input, .field select, .field textarea { font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: .75rem .9rem; transition: border-color .2s, box-shadow .2s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 78, 121, .18); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.error { color: var(--danger); font-size: .9rem; margin: 0; }
.form-status { font-size: .98rem; margin: 0; min-height: 1.5em; }
.form-status.ok { color: #1e6b3a; font-weight: 600; }
.form-status.fail { color: var(--danger); }
.form .btn { justify-self: start; }

/* ===== Galería ===== */
.gallery { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.gallery-item { display: block; width: 100%; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.gallery-item:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16, 24, 40, .08); }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1100px); }
.lightbox::backdrop { background: rgba(10, 20, 35, .85); }
.lightbox img { display: block; width: 100%; height: auto; max-height: 88vh; object-fit: contain; border-radius: var(--radius); background: #fff; }
.lightbox-close { position: absolute; top: -12px; right: -12px; z-index: 1; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.lightbox-close:hover { background: var(--surface); }

/* ===== Footer ===== */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 2rem 0; color: var(--muted); font-size: .92rem; text-align: center; }

/* ===== Reveal (solo si JS carga) ===== */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .menu-toggle { display: inline-block; }
  .site-nav { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 10px 24px rgba(16, 24, 40, .08); display: none; padding: .5rem 0; max-height: calc(100vh - 70px); overflow-y: auto; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { display: block; padding: .8rem 1.25rem; font-size: 1.02rem; }
  .brand-text { display: none; }
}
@media (max-width: 520px) {
  .lang-switch button { padding: .3rem .55rem; }
  .food-head .qr { width: 96px; }
  .food-head .qr img { width: 84px; height: 84px; }
  .info-card { padding: 1.25rem; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
