/* ==========================================================================
   OSTRAC – Obra Social de Trabajadores de las Comunicaciones
   Estilos del sitio (sin build: se edita y se sube tal cual)
   ========================================================================== */

:root {
  --primary: #0b5fa5;        /* azul institucional */
  --primary-dark: #0a3d6b;
  --accent: #1597d5;         /* celeste del emblema */
  --navy: #0d2b45;
  --text: #24323f;
  --text-muted: #5d6b79;
  --border: #d9e3ec;
  --bg: #ffffff;
  --bg-alt: #f2f7fb;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(13, 43, 69, 0.08);
  --max: 1140px;
  --header-h: 84px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.25; color: var(--navy); margin: 0 0 0.6em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff; padding: 0.6rem 1rem; z-index: 200; }
.skip-link:focus { left: 0; }

/* ── Header / navegación ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; color: var(--primary); }
.brand img { height: 62px; width: auto; }
.brand-name { font-size: 0.82rem; font-weight: 700; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.02em; max-width: 15rem; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--border); border-radius: 8px;
  width: 44px; height: 44px; cursor: pointer; padding: 0; align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 20px; height: 2px; background: var(--navy); position: relative; content: "";
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

.site-header .container { max-width: 1320px; }
.main-nav ul { list-style: none; display: flex; flex-wrap: nowrap; gap: 0.1rem; margin: 0; padding: 0; }
.main-nav a {
  display: block; padding: 0.5rem 0.6rem; border-radius: 6px; white-space: nowrap;
  font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--primary); text-decoration: none;
}
.main-nav a:hover { background: var(--bg-alt); }
.main-nav a[aria-current="page"] { background: var(--primary); color: #fff; }

@media (max-width: 1240px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 0.5rem 1.25rem 1rem; }
  .main-nav a { padding: 0.8rem 0.6rem; font-size: 0.9rem; }
}

/* ── Botones ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: 0.75rem 1.4rem; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 0.9rem; text-decoration: none; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-light { background: #fff; color: var(--primary); }
.btn-light:hover { background: var(--bg-alt); color: var(--primary-dark); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ── Hero (home) ─────────────────────────────────────────────────────── */
.hero { position: relative; height: clamp(400px, 64vh, 620px); overflow: hidden; background: var(--navy); }
.hero-slide {
  position: absolute; inset: 0; display: flex; align-items: center;
  background-size: cover; background-position: center;
  opacity: 0; visibility: hidden; transition: opacity 1s ease, visibility 0s linear 1s;
}
.hero-slide.active { opacity: 1; visibility: visible; transition: opacity 1s ease; }
.hero-slide::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13,43,69,0.82) 0%, rgba(13,43,69,0.45) 55%, rgba(13,43,69,0.1) 100%); }
.hero-content { position: relative; z-index: 2; color: #fff; padding-left: 4rem; padding-right: 4rem; }
.hero-kicker { font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.85rem; color: #bfe4f7; margin-bottom: 0.75rem; }
.hero h1, .hero h2 { color: #fff; font-size: clamp(1.8rem, 4.6vw, 3.1rem); font-weight: 800; max-width: 17em; }
.hero p { max-width: 38em; font-size: 1.05rem; color: #e8f2f9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.hero-aatrac { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.hero-aatrac img { width: clamp(150px, 24vw, 280px); background: rgba(255,255,255,0.92); border-radius: 16px; padding: 1rem; }
.hero-arrow {
  position: absolute; z-index: 3; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,0.18); color: #fff; font-size: 1.8rem; line-height: 1; padding: 0 0 4px;
}
.hero-arrow:hover { background: rgba(255,255,255,0.35); }
.hero-arrow.prev { left: 0.75rem; }
.hero-arrow.next { right: 0.75rem; }
@media (max-width: 640px) { .hero-content { padding-left: 1.25rem; padding-right: 1.25rem; } .hero-arrow { top: auto; bottom: 0.5rem; transform: none; } }
.hero-dots { position: absolute; z-index: 3; bottom: 1rem; left: 0; right: 0; display: flex; justify-content: center; gap: 0.5rem; }
.hero-dots button { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; background: transparent; padding: 0; cursor: pointer; }
.hero-dots button.active { background: #fff; }

/* ── Encabezado de páginas internas ──────────────────────────────────── */
.page-header { background: linear-gradient(120deg, var(--primary-dark), var(--primary) 60%, var(--accent)); color: #fff; padding: 2.75rem 0 2.5rem; }
.page-header h1 { color: #fff; font-size: clamp(1.6rem, 3.6vw, 2.4rem); font-weight: 800; margin-bottom: 0.25rem; }
.page-header p { margin: 0; color: #dcecf7; }
.breadcrumb { font-size: 0.8rem; margin-bottom: 0.75rem; color: #cfe6f5; }
.breadcrumb a { color: #fff; }

/* ── Secciones ───────────────────────────────────────────────────────── */
.section { padding: 4rem 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: clamp(1.4rem, 2.8vw, 1.9rem); font-weight: 800; }
.section-title::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 2px; background: var(--accent); margin-top: 0.6rem; }
.section-subtitle { color: var(--text-muted); margin-top: -0.25rem; }
.text-center { text-align: center; }
.text-center .section-title::after { margin-left: auto; margin-right: auto; }
.prose { max-width: 820px; }
.prose p { text-align: justify; }

/* ── Líneas telefónicas ──────────────────────────────────────────────── */
.phones { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.phone-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.25rem 1.1rem; text-align: center; box-shadow: var(--shadow); }
.phone-card .label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); min-height: 2.6em; }
.phone-card a { display: block; font-size: 1.2rem; font-weight: 800; color: var(--primary); text-decoration: none; margin-top: 0.3rem; }
.phone-card.urgent { background: var(--navy); border-color: var(--navy); }
.phone-card.urgent .label { color: #bfe4f7; }
.phone-card.urgent a { color: #fff; }

/* ── Franja SCIS ─────────────────────────────────────────────────────── */
.scis { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-top: 2rem; }
.scis-logo img { height: 56px; width: auto; }
.scis-links { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.scis-links a { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; min-width: 92px; padding: 0.6rem 0.7rem; border-radius: 8px; font-size: 0.8rem; font-weight: 600; color: #4a7f86; text-decoration: none; }
.scis-links a:hover { background: var(--bg-alt); color: var(--primary); }
.scis-links svg { width: 30px; height: 30px; }

/* ── Tarjetas ────────────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.card { display: block; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: transform 0.15s, border-color 0.15s; }
a.card:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--text); }
.card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.card p { margin: 0; font-size: 0.92rem; color: var(--text-muted); }
.card .more { display: inline-block; margin-top: 0.9rem; font-weight: 700; font-size: 0.85rem; color: var(--primary); }
.card-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--bg-alt); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 0.9rem; }
.card-icon svg { width: 26px; height: 26px; }
.cards-services { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.cards-services .card { text-align: center; }
.cards-services .card-icon { margin-left: auto; margin-right: auto; }
.cards-services h3 { margin: 0; }

/* ── Tabla de delegaciones ───────────────────────────────────────────── */
.table-tools { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.table-tools input { flex: 1; min-width: 220px; max-width: 380px; padding: 0.65rem 1rem; border: 1px solid var(--border); border-radius: 999px; font: inherit; font-size: 0.9rem; }
.table-count { font-size: 0.8rem; color: var(--text-muted); }
.table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
table.data th { background: var(--primary); color: #fff; text-align: left; padding: 0.7rem 0.9rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.data td { padding: 0.6rem 0.9rem; border-top: 1px solid var(--border); vertical-align: top; }
table.data tbody tr:nth-child(even) { background: #f8fbfd; }
table.data td:first-child { font-weight: 700; color: var(--navy); white-space: nowrap; }
table.data a { word-break: break-all; }
@media (max-width: 720px) {
  table.data thead { display: none; }
  table.data tr { display: block; padding: 0.8rem 0.9rem; border-top: 1px solid var(--border); }
  table.data tr:first-child { border-top: 0; }
  table.data td { display: block; padding: 0.1rem 0; border: 0; white-space: normal !important; }
  table.data td:first-child { font-size: 0.95rem; margin-bottom: 0.2rem; }
}
.map-frame { width: 100%; height: 380px; border: 0; border-radius: var(--radius); margin-top: 1.5rem; }

/* ── Visor de documentos (páginas escaneadas) ────────────────────────── */
.doc-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.doc-bar p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.doc-pages { display: grid; gap: 1.25rem; max-width: 900px; margin: 0 auto; }
.doc-pages figure { margin: 0; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); overflow: hidden; }
.doc-pages img { width: 100%; }
.doc-pages figcaption { font-size: 0.75rem; color: var(--text-muted); text-align: center; padding: 0.4rem; border-top: 1px solid var(--border); }

/* ── Bloques de texto destacados ─────────────────────────────────────── */
.callout { background: #fff; border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: 1.25rem 1.5rem; box-shadow: var(--shadow); }
blockquote.statute { margin: 1.5rem 0 0; font-size: 0.9rem; color: var(--text-muted); background: var(--bg-alt); border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: 1.25rem 1.5rem; text-align: justify; }
.history { display: grid; grid-template-columns: 1fr 220px; gap: 2.5rem; align-items: start; }
@media (max-width: 760px) { .history { grid-template-columns: 1fr; } .history img { max-width: 180px; margin: 0 auto; } }
.topic { padding: 1.75rem 0; border-top: 1px solid var(--border); }
.topic:first-of-type { border-top: 0; padding-top: 0; }
.topic h2 { font-size: 1.3rem; }
.notice { text-align: center; padding: 3rem 1.5rem; border: 2px dashed var(--border); border-radius: var(--radius); background: #fff; }

/* ── Contacto ────────────────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.form { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.3rem; }
.field input, .field textarea { width: 100%; padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 0.95rem; }
.field textarea { min-height: 140px; resize: vertical; }
.hp { position: absolute; left: -9999px; }
.form-msg { margin: 1rem 0 0; font-weight: 600; font-size: 0.9rem; }
.form-msg.ok { color: #1a7f4b; }
.form-msg.err { color: #b3261e; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.contact-list li { display: flex; gap: 0.9rem; align-items: flex-start; }
.contact-list .card-icon { flex-shrink: 0; margin: 0; }
.contact-list strong { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.contact-list a { font-weight: 600; text-decoration: none; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer { background: var(--navy); color: #c9d8e5; padding: 3rem 0 1.25rem; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h2 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.8rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.footer-brand { display: flex; gap: 0.9rem; align-items: center; margin-bottom: 0.9rem; }
.footer-brand img { height: 64px; width: auto; border-radius: 6px; background: #fff; padding: 3px; }
.footer-brand span { color: #fff; font-weight: 700; font-size: 0.85rem; text-transform: uppercase; line-height: 1.3; }
.sss { display: inline-flex; align-items: center; gap: 0.7rem; background: #fff; border-radius: 8px; padding: 0.5rem 0.8rem; margin-top: 0.4rem; color: var(--navy) !important; font-weight: 600; font-size: 0.8rem; }
.sss img { height: 34px; width: auto; }
.footer-legal { margin: 2rem 0 0; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.14); font-size: 0.8rem; text-align: center; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.14); margin-top: 1rem; padding-top: 1rem; font-size: 0.78rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-slide, .card, .btn { transition: none; }
}
