/**
 * TP Pie - Package Design Gallery Styles
 * Updated to match new 2x3 grid structure with CSS variables
 */

.tp-pie {
  padding: 2rem 0;
  background: var(--tp-white);
}

.tp-pie-title {
  font-size: 1.8rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  text-align: center;
  font-family: var(--font-primary);
  letter-spacing: -0.025em;
}

/* Desktop Layout - 2 rows, 3 columns each */
.tp-pie-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tp-pie-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

.tp-pie-item {
  background: var(--tp-white);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: var(--tp-shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  height: 300px;
  text-decoration: none;
  color: inherit;
  display: block;
}

.tp-pie-item:hover {
  text-decoration: none;
  color: inherit;
}

.tp-pie-image {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.tp-pie-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.tp-pie-item:hover .tp-pie-image img {
  transform: scale(1.05);
}

.tp-pie-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-lg)
    var(--spacing-lg);
  color: var(--tp-white);
}

.tp-pie-badge {
  display: inline-flex;
  align-items: center;
  background: var(--tp-primary);
  color: var(--tp-white);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 5px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  margin-bottom: var(--spacing-sm);
  line-height: normal;
}

.tp-pie-name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: white;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-normal);
  font-family: var(--font-primary);
}

/* Tablet Layout */
@media (max-width: 1024px) {
  .tp-pie-row {
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }

  .tp-pie-item {
    height: 250px;
  }

  .tp-pie-name {
    font-size: var(--font-size-sm);
  }
}

/* Mobile Layout */
@media (max-width: 768px) {
  .tp-pie-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .tp-pie-item {
    height: 250px;
  }

  .tp-pie-info {
    padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md)
      var(--spacing-md);
  }

  .tp-pie-name {
    font-size: var(--font-size-lg);
  }

  .tp-pie-badge {
    font-size: var(--font-size-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
  }
}

@media (max-width: 480px) {
  .tp-pie-item {
    height: 200px;
  }

  .tp-pie-name {
    font-size: var(--font-size-base);
  }
}

/* Focus states for accessibility */
.tp-pie-item:focus {
  outline: 2px solid var(--tp-primary);
  outline-offset: 2px;
}

.tp-pie-item:focus-visible {
  outline: 2px solid var(--tp-primary);
  outline-offset: 2px;
}