/* ShipVibed's own overrides of the kit (public/assets/system.css stays the kit's copy, unedited).
   Loaded after the kit CSS in SiteHead.astro. */

/* Desktop sections grow instead of overlapping. The kit gives a section exactly --h screens from
   1280px up and lets it grow only from 640 to 1279; here the same "at least its screens" rule runs
   at every width from 640 up, so a long FAQ or table never lays its last rows over the next section.
   The rhythm check still wants each section to fit 1 or 2 screens: size the content, not this rule. */
@media (min-width: 1280px) {
  main > :is(section, .section):not(.hero, .section--hero), footer.closing {
    height: auto; min-height: calc(var(--h, 1) * 100vh); min-height: calc(var(--h, 1) * 100svh);
  }
  :where(main > :is(section, .section):not(.hero, .section--hero), footer.closing) { display: flex; flex-direction: column; }
  main > :is(section, .section):not(.hero, .section--hero) > :is(.wrap, .container), footer.closing > .wrap { flex: 1 0 auto; height: auto; min-height: 0; }
}

/* a 320px phone: the nav's button steps down a size so the bar (logo, button, menu) fits the screen */
@media (max-width: 359px) {
  .nav:not(.is-open) .nav__bar .nav__actions .btn { padding-inline: 10px; font-size: 13px; }
  .nav .nav__bar .nav__logo { font-size: 15px; gap: 5px; }
}

/* a dealt CSS ground (backgrounds.css) never changes a section's height: it keeps its --h screens (a
   phone: --hm, in lvh) as every other section does (the ground's own minimum is 76svh, or 0 on a phone) */
main > section.section { --g-screen: calc(var(--h, 1) * 100svh); }
@media (max-width: 639px) {
  main > section.section { --g-screen: calc(var(--hm, var(--h, 1)) * 100lvh); }
  main > section.section:is(.bg-mist, .bg-halo, .bg-ruled, .bg-dots):not(.section--hero) { align-content: normal; }
}
/* nor its layout: a soft ground (mist, dots) keeps the system's padding and the column that lets a
   .fill window run to the section's foot, instead of its own centred grid */
main > section.section:is(.bg-mist, .bg-halo, .bg-ruled, .bg-dots):not(.section--hero) { padding: var(--padt) 0 calc(var(--padb) + var(--bar)); }
@media (min-width: 640px) {
  main > section.section:is(.bg-mist, .bg-halo, .bg-ruled, .bg-dots):not(.section--hero) { display: flex; flex-direction: column; }
}

/* ---- accounts: header login state (SiteNav.astro; html.sv-in is set before first paint by SiteHead's flag script) ---- */
.nav__profile-link, .nav__acct { display: none; }
html.sv-in .nav__login { display: none; }
html.sv-in .nav__acct--in { display: inline-grid; }
.nav__acct {
  flex: none; width: 40px; height: 40px; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); color: var(--ink); background: transparent; transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.nav__acct--in { color: var(--ink); border-color: color-mix(in oklab, var(--ink) 40%, var(--line)); }
.nav__acct:hover { background: color-mix(in oklab, var(--ink) 8%, transparent); }
.nav__acct:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav__acct--in svg { margin-top: -1px; }
/* the text link beside the main button (desktop) */
.nav__login { font-weight: 500; }
@media (max-width: 1023px) {
  html:not(.sv-in) .nav__acct--out { display: inline-grid; }
  /* in the open sheet the icon is not needed: the text actions are */
  .nav.is-open .nav__acct { display: none !important; }
  html.sv-in .nav.is-open .nav__profile-link { display: inline-flex; }
  html.sv-in .nav.is-open .nav__login { display: none; }
  .nav:not(.is-open) .nav__actions + .nav__acct { margin-left: 0; }
  .nav__acct ~ .nav__toggle { margin-left: 0; }
  .nav.is-open .nav__toggle { margin-left: auto; }
}
@media (max-width: 639px) {
  /* a phone: logo, profile/log-in icon, menu. The main button moves into the sheet (the hero repeats it anyway),
     so the log-in icon is always on the first screen */
  .nav:not(.is-open) .nav__actions { display: none; }
  .nav:not(.is-open) .nav__actions + .nav__acct--out, .nav:not(.is-open) .nav__acct--in { margin-left: auto; }
}
/* inline free-offer cards hide for signed-in people and when this month's supply is gone (FreeCheckOffer.astro) */
html.sv-in .sv-offer, html.sv-offer-off .sv-offer { display: none !important; }
/* desktop: the header is a 3-column grid (logo | words | actions); the profile icon gets a 4th, only while signed in */
@media (min-width: 1024px) {
  html.sv-in .nav--centre .nav__bar { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; column-gap: var(--s-4); }
  html.sv-in .nav--centre .nav__links { margin-inline: var(--s-4); }
  .nav--centre .nav__acct { grid-column: 4; grid-row: 1; }
}
