/* T15 Community + T16 Deals final-design ownership layer. */

[data-hq-template="community"],
[data-hq-template="deals-archive"] {
  --hq-final-panel: rgb(255 255 255 / .82);
  --hq-final-panel-soft: rgb(250 250 250 / .88);
  --hq-final-border: rgb(212 212 216 / .8);
  --hq-final-text: #18181b;
  --hq-final-muted: #52525b;
  --hq-final-accent: #047857;
}

html.dark [data-hq-template="community"],
html.dark [data-hq-template="deals-archive"] {
  --hq-final-panel: rgb(6 12 10 / .9);
  --hq-final-panel-soft: rgb(255 255 255 / .06);
  --hq-final-border: rgb(255 255 255 / .12);
  --hq-final-text: #fafafa;
  --hq-final-muted: #a1a1aa;
  --hq-final-accent: #34d399;
}

[data-hq-template="community"] .hq-community-hero .hq-h1,
[data-hq-template="deals-archive"] .hq-deals-catalog-hero .hq-h1 {
  color: var(--hq-final-text);
  font-size: 1.875rem !important;
  line-height: 1.12 !important;
}

[data-hq-template="community"] .hq-community-board {
  max-height: none;
}

[data-hq-template="community"] .hq-community-board p,
[data-hq-template="community"] .hq-community-board__description {
  display: block;
  max-height: none;
  overflow: visible;
  -webkit-line-clamp: unset;
}

[data-hq-template="community"] .hq-v42-tabs a,
[data-hq-template="community"] .hq-v42-button,
[data-hq-template="community"] .hq-community-board-overflow summary,
[data-hq-template="deals-archive"] .hq-deals-filter-pill,
[data-hq-template="deals-archive"] .hq-deal-catalog-card__cta,
[data-hq-template="deals-archive"] .hq-deal-vote button {
  min-width: 44px;
  min-height: 44px;
}

[data-hq-template="community"] .hq-v42-tabs {
  display: flex;
  max-width: 100%;
  gap: .5rem;
  overflow-x: auto;
  padding-block: .25rem;
  scrollbar-width: thin;
}

[data-hq-template="community"] .hq-v42-tabs a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding-inline: .9rem;
}

/* T15's authority uses compact discussion rows rather than excerpt cards. */
[data-hq-template="community"] .hq-community-topic-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

[data-hq-template="community"] .hq-community-topic-list .hq-topic-row {
  align-items: start;
  gap: .8rem;
  padding: .9rem 1rem;
}

[data-hq-template="community"] .hq-community-topic-list .hq-topic-row__score {
  min-height: 2.75rem;
}

[data-hq-template="community"] .hq-community-topic-list .hq-topic-row h3 {
  margin-top: .2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-hq-template="community"] .hq-community-topic-list .hq-topic-row__footer {
  margin-top: .55rem;
  padding-top: .55rem;
}

[data-hq-template="community"] .hq-community-sidebar {
  gap: 1.5rem;
}

[data-hq-template="deals-archive"] .hq-deals-category-filters,
[data-hq-template="deals-archive"] .hq-deals-drop-filters {
  flex-wrap: wrap;
  overflow-x: visible;
}

[data-hq-template="deals-archive"] .hq-deals-expired-notice {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border: 1px solid rgb(245 158 11 / .38);
  border-radius: 1rem;
  background: rgb(245 158 11 / .09);
  color: var(--hq-final-text);
}

[data-hq-template="deals-archive"] .hq-deals-expired-notice p {
  margin: .5rem 0 0;
  color: var(--hq-final-muted);
}

[data-hq-template="deals-archive"] .hq-deals-expired-notice a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: .75rem;
  padding: .65rem 1rem;
  border-radius: .75rem;
  background: #047857;
  color: #fff;
  font-weight: 700;
}

[data-hq-template="deals-archive"] .hq-deal-catalog-card__cta[aria-disabled="true"] {
  background: #71717a;
  color: #fff;
  cursor: not-allowed;
}

[data-hq-template="deals-archive"] .hq-deal-catalog-card__badge--expired {
  background: #52525b !important;
  color: #f4f4f5 !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  right: 1rem;
}

[data-hq-template="deals-archive"] .hq-deal-catalog-card__media {
  position: relative;
  overflow: hidden;
}

[data-hq-template="deals-archive"] .hq-deal-catalog-card__discount,
[data-hq-template="deals-archive"] .hq-deal-catalog-card__expiry,
[data-hq-template="deals-archive"] .hq-deal-catalog-card__badge {
  max-width: calc(100% - 2rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  [data-hq-template="deals-archive"] .hq-deal-catalog-card__expiry {
    top: 0.75rem;
    left: 0.75rem;
    max-width: calc(55% - 1rem);
  }
  [data-hq-template="deals-archive"] .hq-deal-catalog-card__discount,
  [data-hq-template="deals-archive"] .hq-deal-catalog-card__badge {
    top: 0.75rem;
    right: 0.75rem;
    max-width: calc(45% - 1rem);
  }
}

[data-hq-template="deals-archive"] .hq-deal-catalog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (min-width: 640px) {
  [data-hq-template="community"] .hq-community-hero .hq-h1,
  [data-hq-template="deals-archive"] .hq-deals-catalog-hero .hq-h1 {
    font-size: 2.25rem !important;
    line-height: 1.1 !important;
  }
}

@media (min-width: 1024px) {
  [data-hq-template="community"] .hq-community-hero .hq-h1,
  [data-hq-template="deals-archive"] .hq-deals-catalog-hero .hq-h1 {
    font-size: 3rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-hq-template="community"] *,
  [data-hq-template="deals-archive"] * {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
