/* ===== Projects Page Styles ===== */

/* Section headings */
.section-header {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--text-2xl);
  margin-bottom: 2rem;
}

.section-divider {
  height: 1px;
  background: var(--border);
  margin: var(--section-gap) auto;
  max-width: var(--content-max);
}

/* ===== Accordion Panels (click to expand) ===== */
.panels {
  display: flex;
  height: 60vh;
  max-width: var(--content-max);
  margin: 0 auto;
}

.panel {
  position: relative;
  flex: 1;
  margin-right: 12px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: flex 0.8s cubic-bezier(0.25, 1, 0.5, 1),
              margin 0.8s cubic-bezier(0.25, 1, 0.5, 1),
              opacity 0.6s ease;
}
.panel:last-child { margin-right: 0; }

/* Background image — grayscale + dark by default */
.panel__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.1);
  filter: grayscale(80%) brightness(0.5);
  transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Hover preview — lighten slightly, scale image */
.panel:hover .panel__bg {
  filter: grayscale(40%) brightness(0.7);
  transform: scale(1.05);
}

.panel:hover .panel__title {
  transform: translateY(-5px);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.panel:hover {
  flex: 1.5;
}

/* Remove overlay div — using filter instead */
.panel__image-wrapper {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 8px;
}
.panel__overlay { display: none; }

/* Text content — centered */
.panel__text-group {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.panel__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  margin: 0;
  transform: translateY(20px);
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Details — hidden by default */
.panel__details {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 15px;
}

.panel__role {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.panel__desc {
  font-size: var(--text-sm);
  color: #ccc;
  max-width: 280px;
  line-height: 1.6;
  word-break: keep-all;
  margin-bottom: 1rem;
}

/* Vertical line indicator */
.panel__line {
  display: block;
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.5);
}

/* Giant number — hidden, slides in from right */
.panel__number {
  position: absolute;
  bottom: -30px;
  right: -20px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(10rem, 20vw, 18rem);
  font-weight: 900;
  color: #fff;
  line-height: 1;
  opacity: 0;
  transform: translateX(100px);
  transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 1;
  pointer-events: none;
}

/* ===== Active state (clicked) ===== */

/* Non-active cards collapse and disappear */
.panels.has-active .panel:not(.active) {
  flex: 0;
  margin-right: 0;
  opacity: 0;
  pointer-events: none;
}

/* Active card takes full width */
.panel.active {
  flex: 1;
  cursor: default;
}

/* Background becomes colorful */
.panel.active .panel__bg {
  transform: scale(1);
  filter: grayscale(0%) brightness(1);
}

/* Title slides up */
.panel.active .panel__title {
  transform: translateY(-40px);
}

/* Details fade in with delay */
.panel.active .panel__details {
  opacity: 1;
  transform: translateY(-20px);
  transition-delay: 0.3s;
}

/* Giant number slides in from right */
.panel.active .panel__number {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.2s;
}

/* ===== Bento Grid ===== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  grid-auto-flow: dense;
}

.bento-item {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  min-height: 280px;
  cursor: pointer;
  transition: all 0.4s var(--ease-spring);
}

.bento-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow);
}

.bento-item--large {
  grid-column: span 2;
  grid-row: span 2;
}

.bento-item--wide {
  grid-column: span 2;
}

.bento-item--tall {
  grid-row: span 2;
}

.bento-item__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-spring);
}

.bento-item:hover .bento-item__media {
  transform: scale(1.08);
}

.bento-item__content {
  position: absolute;
  inset: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.bento-item:hover .bento-item__content {
  opacity: 1;
}

.bento-item__number {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.bento-item__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--text-xl);
  margin-bottom: 0.25rem;
}

.bento-item__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* ===== Media Section ===== */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.media-card {
  position: relative;
  border-radius: var(--card-radius-outer);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: block;
  text-decoration: none;
  color: inherit;
}

.media-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.media-card:hover .media-card__overlay {
  opacity: 1;
}

.media-card__play {
  width: 60px;
  height: 60px;
  border: 2px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.media-card__play::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent white;
  margin-left: 4px;
}

.media-card__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--text-lg);
}

.media-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .panels {
    flex-direction: column;
    height: auto;
    gap: 10px;
    padding: 0 1rem;
  }

  .panel {
    height: 120px;
    flex: none !important;
    margin-right: 0;
    transition: height 0.8s cubic-bezier(0.25, 1, 0.5, 1),
                opacity 0.6s ease;
  }

  .panels.has-active .panel:not(.active) {
    height: 0;
    opacity: 0;
    margin: 0;
    overflow: hidden;
  }

  .panel.active {
    height: 400px;
  }

  .panel__number {
    font-size: 6rem;
    bottom: -10px;
    right: -5px;
  }

  .panel__desc {
    max-width: 100%;
    font-size: var(--text-xs);
  }

  .bento-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding: 0 1rem;
  }

  .bento-item {
    min-height: 180px;
  }

  .bento-item--large,
  .bento-item--wide {
    grid-column: span 1;
  }

  .bento-item--tall {
    grid-row: span 1;
  }

  .bento-item__content {
    opacity: 1;
    padding: 1rem;
  }

  .bento-item__number {
    font-size: 1.5rem;
  }

  .bento-item__title {
    font-size: var(--text-base);
  }

  .bento-item__desc {
    font-size: var(--text-xs);
  }

  .media-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }

  .section-header {
    padding-left: 1rem !important;
  }

  .section-divider {
    margin: var(--section-gap) 1rem;
  }
}
