#website-themes {
  max-width: 960px;
  margin-inline: auto;
  scroll-margin-top: 116px;
}

body[data-preview-size="full"] #website-themes { max-width: none; }

.theme-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}
.theme-grid + .theme-grid { margin-top:24px; }

.theme-card {
  min-width: 0;
  border: 1px solid var(--view-border, #d9ded4);
  border-radius: 14px;
  overflow: hidden;
  background: var(--view-bg, #fff);
  color: var(--view-text, #202920);
}

.theme-card[data-tone="blue"] { --theme-tint: #e7effb; --theme-ink: #234678; }
.theme-card[data-tone="coral"] { --theme-tint: #fae9e3; --theme-ink: #793b2b; }
.theme-card[data-tone="gold"] { --theme-tint: #f5edcf; --theme-ink: #60450a; }
.theme-card[data-tone="green"] { --theme-tint: #e7f0e6; --theme-ink: #2f5736; }
.theme-card[data-tone="ink"] { --theme-tint: #e9eaf3; --theme-ink: #343659; }

.theme-image {
  display: block;
  background: var(--view-bg, #f7f7f2);
  border-bottom: 1px solid var(--view-border, #d9ded4);
}

.theme-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto 16 / 9;
  object-fit: contain;
}

.theme-image--portrait img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center top;
}

.theme-image:focus-visible { outline-offset: -4px; }

.theme-copy { padding: 12px 16px; }
.theme-copy h3 { margin: 8px 0 0; font: 400 clamp(22px, 2.5vw, 30px)/1.16 Georgia, serif; }
.theme-copy p { margin: 4px 0 8px; }
.theme-kind {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--theme-tint);
  color: var(--theme-ink);
  font-size: .875rem;
  font-weight: 700;
}

.theme-links { display: flex; flex-wrap: wrap; gap: 0 18px; }
.theme-links a, .theme-details summary, .theme-viewer button {
  min-height: 44px;
  box-sizing: border-box;
  padding-block: 11px;
}
.theme-details summary { cursor: pointer; }
.theme-copy .theme-details { border-top: 1px solid var(--view-border, #d9ded4); }
.theme-details[open] { padding-bottom: 12px; }

.theme-viewer {
  width: min(1120px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  box-sizing: border-box;
  border: 1px solid var(--view-border, #d9ded4);
  border-radius: 14px;
  padding: 12px;
}
.theme-viewer::backdrop { background: rgb(21 26 23 / .72); }
.theme-viewer-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.theme-viewer-bar h2 { flex: 1 1 200px; font-size: 1.25rem; margin: 0; }
.theme-viewer button {
  padding-inline: 12px;
  border: 1px solid var(--view-border, #91a395);
  border-radius: 6px;
  font: inherit;
  background: var(--view-control, white);
  color: inherit;
  cursor: pointer;
}
.theme-viewer-scroll {
  margin-top: 10px;
  max-height: min(75dvh, calc(100dvh - 160px));
  overflow: auto;
  border: 1px solid var(--view-border, #d9ded4);
}
.theme-viewer-scroll img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}
.theme-viewer-scroll[data-actual-size] img { max-width: none; margin-inline: 0; }

@media (max-width: 760px) {
  .theme-grid { margin-inline: -8px; gap: 16px; }
}
