/* =========================================================
   IVAN Online — sistema de diseño moderno
   ========================================================= */
:root {
    --brand:        #2f8f5b;
    --brand-600:    #268050;
    --brand-700:    #1f6e44;
    --brand-50:     #eaf5ee;
    --ink:          #14201b;
    --slate:        #5b6b63;
    --dark:         #18242b;
    --dark-2:       #213039;
    --bg:           #ffffff;
    --bg-soft:      #f5f8f6;
    --line:         #e6ece8;
    --shadow-sm:    0 1px 2px rgba(20,32,27,.06), 0 1px 3px rgba(20,32,27,.08);
    --shadow-md:    0 8px 24px rgba(20,32,27,.10);
    --shadow-lg:    0 18px 48px rgba(20,32,27,.16);
    --radius:       16px;
    --radius-lg:    22px;
    --ease:         cubic-bezier(.22,.61,.36,1);
}

* { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .section-title, .hero__carousel h2 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    letter-spacing: -.02em;
}

a { text-decoration: none; }

html { scroll-padding-top: 90px; } /* compensa navbar sticky al ir a anclas */

/* ---------- Botones ---------- */
.btn-brand {
    --bs-btn-color: #fff;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-600) 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    padding: .6rem 1.4rem;
    box-shadow: 0 6px 16px rgba(38,128,80,.28);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.btn-brand:hover, .btn-brand:focus-visible {
    color: #fff;
    background: linear-gradient(180deg, var(--brand-600) 0%, var(--brand-700) 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(31,110,68,.34);
}
.btn-brand.btn-lg { padding: .8rem 1.9rem; font-size: 1.05rem; }

/* Layout base: min-height en vez de height:100% para no romper el sticky */
.site-body { min-height: 100vh; }

/* ---------- Navbar ----------
   El sticky va en el <header> (su padre es el body, alto) para que la barra
   se mantenga arriba durante TODO el scroll. */
#header {
    position: sticky;
    top: 0;
    z-index: 1030;
}
.site-navbar {
    background: rgba(255,255,255,.82);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: box-shadow .3s var(--ease), border-color .3s var(--ease),
                background .3s var(--ease), padding .3s var(--ease);
    padding-top: .75rem;
    padding-bottom: .75rem;
}
/* Al hacer scroll: más compacta, fondo más sólido y sombra marcada */
.site-navbar.is-scrolled {
    box-shadow: var(--shadow-md);
    border-bottom-color: var(--line);
    background: rgba(255,255,255,.96);
    padding-top: .4rem;
    padding-bottom: .4rem;
}
.site-navbar__logo {
    height: 48px; width: auto; display: block;
    transition: height .3s var(--ease);
}
.site-navbar.is-scrolled .site-navbar__logo { height: 38px; }
.site-navbar .navbar-nav .nav-link {
    color: var(--ink);
    font-weight: 600;
    border-radius: 999px;
    padding: .45rem .9rem;
    transition: color .2s var(--ease), background .2s var(--ease);
}
.site-navbar .navbar-nav .nav-link:hover,
.site-navbar .navbar-nav .nav-link:focus-visible { color: var(--brand-700); background: var(--brand-50); }
.site-navbar .navbar-nav .nav-link.btn-brand { color: #fff; }
.site-navbar .navbar-nav .nav-link.btn-brand:hover { color: #fff; background: linear-gradient(180deg, var(--brand-600), var(--brand-700)); }
.site-navbar .navbar-toggler { border: none; box-shadow: none; }

/* ---------- Secciones ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section--soft { background: var(--bg-soft); }
.section-head { max-width: 720px; margin: 0 auto clamp(2rem, 5vw, 3rem); text-align: center; }
.eyebrow {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--brand-700);
    background: var(--brand-50);
    padding: .35rem .8rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}
.section-title {
    font-weight: 800;
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    color: var(--ink);
    margin: 0 0 .75rem;
}
.section-sub { color: var(--slate); font-size: 1.08rem; margin: 0; }

/* ---------- Hero ---------- */
.hero { position: relative; }
.hero__carousel .carousel-item { position: relative; }
.hero__carousel picture { display: block; }
.hero__carousel .carousel-item img {
    width: 100%;
    height: clamp(360px, 56vh, 540px); /* hero más alto (fuentes 1140x230: a más altura, más escalado) */
    object-fit: cover;
    object-position: center;
}
.hero__carousel .carousel-item::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(15,28,21,.82) 0%, rgba(15,28,21,.55) 45%, rgba(15,28,21,.12) 100%);
}
.hero__carousel .carousel-caption {
    right: auto; left: 0; bottom: 0; top: 0;
    display: flex; flex-direction: column; justify-content: center;
    text-align: left;
    max-width: min(620px, 86%);
    padding: 0 clamp(1.2rem, 6vw, 5rem);
    z-index: 2;
}
.hero__carousel .carousel-caption h2 {
    color: #fff;
    font-weight: 800;
    font-size: clamp(1.6rem, 4.4vw, 3rem);
    line-height: 1.08;
    margin-bottom: .8rem;
    text-shadow: 0 2px 14px rgba(0,0,0,.35);
}
.hero__carousel .carousel-caption p {
    color: rgba(255,255,255,.92);
    font-size: clamp(1rem, 1.6vw, 1.18rem);
    margin-bottom: 1.5rem;
    max-width: 30em;
}
.hero__cta { align-self: flex-start; }
.hero__carousel .carousel-indicators { margin-bottom: 1.2rem; z-index: 3; }
.hero__carousel .carousel-indicators [data-bs-target] {
    width: 10px; height: 10px; border-radius: 50%; border: none; opacity: .55;
}
.hero__carousel .carousel-indicators .active { opacity: 1; background: var(--brand); width: 26px; border-radius: 999px; }
.hero__carousel .carousel-control-prev,
.hero__carousel .carousel-control-next { width: 8%; opacity: .85; z-index: 3; }
.hero__carousel .carousel-control-prev-icon,
.hero__carousel .carousel-control-next-icon {
    background-color: rgba(0,0,0,.35);
    border-radius: 50%;
    padding: 1.25rem;
    background-size: 45%;
}

/* ---------- Network cards ---------- */
.net-card {
    position: relative;
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    background: #0c1410;
    box-shadow: var(--shadow-sm);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.net-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.net-card__media { display: block; overflow: hidden; }
.net-card__img {
    display: block; width: 100%; height: 100%;
    aspect-ratio: 360 / 230; object-fit: cover;
    transition: transform .5s var(--ease), opacity .35s var(--ease);
}
.net-card:hover .net-card__img { transform: scale(1.07); opacity: .92; }
.net-card__label {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding: 1.5rem .9rem .8rem;
    color: #fff; font-weight: 700; font-size: 1.02rem;
    background: linear-gradient(to top, rgba(8,16,11,.92) 0%, rgba(8,16,11,.55) 55%, rgba(8,16,11,0) 100%);
}
.net-card__arrow { transition: transform .3s var(--ease); flex: none; }
.net-card:hover .net-card__arrow { transform: translateX(4px); }

/* ---------- Map band ---------- */
.map-band {
    background: radial-gradient(120% 140% at 50% 0%, var(--dark-2) 0%, var(--dark) 70%);
    padding: clamp(3rem, 7vw, 5rem) 0;
}
.section-head--light .section-title { color: #fff; }
.section-head--light .section-sub { color: rgba(255,255,255,.8); }
.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3rem);
}
.ivan-mapcard {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1rem, 2.5vw, 2rem);
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
}
.ivan-svgmap { display: block; width: 100%; height: auto; }

/* Interactividad del mapa */
.ivan-svgmap a { cursor: pointer; }
.ivan-svgmap a path { transition: fill .2s var(--ease); }
.ivan-svgmap a:hover > path:not(.lead),
.ivan-svgmap a.is-active > path:not(.lead) { fill: var(--brand-700); }
.ivan-svgmap .lead { transition: stroke .2s var(--ease), stroke-width .2s var(--ease); }
.ivan-svgmap a:hover .lead,
.ivan-svgmap a.is-active .lead { stroke: var(--brand-700); stroke-width: 1.7; }
.ivan-svgmap .lbl { transition: fill .2s var(--ease); }
.ivan-svgmap a:hover .lbl,
.ivan-svgmap a.is-active .lbl { fill: var(--brand-700); }
.ivan-svgmap a:focus { outline: none; }
.ivan-svgmap a:focus > path:not(.lead) { stroke: #14201b; stroke-width: 2; }

/* Leyenda: grupos por estado apilados; comunidades en 2 columnas */
.map-legend {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}
.map-legend__state {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    margin: 0 0 .8rem;
    display: flex; align-items: center; gap: .55rem;
}
.map-legend__state::before {
    content: ""; width: 13px; height: 13px; border-radius: 4px;
    background: var(--brand); display: inline-block;
}
.map-legend ul {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem 1.4rem;
}
.map-legend a {
    display: inline-flex; align-items: center; gap: .5rem;
    color: rgba(255,255,255,.82); font-weight: 600;
    padding: .15rem 0; border-radius: 6px;
    transition: color .2s var(--ease);
}
.map-legend a::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%;
    background: var(--brand); flex: none; opacity: .7;
    transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.map-legend a:hover,
.map-legend a.is-active { color: #fff; }
.map-legend a:hover::before,
.map-legend a.is-active::before { transform: scale(1.6); opacity: 1; }

@media (max-width: 820px) {
    .map-layout { grid-template-columns: 1fr; gap: 2rem; }
    .map-legend { max-width: 560px; margin: 0 auto; }
}
@media (max-width: 420px) {
    .map-legend ul { grid-template-columns: 1fr; }
}

/* ---------- Resource cards ---------- */
.resource-card {
    height: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.6rem 1.4rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem;
}
.resource-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: #d3e3d9; }
.resource-card--accent {
    background: linear-gradient(165deg, var(--brand) 0%, var(--brand-700) 100%);
    border-color: transparent; color: #fff;
}
.resource-card__title { font-size: 1.12rem; font-weight: 700; margin: 0; color: var(--ink); }
.resource-card--accent .resource-card__title { color: #fff; }
.resource-card__title a { color: var(--brand-700); }
.resource-card__title a:hover { color: var(--brand); }
.resource-card__text { color: var(--slate); margin: 0; font-size: .98rem; }
.resource-card--accent .resource-card__text { color: rgba(255,255,255,.85); }
.resource-card__phone { font-size: 1.4rem; font-weight: 800; margin: 0; }
.resource-card__phone a { color: #fff; }
.resource-card__img { max-width: 100%; height: auto; }
.resource-card__logo { width: 72px; height: auto; }

/* ---------- Contact ---------- */
.contact-card {
    height: 100%;
    background: linear-gradient(165deg, var(--dark-2) 0%, var(--dark) 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem 1.8rem;
    box-shadow: var(--shadow-md);
    display: flex; flex-direction: column; justify-content: center;
}
.contact-card__name { font-size: 1.3rem; font-weight: 700; margin: 0 0 1.1rem; color: #fff; }
.contact-card__list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.contact-card__list li { color: rgba(255,255,255,.86); }
.contact-card__list a { color: #fff; border-bottom: 1px solid rgba(255,255,255,.25); padding-bottom: 1px; }
.contact-card__list a:hover { border-color: var(--brand); color: #bff0d3; }
.contact-map {
    height: 100%; min-height: 360px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--line);
}
.contact-map iframe { display: block; width: 100%; height: 100%; min-height: 360px; }

/* ---------- Footer ---------- */
.site-footer {
    margin-top: auto;
    background: var(--dark);
    color: rgba(255,255,255,.7);
    padding: 2.2rem 0;
    font-size: .95rem;
}
.site-footer__logo { height: 44px; width: auto; filter: brightness(0) invert(1); opacity: .9; }
.site-footer__nav { display: inline-flex; flex-wrap: wrap; gap: 1.1rem; justify-content: center; }
.site-footer__nav a { color: rgba(255,255,255,.78); font-weight: 500; }
.site-footer__nav a:hover { color: #fff; }
.site-footer__copy { color: rgba(255,255,255,.55); }

@media (max-width: 991.98px) {
    .site-navbar .navbar-nav { padding: .75rem 0; gap: .25rem; }
    .hero__carousel .carousel-caption { text-align: center; max-width: 100%; align-items: center; }
    .hero__cta { align-self: center; }
}

/* =========================================================
   Helpers de Yii (formularios / login / contact heredados)
   ========================================================= */
.not-set { color: #c55; font-style: italic; }

a.asc:after, a.desc:after {
    content: ''; left: 3px; display: inline-block; width: 0; height: 0;
    border: solid 5px transparent; margin: 4px 4px 2px 4px; background: transparent;
}
a.asc:after { border-bottom: solid 7px #212529; border-top-width: 0; }
a.desc:after { border-top: solid 7px #212529; border-bottom-width: 0; }
.grid-view th { white-space: nowrap; }
.hint-block { display: block; margin-top: 5px; color: #999; }
.error-summary {
    color: #a94442; background: #fdf7f7; border-left: 3px solid #eed3d7;
    padding: 10px 20px; margin: 0 0 15px 0;
}
