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

:root {
  --azul-oscuro:  #1e5fa0;
  --azul-medio:   #4d8ec4;
  --azul-claro:   #a8c8e8;
  --azul-icono:   #2671b5;
  --negro:        #1a1a1a;
  --gris:         #f4f6f9;
  --blanco:       #ffffff;
  --texto:        #333333;
}

html { scroll-behavior: smooth; }
body { font-family: 'Open Sans', sans-serif; color: var(--texto); background: var(--blanco); }

/* ══════════════════════════════════════
   ANIMACIONES
══════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(37,211,102,.4); }
  50%       { box-shadow: 0 8px 30px rgba(37,211,102,.7); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

/* Clases de scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.from-right { transform: translateX(40px); }
.reveal.from-left  { transform: translateX(-40px); }
.reveal.visible    { opacity: 1; transform: translate(0); }

/* Delays escalonados para grids */
.reveal-grid > *:nth-child(1) { transition-delay: .05s; }
.reveal-grid > *:nth-child(2) { transition-delay: .12s; }
.reveal-grid > *:nth-child(3) { transition-delay: .19s; }
.reveal-grid > *:nth-child(4) { transition-delay: .26s; }
.reveal-grid > *:nth-child(5) { transition-delay: .33s; }
.reveal-grid > *:nth-child(6) { transition-delay: .40s; }
.reveal-grid > *:nth-child(7) { transition-delay: .47s; }
.reveal-grid > *:nth-child(8) { transition-delay: .54s; }
.reveal-grid > *:nth-child(9) { transition-delay: .61s; }

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px rgba(30,95,160,.12);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  animation: fadeInDown .5s ease both;
}
.logo-wrap img { height: 52px; width: auto; }
nav { display: flex; align-items: center; gap: 1.8rem; }
nav a {
  font-family: 'Montserrat', sans-serif;
  font-size: .85rem;
  font-weight: 600;
  color: var(--negro);
  text-decoration: none;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: color .2s;
  position: relative;
}
nav a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 2px;
  background: var(--azul-oscuro);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s;
}
nav a:hover::after, nav a.active::after { transform: scaleX(1); }
nav a:hover, nav a.active { color: var(--azul-oscuro); }
.nav-cta {
  background: var(--azul-oscuro);
  color: var(--blanco) !important;
  padding: .5rem 1.2rem;
  border-radius: 4px;
  transition: background .2s, transform .2s !important;
}
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--azul-medio) !important; transform: translateY(-1px); }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 4px; }
.hamburger span { display: block; width: 26px; height: 2px; background: var(--negro); border-radius: 2px; transition: .3s; }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ══════════════════════════════════════
   HERO BLOG
══════════════════════════════════════ */
.blog-hero {
  background: linear-gradient(135deg, var(--azul-oscuro) 0%, var(--azul-icono) 100%);
  padding: 5rem 1.5rem 3.5rem;
  text-align: center;
  color: var(--blanco);
  position: relative;
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,.07) 0%, transparent 60%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.05) 0%, transparent 50%);
  pointer-events: none;
}
.blog-hero .hero-content { position: relative; z-index: 1; }
.blog-hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: .8rem;
  animation: fadeInUp .6s .2s ease both;
}
.blog-hero p {
  font-size: 1.05rem;
  color: rgba(255,255,255,.85);
  max-width: 560px;
  margin: 0 auto 1.5rem;
  line-height: 1.65;
  animation: fadeInUp .6s .35s ease both;
}
.breadcrumb {
  display: flex;
  justify-content: center;
  gap: .5rem;
  font-size: .82rem;
  color: rgba(255,255,255,.65);
  margin-bottom: 1.2rem;
  animation: fadeInDown .5s .1s ease both;
}
.breadcrumb a { color: var(--azul-claro); text-decoration: none; transition: color .2s; }
.breadcrumb a:hover { color: white; }

.results-bar { animation: fadeInUp .6s .45s ease both; }
.results-count {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px;
  padding: .35rem 1rem;
  font-family: 'Montserrat', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  backdrop-filter: blur(4px);
}

/* ══════════════════════════════════════
   LAYOUT PRINCIPAL
══════════════════════════════════════ */
.blog-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

/* ══════════════════════════════════════
   FILTROS TOP
══════════════════════════════════════ */
.filters-bar {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.filter-btn {
  font-family: 'Montserrat', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .4rem .95rem;
  border: 2px solid var(--azul-medio);
  border-radius: 3px;
  background: transparent;
  color: var(--azul-oscuro);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.filter-btn:hover { transform: translateY(-2px); }
.filter-btn.active {
  background: var(--azul-oscuro);
  border-color: var(--azul-oscuro);
  color: var(--blanco);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════
   GRID POSTS
══════════════════════════════════════ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.8rem;
}

.post-card {
  background: var(--blanco);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  transition: transform .3s cubic-bezier(.2,.8,.3,1), box-shadow .3s;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(30px);
}
.post-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .55s ease, transform .55s ease,
              box-shadow .3s, transform .3s cubic-bezier(.2,.8,.3,1);
}
.post-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(30,95,160,.16); }

.post-thumb {
  position: relative;
  overflow: hidden;
  height: 230px;
}
.post-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(.2,.8,.3,1);
}
.post-card:hover .post-thumb img { transform: scale(1.08); }

.post-thumb::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,.35), transparent);
  pointer-events: none;
  transition: opacity .3s;
}
.post-card:hover .post-thumb::after { opacity: .8; }

.post-category {
  position: absolute;
  top: .9rem; left: .9rem;
  background: var(--azul-oscuro);
  color: var(--blanco);
  font-family: 'Montserrat', sans-serif;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .25rem .7rem;
  border-radius: 3px;
  z-index: 1;
  transition: background .2s;
}
.post-card:hover .post-category { background: var(--azul-icono); }

.post-body {
  padding: 1.4rem 1.5rem 1.6rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-meta {
  display: flex;
  gap: 1rem;
  font-size: .75rem;
  color: #999;
  margin-bottom: .7rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}
.post-meta span { display: flex; align-items: center; gap: .3rem; }

.post-body h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--negro);
  margin-bottom: .7rem;
  line-height: 1.3;
}
.post-body h2 a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--azul-oscuro), var(--azul-oscuro));
  background-size: 0 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .3s, color .2s;
}
.post-body h2 a:hover {
  color: var(--azul-oscuro);
  background-size: 100% 2px;
}

.post-body p {
  font-size: .88rem;
  color: #666;
  line-height: 1.6;
  flex: 1;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 1rem;
}
.post-tag {
  font-family: 'Montserrat', sans-serif;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--azul-oscuro);
  background: var(--azul-claro);
  padding: .18rem .55rem;
  border-radius: 3px;
  transition: background .2s, color .2s;
}
.post-tag:hover { background: var(--azul-oscuro); color: white; cursor: pointer; }

.post-footer {
  margin-top: 1.2rem;
  padding-top: .9rem;
  border-top: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.post-location { font-size: .78rem; color: #888; display: flex; align-items: center; gap: .3rem; }
.read-more {
  font-family: 'Montserrat', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  color: var(--azul-oscuro);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: gap .2s, color .2s;
}
.read-more:hover { gap: .6rem; color: var(--azul-icono); }

.post-card.hidden { display: none; }

.no-results {
  display: none;
  text-align: center;
  padding: 3rem;
  color: #999;
  grid-column: 1/-1;
  font-family: 'Montserrat', sans-serif;
}
.no-results.show { display: block; }

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar { position: sticky; top: 90px; }

.sidebar-widget {
  background: var(--gris);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: box-shadow .3s;
}
.sidebar-widget:hover { box-shadow: 0 8px 30px rgba(30,95,160,.1); }
.sidebar-widget h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: .9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--negro);
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 3px solid var(--azul-oscuro);
}

.widget-categories ul { list-style: none; }
.widget-categories li {
  padding: .5rem 0;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background .2s;
}
.widget-categories li:last-child { border-bottom: none; }
.widget-categories li:hover { background: rgba(30,95,160,.04); border-radius: 4px; padding-left: .4rem; }
.widget-categories a {
  font-size: .88rem;
  color: var(--texto);
  text-decoration: none;
  transition: color .2s;
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  flex: 1;
}
.widget-categories a:hover { color: var(--azul-oscuro); }
.widget-categories li.cat-active a { color: var(--azul-oscuro); font-weight: 700; }
.widget-categories li.cat-active .cat-count { background: var(--azul-icono); }
.cat-count {
  background: var(--azul-oscuro);
  color: white;
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  min-width: 22px;
  text-align: center;
  transition: background .2s, transform .2s;
}
.widget-categories li:hover .cat-count { transform: scale(1.1); }

.widget-contact {
  background: linear-gradient(135deg, var(--azul-oscuro), var(--azul-icono));
  color: var(--blanco);
}
.widget-contact h3 { color: var(--blanco); border-bottom-color: rgba(255,255,255,.3); }
.widget-contact p { font-size: .88rem; color: rgba(255,255,255,.85); line-height: 1.6; margin-bottom: 1rem; }
.widget-contact a.cta-widget {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: var(--blanco);
  color: var(--azul-oscuro);
  font-family: 'Montserrat', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  padding: .75rem;
  border-radius: 6px;
  text-decoration: none;
  margin-bottom: .6rem;
  transition: background .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.widget-contact a.cta-widget:hover {
  background: var(--azul-claro);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.2);
}

.recent-posts-widget { list-style: none; }
.recent-posts-widget li {
  display: flex;
  gap: .8rem;
  padding: .8rem 0;
  border-bottom: 1px solid #e5e5e5;
  align-items: center;
  cursor: pointer;
  border-radius: 6px;
  transition: background .2s, padding-left .2s;
}
.recent-posts-widget li:last-child { border-bottom: none; }
.recent-posts-widget li:hover { background: rgba(30,95,160,.05); padding-left: .4rem; }
.recent-thumb-wrap {
  width: 66px; height: 54px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform .3s;
}
.recent-posts-widget li:hover .recent-thumb-wrap { transform: scale(1.05); }
.recent-posts-widget img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s;
}
.recent-posts-widget li:hover img { transform: scale(1.1); }
.recent-post-text a {
  font-size: .82rem;
  font-weight: 600;
  color: var(--negro);
  text-decoration: none;
  line-height: 1.35;
  display: block;
  margin-bottom: .2rem;
  transition: color .2s;
}
.recent-posts-widget li:hover .recent-post-text a { color: var(--azul-oscuro); }
.recent-post-text span { font-size: .72rem; color: #999; }

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
#modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: background .3s;
}
#modal.open {
  display: flex;
  animation: modalBgIn .3s ease forwards;
}
@keyframes modalBgIn {
  from { background: rgba(0,0,0,0); }
  to   { background: rgba(0,0,0,.85); }
}
.modal-inner {
  background: var(--blanco);
  border-radius: 12px;
  overflow: hidden;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  animation: scaleIn .3s cubic-bezier(.2,.8,.3,1) both;
}
#modal.closing .modal-inner {
  animation: scaleOut .2s ease forwards;
}
@keyframes scaleOut {
  to { opacity: 0; transform: scale(.92); }
}
.modal-header { position: relative; height: 320px; overflow: hidden; }
.modal-header img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s;
}
.modal-header:hover img { transform: scale(1.03); }
.modal-header .modal-cat {
  position: absolute;
  top: 1rem; left: 1rem;
  background: var(--azul-oscuro);
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .25rem .8rem;
  border-radius: 3px;
}
.modal-close {
  position: absolute;
  top: .8rem; right: .8rem;
  background: rgba(0,0,0,.5);
  border: none;
  color: white;
  font-size: 1.4rem;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .2s;
  z-index: 1;
}
.modal-close:hover { background: var(--azul-oscuro); transform: rotate(90deg); }
.modal-body { padding: 2rem 2.4rem 2.4rem; }
.modal-meta {
  display: flex;
  gap: 1.2rem;
  font-size: .78rem;
  color: #999;
  margin-bottom: 1rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  flex-wrap: wrap;
}
.modal-body h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--negro);
  margin-bottom: 1rem;
  line-height: 1.2;
}
.modal-body p { color: #555; line-height: 1.75; margin-bottom: .9rem; font-size: .95rem; }
.modal-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  margin-top: 1.5rem;
}
.modal-gallery img {
  width: 100%; height: 120px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity .2s, transform .25s;
  border: 2px solid transparent;
}
.modal-gallery img:hover { opacity: .9; transform: scale(1.03); border-color: var(--azul-medio); }
.modal-gallery img.active { border-color: var(--azul-oscuro); opacity: 1; }

/* ══════════════════════════════════════
   PAGINACIÓN
══════════════════════════════════════ */
.pagination {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-top: 3rem;
}
.page-btn {
  font-family: 'Montserrat', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  width: 40px; height: 40px;
  border: 2px solid var(--azul-medio);
  border-radius: 4px;
  background: transparent;
  color: var(--azul-oscuro);
  cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-btn:hover { transform: translateY(-2px); }
.page-btn.active, .page-btn:hover {
  background: var(--azul-oscuro);
  border-color: var(--azul-oscuro);
  color: white;
}

/* ══════════════════════════════════════
   WHATSAPP
══════════════════════════════════════ */
.whatsapp-float {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 999;
  width: 58px; height: 58px; background: #25d366;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  animation: pulse 2.5s ease infinite;
  transition: transform .25s; text-decoration: none;
}
.whatsapp-float:hover { transform: scale(1.12); }
.whatsapp-float svg { width: 30px; height: 30px; }

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
footer {
  background: var(--negro);
  color: rgba(255,255,255,.65);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: .82rem;
}
footer a { color: var(--azul-claro); text-decoration: none; transition: color .2s; }
footer a:hover { color: white; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 960px) {
  .blog-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  nav { display: none; }
  .hamburger { display: flex; }
  nav.open {
    display: flex; flex-direction: column;
    position: fixed; top: 70px; left: 0; right: 0;
    background: white; padding: 1.5rem; gap: 1.2rem;
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
    animation: fadeInDown .25s ease both;
  }
}
@media (max-width: 600px) {
  .posts-grid { grid-template-columns: 1fr; }
  .modal-body { padding: 1.5rem; }
  .modal-gallery { grid-template-columns: repeat(2,1fr); }
  .modal-header { height: 220px; }
}
