/* ================================================================
 * Layout — the page frame: skip link, icon sprite, icons, container,
 * section colour blocks, grids, stacks, the floating glass header,
 * the mobile drawer, the rounded navy footer and the toast region.
 *
 * Mobile first. The only breakpoints are 640 / 900 / 1200px and they
 * are always `min-width`. Selectors stay flat: no nesting syntax.
 * ================================================================ */

/* ================================================================
 * 1. Layout variables
 * The design system fixes the floating header at 68px inside 16px of
 * page padding. No token carries those two numbers, so they are named
 * once here and everything that must line up with the header — the
 * flush-top hero pull, scroll padding, the drawer — is derived from
 * them instead of repeating a magic number.
 * ================================================================ */

:root{
  --avx-header-h:68px;
  --avx-header-pad:var(--space-4);
  --avx-header-space:calc(var(--avx-header-h) + var(--avx-header-pad) * 2);

  /* Two-column split gap: 32px → 80px, both ends token-derived. */
  --avx-split-gap:clamp(var(--space-6),5vw,calc(var(--space-8) + var(--space-4)));
  /* Footer block top padding: 56px → 96px. */
  --avx-footer-y:clamp(calc(var(--space-7) + var(--space-2)),7vw,var(--space-9));

  /* Display type, floored so a single long Albanian word still fits a
     320px screen without breaking mid-word. At 640px and wider each of
     these resolves to exactly its token value, so the desktop scale is
     the design system's untouched. */
  --avx-fs-display-xl:clamp(38px,11vw,var(--fs-display-xl));
  --avx-fs-display-l:clamp(34px,9vw,var(--fs-display-l));
  --avx-fs-display-m:clamp(28px,7vw,var(--fs-display-m));
}

/* In-page anchors must not land under the sticky header. */
html{scroll-padding-top:calc(var(--avx-header-space) + var(--space-2))}

/* ================================================================
 * 2. Skip link — the first focusable thing on every page
 * ================================================================ */

.avx-skip{position:absolute;left:var(--space-4);top:var(--space-4);z-index:100;
  display:inline-flex;align-items:center;height:42px;padding:0 var(--space-5);
  border:0;border-radius:var(--radius-pill);
  background:var(--navy-900);color:var(--cream-50);
  font:var(--text-ui);white-space:nowrap;text-decoration:none;
  transform:translateY(calc(-100% - var(--space-5)));
  transition:transform var(--dur-fast) var(--ease-out)}
.avx-skip:focus{transform:translateY(0)}
.avx-skip:hover{color:var(--cream-50)}

/* ================================================================
 * 3. Icon sprite and icons
 * The sprite is one <svg> of <symbol>s at the top of <body>. It must
 * stay in the render tree — display:none or visibility:hidden break
 * <use> references in some engines — so it is parked at zero size.
 * ================================================================ */

.avx-sprite{position:absolute;width:0;height:0;overflow:hidden;
  border:0;padding:0;margin:0;pointer-events:none}

/* The vendored symbols carry no presentation of their own, by design:
 * this class supplies every stroke attribute. Size is a custom property
 * so a component can set it for its context (a strict CSP rules out an
 * inline style, and CSS beats the SVG width/height attributes anyway). */
.avx-icon{display:inline-block;vertical-align:middle;flex:0 0 auto;
  width:var(--avx-icon-size,24px);height:var(--avx-icon-size,24px);
  fill:none;stroke:currentColor;stroke-width:1.75;
  stroke-linecap:round;stroke-linejoin:round}

/* One-off sizes, for the rare icon outside a component context. */
.avx-icon--14{--avx-icon-size:14px}
.avx-icon--16{--avx-icon-size:16px}
.avx-icon--18{--avx-icon-size:18px}
.avx-icon--20{--avx-icon-size:20px}
.avx-icon--22{--avx-icon-size:22px}
.avx-icon--26{--avx-icon-size:26px}
.avx-icon--32{--avx-icon-size:32px}

/* ================================================================
 * 4. Container
 * ================================================================ */

.avx-container{width:100%;max-width:var(--container-max);margin-right:auto;margin-left:auto;
  padding-right:var(--gutter);padding-left:var(--gutter)}
.avx-container--narrow{max-width:var(--container-narrow)}

/* ================================================================
 * 5. Sections — the colour blocks the whole site is built from
 * `page` is the default tone: transparent and full-bleed. Every other
 * tone is a rounded block inset by --section-gap, with --section-gap
 * of air between consecutive blocks.
 * ================================================================ */

.avx-section{padding-right:0;padding-left:0}
.avx-section__inner{position:relative;background:transparent;color:var(--navy-900);
  padding-top:var(--section-y);padding-bottom:var(--section-y)}

.avx-section--page{padding-right:0;padding-left:0}

.avx-section--cream,
.avx-section--apricot,
.avx-section--gold,
.avx-section--navy{padding-right:var(--section-gap);padding-left:var(--section-gap)}

.avx-section--cream>.avx-section__inner,
.avx-section--apricot>.avx-section__inner,
.avx-section--gold>.avx-section__inner,
.avx-section--navy>.avx-section__inner{border-radius:var(--radius-section);overflow:hidden}

.avx-section--cream>.avx-section__inner{background:var(--cream-100)}
.avx-section--apricot>.avx-section__inner{background:var(--apricot-500)}
.avx-section--gold>.avx-section__inner{background:var(--gold-500)}
.avx-section--navy>.avx-section__inner{background:var(--navy-900);color:var(--cream-50)}

/* 16px between colour blocks. Two transparent blocks need no gap: their own
   --section-y padding already carries the rhythm. */
.avx-section+.avx-section{margin-top:var(--section-gap)}
.avx-section--page+.avx-section--page{margin-top:0}

.avx-section--tight>.avx-section__inner{
  padding-top:calc(var(--section-y) * .5);padding-bottom:calc(var(--section-y) * .5)}

/* The hero slides up under the floating header and pays the pull back as top
   padding, so the glass pill sits over the hero instead of on a seam. Done
   from a class because the CSP forbids the inline style the kit used.
   Specificity is 0,2,0 so it wins over `.avx-section + .avx-section`.

   The pull stops one --section-gap short of the viewport edge, so the block
   is inset by the same 16px at the top as it is left and right and as every
   later block is from its neighbour. Pulling the full header height instead
   would butt the rounded corners against the top of the window. The same gap
   comes back off the inner padding, so the hero content does not move. */
.avx-section.avx-section--flush-top{
  margin-top:calc((var(--avx-header-space) - var(--section-gap)) * -1)}
.avx-section--flush-top>.avx-section__inner{
  padding-top:calc(var(--section-y) + var(--avx-header-space) - var(--section-gap))}

/* Unclassed prose links need a light colour on a navy block. */
.avx-section--navy a:not([class]){color:var(--cream-50);border-bottom-color:var(--gold-500)}
.avx-section--navy a:not([class]):hover{color:var(--apricot-500);border-bottom-color:var(--apricot-500)}

/* ================================================================
 * 6. Grids
 * ================================================================ */

.avx-grid{display:grid;gap:var(--space-4);min-width:0}

/* Two-column split: one column until there is room for two 420px tracks.

   Aligned to the top, not centred. Every pair that uses this grid is two
   blocks of content — two paragraphs, a heading beside a list, ingredients
   beside a nutrition table — and centring them means the shorter column floats
   against the taller one, so neither heading starts where the other does. Top
   alignment is what makes the two columns read as one row. */
.avx-grid--2{grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));
  gap:var(--avx-split-gap);align-items:start}
.avx-grid--3{grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr))}
.avx-grid--cards{grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))}
.avx-grid--cats{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}

/* ================================================================
 * 7. Stack and cluster helpers
 * ================================================================ */

.avx-stack{display:flex;flex-direction:column;align-items:flex-start;gap:var(--space-5);min-width:0}
.avx-stack--tight{gap:var(--space-3)}
.avx-stack--loose{gap:var(--space-7)}
.avx-cluster{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-3);min-width:0}
.avx-cluster--center{justify-content:center}

/* ================================================================
 * 8. Header — a floating glass pill, sticky inside 16px page padding
 * ================================================================ */

.avx-header{position:sticky;top:0;z-index:20;
  padding:var(--avx-header-pad)}

/* The pill provides its own inset, so a container nested inside the header
   must not add a second gutter. */
.avx-header>.avx-container{max-width:none;padding-right:0;padding-left:0}

.avx-header__bar{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);
  width:100%;max-width:var(--container-max);margin-right:auto;margin-left:auto;
  height:var(--avx-header-h);padding:0 var(--space-3) 0 22px;
  border-radius:var(--radius-pill);background:var(--glass);
  -webkit-backdrop-filter:var(--blur-glass);backdrop-filter:var(--blur-glass);
  box-shadow:var(--shadow-2);
  transition:box-shadow var(--dur-base) var(--ease-out)}

.avx-header--scrolled .avx-header__bar{box-shadow:var(--shadow-pop)}

/* Brand: either the full lockup as one image, or the mark plus the wordmark.
   The wordmark is the second image; it is dropped on the narrowest screens. */
.avx-header__brand{display:flex;align-items:center;gap:var(--space-3);
  flex:0 0 auto;border:0;text-decoration:none}
.avx-header__brand img{width:auto;height:30px}
.avx-header__brand img:first-child:not(:only-child){height:34px}
.avx-header__brand img+img{height:13px}
/* Below 640px the wordmark is dropped: the mark alone carries the brand and
   the nav gets the room it needs to stay usable at 320–360px. */
.avx-header__brand img+img{display:none}

/* With JS off the nav is the only way around the site, so it stays in the bar
   and scrolls sideways when it runs out of room. It must start at flex-start:
   centring a flex row that overflows puts the first links past the scroll
   origin, where nothing can reach them. The mask fades the right edge so the
   row reads as scrollable rather than cut off. */
.avx-header__nav{display:flex;align-items:center;gap:2px;
  flex:1 1 auto;min-width:0;justify-content:flex-start;
  overflow-x:auto;overflow-y:hidden;
  scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;
  -webkit-mask-image:linear-gradient(90deg,var(--navy-900) calc(100% - var(--space-5)),transparent);
  mask-image:linear-gradient(90deg,var(--navy-900) calc(100% - var(--space-5)),transparent)}
.avx-header__nav::-webkit-scrollbar{width:0;height:0}
.avx-header__nav>*{flex:0 0 auto}

.avx-header__actions{display:flex;align-items:center;gap:var(--space-2);flex:0 0 auto}

/* The burger mirrors IconButton `soft` at 48px, so adding .avx-iconbtn to the
   same element changes nothing whichever sheet lands last. */
.avx-header__burger{display:inline-flex;align-items:center;justify-content:center;
  width:48px;height:48px;padding:0;flex:0 0 auto;
  border:1.5px solid transparent;border-radius:var(--radius-pill);
  background:var(--cream-200);color:var(--navy-900);cursor:pointer;
  --avx-icon-size:20px;
  transition:background var(--dur-base) var(--ease-pop),transform var(--dur-base) var(--ease-pop)}
.avx-header__burger:hover{background:var(--cream-300);transform:translateY(-2px)}
.avx-header__burger:active{transform:scale(.97)}

/* --- JS gating -------------------------------------------------
 * boot.js adds `.js` to <html> in <head>. Without it the burger and the
 * drawer do not exist at all, so a no-JS visitor never meets a dead
 * control; with it, the inline nav folds into the drawer below 900px. */
html:not(.js) .avx-header__burger{display:none}
html.js .avx-header__nav{display:none}

/* ================================================================
 * 9. Drawer — the mobile menu. JS-only by construction: nothing can
 * add --open without JS, so with JS off it is inert and hidden.
 * ================================================================ */

.avx-drawer{position:fixed;inset:0;z-index:40;display:none}
.avx-drawer--open{display:block}
html:not(.js) .avx-drawer{display:none}

.avx-drawer::before{content:'';position:absolute;inset:0;
  background:var(--scrim);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}

.avx-drawer__panel{position:absolute;top:var(--space-4);right:var(--space-4);left:var(--space-4);
  max-height:calc(100% - var(--space-8));overflow-y:auto;
  display:flex;flex-direction:column;gap:var(--space-5);
  padding:var(--space-5);
  background:var(--cream-50);color:var(--navy-900);
  border-radius:var(--radius-xl);box-shadow:var(--shadow-3)}

.avx-drawer__nav{display:flex;flex-direction:column;align-items:stretch;gap:var(--space-1)}
.avx-drawer__nav .avx-navlink{height:52px;justify-content:flex-start;font-size:var(--fs-h4)}

/* Scroll lock while the drawer is open. The :has() rule needs no cooperation
   from main.js; the class is the explicit hook for engines without :has(). */
html.avx-locked,html.avx-locked body{overflow:hidden}
html:has(.avx-drawer--open),html:has(.avx-drawer--open) body{overflow:hidden}

@media (prefers-reduced-motion:no-preference){
  .avx-drawer--open .avx-drawer__panel{
    animation:avx-drawer-in var(--dur-base) var(--ease-pop) both}
}

@keyframes avx-drawer-in{
  from{opacity:0;transform:translateY(-12px)}
  to{opacity:1;transform:none}
}

/* ================================================================
 * 10. Footer — a rounded navy block, not full bleed
 * Expected structure:
 *   footer.avx-footer
 *     div.avx-footer__inner
 *       div.avx-container            <- the column grid
 *         div.avx-footer__brand  (logo + .avx-footer__tagline)
 *         div.avx-footer__col    (.avx-footer__title + links)
 *         div.avx-footer__col    (.avx-footer__title + .avx-footer__social)
 *       div.avx-footer__bottom
 *         div.avx-container            <- copyright row
 * ================================================================ */

/* The footer is a rounded block like any other, so it gets the same gap above it
   that `.avx-section + .avx-section` gives between two colour blocks. Without
   it the navy block butts straight against the CTA band above. */
.avx-footer{padding:var(--section-gap)}

.avx-footer__inner{background:var(--navy-900);color:var(--cream-50);
  border-radius:var(--radius-section);overflow:hidden;
  padding-top:var(--avx-footer-y)}

.avx-footer__inner>.avx-container{display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:var(--space-7);padding-bottom:var(--space-8)}

.avx-footer__brand{display:flex;flex-direction:column;align-items:flex-start;gap:var(--space-5)}
.avx-footer__brand img{width:200px;max-width:100%}

.avx-footer__tagline{font:500 clamp(var(--space-5),2.6vw,34px)/var(--lh-tight) var(--font-display);
  letter-spacing:var(--ls-display);max-width:460px}

.avx-footer__col{display:flex;flex-direction:column;align-items:flex-start;gap:var(--space-1);min-width:0}

.avx-footer__title{font:600 var(--fs-caption)/1 var(--font-sans);color:var(--apricot-500);
  padding-right:var(--space-4);padding-left:var(--space-4);margin-bottom:var(--space-2)}

.avx-footer__social{display:flex;flex-wrap:wrap;gap:10px;
  padding-right:var(--space-4);padding-left:var(--space-4)}

.avx-footer__bottom{border-top:1px solid var(--border-on-dark);
  font:400 var(--fs-body-s)/1.4 var(--font-sans);color:var(--navy-300)}
.avx-footer__bottom .avx-container{display:flex;flex-wrap:wrap;align-items:center;
  justify-content:space-between;gap:var(--space-3);
  min-height:var(--space-8);padding-top:var(--space-4);padding-bottom:var(--space-4)}

.avx-footer a:not([class]){color:var(--cream-50);border-bottom-color:var(--gold-500)}
.avx-footer a:not([class]):hover{color:var(--apricot-500);border-bottom-color:var(--apricot-500)}

/* ================================================================
 * 11. Toast region — fixed, bottom right, 24px off the corner
 * ================================================================ */

.avx-toasts{position:fixed;right:var(--space-5);bottom:var(--space-5);z-index:60;
  display:flex;flex-direction:column;align-items:flex-end;gap:var(--space-3);
  width:min(380px,calc(100% - var(--space-6)));
  pointer-events:none}
.avx-toasts>*{pointer-events:auto}

/* ================================================================
 * 12. Breakpoints — 640 / 900 / 1200, mobile first
 * ================================================================ */

@media (min-width:640px){
  /* Room for the wordmark beside the mark again. */
  .avx-header__brand img+img{display:block}
  /* The brand takes two of the footer's auto-fit tracks. */
  .avx-footer__brand{grid-column:span 2}
}

@media (min-width:900px){
  /* Wide enough for the whole nav inside the bar: the burger retires and the
     row can centre again, because it no longer needs to scroll. */
  .avx-header__burger{display:none}
  html.js .avx-header__nav{display:flex}
  .avx-header__nav{justify-content:center;overflow-x:visible;
    -webkit-mask-image:none;mask-image:none}
}

@media (min-width:1200px){
  .avx-footer__inner>.avx-container{column-gap:var(--space-8)}
}

/* ================================================================
 * 13. Print — drop the chrome, flatten the colour blocks
 * ================================================================ */

@media print{
  .avx-header,.avx-drawer,.avx-toasts{display:none !important}
  .avx-section,.avx-footer{padding-right:0;padding-left:0}
  .avx-section.avx-section--flush-top{margin-top:0}
  .avx-section+.avx-section{margin-top:0}
  .avx-section__inner,.avx-footer__inner{background:transparent;color:var(--navy-900);
    border-radius:0;box-shadow:none;overflow:visible;
    padding-top:var(--space-5);padding-bottom:var(--space-5)}
  .avx-section--flush-top>.avx-section__inner{padding-top:var(--space-5)}
  .avx-footer__social{display:none}
  .avx-container{max-width:none;padding-right:0;padding-left:0}
}
