/* ============================================================
   Protectoras.es — estilos
   ============================================================ */

:root {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-soft: #fff3e6;
    --ink: #1a202c;
    --muted: #5b6472;
    --line: #e2e6ec;
    --bg: #f6f7f9;
    --surface: #ffffff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow-md: 0 10px 30px rgba(16, 24, 40, .1);
    --container: 1200px;
    --header-h: 76px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

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

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    min-height: var(--header-h); gap: 24px;
}

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

.site-nav { display: flex; align-items: center; gap: 6px; }

.nav-link {
    padding: 9px 14px; border-radius: 999px;
    color: var(--ink); font-weight: 600; font-size: 15px;
}
.nav-link:hover { color: var(--primary); text-decoration: none; background: var(--primary-soft); }
.nav-link.is-active { color: var(--primary); background: var(--primary-soft); }

.nav-toggle {
    display: none; background: none; border: 0; cursor: pointer;
    padding: 8px; border-radius: 8px;
}
.nav-toggle span {
    display: block; width: 24px; height: 2px; background: var(--ink);
    margin: 5px 0; transition: transform .2s;
}

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border: 0; border-radius: 999px;
    font-weight: 700; font-size: 15px; cursor: pointer;
    transition: background-color .2s, transform .1s;
}
.btn:active { transform: scale(.98); }

.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(249, 115, 22, .35); }
.btn--primary:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }

.btn--outline { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn--outline:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.btn--sm { padding: 8px 16px; font-size: 14px; }
.btn--lg { padding: 15px 30px; font-size: 16px; }
.btn--block { display: flex; width: 100%; }

/* ---------- Hero ---------- */
.hero {
    background:
        linear-gradient(135deg, rgba(16, 22, 32, .82), rgba(16, 22, 32, .55)),
        url("/assets/images/hero.jpg") center/cover no-repeat;
    color: #fff;
    padding: 80px 0 70px;
}

.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; }

.hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.15; max-width: 800px; }
.hero-sub { font-size: 18px; max-width: 620px; opacity: .92; }

/* Buscador */
.search-box { position: relative; width: 100%; max-width: 620px; margin-top: 10px; }

.search-icon {
    position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px; color: var(--muted); pointer-events: none;
}

.search-input {
    width: 100%; padding: 18px 24px 18px 54px;
    border: 2px solid transparent; border-radius: 999px;
    font-size: 16px; color: var(--ink); background: #fff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
    outline: none; transition: border-color .2s;
}
.search-input:focus { border-color: var(--primary); }
.search-input::placeholder { color: #9aa3b0; }

.search-results {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-md);
    overflow: hidden; z-index: 50; display: none;
    border: 1px solid var(--line);
}
.search-box.is-open .search-results { display: block; }

.search-result {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; color: var(--ink); font-weight: 600;
    border-bottom: 1px solid var(--line);
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--primary-soft); text-decoration: none; }

.search-result .tag {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--primary); background: var(--primary-soft);
    padding: 3px 8px; border-radius: 999px; flex-shrink: 0;
}

.search-empty { padding: 16px 20px; color: var(--muted); }

/* Stats */
.hero-stats { display: flex; gap: 48px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 30px; line-height: 1.1; }
.stat span { font-size: 13px; opacity: .85; }

/* ---------- Secciones ---------- */
.section { padding: 60px 0; }
.section--alt { background: var(--surface); border-block: 1px solid var(--line); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-title { font-size: 28px; line-height: 1.2; }
.section-sub { color: var(--muted); margin-top: 4px; }

.link-more { font-weight: 700; color: var(--primary); }

/* Tarjetas */
.card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Grid CCAA */
.ccaa-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.ccaa-card {
    display: flex; flex-direction: column; gap: 4px;
    padding: 22px 24px; color: var(--ink);
}
.ccaa-card:hover { color: var(--primary); text-decoration: none; }
.ccaa-card__name { font-weight: 700; font-size: 17px; }
.ccaa-card__count { color: var(--muted); font-size: 14px; }

/* Provincias destacadas */
.prov-grid {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.prov-link {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    color: var(--ink); font-weight: 600; font-size: 15px;
}
.prov-link:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }
.prov-link__count { color: var(--muted); font-weight: 400; font-size: 13px; white-space: nowrap; }

/* Protectora card */
.protectora-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .protectora-grid { grid-template-columns: repeat(2, 1fr); } }

.protectora-card__link { display: flex; gap: 16px; align-items: flex-start; padding: 20px; }
.protectora-card__link:hover { text-decoration: none; }

.protectora-card__logo {
    width: 64px; height: 64px; flex-shrink: 0;
    border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--line); font-size: 28px;
}
.protectora-card__logo img { width: 100%; height: 100%; object-fit: contain; }

.protectora-card__body { flex: 1; min-width: 0; }
.protectora-card__name { font-size: 17px; }
.protectora-card__location {
    display: flex; align-items: center; gap: 6px;
    color: var(--muted); font-size: 14px; margin: 2px 0 6px;
}
.protectora-card__desc { color: var(--muted); font-size: 14px; }
.protectora-card__arrow { color: var(--primary); font-weight: 700; align-self: center; }

/* Noticias */
.news-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .news-grid { grid-template-columns: repeat(3, 1fr); } }
.news-grid--list { grid-template-columns: 1fr; }

.news-card__body { padding: 20px 24px; }
.news-card__body time { color: var(--muted); font-size: 13px; }
.news-card__body h2, .news-card__body h3 { font-size: 18px; margin: 6px 0 8px; line-height: 1.35; }
.news-card__body p { color: var(--muted); }
.news-card__body .link-more { display: inline-block; margin-top: 10px; }

/* CTA banner */
.cta-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
    background: linear-gradient(120deg, var(--primary), #fb923c);
    color: #fff; border-radius: var(--radius); padding: 40px;
    box-shadow: 0 10px 30px rgba(249, 115, 22, .3);
}
.cta-banner h2 { font-size: 26px; margin-bottom: 6px; }
.cta-banner p { opacity: .95; max-width: 520px; }
.cta-banner .btn { background: #fff; color: var(--primary-dark); }

/* ---------- Páginas ---------- */
.page { padding: 36px 0 64px; }
.page-title { font-size: 32px; line-height: 1.2; }
.page-sub { color: var(--muted); margin: 8px 0 28px; }

.breadcrumb {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    color: var(--muted); font-size: 14px; margin-bottom: 14px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 600; }

.content-block {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-sm);
}
.content-block h2 { margin: 22px 0 8px; font-size: 22px; }
.content-block h2:first-child { margin-top: 0; }
.content-block ul, .content-block ol { margin: 10px 0 10px 24px; }
.content-block li { margin-bottom: 6px; }
.content-block p { margin: 10px 0; }
.cta-text { margin-top: 24px; }

/* Chips */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 24px; }
.chip {
    padding: 8px 16px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line);
    color: var(--ink); font-size: 14px; font-weight: 600;
}
.chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* Empty state */
.empty-state {
    background: var(--surface); border: 2px dashed var(--line);
    border-radius: var(--radius); padding: 48px 24px; text-align: center;
    color: var(--muted); margin-top: 24px;
}
.empty-state p { margin-bottom: 10px; }

/* ---------- Ficha detalle ---------- */
.detail-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .detail-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }

.detail-header { padding: 28px; display: flex; gap: 24px; }
.detail-header__logo {
    width: 120px; height: 120px; flex-shrink: 0;
    border-radius: 16px; overflow: hidden; display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--line);
}
.detail-header__logo img { width: 100%; height: 100%; object-fit: contain; }
.detail-title { font-size: 28px; line-height: 1.2; }
.detail-location { display: flex; align-items: center; gap: 6px; color: var(--muted); margin: 6px 0 14px; }
.prose { line-height: 1.75; }

.detail-aside { display: flex; flex-direction: column; gap: 16px; }
.aside-box { padding: 24px; }
.aside-box h2 { font-size: 18px; margin-bottom: 12px; }
.aside-box p { color: var(--muted); margin-bottom: 14px; font-size: 14px; }

.contact-line {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--ink); font-weight: 600; margin-bottom: 8px;
    background: var(--bg); word-break: break-all;
}
.contact-line:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.contact-icon { color: var(--primary); }

.social-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.social-links a {
    font-size: 13px; font-weight: 700; color: var(--ink);
    background: var(--bg); border-radius: 999px; padding: 6px 14px;
}
.social-links a:hover { color: var(--primary); text-decoration: none; }

.aside-box--cta { background: var(--primary-soft); border-color: transparent; }

/* ---------- Artículo ---------- */
.page--article { max-width: 820px; }
.article-head { margin-bottom: 24px; }
.article-head time { color: var(--muted); }
.article-title { font-size: 34px; line-height: 1.2; margin-top: 6px; }
.article-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-sm); }
.article-lead { font-size: 19px; color: var(--muted); font-style: italic; }
.article-body figure { margin: 20px 0; }
.article-body img { border-radius: var(--radius); }
.article-body figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; text-align: center; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 18px; margin-top: 8px; }
.form-row { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-weight: 600; font-size: 14px; }
.form-group input, .form-group textarea, .form-group select {
    padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    font: inherit; color: var(--ink); background: #fff; outline: none;
    transition: border-color .2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--primary); }

.checkbox-line { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.checkbox-line input { margin-top: 3px; }

.alert {
    background: #fef3c7; border: 1px solid #fcd34d; color: #92400e;
    padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px;
}
.alert--ok { background: #dcfce7; border-color: #86efac; color: #166534; }

/* ---------- Anuncios ---------- */
.ad-slot { margin: 24px 0; min-height: 120px; display: flex; align-items: center; justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { background: #151b24; color: #cbd5e1; margin-top: 40px; }
.footer-grid {
    display: grid; gap: 32px; padding: 48px 0;
    grid-template-columns: 1fr; 
}
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }

.footer-logo img { height: 40px; width: auto; }
.footer-brand p { color: #94a3b8; margin-top: 14px; max-width: 340px; font-size: 14px; }
.footer-slogan {
    margin-top: 16px; color: #fff; font-weight: 700; font-size: 14px;
    text-transform: uppercase; letter-spacing: .14em;
}

.footer-col h3 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-col a { display: block; color: #94a3b8; padding: 4px 0; font-size: 14px; }
.footer-col a:hover { color: #fff; text-decoration: none; }

.footer-bottom { border-top: 1px solid #2a3340; }
.footer-bottom p { padding: 18px 0; font-size: 13px; color: #7c8aa0; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    .nav-toggle { display: block; }
    .site-nav {
        position: fixed; top: var(--header-h); left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 4px;
        background: #fff; border-bottom: 1px solid var(--line);
        padding: 12px 20px 20px; box-shadow: var(--shadow-md);
        display: none;
    }
    .site-nav.is-open { display: flex; }
    .nav-link { text-align: center; }
    .hero { padding: 56px 0 48px; }
    .hero-stats { gap: 28px; }
    .detail-header { flex-direction: column; align-items: center; text-align: center; }
    .detail-location { justify-content: center; }
    .cta-banner { padding: 28px; text-align: center; justify-content: center; }
    .page-title { font-size: 26px; }
    .section { padding: 40px 0; }
    .content-block { padding: 24px 20px; }
}

/* ---------- Banner de cookies ---------- */
.cookie-banner {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200;
    display: flex; flex-direction: column; gap: 14px;
    background: #151b24; color: #cbd5e1;
    padding: 18px 20px; border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
    max-width: 520px; margin: 0 auto;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__text { font-size: 14px; line-height: 1.5; margin: 0; }
.cookie-banner__text a { color: #fff; text-decoration: underline; }
.cookie-banner__actions { display: flex; gap: 10px; flex-wrap: wrap; }
