/* ==========================================================================
   THEME DETAIL — /themes/<name>/
   One stylesheet for every theme page (not the gallery, themes/index.html).
   Markup: _includes/themes-2026/*.html. Behavior: /assets/js/theme-detail.js
   ========================================================================== */

/* Only the variant picked in theme-detail.js shows (hero preview, details) */
.theme-preview:not(.is-active),
.theme-details:not(.is-active) {
  display: none;
}

/* ==========================================================================
   HERO
   ========================================================================== */

/* The solid header already offsets the first section (base.css) */
.theme-hero {
  padding-top: calc(var(--js-padding) * 4);
  padding-bottom: calc(var(--js-padding) * 5);
  overflow: clip;
}

.theme-hero__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px 64px;
}

.theme-hero__copy {
  flex: 1 1 340px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.theme-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--color-main-op7);
  text-decoration: none;
  transition: var(--js-transition);
}

.theme-hero__back:is(:hover, :focus-visible) {
  color: var(--color-main);
}

.theme-hero__back .ph {
  transition: var(--js-transition);
}

.theme-hero__back:is(:hover, :focus-visible) .ph {
  translate: -3px 0;
}

/* Size, weight and face come from js-section__title--large (base.css) */
.theme-hero__title {
  margin: 0;
  line-height: 1;
}

.theme-hero__text {
  margin: 0;
  max-width: 480px;
  text-wrap: pretty;
}

/* Premium themes by external authors: who made it and where to get support */
.theme-hero__author {
  font-size: 14px;
  line-height: 1.6;
}

.theme-hero__author strong {
  font-weight: 600;
  color: var(--color-main);
}

.theme-hero__author a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.theme-hero__author a:is(:hover, :focus-visible) {
  color: var(--color-main);
}

.theme-hero__price {
  margin: 0;
  font-size: calc(var(--font-base-size) * 1.5);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-main);
}

.theme-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.theme-hero__note {
  margin: 0;
}

/* Preview: desktop browser + phone over its corner ----------------------- */

.theme-hero__visual {
  flex: 1 1 520px;
  max-width: 720px;
  margin-left: auto;
}

/* js-glow (base.css) sized up to the composition */
.theme-hero__visual.js-glow::before {
  width: 220px;
  height: 220px;
}

@supports (offset-path: circle()) {
  .theme-hero__visual.js-glow::before {
    margin: -82px 0 0 -82px;
  }
}

.theme-preview {
  position: relative;
  padding: 0 48px 40px 0;
}

.theme-preview__desktop,
.theme-preview__mobile {
  overflow: hidden;
  background: var(--color-background);
  box-shadow: 0 0 0 1px var(--color-main-op2), 0 24px 48px var(--color-background-op6);
}

.theme-preview__desktop {
  border-radius: var(--js-radius-lg);
}

.theme-preview__bar {
  display: flex;
  gap: 6px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--color-main-op1);
}

.theme-preview__bar span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-main-op2);
}

/* The full-page screenshot scrolls inside the browser frame */
.theme-preview__scroll {
  aspect-ratio: 16 / 10;
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
}

.theme-preview__scroll::-webkit-scrollbar {
  display: none;
}

.theme-preview__scroll:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.theme-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.theme-preview__mobile {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26%;
  aspect-ratio: 9 / 19;
  border: 4px solid var(--color-background);
  border-radius: 22px;
}

.theme-preview__mobile img {
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* ==========================================================================
   STICKY MENU
   ========================================================================== */

.theme-menu {
  position: sticky;
  top: var(--header-height-desktop);
  z-index: 90;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-main-op1);
}

.theme-menu__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.theme-menu__links {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}

.theme-menu__name {
  font-family: var(--font-main);
  font-size: 20px;
  font-weight: 600;
  color: var(--color-main);
}

.theme-menu__link {
  position: relative;
  padding: 21px 0;
  font-size: 15px;
  color: var(--color-main-op7);
  text-decoration: none;
  transition: var(--js-transition);
}

.theme-menu__link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: var(--js-transition);
}

.theme-menu__link:is(:hover, :focus-visible),
.theme-menu__link.is-active {
  color: var(--color-main);
}

.theme-menu__link.is-active::after {
  transform: scaleX(1);
}

.theme-menu__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-menu .theme-menu__button {
  padding: 10px 18px;
  font-size: 14px;
}

/* The hero already has the demo button: here it appears only once the bar is
   pinned (theme-detail.js adds .is-stuck) */
.theme-menu:not(.is-stuck) .theme-menu__demo {
  display: none;
}

/* The header and the hero already carry the CTA on wide screens; on phones this
   bar is the only one that stays in view */
@media (min-width: 768px) {
  .theme-menu__try {
    display: none;
  }
}

/* Anchor jumps land below the header and this bar */
.theme-section,
#theme-help {
  scroll-margin-top: calc(var(--header-height-desktop) + 64px);
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */

.theme-section__title {
  margin: 0 0 40px;
}

.theme-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}

.theme-section__head .theme-section__title {
  margin: 0;
}

.theme-section__footer {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

/* Cards (variants + related) -------------------------------------------- */

.theme-cards--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 32px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.theme-card__shot {
  aspect-ratio: 16 / 11;
  overflow: hidden;
  border: 1px solid var(--color-main-op1);
  border-radius: var(--js-radius-lg);
  background: var(--color-surface);
  transition: var(--js-transition);
}

.theme-card__shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.theme-card:is(:hover, :focus-visible) .theme-card__shot {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px var(--color-shadow);
}

/* Hover scrolls the screenshot down to its bottom, and back faster on leave */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .theme-card__shot img {
    transition: object-position 0.8s ease-in-out;
  }

  .theme-card:is(:hover, :focus-visible) .theme-card__shot img {
    object-position: bottom;
    transition-duration: 2s;
  }
}

.theme-card.is-current .theme-card__shot {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent);
}

.theme-card__info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.theme-card__name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  margin: 0;
  white-space: nowrap;
  font-family: var(--font-main);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-main);
}

.theme-card__variant {
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-secondary);
  font-size: 16px;
  font-weight: 400;
  color: var(--color-main-op7);
}

.theme-card__price {
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-main);
}

.theme-card__check {
  align-self: center;
  font-size: 22px;
  color: var(--color-accent);
  opacity: 0;
  transition: var(--js-transition);
}

.theme-card.is-current .theme-card__check {
  opacity: 1;
}

/* Related carousel ------------------------------------------------------- */

.theme-cards--carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 3 * 32px) / 4);
  gap: 32px;
  padding: 8px 0 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

@media (prefers-reduced-motion: no-preference) {
  .theme-cards--carousel {
    scroll-behavior: smooth;
  }
}

@media (hover: hover) {
  .theme-cards--carousel {
    cursor: grab;
  }
}

.theme-cards--carousel.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  scroll-snap-type: none;
  user-select: none;
}

.theme-cards--carousel::-webkit-scrollbar {
  display: none;
}

.theme-cards--carousel .theme-card {
  scroll-snap-align: start;
}

.theme-carousel__nav {
  display: flex;
  gap: 8px;
}

.theme-carousel__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-main-op2);
  border-radius: 50%;
  background: transparent;
  font-size: 18px;
  color: var(--color-main);
  cursor: pointer;
  transition: var(--js-transition);
}

.theme-carousel__arrow:hover:not(:disabled) {
  border-color: var(--color-main);
  background: var(--color-main);
  color: var(--color-background);
}

.theme-carousel__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Details ---------------------------------------------------------------- */

.theme-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.theme-details__shot {
  overflow: hidden;
  border: 1px solid var(--color-main-op1);
  border-radius: var(--js-radius-lg);
  background: var(--color-surface);
}

.theme-details__shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* Premium highlights and showcase (apparel) ------------------------------ */

.theme-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.theme-highlights__card {
  padding: 28px;
  border: 1px solid var(--color-main-op1);
  border-radius: var(--js-radius-lg);
  background: var(--color-surface);
}

.theme-highlights__icon {
  display: block;
  margin-bottom: 16px;
  font-size: 28px;
  color: var(--color-main);
}

.theme-highlights__name {
  margin: 0 0 8px;
  font-family: var(--font-main);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-main);
}

.theme-highlights__text {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-main-op8);
}

.theme-highlights__note,
.theme-showcase__note {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-main-op6);
}

.theme-showcase {
  display: flex;
  flex-direction: column;
  gap: 96px;
}

.theme-showcase__row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: start;
  gap: 64px;
}

.theme-showcase__row--media-first {
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
}

.theme-showcase__row--media-first .theme-showcase__copy {
  order: 2;
}

.theme-showcase__row--media-first .theme-showcase__media {
  order: 1;
}

.theme-showcase__eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-main-op6);
}

.theme-showcase__title {
  margin: 0 0 16px;
  font-family: var(--font-main);
  font-size: calc(var(--font-base-size) * 2.5);
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-main);
}

.theme-showcase__lead {
  margin: 0 0 24px;
  font-size: 18px;
  line-height: 1.5;
  color: var(--color-main-op8);
}

.theme-showcase__item {
  padding: 16px 0;
  border-top: 1px solid var(--color-main-op1);
}

.theme-showcase__item h3 {
  margin: 0 0 6px;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-main);
}

.theme-showcase__item p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-main-op8);
}

.theme-showcase__media img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-main-op1);
  border-radius: var(--js-radius-lg);
}

/* Features --------------------------------------------------------------- */

.theme-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.theme-features__group {
  padding: 28px;
  border: 1px solid var(--color-main-op1);
  border-radius: var(--js-radius-lg);
  background: var(--color-surface);
}

.theme-features__title {
  margin: 0 0 20px;
  font-family: var(--font-main);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-main);
}

.theme-features__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.theme-features__list li {
  position: relative;
  padding-left: 28px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--color-main-op8);
}

.theme-features__check {
  position: absolute;
  top: 1px;
  left: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--color-accent);
}

.theme-features__plan {
  margin-left: 4px;
  vertical-align: 1px;
  cursor: help;
}

.theme-features__plan:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Documentation band ----------------------------------------------------- */

/* Same title and section padding as the other sections; three equal cards */
.theme-docs__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.theme-docs__link {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 20px 24px;
  border: 1px solid var(--color-main-op1);
  border-radius: var(--js-radius-lg);
  background: var(--color-surface);
  color: var(--color-main);
  text-decoration: none;
  transition: var(--js-transition);
}

.theme-docs__link:is(:hover, :focus-visible) {
  border-color: var(--color-main-op3);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px var(--color-shadow);
}

.theme-docs__link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.theme-docs__icon {
  flex: 0 0 auto;
  font-size: 24px;
  line-height: 1;
  color: var(--color-accent);
}

.theme-docs__label {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-main);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
}

.theme-docs__arrow {
  flex: 0 0 auto;
  font-size: 18px;
  color: var(--color-main-op5);
  transition: var(--js-transition);
}

.theme-docs__link:is(:hover, :focus-visible) .theme-docs__arrow {
  color: var(--color-main);
  translate: 2px -2px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1199px) {
  .theme-cards--carousel {
    grid-auto-columns: calc((100% - 2 * 32px) / 3);
  }
}

/* Hero stacks: copy centred above the preview */
@media (max-width: 991px) {
  .theme-highlights {
    grid-template-columns: repeat(2, 1fr);
  }

  .theme-showcase {
    gap: 72px;
  }

  .theme-showcase__row,
  .theme-showcase__row--media-first {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .theme-showcase__row--media-first .theme-showcase__copy,
  .theme-showcase__row--media-first .theme-showcase__media {
    order: 0;
  }

  .theme-hero__copy {
    align-items: center;
    text-align: center;
  }

  .theme-hero__actions {
    justify-content: center;
  }

  .theme-hero__visual {
    margin: 0 auto;
  }

  .theme-cards--carousel {
    grid-auto-columns: calc((100% - 32px) / 2);
  }

  .theme-menu__links {
    gap: 20px;
  }
}

@media (max-width: 767px) {
  .theme-highlights {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .theme-highlights__card {
    padding: 24px;
  }

  .theme-showcase {
    gap: 56px;
  }

  .theme-showcase__title {
    font-size: calc(var(--font-base-size) * 2);
  }

  .theme-docs__list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .theme-menu {
    top: var(--header-height-mobile);
  }

  .theme-menu__inner {
    min-height: 56px;
  }

  /* Phones keep the name and the main CTA; the anchors and demo don't fit */
  .theme-menu__link,
  .theme-menu__demo {
    display: none;
  }

  .theme-section,
  #theme-help {
    scroll-margin-top: calc(var(--header-height-mobile) + 56px);
  }

  .theme-section__title,
  .theme-section__head {
    margin-bottom: 28px;
  }

  .theme-section .theme-section__title {
    font-size: calc(var(--font-base-size) * 2);
  }

  .theme-details {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .theme-features {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .theme-features__group {
    padding: 24px;
  }

  .theme-cards--carousel {
    grid-auto-columns: 78%;
    gap: 16px;
  }

  .theme-cards--grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .theme-card__name {
    font-size: 17px;
  }

  .theme-preview {
    padding: 0 28px 28px 0;
  }

  .theme-preview__mobile {
    width: 30%;
    border-width: 3px;
    border-radius: 14px;
  }
}

@media (max-width: 479px) {
  .theme-hero__actions {
    flex-direction: column;
    align-self: stretch;
  }

  .theme-hero__actions > * {
    width: 100%;
    justify-content: center;
  }

  .theme-carousel__nav {
    display: none;
  }
}

/* Touch targets: 44px where a finger, not a cursor, is the likely input */
@media (pointer: coarse), (max-width: 767px) {
  .theme-hero__back {
    min-height: 44px;
  }

  .theme-menu .theme-menu__button {
    min-height: 44px;
  }
}
