/*
Theme Name: British Wins Ledger
Theme URI: https://britishwins.uk
Description: The chrome of British Wins: single header and footer, one-row menubar with dropdown panels, burger below 1060px. Content blocks belong to the Prize Pages plugin (.prz-), the offers board to Prize Columns (.przb-). Ink and brass palette, Palatino headings.
Author: British Wins
Template: astra
Version: 1.1.0
Text Domain: astra-child-britwin
*/

/* ============================================================
   1. Tokens: mirrors of the palette contract shared with the
      Prize Pages plugin sheet. One value each, no drift.
   ============================================================ */
:root{
  --bw-paper:#f7f4ec;
  --bw-ink:#232c3f;
  --bw-ink-soft:#3b4a66;
  --bw-brass:#8c6d1f;
  --bw-brass-soft:#b5924b;
  --bw-rule:#d8d2c2;
  --bw-radius:10px;
  --bw-surface:#fffdf8;
  --bw-max:1080px;
}

/* ============================================================
   2. Canvas and the Astra shells
   ============================================================ */
/* The parent prints its header and footer through actions the child
   removes at wp_loaded; what remains are empty shells. Hide them, and
   hold the paper canvas against the parent's dynamic customizer CSS,
   which prints later in the head and would otherwise win the cascade. */
#masthead,.site-header,#colophon,.site-footer{display:none!important}
body{
  background:var(--bw-paper)!important;
  color:var(--bw-ink)!important;
  font-family:Georgia,'Times New Roman',serif!important;
  font-size:17px!important;
  line-height:1.65;
}
#page,#content,.site-content,.ast-container{background:var(--bw-paper)!important}
#content img,.site-content img{max-width:100%;height:auto}
#content h1,#content h2,#content h3,#content h4,#content h5,#content h6,
.bw-content-shell h1,.bw-content-shell h2,.bw-content-shell h3,
.bw-content-shell h4,.bw-content-shell h5,.bw-content-shell h6{
  font-family:'Palatino Linotype','Book Antiqua',Palatino,serif;
  color:var(--bw-ink);
}
#content a,.site-content a,.bw-content-shell a{
  color:var(--bw-ink);
  text-decoration:underline;
  text-decoration-color:var(--bw-brass-soft);
  text-underline-offset:2px;
}
#content a:hover,.site-content a:hover,.bw-content-shell a:hover{color:var(--bw-brass)}

/* One content measure for the whole site: the shell holds the 820px
   column, the plugin blocks inside keep their own 760px measure, and
   both are auto-centered, so their edges agree on every Astra build. */
.bw-content-shell{max-width:820px;margin:0 auto;padding:28px 18px 64px}

/* Skip link */
.bw-skip{position:absolute;left:-9999px;top:0;background:#232c3f;color:#f7f4ec;padding:10px 16px;font-weight:700;z-index:999;border-radius:0 0 10px 0;text-decoration:none}
.bw-skip:focus{left:0}

/* ============================================================
   3. Header chrome: utility strip and masthead
   ============================================================ */
.bw-utility{background:#232c3f;color:#f7f4ec;font-size:.8rem}
.bw-utility-in{max-width:var(--bw-max);margin:0 auto;padding:6px 18px;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.bw-ages{border:1px solid var(--bw-brass-soft);color:var(--bw-brass-soft);border-radius:999px;padding:1px 10px;font-weight:700;letter-spacing:.04em}
.bw-utility-nav{display:flex;gap:16px;flex-wrap:wrap}
.bw-utility-nav a{color:rgba(247,244,236,.8);text-decoration:none;border:none}
.bw-utility-nav a:hover{color:#fffdf8;text-decoration:underline}
.bw-mast{max-width:var(--bw-max);margin:0 auto;padding:26px 18px 18px;text-align:center}
.bw-logo{display:inline-block;font-family:'Palatino Linotype','Book Antiqua',Palatino,serif;font-size:1.9rem;font-weight:700;letter-spacing:.02em;color:var(--bw-ink);text-decoration:none;border:none;line-height:1.15}
.bw-logo em{font-style:normal;color:#8c6d1f}
.bw-logo:hover{color:var(--bw-ink)}
.bw-tagline{margin:6px 0 0;font-size:.8rem;letter-spacing:.16em;text-transform:uppercase;color:var(--bw-ink-soft)}

/* ============================================================
   4. Menubar and dropdown panels
   ============================================================ */
/* The bar is deliberately static: a sticky bar fights the page scroll
   and the reference sheet dropped it for that reason. */
.bw-menubar{position:static;background:var(--bw-surface);border-top:1px solid var(--bw-rule);border-bottom:1px solid var(--bw-rule)}
.bw-menubar-in{max-width:var(--bw-max);margin:0 auto;padding:0 18px;display:flex;justify-content:center;align-items:stretch}

/* Menu: one row on every width down to the nav breakpoint. */
.bw-menu{display:flex;align-items:stretch;flex-wrap:nowrap;list-style:none;margin:0;padding:0}
.bw-item{position:relative}
.bw-item>a{display:flex;align-items:center;padding:12px 13px;font-size:.95rem;font-weight:600;letter-spacing:.02em;color:var(--bw-ink);text-decoration:none;border:none;white-space:nowrap}
.bw-item>a:hover{color:var(--bw-brass);box-shadow:inset 0 -3px 0 var(--bw-brass-soft)}
.bw-item>a:focus-visible{outline-offset:-2px}
.bw-caret{display:inline-block;width:0;height:0;margin-left:6px;border-left:4px solid transparent;border-right:4px solid transparent;border-top:5px solid var(--bw-brass);transition:transform .15s ease}

/* Dropdown panels: rendered all the time, revealed on hover or
   keyboard focus. The centering offset rides on the translate
   property, so the open state can be a plain transform:none and the
   edge classes cancel the centering with translate:none. The panel
   carries its own scroll and shadow, so no ancestor clipping and no
   stacking-context tricks are needed. */
.bw-drop{position:absolute;top:100%;left:50%;translate:-50% 0;min-width:260px;max-width:320px;max-height:70vh;overflow-y:auto;overscroll-behavior:contain;background:var(--bw-surface);border:1px solid var(--bw-rule);border-radius:var(--bw-radius);box-shadow:0 12px 28px rgba(35,44,63,.14);z-index:60;padding:8px 0;opacity:0;visibility:hidden;transform:translateY(8px);transition:opacity .16s ease,visibility .16s ease,transform .16s ease}
.bw-item.bw-edge .bw-drop{left:auto;right:0;translate:none}
.bw-item.bw-edge-l .bw-drop{left:0;translate:none}
.bw-drop a{display:block;padding:9px 16px;font-size:.9rem;line-height:1.45;color:var(--bw-ink);text-decoration:none;border:none;white-space:nowrap}
.bw-drop a:hover{background:rgba(140,109,31,.07);color:var(--bw-brass)}
.bw-drop .bw-drop-hub{font-weight:700;color:var(--bw-brass);border-bottom:1px solid var(--bw-rule);margin-bottom:4px;padding-bottom:8px}
.bw-drop .bw-drop-hub:hover{background:transparent;text-decoration:underline}

/* Hover and focus-within open panels only above the nav breakpoint;
   below it the media block hands the menu to the tap handler. */
@media (min-width:1061px){
  .bw-item:hover .bw-drop,.bw-item:focus-within .bw-drop{opacity:1;visibility:visible;transform:none}
  .bw-item:hover>.bw-caret,.bw-item:focus-within>.bw-caret{transform:rotate(180deg)}
}

/* Burger: hidden on desktop, the only menu entry below the breakpoint. */
.bw-burger{display:none}

/* ============================================================
   5. Footer chrome
   ============================================================ */
.bw-footer{background:#232c3f;color:rgba(247,244,236,.85)}
.bw-footer a{color:rgba(247,244,236,.85);text-decoration:none;border:none}
.bw-footer a:hover{color:var(--bw-brass-soft);text-decoration:underline}
.bw-foot-grid{max-width:var(--bw-max);margin:0 auto;padding:38px 18px 26px;display:grid;grid-template-columns:1.2fr 2fr 1fr;gap:36px}
.bw-foot-brand .bw-logo{color:#f7f4ec;font-size:1.5rem}
.bw-foot-brand .bw-logo em{color:var(--bw-brass-soft)}
.bw-foot-brand .bw-logo:hover{color:#fffdf8}
.bw-foot-note{margin:12px 0 0;font-size:.9rem;line-height:1.65;color:rgba(247,244,236,.7);max-width:44ch}
.bw-foot-col h2{margin:6px 0 12px;font-family:'Palatino Linotype','Book Antiqua',Palatino,serif;font-size:1.05rem;font-weight:700;font-variant-caps:small-caps;letter-spacing:.06em;color:var(--bw-brass-soft)}
.bw-foot-col ul{list-style:none;margin:0;padding:0}
.bw-foot-col li{margin:0 0 2px}
.bw-foot-col a{display:inline-block;padding:3px 0;font-size:.95rem}
.bw-foot-strip{border-top:1px solid rgba(255,255,255,.12)}
.bw-foot-strip-in{max-width:var(--bw-max);margin:0 auto;padding:14px 18px;display:flex;justify-content:space-between;gap:8px 24px;flex-wrap:wrap;font-size:.85rem;color:rgba(255,255,255,.75)}

/* ============================================================
   6. Focus and motion
   ============================================================ */
a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid #8c6d1f;outline-offset:2px}
.bw-utility a:focus-visible,.bw-footer a:focus-visible{outline-color:var(--bw-brass-soft)}
@media (prefers-reduced-motion:reduce){
  .bw-caret{transition:none}
  .bw-drop{transition:none}
}

/* ============================================================
   7. Responsive
   ============================================================ */
/* Media queries carry literal pixel values on purpose: a CSS custom
   property is not valid inside a media condition, and a var() there
   would be dropped together with the whole block. The nav breakpoint
   is the literal 1060px shared with the tap handler. */
@media (max-width:900px){
  .bw-foot-grid{grid-template-columns:1fr;gap:26px;padding-top:28px}
}
@media (max-width:1060px){
  .bw-menubar-in{display:block;padding-top:4px;padding-bottom:4px}
  .bw-burger{display:inline-flex;align-items:center;gap:10px;background:var(--bw-surface);border:1px solid var(--bw-rule);border-radius:var(--bw-radius);padding:9px 14px;margin:8px 0;cursor:pointer;color:var(--bw-ink);font-family:Georgia,'Times New Roman',serif;font-size:.85rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
  .bw-burger-box{display:inline-flex;flex-direction:column;gap:4px}
  .bw-burger-box span{display:block;width:20px;height:2px;border-radius:2px;background:var(--bw-ink)}
  .bw-menu{display:none;flex-direction:column;align-items:stretch}
  .bw-menubar.bw-open .bw-menu{display:block}
  .bw-item{border-top:1px solid var(--bw-rule)}
  .bw-item:first-child{border-top:none}
  .bw-item>a{justify-content:space-between;width:100%;padding:12px 6px}
  .bw-item.bw-tapopen>.bw-caret{transform:rotate(180deg)}
  /* Touch: hover must never open a panel, the tap handler owns it.
     The panel drops back into the flow as a static accordion step. */
  .bw-drop{position:static;translate:none;transform:none;display:none;opacity:1;visibility:visible;min-width:0;max-width:none;max-height:none;overflow:visible;box-shadow:none;background:transparent;border:none;border-radius:0;padding:2px 0 10px 16px;transition:none}
  .bw-item.bw-tapopen .bw-drop{display:block}
  .bw-drop a{white-space:normal}
}
@media (max-width:768px){
  .bw-mast{padding:20px 16px 14px}
  .bw-logo{font-size:1.6rem}
  .bw-tagline{font-size:.75rem;letter-spacing:.12em}
  .bw-content-shell{padding:24px 16px 56px}
}
@media (max-width:600px){
  .bw-utility-in{justify-content:center}
  .bw-logo{font-size:1.45rem}
  .bw-content-shell{padding:20px 14px 48px}
  .bw-foot-strip-in{flex-direction:column;gap:6px}
}
@media (max-width:390px){
  .bw-mast{padding:16px 12px 12px}
  .bw-logo{font-size:1.3rem}
  .bw-utility{font-size:.75rem}
  .bw-content-shell{padding:18px 12px 44px}
}