/* ==========================================================================
   J.Show Studio — display page (index.html)

   Page-only additions. Every component on this page (hero, filters, review
   cards, empty state, skeleton shimmer, buttons …) is styled by base.css;
   this file only adds what the display page needs on top of it:

     01 · Hero            the placeholder of the review count
     02 · Loading         skeleton cards, the "JavaScript never started" note
     03 · Long reviews    the collapsed text block and its toggle
     04 · More            the "查看更多评价" row
     05 · States          the button inside .empty, the list without a filter bar
     06 · Scrolling       scroll anchoring is left to the page script
     07 · No script / print
   ========================================================================== */


/* ==========================================================================
   01 · Hero
   ========================================================================== */

/* the review count before the data has arrived: a quiet dash */
.stat__value.is-pending { color: var(--color-line-strong); }


/* ==========================================================================
   02 · Loading
   ========================================================================== */

/* A skeleton card sits on .card (same border, radius and paper as .review)
   and has the proportions of a review with two photos, so the avatar of the
   real card lands where the skeleton showed it. */
.skeleton-card { overflow: hidden; }
.skeleton-card__photo { aspect-ratio: 8 / 5; border-radius: 0; }
.skeleton-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 1.25rem 1.25rem 1.5rem;         /* = .review__body */
}
.skeleton-card__head { display: flex; align-items: center; gap: var(--space-3); }
.skeleton-card__avatar { flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; }
.skeleton-card__who {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.skeleton-card__line { height: 0.875rem; }
.skeleton-card__line--30 { width: 30%; }
.skeleton-card__line--45 { width: 45%; }
.skeleton-card__line--70 { width: 70%; }
.skeleton-card__line--90 { width: 90%; }

/* three placeholders on a phone and on a three-column desktop, four in the
   two-column layout in between (the breakpoints of .review-list) */
.skeleton-card:nth-child(n + 4) { display: none; }
@media (min-width: 44em) {
  .skeleton-card:nth-child(4) { display: block; }
}
@media (min-width: 68em) {
  .skeleton-card:nth-child(4) { display: none; }
  .skeleton-card__body { padding: 1.375rem 1.5rem 1.75rem; }
}

/* Shown by CSS alone when the page script has not taken over after 12 seconds
   (a script file did not arrive, or the browser is too old to run it).
   The script removes this element the moment it starts. */
.boot-note {
  max-height: 0;
  margin: 0 auto;
  max-width: 30em;
  overflow: hidden;
  visibility: hidden;
  color: var(--color-ink-soft);
  font-size: 0.875rem;
  line-height: 1.8;
  text-align: center;
  text-wrap: balance;
  animation: boot-note-in 0.01s linear 12s forwards;
}
.boot-note a {
  /* a comfortable tap target without moving the line */
  display: inline-block;
  margin-block: -0.625rem;
  padding-block: 0.625rem;
}
@keyframes boot-note-in {
  to { max-height: 12rem; margin-bottom: var(--space-5); visibility: visible; }
}


/* ==========================================================================
   03 · Long reviews
   ========================================================================== */

/* The three sections of a card live in one block so that a very long review
   can be clipped as a whole. The margins repeat the rhythm base.css gives a
   first .review__section. */
.review__text { margin-top: 1.375rem; }
.review__text > .review__section:first-child { margin-top: 0; }

/* .is-collapsible is set by the page script on a card whose text is taller
   than 35rem (roughly 14 lines of text plus the three titles); the text is
   then clipped to 25rem until the visitor opens it. */
.review.is-collapsible:not(.is-expanded) .review__text {
  position: relative;
  max-height: 25rem;
  overflow: hidden;
}
.review.is-collapsible:not(.is-expanded) .review__text::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5.5rem;
  /* the paper colour written out with zero alpha: "transparent" turns grey
     half-way in older Safari */
  background: linear-gradient(to bottom, rgba(253, 251, 247, 0), var(--color-surface));
  pointer-events: none;
}

.review__toggle {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  min-height: var(--tap);
  margin: 0 0 -0.625rem;                    /* the 44px button brings its own air above and below the label */
  color: var(--color-accent-strong);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.16em;
  transition: color 0.2s ease;
}
/* hairlines on both sides, like the rules beside a text-only card's quote mark */
.review__toggle::before,
.review__toggle::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background-color: var(--color-line);
}
.review__toggle-label { display: inline-flex; align-items: center; gap: 0.375rem; }
.review__toggle svg {
  flex: none;
  width: 0.8125rem;
  height: 0.8125rem;
  transform: rotate(90deg);                 /* chevron-right, pointing down */
  transition: transform 0.3s var(--ease);
}
.review.is-expanded .review__toggle { margin-top: 0.75rem; }
.review.is-expanded .review__toggle svg { transform: rotate(-90deg); }
@media (hover: hover) {
  .review__toggle:hover { color: var(--color-ink); }
}

/* While a card is open, the other cards of its grid row keep the height the
   row had before (the script writes it as min-height) instead of stretching
   into tall, empty cards. */
.review.is-row-frozen { align-self: start; }


/* ==========================================================================
   04 · More
   ========================================================================== */

.more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.more .btn { min-width: 13.5rem; }
.more__count {
  color: var(--color-ink-faint);
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 48em) {
  .more { margin-top: var(--space-7); }
}


/* ==========================================================================
   05 · States
   ========================================================================== */

.empty .btn { margin-top: var(--space-4); }

/* without the filter bar (no reviews at all, or the list could not be
   loaded) one hairline still closes the masthead */
.review-list.is-bare { border-top: 1px solid var(--color-line); }


/* ==========================================================================
   06 · Scrolling
   ========================================================================== */

/* Opening and closing a long review is the only thing that moves content on
   this page, and the script keeps the pressed button where it was. The
   browser's own scroll anchoring would correct the same movement a second
   time, so nothing in or below the list may serve as its anchor. */
.review-list,
.more,
.site-footer { overflow-anchor: none; }


/* ==========================================================================
   07 · No script / print
   ========================================================================== */

/* JavaScript switched off: the <noscript> notice explains; placeholders that
   would never be filled are not shown. */
@media (scripting: none) {
  .filters,
  .review-list,
  .boot-note { display: none; }
}

/* a gradient would smear the system colours in forced-colours mode */
@media (forced-colors: active) {
  .review.is-collapsible:not(.is-expanded) .review__text::after { display: none; }
}

@media print {
  .banner,
  .filters,
  .more,
  .review__toggle { display: none !important; }
  .review.is-collapsible .review__text { max-height: none !important; overflow: visible !important; }
  .review.is-collapsible .review__text::after { display: none !important; }
  .review-list > .review { animation: none; break-inside: avoid; }
}
