/* ==========================================================================
   Persian Garden: polish layer (2026-11-12). Loaded last, after life.css.
   Pairs with assets/polish.js. Remove the two polish lines in index.html to
   get the previous look back; nothing else depends on this file.

   What it does: hero lockup and type scale, easier-to-read product cards,
   a calmer quantity control, press feedback, a basket drawer that leaves the
   way it came in, staggered section headings, and touch-safe hovers.

   Rules it keeps (same as garden.css / garden-fx.css):
   - only transform / opacity / translate animate
   - nothing animated sits under a mask, a clip-path or a blur
   - no letter-spacing on Farsi
   - every move collapses under prefers-reduced-motion
   ========================================================================== */

@media screen {

  :root{
    --ease-out:cubic-bezier(.23,1,.32,1);       /* entrances, releases */
    --ease-drawer:cubic-bezier(.32,.72,0,1);    /* the basket drawer and sheet */
  }

  /* ---------- hero: one lockup, one left edge (desktop) ----------
     The seal used to float centred over left-aligned copy, and the headline
     sat 20px in from the paragraph under it. Now the seal and the Farsi name
     sit side by side as a lockup, and everything shares the column's left
     edge. It is also about 110px shorter, so both buttons clear the fold on a
     768px-tall laptop. */
  @media (min-width:900px){
    .pg-hero-copy{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:1.9rem;align-items:center}
    .pg-hero-copy > *{grid-column:1 / -1;min-width:0}
    .pg-medallion{grid-column:1;grid-row:1 / 3;width:128px;margin:18px 0 2.1rem 18px}   /* 18px: the outer ring */
    .pg-hero .fa-title{grid-column:2;grid-row:1;align-self:end;margin:0;max-width:none;text-align:left;font-size:1.55rem}
    html[data-pg-season="thanksgiving"] .pg-season-line{grid-column:2;grid-row:2;align-self:start;margin:.15rem 0 0}
    html:not([data-pg-season]) .pg-hero .fa-title{grid-row:1 / 3;align-self:center}
    .pg-hero-title{margin:0 0 1.1rem;max-width:15ch;font-size:clamp(2.9rem,4.7vw,4.15rem);line-height:1.04;letter-spacing:-.02em}
    .pg-hero p.tag{font-size:1.2rem;line-height:1.6;max-width:52ch;margin-bottom:1.7rem;text-wrap:pretty}
    .badges{margin-bottom:1.9rem}
  }
  .pg-hero p.tag{color:#ddd6c1}
  /* tablet: the centred headline had stopped growing at 34px */
  @media (min-width:481px) and (max-width:899px){.pg-hero-title{font-size:clamp(2.3rem,6vw,3.1rem);max-width:18ch}}

  /* a little depth as the hero scrolls away: the photo collage lags the copy.
     Scroll-driven, so it runs on the compositor and costs no script. The whole
     collage moves as one piece (the vines and the turkey are inside it). */
  @supports (animation-timeline:scroll()){
    @media (min-width:900px) and (prefers-reduced-motion:no-preference){
      .pg-showcase{animation:pg-par-show linear both;animation-timeline:scroll(root block);animation-range:0 900px}
    }
  }
  @keyframes pg-par-show{to{translate:0 46px}}

  /* ---------- section rhythm (desktop) ---------- */
  @media (min-width:900px){
    section{padding-top:4.2rem;padding-bottom:4.2rem}
    .sec-head{margin-bottom:2.8rem}
  }

  /* ---------- product cards: bigger, calmer text ----------
     Body copy was 13.9px in a small-x-height serif. Sizes go up a step, the
     prices get lining figures so "$15" sits on the line, and the price itself
     is the strongest thing in its row. */
  .card h3{font-size:1.32rem;line-height:1.18}
  .card .fa-name{font-size:1.12rem}
  .card p.desc{font-size:1.02rem;line-height:1.5;color:#d6ceb6;margin-bottom:.95rem}
  .prices{gap:.2rem}
  .prices li{font-size:1rem;padding:.3rem .5rem;margin:0 -.5rem;min-height:2.35rem;border-radius:8px}
  .prices .wt{font-size:.74rem;padding:.1rem .5rem}
  .prices .pr{font-size:1.1rem;min-width:40px;font-variant-numeric:lining-nums tabular-nums}
  .qn,.cl-sum,.sl-p,.cf-count,#cartFabTotal,.cart-total .ct-val,.order-total .t-val{font-variant-numeric:lining-nums tabular-nums}
  .sour{font-size:.78rem}

  /* ---------- quantity control: just "+" until something is added ----------
     Every row used to show a greyed-out minus and a "0". Now a row that is not
     in the basket shows one clear "+"; the minus and the count appear once it
     is. The buttons are the same elements with the same data attributes, so
     the basket script is untouched. */
  .prices li:not(.picked) .qbtn[data-d="-1"],
  .prices li:not(.picked) .qn{display:none}
  .prices li.picked .qbtn[data-d="-1"],
  .prices li.picked .qn{animation:pg-pop .22s var(--ease-out) backwards}
  @keyframes pg-pop{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:none}}
  .qbtn{width:28px;height:28px;font-size:1.05rem;
    transition:background .15s ease,color .15s ease,border-color .15s ease,transform .14s var(--ease-out)}
  .qbtn:active:not(:disabled){transform:scale(.86)}
  .qn{min-width:18px;font-size:1rem}
  .prices li.picked{background:rgba(217,180,94,.12)}
  @media (pointer:coarse),(max-width:760px){
    .prices{gap:.45rem}
    .qbtn{width:36px;height:36px;font-size:1.25rem}
    .qbtn::after{inset:-4px}
    .qn{min-width:22px;font-size:1.05rem}
  }

  /* ---------- press feedback on everything that can be pressed ---------- */
  .cta,.submit-btn,.cart-go,.nav-links .order-btn,.sum-edit{
    transition:background .2s ease,color .2s ease,border-color .2s ease,box-shadow .25s ease,transform .16s var(--ease-out)}
  .cta:active,.cta.solid:active,.submit-btn:active:not(:disabled),.cart-go:active,
  .nav-links .order-btn:active,.sum-edit:active{transform:scale(.97)}
  .cart-fab:active{transform:scale(.97)}
  .pg-cat{transition:transform .3s var(--ease-out),box-shadow .3s ease}
  .pg-cat:active{transform:scale(.98)}
  .pg-top:active{transform:scale(.94)}
  .lang-tabs button{transition:background .2s ease,color .2s ease}
  .cart-close{border-radius:50%;transition:background .15s ease,transform .14s var(--ease-out)}
  .cart-close:hover{background:rgba(217,180,94,.12)}
  .cart-close:active{transform:scale(.9)}

  /* touch screens fire :hover on tap and it sticks: keep the lifts for a mouse */
  @media (hover:none){
    .card:hover,.step:hover,.contact-card:hover,.pg-cat:hover,.cart-fab:hover{transform:none}
    .card:hover .art img{transform:none}
    .qbtn:hover:not(:disabled){background:rgba(217,180,94,.06);color:var(--foil);border-color:rgba(217,180,94,.55)}
    .qbtn:active:not(:disabled){background:var(--metal-gold);color:var(--night-2);border-color:var(--foil)}
    .pg-cat:hover .pg-cat-arrow,.pg-top:hover .pg-top-arrow{transform:none}
  }

  /* ---------- top nav: the gold underline scales instead of resizing, and
     marks the section you are in (aria-current is set by polish.js) ---------- */
  @media (min-width:761px){
    .nav-links li:not(:last-child) a::after{right:0;transform:scaleX(0);transform-origin:0 50%;transition:transform .3s var(--ease-out)}
    .nav-links li:not(:last-child) a:hover::after,
    .nav-links li:not(:last-child) a[aria-current]::after{transform:scaleX(1)}
    .nav-links li:not(:last-child) a{transition:color .2s ease}
    .nav-links a[aria-current]{color:var(--foil)}
  }

  /* ---------- basket button: arrives instead of popping in ---------- */
  .cart-fab.show{animation:pg-fab-in .5s var(--ease-out) backwards}
  @keyframes pg-fab-in{from{opacity:0;transform:translateY(22px) scale(.96)}to{opacity:1;transform:none}}

  /* ---------- basket drawer / sheet ----------
     It used to vanish on close (visibility flipped at once, so the slide-out
     never showed). Now it leaves the way it came, a little quicker than it
     arrives, and the backdrop fades with it. On phones the sheet can be
     dragged down by its handle (polish.js). */
  .cart-panel{transition:transform .3s var(--ease-drawer),visibility 0s linear .3s}
  /* (visibility is deliberately not in the open list: it must flip at once, or the close
     button cannot take focus as the drawer opens) */
  .cart-panel.open{transition:transform .5s var(--ease-drawer)}
  .cart-backdrop{transition:opacity .3s ease,visibility 0s linear .3s}
  .cart-backdrop.open{transition:opacity .35s ease}
  .cart-panel.pg-drag,.cart-backdrop.pg-drag{transition:none}
  @media (max-width:640px){
    .cart-grabber{width:44px;height:5px;margin-top:.7rem}
    .cart-grabber,.cart-head{touch-action:none}     /* the handle drags the sheet, not the page */
    .cart-panel{max-height:86vh;max-height:86dvh}
  }
  /* the lines settle in one after another when the basket opens (class set
     by polish.js for the opening only, so + and - never replay it) */
  .cart-panel.pg-opening .cart-line{animation:pg-line-in .45s var(--ease-out) backwards}
  .cart-panel.pg-opening .cart-line:nth-child(1){animation-delay:.12s}
  .cart-panel.pg-opening .cart-line:nth-child(2){animation-delay:.17s}
  .cart-panel.pg-opening .cart-line:nth-child(3){animation-delay:.22s}
  .cart-panel.pg-opening .cart-line:nth-child(4){animation-delay:.27s}
  .cart-panel.pg-opening .cart-line:nth-child(n+5){animation-delay:.32s}
  @keyframes pg-line-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
  .cart-head .fa{text-align:left}          /* was pushed in from the left by its rtl box */
  .cart-line{padding:.8rem 0}
  .cart-line .cl-name{font-size:1.05rem;line-height:1.3}
  /* the Farsi name on its own line: beside the English it wrapped mid-phrase on phones */
  .cart-line .cl-name .fa{display:block;text-align:left;font-size:.98rem;line-height:1.9;color:var(--gold-ink);font-weight:400}
  .cart-line .cl-var{font-size:.9rem}
  .cart-line .cl-sum{font-size:1.05rem;text-align:right}
  .cart-line .stepper{justify-self:end}
  .cart-clear{text-underline-offset:3px}

  /* ---------- order section ---------- */
  .sum-line{font-size:1.05rem;padding:.6rem 0}
  .sum-line .sl-q{font-size:.92rem}
  .order-total .t-note{font-size:.86rem}
  .pay-note{font-size:.84rem}
  .field input,.field textarea{font-size:1.05rem}
  /* status messages were dark red / dark green on the dark panel */
  #orderStatus{color:var(--berry-bright)}
  #orderStatus.pg-ok{color:var(--foil)}

  /* ---------- section headings arrive piece by piece ----------
     The whole heading used to rise as one block. Now the pomegranate badge,
     the title, the Farsi line, the flourish and the note follow each other. */
  .sec-head.reveal{opacity:1}
  .sec-head.reveal.in{animation:none}
  .sec-head.reveal:not(.in) > *,.sec-head.reveal:not(.in)::before{opacity:0}
  .sec-head.reveal.in > *{animation:pg-rise .8s var(--ease-out) backwards}
  .sec-head.reveal.in::before{animation:pg-badge-in .7s var(--ease-out) backwards}
  .sec-head.reveal.in > :nth-child(1){animation-delay:.08s}
  .sec-head.reveal.in > :nth-child(2){animation-delay:.16s}
  .sec-head.reveal.in > :nth-child(3){animation-delay:.24s}
  .sec-head.reveal.in > :nth-child(n+4){animation-delay:.32s}
  @keyframes pg-badge-in{from{opacity:0;transform:scale(.7)}to{opacity:1;transform:none}}

  /* ---------- product photos settle as their card arrives ----------
     A transform inside the frame's own rounded overflow box (the same box the
     hover zoom already uses); no mask, no filter. */
  html.pg-on .card.reveal.in .art img{animation:pg-photo-settle 1.5s var(--ease-out) calc(var(--i,0)*95ms) backwards}
  @keyframes pg-photo-settle{from{transform:scale(1.07)}to{transform:scale(1)}}

  /* ---------- story: the two languages cross-fade instead of swapping ---------- */
  .story-body:not([hidden]){animation:pg-swap .4s var(--ease-out)}
  @keyframes pg-swap{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
  .story-body p{font-size:1.1rem}
  .story-body p:first-child{font-size:1.3rem;line-height:1.55}
  .story-body.fa p,.story-body.fa p:first-child{font-size:1.06rem}

  /* the story panel's vine reached 19px past the viewport at tablet widths (768px) and
     gave the whole page a sideways scroll; clip it the way the card vines already are */
  #story{overflow-x:clip}

  /* ---------- steps and contact: readable sizes ---------- */
  .step h3{font-size:1.2rem}
  .step p{font-size:1rem}
  .contact-card .c-lbl{font-size:.72rem}
  .contact-card .c-val{font-size:1.1rem}

  /* ---------- phone ---------- */
  @media (max-width:480px){
    .card .body{padding:1.1rem 1.1rem 1.25rem}
    .card h3{font-size:1.36rem}
    .pg-hero p.tag{font-size:1.12rem}
  }

  /* ---------- screen-reader-only live region (basket announcements) ---------- */
  .pg-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

  /* ---------- reduced motion: no travel, nothing hidden ---------- */
  @media (prefers-reduced-motion:reduce){
    .sec-head.reveal:not(.in) > *,.sec-head.reveal:not(.in)::before{opacity:1}
    .sec-head.reveal.in > *,.sec-head.reveal.in::before,
    html.pg-on .card.reveal.in .art img,.story-body:not([hidden]),
    .cart-fab.show,.cart-panel.pg-opening .cart-line,
    .prices li.picked .qbtn[data-d="-1"],.prices li.picked .qn{animation:none!important}
    .qbtn:active:not(:disabled),.cta:active,.cta.solid:active,.submit-btn:active:not(:disabled),.cart-go:active,
    .nav-links .order-btn:active,.sum-edit:active,.cart-fab:active,.pg-cat:active,.pg-top:active,.cart-close:active{transform:none}
  }
}

/* Price rows must never push the + button out of the card. With a large
   phone text size (an accessibility setting many customers use), or once a
   row is picked and shows − and the count, the row was wider than the card,
   so the + was clipped and could not be tapped. Let the row wrap instead:
   the stepper drops to its own line, right-aligned. */
.prices li{flex-wrap:wrap;row-gap:.35rem}
.prices li .stepper{margin-left:auto}

/* The two category tiles ("Pickles", "Jams"…) used plain 1fr columns, which
   can't shrink below their text. With a large phone text size they pushed
   the page wider than the screen, so it slid sideways. Let the columns
   shrink and the labels wrap; clip any decorative overflow as a backstop. */
.pg-cats{grid-template-columns:repeat(2,minmax(0,1fr))}
.pg-cat{min-width:0}
.pg-cat-txt strong,.pg-cat-txt .fa{overflow-wrap:anywhere}
body{overflow-x:clip}

/* The question form ("Your Name", "Phone or Email", notes) is a grid whose
   column was sized by the inputs' built-in width. With a large phone text
   size the inputs got wider than the form, ran out of the order panel and
   made the whole page slide sideways (320px screen at 160% text: page 378px
   wide in Chromium, 381px in Safari). Let the columns and inputs shrink. */
.order-form{grid-template-columns:minmax(0,1fr)}
.two-col{grid-template-columns:repeat(2,minmax(0,1fr))}
@media (max-width:560px){.two-col{grid-template-columns:minmax(0,1fr)}}
.field,.field input,.field textarea{min-width:0;max-width:100%}

/* Basket sheet on a small phone with a large text size: the header and the
   total/buttons footer took all the room, leaving the list of items 33px
   tall (iPhone SE at 130% text) and, at 160%, pushing "Continue to Order
   Details" off the bottom of the screen. The list keeps a floor that grows
   with the text size (at normal text it is shorter than the list already is,
   so nothing moves), and if everything still doesn't fit the sheet scrolls. */
.cart-panel{overflow-y:auto;overscroll-behavior:contain}
.cart-body{min-height:9rem}

/* Phones: the back-to-top circle sits above the full-width basket bar by a
   fixed 58px, but the bar grows with the phone's text size, so at large
   text the circle overlapped the bar. Same 58px at normal text (3.625rem). */
@media screen and (max-width:640px){
  body:has(.cart-fab.show) .pg-top,
  body:has(.cart-fab.show) .pg-top-fallback{bottom:calc(.9rem + 3.625rem)}
}

/* Large phone text size (Android font scaling, 160%): long single words,
   "@persiangardenva" in the contact card and footer, and the longer section
   and product headings, were wider than a 320px screen and widened the page.
   They may break inside the word when there's no other way to fit. No
   effect at normal text sizes, where everything already fits. */
h2,h3,.contact-card .c-val,.contact-card > span,.foot-inner > *,.foot-ig,.foot-ig a{overflow-wrap:anywhere;min-width:0;max-width:100%}
.contact-strip{grid-template-columns:repeat(auto-fit,minmax(min(212px,100%),1fr))}

/* At the largest phone text sizes (200%+, an iOS/Android accessibility
   setting) the size label "Paste · Small Jar" could not wrap, so the price
   list grew wider than the Strawberry Jam card and its + button was cut off
   at the right edge. The label may now wrap onto a second line when it has
   to; at normal sizes it fits on one line and nothing changes. */
.prices{min-width:0}
.prices .sz{white-space:normal;min-width:0;overflow-wrap:anywhere}
