/* oc-notice.css — the owner's dated notice card, served at /oc-notice.css.

   The edge (functions/lib/notice.js) links this, and /oc-notice.js, only while a
   notice is live. Ported from the approved logo-card mock-up
   (bakery-on-oconnell/notice-mockups/notice.css), class nt- renamed oc-notice-.

   Colours and fonts sit behind custom properties so another site can set its own on
   :root. The fallbacks are Bakery on O'Connell's, copied from its computed styles
   (its pages all load Work Sans; only its home page declares Plus Jakarta Sans):
     --oc-notice-bg cream, --oc-notice-ink text, --oc-notice-btn red button,
     --oc-notice-btn-hover deep red, --oc-notice-head-font, --oc-notice-body-font

   Motion is the crisp tempo, as measured on the mock-up: one ease-out curve, no
   overshoot, at rest inside 300 ms, the exit about half the entrance. */

dialog.oc-notice{
  border:0; padding:0; margin:auto;
  width:min(440px,calc(100vw - 32px)); max-width:none;
  /* a long message on a short landscape phone scrolls inside the card */
  max-height:calc(100vh - 32px); max-height:calc(100dvh - 32px); overflow:auto;
  box-sizing:border-box;
  background:var(--oc-notice-bg,#F3ECE2);
  color:var(--oc-notice-ink,#211A15);
  font-family:var(--oc-notice-body-font,"Work Sans"),system-ui,sans-serif;
  box-shadow:0 24px 60px rgba(33,26,21,.35);
  /* closed state: slightly low and small, so it rises into place */
  opacity:0; transform:translateY(12px) scale(.97);
  transition:opacity .2s cubic-bezier(.23,1,.32,1),transform .3s cubic-bezier(.23,1,.32,1);
}
/* one class, so each piece's own rule below (same weight, later) sets its margins */
.oc-notice *{box-sizing:border-box;margin:0;}
dialog.oc-notice.is-in{opacity:1;transform:none;}
dialog.oc-notice:focus{outline:none;}   /* the card takes focus on open; no ring on the card itself */
dialog.oc-notice.is-out{transition-duration:.15s;}
/* literal colours here: older browsers do not pass variables to ::backdrop */
dialog.oc-notice::backdrop{background:rgba(33,26,21,0);transition:background-color .25s cubic-bezier(.23,1,.32,1);}
dialog.oc-notice.is-in::backdrop{background:rgba(33,26,21,.55);}
dialog.oc-notice.is-out::backdrop{transition-duration:.15s;}

/* The page behind does not scroll whilst the card is open. No scrollbar-gutter
   here: the site decides its own (the bakery reserves it on desktop and not on
   narrow screens), and forcing it shifted the page 15px sideways at 390 wide. */
html:has(dialog.oc-notice[open]){overflow:hidden;}

.oc-notice-in{padding:36px 36px 34px;text-align:center;}
.oc-notice-logo{display:block;width:176px;max-width:100%;height:auto;margin:0 auto 24px;}

/* Qualified with the dialog so it outranks a site's own heading rules: the bakery's
   ':root h2' (0,1,1) beat a bare '.oc-notice-h' (0,1,0) on the preview, 17-11-2026,
   and the card heading came out in Archivo instead of the approved face. */
dialog.oc-notice .oc-notice-h{
  /* The body font is second: on the bakery only the home page declares Plus Jakarta
     Sans, and every page loads Work Sans, so a sub-page shows the site's own face
     rather than the system one. */
  font:800 30px/1.1 var(--oc-notice-head-font,"Plus Jakarta Sans"),var(--oc-notice-body-font,"Work Sans"),system-ui,sans-serif;
  letter-spacing:-.015em; text-wrap:balance; color:inherit;
  /* the heading is the owner's own words: a 60-letter word must wrap, not widen the card */
  overflow-wrap:anywhere;
}
/* balance, not pretty: these are two or three short lines, and balance is
   what stops a last line of 'of us.' on a phone */
.oc-notice-body{margin-top:12px;font-size:17px;line-height:1.55;text-wrap:balance;overflow-wrap:anywhere;}
dialog.oc-notice .oc-notice-body p + p{margin-top:8px;}

/* The site's own button: square, Work Sans 600, 2px border. */
dialog.oc-notice .oc-notice-btn{
  margin-top:26px; min-width:168px; padding:13px 28px;
  font:600 15px/1.65 var(--oc-notice-body-font,"Work Sans"),system-ui,sans-serif;
  color:#fff; background:var(--oc-notice-btn,#B33520);
  border:2px solid var(--oc-notice-btn,#B33520); border-radius:0;
  cursor:pointer;
  transition:transform .15s cubic-bezier(.23,1,.32,1),background-color .15s cubic-bezier(.23,1,.32,1),border-color .15s cubic-bezier(.23,1,.32,1);
}
.oc-notice-btn:active{transform:scale(.97);}
.oc-notice-btn:focus-visible{outline:2px solid var(--oc-notice-ink,#211A15);outline-offset:3px;}

@media (hover:hover) and (pointer:fine){
  dialog.oc-notice .oc-notice-btn:hover{
    background:var(--oc-notice-btn-hover,#8E2A18);border-color:var(--oc-notice-btn-hover,#8E2A18);
  }
}

/* ---------- phones ---------- */
@media (max-width:640px){
  dialog.oc-notice .oc-notice-h{font-size:26px;}
  .oc-notice-in{padding:30px 24px 28px;}
  .oc-notice-logo{width:152px;margin-bottom:20px;}
}

/* Reduced motion: keep the fade, drop the movement. */
@media (prefers-reduced-motion:reduce){
  dialog.oc-notice{transform:none !important;}
  .oc-notice-btn:active{transform:none;}
}
