/* From the design preview, preview/header-nav.css (tools/theme-sync.mjs). */
/* The header in Track 07's design (header-nav.js, 14 October): Shop all with the collections under
   it, alone in the row since 27 October (reviewers; Track order is in the menu, as Reviews and FAQ
   are, with the footer); on screen at all times, slimmer once scrolled. Shop all's menu is a list
   of the collections in the dropdowns' design (dropdown.css dresses both: 07 dashed paper and the
   serif's italic, 08 the sage sill and pill highlights), the page dimmed a little behind. */

/* A page change (app.js, 15 October): the header takes the new page's look at once, clear glass over
   the story or paper elsewhere, and its height; the eases below are for the scroll within a page.
   (The loader's curtain covered this change until then.) */
html.lv-page-change .header,html.lv-page-change .header *{transition:none!important}

/* ---- Always on screen -------------------------------------------------------------------------- */
/* The slimming header keeps the page still itself (header-nav.js matches its margin to it), so the
   browser's scroll anchoring stays out of it: it would pull the page up as the header first eases,
   past the top near it, and Back's restored position with it. Safari has no scroll anchoring. */
body:is([data-direction="gardenpostcard"]){overflow-anchor:none}
body:is([data-direction="gardenpostcard"]) .header{position:sticky;top:0;z-index:60;--lv-ease:cubic-bezier(.16,1,.3,1);transition:min-height .45s var(--lv-ease),padding .45s var(--lv-ease),row-gap .45s var(--lv-ease),background-color .45s ease,box-shadow .45s ease,border-color .45s ease,-webkit-backdrop-filter .45s ease,backdrop-filter .45s ease}
body:is([data-direction="gardenpostcard"])[data-story="on"] .header{position:fixed;top:var(--lv-header-top,var(--story-chrome-top,46px));left:0;right:0;z-index:60}
/* Over the story it eases too (14 October, Jin Hao: "the header resizing is not smooth"). The
   story's own rules (story.css; story-tracks.css until 27 October) set the header's transition to its colours alone
   and outranked the one above, so there it snapped from 113 to 69 px (134 to 79 on a phone) in one
   frame. Their colours stay (and the fade-in after the loader stayed, until the loader went on 10
   November: the header now shows at once). */
body:is([data-direction="gardenpostcard"])[data-story="on"]:not([data-story-phase="loading"]) .header{transition:min-height .45s var(--lv-ease),padding .45s var(--lv-ease),row-gap .45s var(--lv-ease),background-color .6s ease,box-shadow .6s ease,border-color .6s ease,-webkit-backdrop-filter .6s ease,backdrop-filter .6s ease}
/* No room under Shop all for a flower since 27 October (soft-round.js draws none on 07 and 08): the
   link's padding is even, not 10 px over 17. */
body:is([data-direction="gardenpostcard"])[data-floral="true"] .header :is(nav > a,.nav-shop-link){padding-block:10px}
/* The links' own padding eases with it (phones slim them), keeping the story's colour easing. */
body:is([data-direction="gardenpostcard"]) .header :is(nav > a,.nav-shop-link){transition:padding .45s var(--lv-ease)}
body:is([data-direction="gardenpostcard"])[data-story="on"] .header :is(nav > a,.nav-shop-link){transition:padding .45s var(--lv-ease),color .6s ease,border-color .6s ease,text-shadow .6s ease}
/* Under the design-review bar at first, at the top once the bar has scrolled away. Where the
   browser can tie an animation to the scroll it moves with the page itself, on the compositor;
   elsewhere header-nav.js sets --lv-header-top each frame, which trails the scroll by one. */
@supports (animation-timeline:scroll()){
  body:is([data-direction="gardenpostcard"])[data-story="on"]:not([data-story-phase="static"]) .header{top:0;animation:lv-header-under-bar linear both;animation-timeline:scroll(root block);animation-range:0px var(--story-chrome-top,46px)}
  @keyframes lv-header-under-bar{from{translate:0 var(--story-chrome-top,46px)}to{translate:0 0}}
}
body:is([data-direction="gardenpostcard"])[data-story="on"][data-story-phase="static"] .header{position:sticky;top:0}
body:is([data-direction="gardenpostcard"]) .header .brand{transition:width .45s var(--lv-ease),height .45s var(--lv-ease),padding .45s var(--lv-ease)}
/* Scrolled: slimmer, on frosted paper (over the story's hero it keeps the hero's glass). */
body:is([data-direction="gardenpostcard"]) .header.is-scrolled{min-height:64px;padding-top:6px;padding-bottom:6px;box-shadow:0 18px 36px -30px rgba(40,25,30,.5)}
body:is([data-direction="gardenpostcard"]):not([data-story-over]) .header.is-scrolled{background:color-mix(in srgb,var(--paper) 90%,transparent);-webkit-backdrop-filter:blur(14px) saturate(1.1);backdrop-filter:blur(14px) saturate(1.1);border-bottom:1px solid var(--line)}
body:is([data-direction="gardenpostcard"]) .header.is-scrolled .brand{width:128px;height:56px;padding:4px 10px}
/* Over the 3D the header stays now: each chapter's words start under it (on computers they already
   do; on phones they sat about 63 px from the top, for a header that scrolled away). Under its slim
   height (--lv-header-slim): a chapter's words only show once the page has moved, when the header
   is slim, and this way its slimming changes nothing in the story (14 October: following its
   current height, the slimming re-laid every pin and the story re-measured itself, a 110 ms frame
   just as the header began to ease). */
body:is([data-direction="gardenpostcard"])[data-story="on"]:not([data-story-phase="static"]) .lovento-story .story-chapter[data-layout] .story-pin{padding-top:max(clamp(92px,13vh,150px),calc(var(--lv-header-slim,var(--lv-header-h,0px)) + 14px))}
@media (max-width:760px) and (orientation:portrait){
  body:is([data-direction="gardenpostcard"])[data-story="on"]:not([data-story-phase="static"]) .lovento-story .story-chapter[data-layout] .story-pin{padding-top:max(clamp(50px,7.5svh,80px),calc(var(--lv-header-slim,var(--lv-header-h,0px)) + 14px))}
}
@media (max-height:500px) and (orientation:landscape){
  body:is([data-direction="gardenpostcard"])[data-story="on"]:not([data-story-phase="static"]) .lovento-story .story-chapter[data-layout] .story-pin{padding-top:max(clamp(34px,10svh,56px),calc(var(--lv-header-slim,var(--lv-header-h,0px)) + 10px))}
}
/* The pages' sticky side columns stay clear of it. */
body:is([data-direction="gardenpostcard"]) :is(.faq-topics,.account-nav,.email-list){top:calc(var(--lv-header-h,0px) + 24px)}
body:is([data-direction="gardenpostcard"]) .summary{top:calc(var(--lv-header-h,0px) + 20px)}

/* ---- Shop all and its chevron ------------------------------------------------------------------- */
/* The chevron stands on the label's baseline, so it is centred on its capitals at every size and in
   both header states (14 October: on phones it hung 4 px low; centring it in the link's height
   assumed the computer's padding, 10 px over 17, where phones have 4 over 17). An 8 px chevron's
   middle is 4 px up: the capitals' middle at 10 to 12.5 px type. Its tap area (::before) still
   reaches about the link's height. */
.header .nav-shop{position:relative;display:inline-flex;align-items:baseline;gap:0}
.header .nav-shop-toggle{position:relative;display:grid;place-items:center;align-self:baseline;width:24px;height:8px;margin:0 -4px 0 2px;padding:0;border:0;border-radius:8px;background:none;color:inherit;cursor:pointer;transition:background-color .2s ease}
.header .nav-shop-toggle::before{content:'';position:absolute;inset:-13px 0 -16px;border-radius:8px}
.header .nav-shop-toggle svg{width:11px;height:8px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;transition:transform .38s cubic-bezier(.16,1,.3,1)}
.header .nav-shop-toggle:hover svg{transform:translateY(1px)}
.header .nav-shop.is-open .nav-shop-toggle svg{transform:rotate(180deg)}
.header .nav-shop-toggle:focus-visible{outline:0}
.header .nav-shop-toggle:focus-visible::before{outline:2px solid var(--accent);outline-offset:-2px}

/* ---- Shop all in the page's middle -------------------------------------------------------------- */
/* Where the logo, Shop all and the tools share one row (computers, phones on their side), Shop all
   stands in the middle of the page, as the hero's Shop now does (27 October, Jin Hao: "it should be
   positioned in the center relative to the website width, just like the SHOP NOW button"). Spread
   apart in a flex row, it stood in the middle of the space between the logo and the tools: 10 px
   left of the page's middle (the tools are wider than the logo), 29 px once scrolled (the logo
   smaller), 31 px on a phone on its side. Three columns now, the outer two alike, so the middle one
   is the page's middle whatever the logo's width; Shop all and its chevron are centred there
   together, as Shop now and its arrow are in their pill. Where Shop all has a row of its own (1100 px
   and narrower: links.css) it was centred already. Tablets upright share the computer's row too
   (below). */
@media (width > 1100px),(max-height:500px) and (orientation:landscape),(min-width:701px) and (orientation:portrait){
  body:is([data-direction="gardenpostcard"]) :is(.header,.header.is-scrolled){display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
  body:is([data-direction="gardenpostcard"]) .header .brand{justify-self:start}
  body:is([data-direction="gardenpostcard"]) .header nav{justify-self:center}
  body:is([data-direction="gardenpostcard"]) .header .header-tools{justify-self:end}
}

/* ---- The menu: the dropdowns' list (its look in dropdown.css), the collections only -------------- */
/* Under Shop all, its names in line with Shop all's own (the list's 8 px and an option's 12 px in). */
.header .nav-shop-panel{top:calc(100% + 8px);left:-20px;z-index:2;width:min(260px,calc(100vw - 28px));max-height:min(380px,var(--nav-shop-room,70vh));--lv-dd-ease:cubic-bezier(.16,1,.3,1)}
.header .nav-shop-panel[hidden]{display:none}
.header .nav-shop-list{margin:0;padding:0;list-style:none}
.header .nav-shop-list li{display:block;margin:0;padding:0}
/* The dim behind it, under the header: the dropdowns' shade. */
.nav-shop-scrim{position:fixed;inset:0;z-index:55;background:rgba(40,30,32,.2);opacity:0;transition:opacity .3s ease}
.nav-shop-scrim.is-shown{opacity:1}
body[data-direction="gardenpostcard"] .nav-shop-scrim{background:rgba(74,36,42,.2)}

/* ---- Phones ---------------------------------------------------------------------------------------- */
@media (max-width:700px){
  /* Shop all under the logo, centred on the screen (16 October, Jin Hao; it sat at the left edge);
     alone there since 27 October, Track order having moved to the menu. Its padding below no longer
     keeps room for the flower (17 px; 10 since then). */
  body:is([data-direction="gardenpostcard"]) .header nav{position:relative;display:flex;justify-content:center;align-items:center;gap:0 30px}
  body:is([data-direction="gardenpostcard"]) .header nav>a,.header .nav-shop-link{white-space:nowrap}
  body:is([data-direction="gardenpostcard"])[data-floral="true"] .header :is(nav > a,.nav-shop-link){padding-block:4px 10px}
  /* Scrolled, it slims, gently: a little smaller logo, the links closer. (19 October, Jin Hao: on a
     phone it squeezed much more than on a computer. Its own rules took the paper above and below to
     2 px, the logo to 104 x 42 from 135 x 64 and the links' padding to 2/8 px, across its two rows:
     134 to 79 px at 390 px. Now the computer's 6 px, a 120 x 54 logo and 3/10 px: 134 to 102 px at
     390, 133 to 97 at 360; the computer's 113 to 69 is unchanged.) */
  body:is([data-direction="gardenpostcard"]) .header.is-scrolled{min-height:0;padding-top:6px;padding-bottom:6px;row-gap:0}
  body:is([data-direction="gardenpostcard"]) .header.is-scrolled .brand{width:120px;height:54px}
  body:is([data-direction="gardenpostcard"])[data-floral="true"] .header.is-scrolled :is(nav > a,.nav-shop-link){padding-block:3px 10px}
  /* With the links centred, the menu hangs centred under their row (the row spans the screen's
     width, so it stays at least 14 px from either edge, as the dropdowns do): the row, not Shop all,
     holds it. */
  body:is([data-direction="gardenpostcard"]) .header .nav-shop{position:static}
  .header .nav-shop-panel{left:50%;translate:-50% 0;width:min(300px,calc(100vw - 28px))}
  .header .nav-shop-toggle{width:22px}
}
/* ---- Upright: a lower header (27 October, Jin Hao: "reduce the height of the header banner in all
   upright dimensions") ---------------------------------------------------------------------------- */
/* Tablets upright: one row, the computer's (the logo, Shop all in the page's middle, the tools),
   where Shop all had a row of its own under the computer's logo: 166 px at 820x1180 and 768x1024,
   182 on an iPad Pro, 128 and 138 once scrolled. Now 106 (112 on an iPad Pro) and 68. */
@media (min-width:701px) and (max-width:1100px) and (orientation:portrait){
  body:is([data-direction="gardenpostcard"]) .header nav{order:0;flex:0 1 auto;width:auto;padding-top:0}
}
/* Phones upright: the two rows close up, at the size they had once scrolled (19 October, Jin Hao:
   not squeezed further than that), the same at the top and scrolled: the 120 x 54 logo and the
   tools, then Shop all, with 6 px above and below and nothing between (at 360 and narrower the
   logo still slims to 112 x 50 once scrolled, below). 127 px at 390 (102 scrolled) is now 93; at
   320 the tools fit beside the logo again (164 px, three rows). */
@media (max-width:700px) and (orientation:portrait){
  body:is([data-direction="gardenpostcard"]) :is(.header,.header.is-scrolled){min-height:0;padding-top:6px;padding-bottom:6px;row-gap:0;column-gap:8px}
  body:is([data-direction="gardenpostcard"]) :is(.header,.header.is-scrolled) .brand{width:120px;height:54px}
  body:is([data-direction="gardenpostcard"]) .header nav{padding-top:0}
  body:is([data-direction="gardenpostcard"])[data-floral="true"] :is(.header,.header.is-scrolled) :is(nav > a,.nav-shop-link){padding-block:3px 8px}
}
@media (max-width:360px){
  /* Small phones: scrolled, the logo and the tools share one row too (the logo 112 x 50; it was
     88 x 38, 19 October). */
  body:is([data-direction="gardenpostcard"]) .header.is-scrolled{column-gap:6px}
  body:is([data-direction="gardenpostcard"]) .header.is-scrolled .brand{width:112px;height:50px;padding:3px 6px}
  body:is([data-direction="gardenpostcard"]) .header.is-scrolled .header-tools .bag-link{margin:0 1px}
}
/* ---- Phones on their side ------------------------------------------------------------------------ */
/* 27 October (reviewers): turned sideways the header took half the screen, three rows and 173 px of
   390, over the hero. One slim row now, as on a computer: the logo, Shop all and the tools side by
   side (an upright phone's row of its own for the links is for upright phones), the logo smaller and
   little paper above and below; the same once scrolled, having nothing left to slim. */
@media (max-height:500px) and (orientation:landscape){
  body:is([data-direction="gardenpostcard"]) :is(.header,.header.is-scrolled){flex-wrap:nowrap;min-height:0;gap:0 18px;padding-top:4px;padding-bottom:4px}
  body:is([data-direction="gardenpostcard"]) .header nav{order:0;flex:0 1 auto;width:auto;padding-top:0}
  body:is([data-direction="gardenpostcard"]) :is(.header,.header.is-scrolled) .brand{width:124px;height:50px;padding:0}
  body:is([data-direction="gardenpostcard"])[data-floral="true"] .header .brand::before{inset:4px 8px}
  body:is([data-direction="gardenpostcard"])[data-floral="true"] :is(.header,.header.is-scrolled) :is(nav > a,.nav-shop-link){padding-block:8px}
  /* The design-review bar above it (the preview's own, not the site's) on as few lines as fit, each
     group whole, wrapping, never cut. (Its Direction menu, photo link and note went on 27 October;
     since then it shows what an upright window of its width shows, on one line: notices.css.) */
  .review-bar{display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px;min-height:0;padding:6px 3%}
}
@media (prefers-reduced-motion:reduce){
  .nav-shop-scrim,.header .nav-shop-toggle svg{transition:none!important}
}
