/* ============================================================
   AJAL LOL — portfolio.css
   Ruta: assets/css/publicpages/portfolio.css
   Estilos exclusivos de la sección #portfolio:
   year-tabs · year-panels · general-grid · portfolio-grid
   filtros de categoría · lightbox
   ============================================================ */

/* ─── YEAR TABS (selector de año, nivel 1) ─── */
.year-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.year-tab {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.6rem;
  border-radius: 99px;
  border: 1.5px solid var(--rose-pale);
  background: transparent;
  font-family: var(--font-body);
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--text-mid);
  cursor: none;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  isolation: isolate; /* ← agrega esto */
}

.year-tab i {
  font-size: .9rem;
  transition: transform var(--transition);
  position: relative;
  z-index: 1;
}

/* Fondo gradiente que aparece al activar */
.year-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--rose-deep), var(--rose-mid));
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: inherit;
  z-index: -1; /* ← cambia de nada a -1 */
}

.year-tab:hover {
  border-color: var(--rose-soft);
  color: var(--rose-deep);
}

.year-tab.active {
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 4px 20px rgba(139,34,82,.28);
}

.year-tab.active::before { opacity: 1; }
.year-tab.active i       { transform: scale(1.1); }

/* ─── YEAR PANELS ─── */
.year-panel        { display: none; animation: panelFadeIn .4s ease both; }
.year-panel.active { display: block; }

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ─── FILTROS DE CATEGORÍA (dentro de cada panel de año) ─── */
.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  justify-content: center;
  margin-top: .5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 900px) {
  .portfolio-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: .4rem 1.2rem 1rem;
    margin-left: 0;
    margin-right: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .portfolio-filters::-webkit-scrollbar {
    display: none;
  }

  .portfolio-filters button {
    flex-shrink: 0;
    scroll-snap-align: start;
  }
}

.portfolio-filters button {
  padding: .5rem 1.4rem;
  border-radius: 99px;
  border: 1.5px solid var(--rose-pale);
  background: transparent;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .4px;
  color: var(--text-mid);
  cursor: none;
  transition: var(--transition);
}

.portfolio-filters button.active,
.portfolio-filters button:hover {
  background: linear-gradient(135deg, var(--rose-deep), var(--rose-mid));
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 4px 16px rgba(139,34,82,.25);
}

/* ─── GRID DE IMÁGENES ─── */
.portfolio-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.portfolio-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4/3;
  cursor: none;
  width: calc(33.333% - 1rem);
  transition: opacity .4s ease, transform .4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portfolio-item::before {
  content: '';
  position: absolute; inset: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  z-index: 2;
  transition: border-color var(--transition);
  pointer-events: none;
}

.portfolio-item:hover::before { border-color: rgba(245,198,212,.5); }

.portfolio-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}

.portfolio-item:hover img { transform: scale(1.08); }

.portfolio-info {
  position: absolute; inset: 0;
  background: linear-gradient(
    to top,
    rgba(139,34,82,.9) 0%,
    rgba(92,20,56,.5)  40%,
    transparent        70%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 1;
}

.portfolio-item:hover .portfolio-info { opacity: 1; }

.portfolio-info h3 {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.portfolio-info p {
  color: var(--rose-pale);
  font-size: .8rem;
  margin-top: .3rem;
  font-weight: 400;
}

.zoom-btn {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 38px; height: 38px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-size: 1rem;
  border: 1px solid rgba(255,255,255,.25);
  cursor: pointer;
  transition: var(--transition);
   z-index: 3;
  pointer-events: auto; 
}

.zoom-btn svg {
  display: block;
  pointer-events: none;      /* ← el SVG no interfiere con el click */
}

.zoom-btn:hover {
  background: var(--rose-mid);
  border-color: transparent;
  transform: scale(1.1);
}

/* ─── LIGHTBOX ─── */
/* ─── LIGHTBOX ─── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 18, 0.96);
  z-index: 9999;
  display: none;              /* empieza oculto con display:none */
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease;
  backdrop-filter: blur(6px);
}

.lightbox-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  border: 1px solid rgba(245,198,212,.15);
  transform: scale(0.92);
  transition: transform 0.35s ease, opacity 0.35s ease;
  opacity: 0;
}

.lightbox-overlay.open .lightbox-img {
  transform: scale(1);
  opacity: 1;
}

.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 10000;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.25);
  transform: rotate(90deg) scale(1.1);
}

.lightbox-close svg {
  pointer-events: none;
  display: block;
}

.lightbox-close:hover { color: var(--rose-pale); transform: rotate(90deg) scale(1.1); }

/* ─── Responsive ─── */
@media (max-width: 768px) { .portfolio-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .year-tab     { font-size: .82rem; padding: .5rem 1.2rem; }
}
@media (max-width: 480px) { .portfolio-grid { grid-template-columns: 1fr; } }

/* ─── ESTADO VACÍO ─── */
.portfolio-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--rose-deep);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.portfolio-empty svg {
    opacity: 0.5;
    color: var(--rose-deep);
    stroke: var(--rose-deep);
}
.portfolio-empty p {
    font-size: 15px;
    margin: 0;
    font-family: var(--font-body);
    color: var(--text-mid);
}

/* ─── MÓVIL ─── */
@media (max-width: 900px) {
  .zoom-btn { display: none !important; }

  .portfolio-grid { display: block; }

  .carousel-group {
      display: flex;
      gap: .8rem;
      overflow-x: auto;
      scroll-snap-type: x proximity;
      -webkit-overflow-scrolling: touch;
      padding: 0 12.5vw .5rem;
      margin-bottom: 1rem;
      scrollbar-width: none;
  }

  .carousel-group::-webkit-scrollbar { display: none; }

  .carousel-group .portfolio-item {
    flex: 0 0 75vw;
    width: 75vw;
    scroll-snap-align: center;
    aspect-ratio: 4/3;
  }

  /* Espaciador que permite centrar el último item */
  .carousel-spacer {
    flex: 0 0 12.5vw;
    width: 12.5vw;
  }

  .carousel-dots {
    display: flex;
    justify-content: center;
    gap: .4rem;
  }

  .carousel-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--rose-pale);
    transition: background .2s ease, transform .2s ease;
  }

  .carousel-dot.active {
    background: var(--rose-deep);
    transform: scale(1.3);
  }

  .portfolio-item .portfolio-info { opacity: 1; }
}