/*
 * Wine Detail Page & Index Styles
 * Linear-inspired: tight spacing, 1px borders, no shadows, muted hierarchy
 */

/* ===== Wine Detail Container ===== */
.wine-detail {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

@media (min-width: 769px) {
  .wine-detail {
    padding: 0;
  }
}

/* ===== Wine Header (Compact) ===== */
.wine-header {
  margin-bottom: var(--space-xl);
}

.wine-header h1 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-xs);
}

.wine-header .producer {
  font-size: var(--font-size-base);
  color: var(--color-text-light);
  margin: 0 0 var(--space-xs);
}

.wine-header .producer a {
  color: var(--color-text-light);
  text-decoration: none;
}

.wine-header .producer a:hover {
  color: var(--color-primary);
}

.wine-header .meta {
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
  margin: 0;
}

/* ===== Vintage Pills (Ghost Buttons) ===== */
.vintage-selector {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.vintage-pill {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-light);
  text-decoration: none;
  transition: all 0.15s ease;
}

.vintage-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  text-decoration: none;
}

.vintage-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}

/* ===== 2-Column Info Grid ===== */
.wine-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
  align-items: start;
}

@media (min-width: 769px) {
  .wine-info-grid {
    grid-template-columns: 260px 1fr;
    gap: var(--space-xl);
  }
}

/* ===== Info Cards ===== */
.info-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-xl);
}

.info-card h3 {
  font-size: var(--font-size-md);
  font-weight: 600;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.info-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.info-card-header h3 {
  margin: 0;
  padding: 0;
  border: none;
}

.info-card-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

/* Wishlist button — square, matching btn-small height */
.info-card-actions .wishlist-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius);
}

.info-card-actions .wishlist-btn svg {
  width: 14px;
  height: 14px;
}

/* ===== Definition Lists ===== */
.info-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.info-card dt {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 500;
  margin-top: var(--space-md);
}

.info-card dt:first-child {
  margin-top: 0;
}

.info-card dd {
  margin: var(--space-xs) 0 0 0;
  font-size: var(--font-size-md);
  font-weight: 400;
}

.info-card-separator {
  margin: var(--space-lg) 0;
  border: none;
  border-top: 1px solid var(--color-border);
}

/* ===== Wine Image ===== */
.wine-image {
  text-align: center;
}

.wine-image a {
  cursor: zoom-in;
}

.wine-image img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: var(--radius);
}

/* ===== Ratings Grid ===== */
.ratings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
  gap: var(--space-md);
}

@media (max-width: 480px) {
  .ratings-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Rating Cards ===== */
.rating-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-xl);
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.rating-card h3 {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-md);
  border: none;
  padding: 0;
}

.rating-card .rating-score {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--color-text);
}

.rating-card .rating-source,
.rating-card .rating-reviews {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.rating-card .rating-price {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: 500;
  margin-top: var(--space-sm);
}

.rating-card .rating-price-primary {
  font-size: var(--font-size-md);
  font-weight: 600;
}

.rating-card .btn {
  margin-top: var(--space-xl);
}

.rating-card .not-found {
  color: var(--color-warning);
  font-weight: 500;
}

.rating-card .pending {
  color: var(--color-text-muted);
}

/* Rating card accent: provider color shown only on the provider name label
   to avoid four competing top-border accents. Top border stays neutral. */
.rating-card.lcbo .rating-source,
.rating-card.lcbo h3 {
  color: var(--color-secondary);
}

.rating-card.producer .rating-source,
.rating-card.producer h3 {
  color: var(--color-producer);
}

.rating-card[data-controller~="dynamic-color"] h3 {
  color: var(--provider-color);
}

/* ===== External Links Cluster (LCBO / Wine-Searcher) =====
   Lives in the sidebar info-card beneath the Buy button. Stacked
   vertically so each button gets a full-width target in the narrow column.
   The `margin-top` matches the inter-button gap so the cluster reads as
   a continuation of the Buy section without needing a separator rule. */
.wine-external-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.wine-external-links .btn {
  width: 100%;
  text-align: center;
}

/* ===== Wine Actions (Back / Report) ===== */
.wine-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

@media (max-width: 480px) {
  .wine-actions {
    flex-direction: column;
  }

  .wine-actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* ===== Buy Section ===== */
.wine-buy-section .btn-buy {
  width: 100%;
  text-align: center;
  font-weight: 600;
}

/* ===== Image Modal ===== */
.image-modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  z-index: var(--z-modal);
}

.image-modal::backdrop {
  background: var(--color-overlay-heavy);
  cursor: zoom-out;
}

.image-modal-content {
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
}

.image-modal-close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #fff;
  font-size: var(--font-size-3xl);
  font-weight: bold;
  cursor: pointer;
  z-index: var(--z-modal-top);
}

.image-modal-close:hover {
  color: #ccc;
}

/* ===== Release History ===== */
.release-history {
  margin-bottom: var(--space-xl);
}

.release-history h3 {
  font-size: var(--font-size-md);
  font-weight: 600;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.release-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.release-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0 var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  line-height: 1.2;
}

.release-history-item:last-child {
  border-bottom: none;
}

.release-history-link {
  font-weight: 500;
}

.release-history-price {
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  white-space: nowrap;
}
