/* === GRID === */
.oecsa-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding: 20px;
}
@media (max-width: 1024px) { .oecsa-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .oecsa-grid { grid-template-columns: 1fr; } }

.oecsa-card {
  overflow: hidden;
  transition: all 0.3s ease;
  background: #fff;
}

.oecsa-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.oecsa-card__media {
  aspect-ratio: 16/10;
  overflow: hidden;
}
.oecsa-card__media img {
  width: 100%; 
  height: 100%; 
  object-fit: cover;
  transition: transform .5s ease;
}
.oecsa-card__link:hover .oecsa-card__media img { 
  transform: scale(1.08); 
}

.oecsa-card__caption { 
  padding: 20px;
  font-weight: 700;
  text-align: left;
  font-size: 1.2rem;
  color: #333;
  line-height: 1.4;
}

/* === MODAL FULLSCREEN === */
.oecsa-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  background: rgba(0,0,0,0.85);
}
.oecsa-modal.is-open {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.oecsa-modal__dialog {
  position: relative;
  width: 95%;
  max-width: 1400px;
  height: 90vh;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  animation: slideIn .4s ease;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}
@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* === MODAL LAYOUT === */
.oecsa-modal__content {
  display: flex;
  width: 100%;
  height: 100%;
}
.oecsa-modal__image {
  flex: 1.5;
  overflow: hidden;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.oecsa-modal__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity .4s ease;
}
.oecsa-modal__image img.is-visible { 
  opacity: 1; 
}

/* Garantizar que la imagen cubra completamente el contenedor */
.oecsa-modal__image-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.oecsa-modal__image-container img {
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity .4s ease;
}

.oecsa-modal__image-container img.is-visible {
  opacity: 1;
}

.oecsa-modal__info {
  flex: 1;
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  background: #fff;
  overflow-y: auto;
}
.oecsa-modal__info h2 {
	font-family: "AvenirLTProBlack";
	font-weight: normal;
	line-height: 1;
	margin: 6px 0 6px;
	font-size: 1.6rem;
	margin-bottom: 1.5rem;
	color: #222;
}
.oecsa-modal__info p {
  font-size: 1.1rem;
  color: #555;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  margin-right: 2rem;
}
.oecsa-btn {
  background: black;
  color: #fff;
  padding: 12px 28px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 1rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: inline-block;
}
.oecsa-btn:hover { 
  background:#c1d62e;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,101,156,0.3);
}

/* === NAVIGATION === */
.oecsa-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.9);
  color: #333;
  border: none;
  font-size: 1.8rem;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.oecsa-modal__nav:hover { 
  background: #fff;
  transform: translateY(-50%) scale(1.1);
}
.oecsa-prev { left: 20px; }
.oecsa-next { right: 20px; }

.oecsa-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  border: none;
  background: rgba(255,255,255,0.9);
  font-size: 28px;
  color: #333;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s;
}
.oecsa-modal__close:hover {
  background: #fff;
  transform: scale(1.1);
}

/* Responsive adjustments for modal */
@media (max-width: 1024px) {
  .oecsa-modal__dialog {
    width: 95%;
    height: 85vh;
  }
  .oecsa-modal__info {
    padding: 40px 30px;
  }
  .oecsa-modal__info h2 {
    font-size: 1.8rem;
  }
}

@media (max-width: 768px) {
  .oecsa-modal__dialog {
    flex-direction: column;
    height: 95vh;
    width: 95%;
  }
  .oecsa-modal__image {
    flex: 1.2;
  }
  .oecsa-modal__info {
    flex: 0.8;
    padding: 30px 25px;
  }
  .oecsa-modal__info h2 {
    font-size: 1.6rem;
  }
  .oecsa-modal__info p {
    font-size: 1rem;
  }
}