/* ---------------------------
   Cards / Grid
---------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 16px 0 0;
  align-items: stretch;
}

/* Ensure all cards in grid have equal height */
.grid .card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sectionFeatured,
.sectionWhat {
  margin-top: 0;
}

.whatGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.whatItem {
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.whatLabel {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-heading);
}

.whatItem p {
  font-size: 14px;
  line-height: 1.6;
}

.featuredGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr);
  gap: 18px;
  padding-top: 16px;
}

.featuredMain {
  height: 100%;
}

.featuredSide {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 18px;
}

/* Make primary latest image taller */
.sectionFeatured .featuredMain .cover-product {
  height: 474px;
}

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px; /* squarer */
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  transition: var(--t);
  display: flex;
  flex-direction: column;
}

/* Transparent cards on gear and collect pages - elegant design for transparent images */
.gearGrid .card,
.collectGrid .card,
.sectionGear .card,
body.category-gear .card,
body.category-gear .grid .card {
  background: transparent !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02) !important;
  overflow: hidden;
}

.gearGrid .card:hover,
.collectGrid .card:hover,
.sectionGear .card:hover,
body.category-gear .card:hover,
body.category-gear .grid .card:hover {
  box-shadow: var(--shadow) !important;
  transform: translateY(-1px);
}

/* Content area - transparent background, no blur */
.gearGrid .card .content,
.collectGrid .card .content,
.sectionGear .card .content,
body.category-gear .card .content,
body.category-gear .grid .card .content {
  background: transparent !important;
  border-radius: 0;
  margin-top: 0;
  padding-top: 14px;
  position: relative;
  z-index: 1;
}

/* Image area - no background, let transparency show through, fit height */
.gearGrid .card .cover,
.collectGrid .card .cover,
.sectionGear .card .cover,
body.category-gear .card .cover,
body.category-gear .grid .card .cover {
  background: transparent !important;
  border-radius: 12px 12px 0 0;
  position: relative;
  z-index: 0;
  height: 220px !important;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  background: transparent !important;
}

.gearGrid .card .cover img,
.collectGrid .card .cover img,
.sectionGear .card .cover img,
body.category-gear .card .cover img,
body.category-gear .grid .card .cover img {
  width: auto;
  min-height: 220px;
  max-width: 100%;
}
.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

/* Border trace — purple line traces around discover cards on hover */
@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.sectionCategory .card::before,
.sectionFeatured .card::before,
.pageGrid .card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--border-angle),
    transparent 25%,
    var(--accent) 50%,
    transparent 75%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  animation: borderTrace 6s linear infinite paused;
  transition: opacity 2s var(--ease);
}

.sectionCategory .card:hover::before,
.sectionFeatured .card:hover::before,
.pageGrid .card:hover::before {
  opacity: 1;
  animation-play-state: running;
  transition: opacity 0.4s var(--ease);
}

@keyframes borderTrace {
  to { --border-angle: 360deg; }
}

.cover {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface-2);
  flex-shrink: 0; /* Prevent image from shrinking */
}

.cover-product {
  height: 220px;
}

.cover-article {
  height: 150px;
}

/* Gear category cards in discover grid and featured section: height-based, fit full height */
/* This is for the discover page and latest section only, not the gear page */
/* Keep same height as cover-article (150px), just change object-fit */
.grid .card .cover-gear,
.sectionFeatured .card .cover-gear {
  height: 150px !important; /* Same height as cover-article */
  flex-shrink: 0 !important; /* Prevent shrinking */
  object-fit: contain !important; /* Fit height, adjust width */
  object-position: center !important;
  background: transparent !important;
}

/* Featured main card gear images - keep 474px height but use contain */
.sectionFeatured .featuredMain .cover-gear {
  height: 474px !important;
  object-fit: contain !important;
}

.content {
  padding: 14px 14px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Allow flex shrinking */
}

/* Ensure content areas are consistent height across all cards */
.grid .card .content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

/* Lucide icons in meta section - thicker strokes and proper alignment */
.meta [data-lucide] {
  stroke-width: 2.5;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.meta-divider,
.meta-divider-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.view-count {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  margin-left: -4px;
  margin-right: -4px;
  color: var(--muted-2);
}

.view-count > i {
  flex-shrink: 0;
}

.view-number {
  font-weight: 600;
  font-size: 13px;
  line-height: 15px;
  padding-left: 0;
}

.view-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  stroke-width: 1.8;
}

.view-icon--spin {
  animation: viewIconSpin 6s linear infinite;
}

@keyframes viewIconSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.meta-divider--muted {
  color: var(--muted-2);
  margin-left: -4px;
  margin-right: -4px;
}

.meta .tag + .meta-divider--muted {
  margin-left: -2px;
}

/* Show only left or right half of braces icon */
.meta-brace {
  overflow: hidden;
  display: inline-flex;
}

.meta-divider--muted:has(.meta-brace--left) {
  margin-left: 0;
}

.meta-brace--left {
  clip-path: inset(0 50% 0 0);
  margin-right: -6px;
}

.meta-brace--right {
  clip-path: inset(0 0 0 50%);
  margin-left: -6px;
}

span.tag {
  color: var(--accent-text);
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.meta-date {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  white-space: nowrap;
  flex-shrink: 0;
}

.cardTitle {
  margin: 10px 0 6px;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--text-heading);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.card .content p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

/* ---------------------------
   Review Card
---------------------------- */
.review-card {
  display: flex;
  gap: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 32px 0;
  align-items: flex-start;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), border-color 200ms var(--ease);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

/* Geometric accent corner */
.review-card::before {
  content: '';
  position: absolute;
  top: -1px;
  right: -1px;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, transparent 50%, var(--accent-subtle) 50%);
  border-radius: 0 var(--radius-lg) 0 0;
  pointer-events: none;
}

.review-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  border-left-color: var(--accent-hover);
}

html[data-theme="dark"] .review-card {
  background: var(--surface-2);
}

.review-card-image {
  flex: 0 0 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.review-card .review-card-image .verdict-card {
  height: auto !important;
}

.review-card-image img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 4px;
}

.review-card-details {
  flex: 1;
  min-width: 0;
}

.review-card-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.review-card-number {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.review-card-out-of {
  font-size: 20px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}

.review-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent);
  color: #fff;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
}

.review-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 12px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-heading);
}

.review-card-verdict {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 16px;
}

.review-card-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 13px;
}

.review-card-highlights span {
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.review-card-highlights a {
  color: var(--muted);
  text-decoration: none;
  transition: var(--t);
}

.review-card-highlights a:hover {
  color: var(--text);
}

.review-card-cta,
.articleBody .review-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), background 200ms var(--ease);
  border: none;
}

.review-card-cta:hover,
.articleBody .review-card-cta:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.3);
}

html[data-theme="dark"] .review-card-cta,
html[data-theme="dark"] .articleBody .review-card-cta {
  background: var(--accent);
  color: #fff;
}

html[data-theme="dark"] .review-card-cta:hover,
html[data-theme="dark"] .articleBody .review-card-cta:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.4);
}

.review-card-cta-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Mobile stack */
@media (max-width: 640px) {
  .review-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 20px;
    gap: 20px;
    border-left: 1px solid var(--border);
    border-top: 3px solid var(--accent);
  }

  .review-card::before {
    display: none;
  }

  .review-card-image {
    flex: none;
    width: 240px;
    max-width: 100%;
  }

  .review-card-score {
    justify-content: center;
  }

  .review-card-highlights {
    justify-content: center;
  }

  .review-card-cta {
    width: 100%;
    justify-content: center;
  }

  .review-card-number {
    font-size: 40px;
  }

  .review-card-out-of {
    font-size: 18px;
  }
}