/*
  The Head Spa by Hikari, D11 journal layer (g2)

  Pages: blog.html, blog-scalp-consultation.html, blog-hair-before-after.html,
         blog-wellness-slower-appointment.html, blog-treatment-60-90.html, search.html
  Linked only on these six pages, right after pages-journal.css. pages-journal.css stays the
  D10 base it shares with the policy and system pages; this file only restyles on top of it,
  scoped by the body classes (.page-archive, .page-article, .page-search).

  Rules kept (DESIGN-D11 7): tokens only (colour, type, space), no font names, no transitions
  or keyframes (motion.css / motion-layer.css own motion), square corners, no shadow.
  Loop films use the shared [data-loop] component (site.css 7.3, site.js 5b).

  Contents
    1. Journal archive: a large italic title, two columns of large pictures on a centre
       hairline, the right column set lower (yusen blog, YUSEN-PATTERNS 7.4)
    2. Article cover: words on the left, the article's picture or film running to the right
       edge of the screen (half bleed, MEDIA-D11 1)
    3. Article body: pictures run to the right edge, a side film above the contents list,
       a picture and guest quote pair
    4. Keep reading: two cards on a centre hairline
    5. Search
*/

/* 1. Journal archive */
.page-archive .page-head {
  padding-block: clamp(3rem, 1.8rem + 4.4vw, 6.5rem) clamp(2rem, 1.4rem + 2.2vw, 3.5rem);
}
/* H1 type: site.css 4 (.page-title, IvyMode 9/27). Only the layout stays here. */
.page-archive .page-head .page-lede { max-width: 24rem; }

.page-archive .entries {
  position: relative;
  display: grid;
  row-gap: clamp(3rem, 2.2rem + 3vw, 5.5rem);
  padding-top: clamp(1.75rem, 1.3rem + 2vw, 3.5rem);
  border-top: 1px solid var(--rule-strong);
}
.page-archive .entry {
  display: block;
  padding: 0;
  border: 0;
}
/* phones: the picture runs edge to edge, like the home page photographs */
.page-archive .entry__media {
  aspect-ratio: 4 / 5;
  margin-inline: calc(-1 * var(--pad-x));
}
.page-archive .entry__body { margin-top: var(--space-5); }
.page-archive .entry__title {
  margin-top: var(--space-3);
  font-size: clamp(1.875rem, 1.4rem + 1.6vw, 2.875rem);
  font-style: italic;
  font-weight: var(--display-wght-em);
  line-height: 1.06;
  letter-spacing: var(--display-track-italic);
  text-wrap: balance;
}
.page-archive .entry__dek {
  max-width: 28rem;
  margin-top: var(--space-3);
  font-size: var(--fs-body);
  line-height: 1.6;
}
.page-archive .entry__more { display: none; }
@media (min-width: 48em) {
  .page-archive .entries {
    --g2-offset: clamp(5rem, 1.5rem + 9vw, 11rem);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(3rem, 0.5rem + 7vw, 8rem);
    padding-bottom: var(--g2-offset);
  }
  /* centre hairline, from the top rule to the foot of the list */
  .page-archive .entries::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--rule);
  }
  .page-archive .entry__media { margin-inline: 0; }
  /* the right column starts lower; it keeps its own rhythm down the page. Counted among the
     articles on show, so a category filter keeps the pattern (older browsers: plain nth-child) */
  .page-archive .entry:nth-child(even) {
    margin-top: var(--g2-offset);
    margin-bottom: calc(-1 * var(--g2-offset));
  }
  .page-archive .entry:nth-child(odd of :not([hidden])) { margin-top: 0; margin-bottom: 0; }
  .page-archive .entry:nth-child(even of :not([hidden])) {
    margin-top: var(--g2-offset);
    margin-bottom: calc(-1 * var(--g2-offset));
  }
  /* a single article on show: no centre line, no lower column */
  .page-archive .entries:not(:has(> .entry:not([hidden]) ~ .entry:not([hidden]))) { padding-bottom: 0; }
  .page-archive .entries:not(:has(> .entry:not([hidden]) ~ .entry:not([hidden])))::before { display: none; }
  html:not(.js) .page-archive .archive:has(#wellness:target, #treatments:target) .entry { margin-block: 0; }
  html:not(.js) .page-archive .archive:has(#wellness:target, #treatments:target) .entries { padding-bottom: 0; }
  html:not(.js) .page-archive .archive:has(#wellness:target, #treatments:target) .entries::before { display: none; }
}
@media (hover: hover) and (pointer: fine) {
  .page-archive .entry:hover .entry__title { color: var(--accent); }
}

/* 2. Article cover */
.page-article .article-head {
  padding-block: 0;
  overflow-x: clip;
}
.page-article .article-head__grid { display: grid; gap: 0; }
.page-article .article-head__text {
  display: flex;
  flex-direction: column;
  padding-block: var(--space-1) clamp(2rem, 1.5rem + 2vw, 3rem);
}
.page-article .article-head .crumbs { margin-bottom: clamp(1.5rem, 1rem + 2.4vw, 3rem); }
.page-article .article-head .page-title { margin-top: auto; }
.page-article .article-head .page-lede { margin-top: var(--space-5); max-width: 30rem; }
/* phones: a 4:5 picture edge to edge under the words */
.page-article .article-head__figure {
  aspect-ratio: 4 / 5;
  margin-inline: calc(-1 * var(--pad-x));
}
.page-article .article-head__figure > img,
.page-article .article-head__figure > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (min-width: 48em) {
  .page-article .article-head__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
    align-items: stretch;
    min-height: clamp(32rem, calc(92svh - var(--header-h)), 56rem);
  }
  .page-article .article-head__text {
    grid-column: 1 / span 7;
    padding-block: var(--space-1) clamp(2.5rem, 1.5rem + 3vw, 4.5rem);
    padding-right: clamp(0rem, -1rem + 3vw, 3rem);
  }
  /* the picture fills the right half down to the body hairline and runs to the right edge of the
     layout: the screen edge up to 1520px wide; wider screens keep the ivory margin, so the 1080px
     source is never shown larger than it is (MEDIA-D11 1) */
  .page-article .article-head__figure {
    grid-column: 8 / -1;
    aspect-ratio: auto;
    margin-left: 0;
    margin-right: calc(-1 * var(--pad-x));
  }
}
/* without JavaScript a video element shows the browser's own controls over the still: the still
   is the finished cover then, and the side film is left out */
html:not(.js) .page-article .article-head__figure > video,
html:not(.js) .g2-side__film { display: none; }
.page-article--scalp .article-head__figure > img { object-position: 50% 50%; }
.page-article--hair .article-head__figure > img { object-position: 50% 42%; }
.page-article--wellness .article-head__figure > img { object-position: 50% 60%; }
/* fix2 (MOTION-r2 must_fix 1): where a loop film plays over the still, the still is the film's
   own first frame, centre-cropped to 4:5, so both sit on the same centre and the film starts
   without a cut */
.page-article .article-head__figure.m-loop > img,
.page-article .article-head__figure.m-loop > video { object-position: 50% 50%; }
/* final fix (MOTION-r3): the still is the middle 1/1.4222 of the 9:16 film, so the film box is
   1.4222x taller and centred; the visible area then matches the still at any frame ratio */
.page-article .article-head__figure.m-loop > video { top: -21.1111%; bottom: auto; height: 142.2222%; }

/* 60 or 90: the two treatments read like the home page plans, the minutes large and italic,
   the measures across the full width so the difference in length is the picture */
@media (min-width: 64em) {
  .page-article--sixty .article-body--short .prose { grid-column: 1 / -1; }
}
.page-article--sixty .duo__row { padding-block: var(--space-6) var(--space-7); }
.page-article--sixty .duo__row:first-child { padding-top: 0; }
.page-article--sixty .duo__name { font-size: clamp(1.125rem, 1rem + 0.5vw, 1.5rem); font-weight: 400; line-height: 1.2; }
.page-article--sixty .duo__name .line:first-child {
  margin-bottom: var(--space-2);
  font-size: clamp(2.75rem, 1.7rem + 3.6vw, 5.25rem);
  font-style: italic;
  font-weight: var(--display-wght-light);
  line-height: 1;
  letter-spacing: var(--display-track-italic);
}
.page-article--sixty .duo__desc { margin-top: var(--space-3); font-size: var(--fs-body); color: var(--ink); }
.page-article--sixty .prose > .duo + p { margin-top: var(--space-6); }

@media (min-width: 64em) {
  .page-article .article-head__text { grid-column: 1 / span 6; }
  .page-article .article-head__figure { grid-column: 7 / -1; }
}

/* 3. Article body */
.page-article .article-body { overflow-x: clip; }
/* phones: pictures edge to edge, the caption stays on the text line */
.page-article .prose > .prose-figure { margin-inline: calc(-1 * var(--pad-x)); }
.page-article .prose > .prose-figure figcaption { padding-inline: var(--pad-x); }
@media (min-width: 48em) {
  .page-article .prose > .prose-figure { margin-inline: 0; }
  .page-article .prose > .prose-figure figcaption { padding-inline: 0; }
}
@media (min-width: 64em) {
  /* the picture keeps the text's left edge and runs to the right edge of the layout (the screen
     edge up to 1520px wide) */
  .page-article .prose > .prose-figure {
    margin-right: calc(-1 * var(--pad-x));
  }
}

/* side film: a short silent film above the contents list (desktop only; the list is desktop only) */
.g2-side { display: none; }
@media (min-width: 64em) {
  .g2-side {
    display: block;
    grid-column: 1 / span 3;
  }
  .g2-side .toc {
    position: sticky;
    top: calc(var(--header-h) + var(--space-6));
  }
  .g2-side__film {
    aspect-ratio: 4 / 5;
    margin-bottom: clamp(2rem, 1rem + 2vw, 3rem);
  }
}

/* picture and guest quote side by side (Time to rest) */
.g2-pair {
  display: grid;
  gap: var(--space-6);
  max-width: none !important;
  margin-block: clamp(2.5rem, 2rem + 2vw, 3.5rem) !important;
}
.g2-pair__figure {
  aspect-ratio: 4 / 5;
  margin-inline: calc(-1 * var(--pad-x));
}
.g2-pair .pullquote { margin-block: 0 !important; }
@media (min-width: 48em) {
  .g2-pair {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: clamp(1.5rem, 0.5rem + 3vw, 3.5rem);
    align-items: end;
  }
  .g2-pair__figure { margin-inline: 0; }
}
/* the interview link carries the guest's own card picture */
.page-article .watch { gap: var(--space-4); }
.watch__poster {
  flex: none;
  width: 4.5rem;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--clay);
}
.page-article .watch .icon { margin-right: calc(-1 * var(--space-2)); }

/* 4. Keep reading */
.page-article .keep-reading .entries {
  position: relative;
  display: grid;
  row-gap: var(--space-6);
  padding-top: var(--space-6);
}
.page-article .keep-reading .entry {
  grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr);
  padding: 0 0 var(--space-6);
  border-bottom: 1px solid var(--rule);
}
.page-article .keep-reading .entry:last-child { padding-bottom: 0; border-bottom: 0; }
.page-article .keep-reading .entry__title {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2.25rem);
  font-style: italic;
  font-weight: var(--display-wght-em);
  line-height: 1.08;
  letter-spacing: var(--display-track-sm);
}
.page-article .keep-reading .entry__dek { font-size: var(--fs-small); }
.page-article .keep-reading .entry__more { display: none; }
@media (min-width: 48em) {
  .page-article .keep-reading .entries {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(2.5rem, 0.5rem + 5vw, 6rem);
  }
  .page-article .keep-reading .entries::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--rule);
  }
  .page-article .keep-reading .entry {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: clamp(1rem, 0.5rem + 1.5vw, 2rem);
    align-items: end;
    padding: 0;
    border: 0;
  }
  .page-article .keep-reading .entry__media { grid-column: auto; }
  .page-article .keep-reading .entry__body { grid-column: auto; padding-bottom: var(--space-1); }
}
@media (hover: hover) and (pointer: fine) {
  .page-article .keep-reading .entry:hover .entry__title { color: var(--accent); }
}

/* 5. Search */
.page-search .page-head { padding-block: clamp(3rem, 1.8rem + 4.4vw, 6.5rem) clamp(1.5rem, 1.2rem + 1.2vw, 2.5rem); }
/* H1 type: site.css 4 (.page-title, IvyMode 9/27). Only the layout stays here. */
.page-search .search-form { max-width: 60rem; margin-top: clamp(2rem, 1.4rem + 2.4vw, 3.5rem); }
.page-search .search-field { border-bottom-color: var(--rule-strong); }
.page-search .search-field input {
  min-height: clamp(4rem, 3.4rem + 2.4vw, 5.5rem);
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 3.25rem);
  font-style: italic;
  font-weight: var(--display-wght-em);
}
.page-search .suggest { margin-top: var(--space-6); }
.page-search .suggest__list { column-gap: clamp(1.25rem, 0.8rem + 2vw, 2.75rem); margin-top: var(--space-2); }
.page-search .suggest__list a {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem);
  font-style: italic;
  font-weight: var(--display-wght-em);
  text-decoration-thickness: 1px;
}
.page-search .result__title {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2.25rem);
  font-style: italic;
  font-weight: var(--display-wght-em);
  line-height: 1.1;
}