/* Page stylesheet: case detail. */

/* Layout */
.mh-detail-page {
  min-height: 100dvh;
  background-color: hsl(var(--background));
}

.mh-detail-hero {
  border-bottom-width: 1px;
  background-color: hsl(var(--muted) / 0.4);
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.mh-detail-hero-inner,
.mh-detail-two-column,
.mh-related-section-inner {
  width: 100%;
  max-width: 1440px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 1rem;
  padding-left: 1rem;
}

.mh-detail-hero-inner,
.mh-detail-two-column {
  display: grid;
  gap: 2.5rem;
}

/* Hero */
.mh-detail-breadcrumb {
  margin-bottom: 2rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.mh-detail-eyebrow,
.mh-related-card-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
}

.mh-detail-eyebrow {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.mh-detail-title {
  max-width: 56rem;
  margin-top: 1.25rem;
  color: hsl(var(--foreground));
  font-size: clamp(2.75rem, 5vw, 5rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: 0;
}

.mh-detail-lead {
  max-width: 42rem;
  margin-top: 1.5rem;
  color: hsl(var(--muted-foreground));
  font-size: 1rem;
  line-height: 1.75rem;
}

.mh-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.mh-detail-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.mh-detail-meta-icon {
  width: 1rem;
  height: 1rem;
}

/* Before and after media */
.mh-before-after-grid,
.mh-related-comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}

.mh-before-after-grid {
  gap: 0;
  border-width: 1px;
  border-radius: var(--radius);
  background-color: hsl(var(--card));
}

.mh-before-after-panel,
.mh-related-comparison-panel {
  position: relative;
  aspect-ratio: 8 / 9;
  overflow: hidden;
  border-right: 1px solid rgb(255 255 255 / 0.7);
}

.mh-before-after-panel {
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--background));
}

.mh-related-comparison-grid,
.mh-related-comparison-panel {
  background-color: hsl(var(--muted));
}

.mh-before-after-panel:last-child,
.mh-related-comparison-panel:last-child {
  border-right-width: 0;
}

.mh-before-after-panel .mh-fill-image,
.mh-related-comparison-panel .mh-fill-image {
  object-fit: contain;
  padding: 0.5rem;
}

.mh-before-after-panel .mh-fill-image,
.mh-related-comparison-panel .mh-fill-image {
  object-fit: cover;
  padding: 0;
}

.mh-before-after-label,
.mh-related-comparison-label {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  color: rgb(255 255 255 / 1);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.mh-before-after-label {
  padding: 0.25rem 0.75rem;
}

.mh-related-comparison-label {
  padding: 0.25rem 0.625rem;
}

.mh-before-after-panel:first-child .mh-before-after-label,
.mh-related-comparison-panel:first-child .mh-related-comparison-label {
  background-color: rgb(30 41 59 / 0.8);
}

.mh-before-after-panel:last-child .mh-before-after-label,
.mh-related-comparison-panel:last-child .mh-related-comparison-label {
  background-color: rgb(4 120 87 / 0.85);
}

/* Detail content */
.mh-step-number {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 2.125rem;
  min-height: 2.125rem;
  justify-content: center;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 9999px;
  background-color: hsl(var(--accent));
  padding: 0.125rem 0.5rem;
  color: hsl(var(--accent-foreground));
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

.mh-metric-row,
.mh-download-row {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
}

.mh-metric-row {
  align-items: center;
  justify-content: space-between;
}

.mh-detail-term {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
}

.mh-detail-value,
.mh-detail-meta-text {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.mh-detail-value {
  text-align: right;
}

.mh-detail-meta-text {
  margin-top: 0.5rem;
}

.mh-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1.5rem 1.5rem;
}

.mh-tag-link,
.mh-download-link,
.mh-related-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--background));
  padding: 0.5rem 1rem;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-duration: 150ms;
}

.mh-tag-link {
  height: 2.25rem;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
}

.mh-download-link,
.mh-related-card-action {
  height: 2.5rem;
}

.mh-tag-link:hover,
.mh-download-link:hover,
.mh-related-card-action:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.mh-related-card-action:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px hsl(var(--ring));
}

.mh-download-row {
  flex-direction: column;
}

.mh-download-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Related cases */
.mh-related-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.mh-related-grid .mh-card-media {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.mh-related-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: hsl(var(--muted));
}

.mh-related-card-badge {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.mh-related-card-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0 1.5rem 1.5rem;
}

.mh-related-card-content .mh-card-summary {
  margin: 0;
  padding: 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  line-height: 1.5rem;
}

.mh-related-card-action {
  width: fit-content;
  margin-top: auto;
}

@media (min-width: 640px) {
  .mh-detail-hero-inner,
  .mh-detail-two-column,
  .mh-related-section-inner {
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }
}

@media (min-width: 768px) {
  .mh-detail-hero {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  .mh-related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mh-download-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .mh-before-after-panel .mh-fill-image,
  .mh-related-comparison-panel .mh-fill-image {
    padding: 0.75rem;
  }

  .mh-before-after-panel .mh-fill-image,
  .mh-related-comparison-panel .mh-fill-image {
    padding: 0;
  }

  .mh-before-after-label,
  .mh-related-comparison-label {
    top: 0.75rem;
    left: 0.75rem;
  }
}

@media (min-width: 1024px) {
  .mh-detail-hero-inner,
  .mh-detail-two-column,
  .mh-related-section-inner {
    padding-right: 2rem;
    padding-left: 2rem;
  }

  .mh-detail-hero-inner {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
  }

  .mh-detail-two-column {
    grid-template-columns: 1fr 1fr;
  }
}
