/* =====================================================
   app.css — Componentes principales
   Municipalidad de Catemu
   ===================================================== */

/* ─── Navbar ──────────────────────────────────────── */
.catemu-navbar {
  min-height: 76px;
  border-bottom: 3px solid var(--catemu-orange) !important;
  box-shadow: 0 2px 16px rgba(87,0,102,.10);
}

/* Logo en navbar */
.brand-img {
  height: 64px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

/* Texto de marca */
.brand-text { line-height: 1.2; }
.brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--catemu-purple);
  letter-spacing: -.01em;
}
.brand-sub {
  font-size: .7rem;
  color: var(--catemu-orange-dark);
  font-style: italic;
  opacity: .85;
}

/* Nav links */
.navbar-nav .nav-link {
  color: var(--catemu-ink) !important;
  font-weight: 500;
  padding: .5rem .8rem;
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--catemu-purple) !important;
  background: rgba(87,0,102,.06);
}

/* ─── Tipografía ──────────────────────────────────── */
body { background: var(--catemu-bg); color: var(--catemu-ink); }
.section-title { font-weight: 800; letter-spacing: -.02em; }
.preline { white-space: pre-line; }

/* ─── Mega dropdown ───────────────────────────────── */
.mega-dropdown .dropdown-menu.mega-menu{
  width: min(1100px, 95vw);
  border: 0;
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 1.25rem 2.5rem rgba(87,0,102,.14);
  margin-top: 0 !important;
}

@media (min-width: 992px){
  .mega-dropdown { position: static; }
  .mega-dropdown .dropdown-menu.mega-menu{
    position: absolute;
    left: 50%;
    transform: translateX(-50%) !important;
    top: calc(100% + 8px);
  }
  .mini-mega { position: relative; }
  .mini-mega .dropdown-menu.mega-menu{
    width: 280px;
    left: 0 !important;
    transform: none !important;
    padding: 1rem !important;
    top: calc(100% + 8px);
  }
}

.mega-title{
  font-weight: 800;
  font-size: .88rem;
  letter-spacing: .03em;
  color: var(--catemu-purple);
  margin-bottom: .6rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid rgba(242,117,0,.20);
  text-transform: uppercase;
}
.mega-link{
  display: block;
  padding: .35rem 0;
  text-decoration: none;
  color: rgba(31,41,55,.90);
  font-size: .92rem;
  transition: color .12s ease, padding-left .12s ease;
}
.mega-link:hover{
  color: var(--catemu-purple);
  padding-left: 6px;
  text-decoration: none;
}

/* ─── Hero / Slider ───────────────────────────────── */
#heroCarousel { width: 100%; }
#heroCarousel .carousel-inner {
  width: 100%;
  height: 460px;
  background: linear-gradient(135deg, rgba(87,0,102,.12), rgba(242,117,0,.08));
  border-radius: 18px;
  overflow: hidden;
}
#heroCarousel .carousel-item { position: relative; height: 100%; overflow: hidden; }
#heroCarousel .slider-img-wrapper { position: absolute; inset: 0; overflow: hidden; }
#heroCarousel .carousel-item img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
/* Overlay degradado elegante */
#heroCarousel .carousel-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 40%,
    rgba(61,0,73,.55) 100%
  );
  pointer-events: none;
}
/* Caption sobre el slider */
#heroCarousel .carousel-caption {
  background: transparent;
  bottom: 1.5rem;
  z-index: 2;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
#heroCarousel .carousel-caption h5 {
  font-size: 1.4rem;
  font-weight: 700;
}
/* Indicadores con color de marca */
#heroCarousel .carousel-indicators [data-bs-target] {
  background-color: var(--catemu-orange);
  opacity: .6;
  border-radius: 50%;
  width: 10px;
  height: 10px;
  border: 0;
}
#heroCarousel .carousel-indicators .active { opacity: 1; }

@media (max-width: 768px){
  #heroCarousel .carousel-inner { height: 260px; border-radius: 12px; }
}
@media (max-width: 480px){
  #heroCarousel .carousel-inner { height: 190px; border-radius: 10px; }
}

/* ─── Quick cards (accesos rápidos) ───────────────── */
.quick-card {
  border: 1px solid rgba(87,0,102,.08) !important;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.quick-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 .85rem 1.75rem rgba(87,0,102,.14) !important;
  border-color: rgba(242,117,0,.28) !important;
}
.quick-card:active { transform: translateY(-2px); }
.quick-card .card-body { min-height: 96px; }
.quick-title { line-height: 1.2; min-height: 2.4em; font-weight: 600; }
.quick-desc  { line-height: 1.3; font-size: .85rem; }

/* Ícono con gradiente de marca */
.quick-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(87,0,102,.12), rgba(242,117,0,.14));
  border: 1px solid rgba(242,117,0,.15);
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 2px 6px rgba(87,0,102,.08);
}
.quick-icon i {
  font-size: 22px;
  color: var(--catemu-purple);
}

/* Accesos: show/hide animado */
#quickLinksFeatured {
  transition: opacity .2s ease, transform .2s ease;
  opacity: 1;
  transform: translateY(0);
}
#quickLinksFeatured.is-hidden {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}
#quickLinksHeader { scroll-margin-top: 90px; }

/* ─── Cards de noticias ───────────────────────────── */
.card-img-top { object-fit: cover; height: 200px; }

/* Badge de label mejorado */
.badge-label-destacado {
  background: var(--catemu-orange-light);
  color: var(--catemu-orange-dark);
  border: 1px solid rgba(242,117,0,.3);
  font-weight: 600;
  border-radius: 20px;
  padding: .25em .75em;
  font-size: .72rem;
}
.badge-label-nuevo {
  background: rgba(87,0,102,.07);
  color: var(--catemu-purple);
  border: 1px solid rgba(87,0,102,.15);
  font-weight: 600;
  border-radius: 20px;
  padding: .25em .75em;
  font-size: .72rem;
}

/* ─── Tablas y contenedores (admin) ───────────────── */
.table-card {
  background: #fff;
  border: 1px solid rgba(87,0,102,.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(87,0,102,.07);
}
.table-card .table { margin-bottom: 0; }
.table-card thead th { background: rgba(87,0,102,.04); }

/* Formularios (admin) */
.form-card {
  background: #fff;
  border: 1px solid rgba(87,0,102,.08);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(87,0,102,.07);
}

/* ─── Footer ──────────────────────────────────────── */
footer {
  background: linear-gradient(135deg, #1a0022 0%, #0d0014 100%);
  color: #cbd5e1;
  border-top: 4px solid var(--catemu-orange);
}
footer a {
  color: #e2e8f0;
  text-decoration: none;
  transition: color .15s ease;
}
footer a:hover { color: var(--catemu-orange) !important; }
footer .text-muted { color: #94a3b8 !important; }
footer h6 {
  color: #f8fafc;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Dropdown hover desktop */
@media (min-width: 992px) {
  .navbar .dropdown:hover .dropdown-menu { display: block; margin-top: 0; }
  .navbar .mega-dropdown:hover .mega-menu { display: block; margin-top: 0; }
}
