/* ==========================================================================
   J.Show Studio — an artist's page (artist.html)

   Page-only additions. The design system is base.css; the look the two public
   pages share — the bar at the top (here with the way back in place of the
   menu), tabs, tags, the review card, the footer — is public.css.

     01 · Portrait        the photo with her name on it, her star rating
     02 · Layout          one column on a phone; from 768px the portrait
                          stands beside the text and stays in view
     03 · Introduction    the tabs, numbered sections, tags, her story
     04 · Reviews         her review cards in the reading column
     05 · Missing / no script / print
   ========================================================================== */


/* ==========================================================================
   01 · Portrait
   ========================================================================== */

/* An upright frame, edge to edge on a phone. Until the picture has arrived
   (and when there is none) the frame shows the calm photo ground. */
/* The picture and her lines share one grid cell: the picture gives the frame its shape, the lines
   stand at its foot — and should they ever need more room than the picture has (very large text),
   the frame grows with them instead of cutting them off. It grows taller only: the one column is
   as wide as the frame, whatever width a taller picture would ask for.

   Her photograph is a square (or upright) studio portrait: the face in the upper middle, the
   shoulders — dark — below. The frame is upright and tall enough (2:3, never lower than 31rem)
   for the picture to fill it by its height: only its sides are cut, never the face, and her
   lines stand below the chin, over the shoulders. */
.profile__hero {
  --shade-rise: min(4rem, 18vw);           /* how far above her lines the shade begins */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-inline: calc(-1 * var(--gutter));
  overflow: hidden;
  background: var(--photo-ground);
}
.profile__photo {
  grid-area: 1 / 1;
  position: relative;
  width: 100%;                             /* of the column — also where the height is capped: the frame is then simply less upright */
  aspect-ratio: 2 / 3;
  min-height: 31rem;
  max-height: 34rem;                       /* a wide phone held upright: the tabs stay on the first screen */
}
.profile__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;                /* a frame that is wider than the picture cuts it at the shoulders, not at the forehead */
}
/* her name in light type on a plum shade that grows out of the picture. The
   shade is deep from the first line of text down, whatever the picture is and
   however many lines there are: it fades out over a fixed stretch above them. */
.profile__caption {
  grid-area: 1 / 1;
  align-self: end;
  position: relative;
  padding: var(--shade-rise) var(--gutter) 1.25rem;
  background: linear-gradient(
    to top,
    rgba(51, 35, 42, 0.92) 0,
    rgba(51, 35, 42, 0.86) calc(100% - var(--shade-rise)),
    rgba(51, 35, 42, 0.62) calc(100% - 0.7 * var(--shade-rise)),
    rgba(51, 35, 42, 0.3) calc(100% - 0.35 * var(--shade-rise)),
    rgba(51, 35, 42, 0) 100%
  );
  color: var(--color-on-accent);
}
/* between a phone and the two columns (a small tablet, a phone held sideways):
   the portrait keeps the width of a large phone, in the middle */
@media (min-width: 30em) and (max-width: 47.99em) {
  .profile__hero {
    width: 30rem;
    margin-inline: auto;
    margin-top: var(--space-5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
  }
  .profile__caption { padding-inline: 1.5rem; }
}
.profile__role {
  color: #F9D3E0;                          /* the rose, light enough for the shade */
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.profile__name {
  margin-top: 0.25rem;
  color: inherit;
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
}
.profile__title {
  font-family: var(--font-body);
  font-size: 0.5em;
  font-weight: 400;
  letter-spacing: 0.16em;
  vertical-align: 0.18em;
}
/* "8 Years of Experience · 顾客评价 2 条". The dot before each part stands in a
   margin that is cut off, so the first part of every line has none — also
   where a narrow portrait breaks the line in two. */
.profile__facts {
  margin-top: 0.4375rem;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0.06em;
}
.profile__facts-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  row-gap: 0.125rem;
  margin-left: -1.25rem;
}
.profile__facts-row > span {
  position: relative;
  padding-left: 1.25rem;
  font-variant-numeric: lining-nums tabular-nums;
}
.profile__facts-row > span::before {
  content: "·";
  position: absolute;
  left: 0;
  width: 1.25rem;
  font: 400 0.8125rem/1.5 var(--font-body);
  text-align: center;
}
.profile__exp {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-style: italic;
  line-height: 1.25;
  letter-spacing: 0.02em;
}
/* Her average from the rated reviews on display (★★★★★ 4.9 · 8 条评分), on
   the shade of the portrait: light ink, the rose lightened like her role
   above. The line is not there at all while she has no rated review. */
.profile__rating { margin-top: 0.4375rem; line-height: 1.5; }
.profile__rating .rating {
  justify-content: flex-start;
  color: rgba(255, 255, 255, 0.94);
}
.profile__rating .rating__value { color: var(--color-on-accent); }
.profile__rating .rating__count { color: inherit; }
.profile__rating .stars::before { color: rgba(255, 255, 255, 0.34); }
.profile__rating .stars::after { color: #F9D3E0; }
@media (forced-colors: active) {
  .profile__rating .stars::before { color: GrayText; }
  .profile__rating .stars::after { color: Highlight; }
}


/* ==========================================================================
   02 · Layout
   ========================================================================== */

.profile__main { min-width: 0; }

@media (min-width: 48em) {
  .profile {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--space-6);
    align-items: start;
    padding-top: var(--space-6);
  }
  /* the portrait keeps her company while the text scrolls, below the bar */
  .profile__hero {
    position: sticky;
    top: calc(var(--bar-height) + var(--space-5));
    margin-inline: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
  }
  /* beside the text the portrait is narrow: as tall as it takes for her lines to stand below the chin */
  .profile__photo { aspect-ratio: 4 / 5; min-height: 37rem; max-height: none; }
  .profile__caption { padding: var(--shade-rise) 1.5rem 1.5rem; }
}
@media (min-width: 68em) {
  .profile { grid-template-columns: 24rem minmax(0, 1fr); column-gap: var(--space-8); }
  .profile__name { font-size: 2rem; }
}


/* ==========================================================================
   03 · Introduction
   ========================================================================== */

.tab-panel { padding-top: var(--space-5); }
.tab-panel:focus-visible { outline-offset: 4px; }
@media (min-width: 48em) {
  .profile__main > .tabs { margin-top: -0.5rem; }   /* the tab labels start level with the portrait */
  .tab-panel { padding-top: var(--space-6); }
}

/* Sections numbered 01 / 02 / 03 … by a counter, like the sections of a
   review; a section that is left out (hidden) is not counted. */
.profile-intro { counter-reset: profile-section; }
.profile-section { counter-increment: profile-section; }
.profile-section + .profile-section { margin-top: var(--space-6); }
.profile-section__title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.875rem;
  color: var(--color-ink);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.1em;
}
.profile-section__title::before {
  content: counter(profile-section, decimal-leading-zero);
  flex: none;
  min-width: 1.75rem;
  color: var(--color-rose-text);
  font-family: var(--font-display);
  font-size: 1.4375rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: lining-nums;
}
.profile-section__title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(to right, #EDB3C8, var(--color-line));
}
.profile-section__note {
  margin-top: 0.625rem;
  color: var(--color-ink-faint);
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
}
/* an artist the settings only name: one quiet line instead of an empty panel */
.profile-intro__none {
  color: var(--color-ink-faint);
  font-size: 0.875rem;
  line-height: 1.8;
  letter-spacing: 0.04em;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.profile-tags > .tag {
  min-height: 2rem;
  padding: 0.25rem 0.875rem;
  border-color: #EDB3C8;
  background-color: var(--color-surface);
  color: var(--color-ink);
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0.06em;
  white-space: normal;
  font-variant-numeric: tabular-nums;
}
.profile-tags > .tag--accent {
  border-color: transparent;
  background-color: var(--color-accent-soft);
  color: var(--color-accent-strong);
}

.profile-bio p {
  color: var(--color-ink);
  font-size: 0.9375rem;
  line-height: 1.9;
  letter-spacing: 0.02em;
  text-wrap: pretty;
}
.profile-bio p + p { margin-top: 0.75rem; }

/* her philosophy: a few lines on the rose tint */
.profile-quote {
  padding: 1rem 1.125rem;
  border-radius: var(--radius-md);
  background-color: var(--color-accent-soft);
}
.profile-quote p {
  color: var(--color-ink);
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.9;
  letter-spacing: 0.08em;
  text-wrap: pretty;
}
@media (min-width: 48em) {
  .profile-bio p { font-size: 1rem; }
  .profile-quote { padding: 1.25rem 1.5rem; }
  .profile-quote p { font-size: 1.125rem; }
}


/* ==========================================================================
   04 · Reviews
   ========================================================================== */

/* her cards in the reading column: one column, two when it is wide enough */
.profile .review-list {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  max-width: 30rem;
  margin-inline: auto;
  /* An address that ends in #reviews opens the 评价 tab. The list happens to carry that id, and a
     browser would jump straight to it, past her portrait and name. With a margin taller than
     everything above the list, "scroll to #reviews" means: stay at the top of her page. */
  scroll-margin-top: 100rem;
}
@media (min-width: 48em) {
  .profile .review-list { margin-inline: 0; }
}
@media (min-width: 75em) {
  .profile .review-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
}


/* ==========================================================================
   05 · Missing / no script / print
   ========================================================================== */

/* no artist to show: only the note with the way back */
.profile[data-state="missing"] { display: block; padding-top: 0; }
.profile[data-state="missing"] > .profile__hero,
.profile[data-state="missing"] > .profile__main { display: none; }

/* JavaScript switched off: the <noscript> notice explains; frames that would
   never be filled are not shown */
@media (scripting: none) {
  .profile { display: block; padding-top: 0; }
  .profile__hero,
  .profile__main { display: none; }
}

@media print {
  .profile__hero { position: relative; top: auto; }
}
