/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), opacity 0.2s var(--ease);
}

.btn--primary {
  background: var(--maroon);
  color: #fff;
}

.btn--primary:hover {
  opacity: 0.88;
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  background: var(--surface);
}

.btn--dark {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn--dark:hover {
  opacity: 0.85;
}

.btn--light {
  background: var(--paper);
  color: var(--ink);
  border-color: rgba(11, 11, 12, 0.15);
}

.btn--light:hover {
  opacity: 0.85;
}

.btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.45;
}

/* Badges / pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge--outline {
  border: 1px solid var(--maroon);
  color: var(--maroon);
}

.badge--muted {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

/* Palette swatches */
.palette-group {
  margin-bottom: 14px;
}

.palette-group:last-child {
  margin-bottom: 0;
}

.palette-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-content: start;
  gap: 28px;
  margin-bottom: 14px;
}

.palette-row .palette-group {
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .palette-row {
    /* !important needed: JS sets an inline grid-template-columns for the desktop layout */
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
}

.palette-group__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 130px);
  gap: 8px;
}

.swatch {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  text-align: left;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

.swatch:hover {
  transform: translateY(-2px);
  border-color: var(--maroon);
}

.swatch__color {
  flex: 0 0 auto;
  height: 44px;
  width: 100%;
}

.swatch__meta {
  flex: 1 1 auto;
  padding: 6px 8px 8px;
  background: var(--surface);
}

.swatch__name {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
}

.swatch__hex {
  display: block;
  font-size: 0.72rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--text-muted);
}

.swatch__status {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  padding: 2px 7px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.swatch.is-copied .swatch__status {
  opacity: 1;
  transform: translateY(0);
}

/* Logo showcase cards */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.logo-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.logo-card__frame {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 14px;
  background: var(--elevated);
  border-radius: 10px;
}

.logo-card__frame img {
  max-height: 120px;
  width: auto;
}

.logo-card__body h3 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.logo-card__body p {
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--text-secondary);
}

.logo-card__downloads {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.logo-card__downloads a {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 9px;
}

.logo-card__downloads a:hover {
  color: var(--maroon);
  border-color: var(--maroon);
}

/* Deck tiles */
.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.deck-tile {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}

.deck-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deck-tile__word {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 10px 8px;
  background: linear-gradient(to top, rgba(11, 11, 12, 0.65), transparent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
}

.deck-tile__placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.deck-tile__placeholder--dark {
  color: rgba(245, 245, 243, 0.75);
}

.deck-tile__placeholder--light {
  color: rgba(11, 11, 12, 0.6);
}

.deck-tile:hover {
  border-color: var(--maroon);
}

.deck-grid__divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0;
}

.deck-grid__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(11, 11, 12, 0.82);
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__frame {
  position: relative;
  width: min(920px, 100%);
  max-height: 100%;
  background: var(--surface);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lightbox__stage {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
}

.lightbox__stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lightbox__nav {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--elevated);
  border: 1px solid var(--border);
}

.icon-btn:hover {
  border-color: var(--maroon);
}

@media (max-width: 640px) {
  .lightbox {
    padding: 0;
  }

  .lightbox__frame {
    width: 100%;
    height: 100%;
    border-radius: 0;
    justify-content: center;
  }
}
