/*
Theme Name: Oak & Ash
Theme URI: https://oakandashevents.com
Author: Bareblink Studio
Description: Custom theme for Oak & Ash Luxury Event Rentals. Phase 02. Presentation only - the catalogue stays in RW Elephant and this theme renders around it.
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: oakandash
*/

/* ===========================================================================
   The block below is the Phase 01 design system, carried over unchanged so the
   approved drawing holds to the pixel: type scale, colour, spacing tokens,
   breakpoints, buttons, content widths and the image treatments. Everything
   responsive is driven from tokens on .root because the original values live
   in inline styles, which a media query cannot reach.
   =========================================================================== */

    body { margin: 0; background: #F4EBE2; }

    .dsp { font-family: var(--dsp); font-weight: 400; }
    /* Large editorial statements only. Newsreader carries a true 300; Libre
       Baskerville and Besley have no light cut, so they fall back to their 400
       rather than being faux-lightened. */
    .dsp-lt { font-weight: var(--dsp-lt, 400); }
    .eyebrow { font-family: 'Inter', system-ui, sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: 0.11em; font-size: 11px; line-height: 1.35; }
    .meta { font-family: 'Inter', system-ui, sans-serif; font-weight: 500; text-transform: uppercase; letter-spacing: 0.075em; font-size: 11px; line-height: 1.35; color: #6E6C52; }

    a { color: #47472E; text-decoration: none; }
    a:hover { color: #6B818B; }
    .nav a { color: #F4EBE2; font-weight: 500; letter-spacing: 0.055em; }
    .nav a:hover { color: #FFFFFF; }
    /* The header is decorative in this concept: the anchors carry no href, so
       they style and hover as links but navigate nowhere and stay out of the
       tab order. Restore the hrefs when the real routes exist. */
    /* Three screens are wired to each other, so some anchors now navigate:
       Collections, "Explore the newest edit" and "Explore the edit" all open
       the collection board, and a product name opens the product board. The
       rest still carry no href — they style and hover as links but go nowhere
       and stay out of the tab order, because the pages do not exist yet.
       Note that each board keeps its own state, so the wishlist count does not
       carry from one screen to the next; that is a property of the prototype,
       not of the design. */
    a:not([href]), .nav span { cursor: default; }
    .navlink { padding-bottom: 3px; border-bottom: 1px solid transparent; }
    .navlink:hover { border-bottom-color: rgba(244,235,226,0.55); }

    .btn { font-family: 'Inter', system-ui, sans-serif; font-weight: 600; font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; border-radius: 2px; display: inline-block; }
    /* Proportional buttons. The space either side of the label is exactly half
       the label's own width, so the button is always twice as wide as its text.
       Each pseudo-element holds the same string at half the font size — and
       because letter-spacing is declared in em it halves too, so the hidden
       copy measures exactly half the real label. Change the wording and the
       padding follows on its own; no numbers to re-measure. */
    .btn[data-label] { display: inline-flex; align-items: center; justify-content: center;
                       padding-left: 0; padding-right: 0; }
    .btn[data-label]::before,
    .btn[data-label]::after { content: attr(data-label); font-size: 0.5em; letter-spacing: inherit;
                              white-space: nowrap; visibility: hidden; pointer-events: none; }

    .b-light { border: 1px solid rgba(244,235,226,0.6); color: #F4EBE2; }
    .b-light:hover { border-color: #F4EBE2; background: rgba(244,235,226,0.12); color: #F4EBE2; }
    .b-text { font-family: 'Inter', system-ui, sans-serif; font-weight: 600; font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; border-bottom: 1px solid #BFB29D; padding-bottom: 5px; }
    .b-text:hover { border-bottom-color: #47472E; }

    /* Hero dissolve. Four clips stacked; the incoming one fades in ON TOP of a
       still-opaque outgoing one, so no background ever shows through the join.
       The clips are different lengths, so the handover is driven from each
       clip's own currentTime rather than a fixed CSS cycle — see the hero
       controller at the end of the body. No Ken Burns drift: the footage
       already moves, and scaling it would only soften the compression. */
    .slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
             opacity: 0; z-index: 1; will-change: opacity;
             transition: opacity var(--fade, 800ms) ease; background: #262618; }

    /* The clips carry their own z-index so the incoming one can ride above the
       outgoing one mid-fade. This wrapper keeps that private: it is its own
       stacking context, so no clip can ever climb above the scrim or the
       headline the way it did when the videos sat loose in the section. */
    .hero-media { position: absolute; inset: 0; z-index: 0; overflow: hidden; }

    /* One flat tint over the whole frame — no gradient, no pool behind the
       copy, no shadow on the type. It reads as a grade on the footage rather
       than as something sitting on top of it, which is the point. 0.42 is the
       setting: measured over the brightest and darkest frames in the loop, it
       is the lightest tint that still carries the 17px body copy over white
       hydrangea, and it leaves the candlelit clip legible rather than crushed. */
    .hero-scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none;
      background: rgba(26,26,16,0.42); }

    @media (prefers-reduced-motion: reduce) {
      .slide { transition: none; }
    }

    .zoom { transition: transform 700ms ease; }
    .tile:hover .zoom { transform: scale(1.05); }
    .row { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
    .row::-webkit-scrollbar { display: none; }
    .row > * { scroll-snap-align: start; }
    /* Both carousels drive their own position so the featured card can
       resize, so they opt out of native snapping. */
    .row-drv { scroll-snap-type: none; }
    /* Featured category. Emphasis is scale only: no border, badge or weight
       change, and the metadata underneath is untouched. */
    /* --cap is the exact height of the caption block. The piece count that used
       to sit under the title is gone at Ashley's request, so the block is now
       just the title's top margin and its own 25px/1.15 line box — the former
       6px title bottom margin and 14.85px metadata line came out with it.
       Shifting an unfeatured card up by that amount lands the foot of its
       caption on the foot of the featured image, with the gap between its own
       image and text untouched — the card moves as one piece. */
    .cat { flex: 0 0 300px; --tm: 14px; --cap: calc(var(--tm) + (25px * 1.15));
           /* --sink is the dead space between the last line's BASELINE and the
              bottom of its line box, so that the alignment reference is the
              baseline and descenders hang below it. Two of the five names
              descend (Lounge, Tabletop) and three do not, and all the secondary
              cards share one transform, so the baseline — not the ink — has to
              be the reference.

              It is SUBTRACTED from --cap, not added. --cap measures down to the
              bottom of the line box; the baseline sits --sink above that, so
              the card has to travel that much LESS far to land its baseline on
              the featured image's foot. The old rule added it. With the old
              3.43px metadata value that put the row under 3px out and nothing
              showed, but it is a sign error, and at this line's 9.75px it lifted
              the whole row 14.25px too high and was plain to see.

              9.75px is measured, not derived: Chromium floors the half-leading
              on the ascent side, so the baseline lands 19px below the top of the
              28.75px line box rather than the 20.25px Newsreader's own metrics
              give (1470/-530 on a 2000 em, so ascent and descent come to exactly
              1em and half-leading is (28.75-25)/2 = 1.875px). Engines that do
              not floor it will sit 1.25px low, which is below the threshold this
              alignment is trying to hold.

              --nudge is an optical allowance on top. It is 0: the baseline now
              lands exactly on the foot, and the -4px that used to be here was
              covering for the sign error above. */
           --sink: 9.75px; --nudge: 0px;
           transform: translateY(calc(-1 * (var(--cap) - var(--sink) + var(--nudge))));
           transition: flex-basis 460ms cubic-bezier(0.4, 0, 0.2, 1),
                       transform 460ms cubic-bezier(0.4, 0, 0.2, 1); }
    .cat.is-feat { flex: 0 0 580px; transform: none; --tm: 22px; }   /* 580 wide against the 580 image height = 1:1 */
    /* The title keeps its natural height. It was previously forced into a box
       tall enough for the 29px featured size and bottom-aligned inside it,
       which padded 5.25px of dead air above every 25px title and made the
       secondary gap visibly wider than the featured one. The three secondary
       cards share identical type, so they stay level with each other without
       it, and the featured caption has nothing to line up with. */
    .cat-t { font-size: 25px; line-height: 1.15; margin: var(--tm) 0 0;
             transition: font-size 460ms cubic-bezier(0.4, 0, 0.2, 1),
                         margin-top 460ms cubic-bezier(0.4, 0, 0.2, 1); }
    /* Every image ends on the same line at the foot of the 580px band; only the
       featured one reaches the top of it. So the hierarchy is built entirely
       upward from a shared baseline, and the captions stay on one line. */
    .cat-img { position: absolute; left: 0; right: 0; top: 112px; bottom: auto;
               /* Height must be set explicitly. On an absolutely positioned
                  REPLACED element, `height: auto` resolves from the intrinsic
                  ratio and `bottom` is then ignored as over-constrained, so the
                  band height never applied and object-fit had nothing to crop. */
               width: 100%; height: calc(100% - 112px); object-fit: cover;
               /* The focal point belongs to the photograph and travels with it
                  between the two card shapes. Each card carries both values;
                  the state picks one, and the move between them is animated so
                  the subject glides rather than jumps. */
               object-position: var(--f-sec, 50% 50%);
               transition: top 460ms cubic-bezier(0.4, 0, 0.2, 1),
                           height 460ms cubic-bezier(0.4, 0, 0.2, 1),
                           object-position 460ms cubic-bezier(0.4, 0, 0.2, 1),
                           transform 700ms ease; }
    .is-feat .cat-img { top: 0; height: 100%; object-position: var(--f-feat, 50% 50%); }
    .is-feat .cat-t { font-size: 29px; }
    @media (prefers-reduced-motion: reduce) {
      .cat, .cat-t, .cat-img, .prod, .prod .wish { transition: none; }
    }
    /* Rentals are merchandising, not an editorial moment, so this row keeps
       the category row's horizontal rhythm but drops its asymmetry: identical
       frames, identical captions on one line, and the first card only ~18%
       wider so the objects — not the containers — carry the variation. */
    .prod { flex: 0 0 300px;
            transition: flex-basis 460ms cubic-bezier(0.4, 0, 0.2, 1); }
    .prod.is-feat { flex: 0 0 354px; }
    .prod-t { font-size: 19px; line-height: 1.2; margin: 22px 0 6px; }
    .prod-img { position: absolute; inset: 0; width: 100%; height: 100%;
                object-fit: contain; object-position: center; }
    /* The heart is a hover affordance, but a piece already saved keeps its
       heart on — otherwise the only record of a save would vanish on mouse-out,
       and it would be unreachable by keyboard. */
    .prod .wish { opacity: 0; transition: opacity 200ms ease; }
    .prod:hover .wish,
    .prod.is-saved .wish,
    .prod .wish:focus-visible { opacity: 1; }

    .rowbtn { width: 48px; height: 48px; min-width: 48px; border-radius: 999px; border: 1px solid #8A7F6B;
              background: none; color: #47472E; cursor: pointer; display: flex; align-items: center;
              justify-content: center; padding: 0; transition: border-color 200ms ease, background 200ms ease; }
    .rowbtn:hover { border-color: #47472E; background: rgba(71,71,46,0.06); }
    .rowbtn:focus-visible { outline: 2px solid #6B818B; outline-offset: 2px; }
    .rowbar { transition: width 240ms ease; }
    /* Working note pinned to the foot of the media it refers to. Deliberately
       low-contrast so it reads as a margin note rather than page content;
       it disappears entirely with the Show placeholders prop off. */
    .ph-media { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; margin: 0;
                padding: 9px 16px; text-align: center; border: 0; pointer-events: none;
                background: linear-gradient(180deg, rgba(26,26,16,0) 0%, rgba(26,26,16,0.34) 100%);
                color: rgba(244,235,226,0.62); font-size: 10px; }
    .wish { cursor: pointer; background: none; border: 0; padding: 6px; }
    .wish:hover svg { stroke: #6B818B; }
    input::placeholder { color: #C4BDA2; }
    #nl-email:focus-visible { outline: 2px solid #F4EBE2; outline-offset: 3px; border-radius: 1px; }
  

    /* ---- header: desktop ----------------------------------------------
       The hamburger and the drawer do not exist above 900px. The wishlist
       reads "Wishlist (3)" there, with the brackets drawn by CSS so the
       number itself is the only thing any script has to write. */
    .navtoggle, .navdrawer { display: none; }
    .wish-n::before { content: "("; }
    .wish-n::after  { content: ")"; }
    /* ===== RESPONSIVE ===================================================
       The boards are drawn at 1440 and everything above this holds that
       drawing exactly. What follows reflows it below that width.

       Nearly every size on these pages lives in an inline style, and a
       media query cannot reach an inline style — inline always wins, media
       query or not. Rather than carpet the file with !important, the values
       that have to move are declared as tokens here and the markup reads
       var(--x). Each clamp's upper bound is the 1440 drawing to the pixel
       (56/1440 = 3.89vw, 144/1440 = 10vw, 82/1440 = 5.7vw ...), so at 1440
       and above nothing shifts by even a pixel; the clamp only starts to
       bite as the viewport narrows. */
    .root {
      --pad-x:    clamp(20px, 3.89vw, 56px);
      --pad-y:    clamp(64px, 10vw,   144px);
      --pad-y-sm: clamp(56px, 8.89vw, 128px);
      --pad-copy: clamp(48px, 6.67vw, 96px);
      --gap-wide: clamp(32px, 5vw,    72px);
      --gap-col:  clamp(28px, 3.89vw, 56px);
      --h-hero:   clamp(38px, 5.69vw, 82px);
      --h-hero-c: clamp(34px, 5vw,    72px);
      --h-48:     clamp(28px, 3.33vw, 48px);
      --h-46:     clamp(28px, 3.19vw, 46px);
      --h-42:     clamp(26px, 2.92vw, 42px);
      --h-38:     clamp(24px, 2.64vw, 38px);
      --h-36:     clamp(23px, 2.50vw, 36px);
      --h-34:     clamp(23px, 2.36vw, 34px);
      --h-32:     clamp(22px, 2.22vw, 32px);
      --h-30:     clamp(21px, 2.08vw, 30px);
      --hero-min:  clamp(620px, 58.33vw, 840px);
      --hero-min-c:clamp(600px, 56.94vw, 820px);
      --break-min: clamp(400px, 44.44vw, 640px);
      --break-620: clamp(390px, 43.06vw, 620px);
      --band:      clamp(380px, 40.28vw, 580px);
      --field:     420px;
      --grid-3:    repeat(3, minmax(0, 1fr));
      --grid-4:    repeat(4, minmax(0, 1fr));
      --nav-gap:   32px;
      --nav-pad-y: 30px;
      --logo-h:    89px;
      --nav-flex:  1 1 240px;
      --nav-just:  flex-end;
      --nav-just-l:flex-start;
      --nav-display: flex;
    }

    /* Tablet. Three and four column grids stop earning their width here:
       a 4-up related row at 900px gives 200px cards, and the cut-out field
       no longer needs its full 420px. */
    @media (max-width: 1023px) {
      .root { --grid-3: repeat(2, minmax(0, 1fr));
              --grid-4: repeat(2, minmax(0, 1fr));
              --field:  clamp(250px, 42vw, 420px); }
    }

    /* Below this the header stops working as a three-part bar and the
       carousels stop promoting a featured card. The promotion is dropped
       rather than rescaled on purpose: the featured card's offset is built
       on the caption maths above (--cap and --sink), which is derived for
       one type size, so re-deriving it at every viewport width would be a
       lot of arithmetic to keep an effect that needs width to read at all. */
    @media (max-width: 899px) {
      .root { --nav-gap: 14px; --nav-pad-y: 14px; --logo-h: 58px;
              --nav-flex: 0 0 auto; --nav-just: flex-end;
              --nav-just-l: center; --nav-display: none; }
      .cat, .cat.is-feat { flex: 0 0 min(76vw, 300px); transform: none; --tm: 14px; }
      .cat.is-feat .cat-t { font-size: 25px; }
      /* The 112px inset is what steps the unfeatured images down from the
         featured one. With the promotion off, every card is the same and the
         inset is just 112px of dead linen above each photograph, which read
         as a broken section. Fill the band instead. */
      .cat-img, .is-feat .cat-img { top: 0; height: 100%;
                                    object-position: var(--f-sec, 50% 50%); }
      .prod, .prod.is-feat { flex: 0 0 min(66vw, 300px); }
      /* Every line of the stacked bar centres, the logo's included — it is
         flex: 0 0 auto, so without this it sits hard left under centred rows. */
      .nav { justify-content: center; }
      .navlink { font-size: 13px; }
      /* ---- header: phone and small tablet ------------------------------
         One row: menu, logo, heart. The four links, the search and Inquire
         all move into the drawer. */
      .nav { justify-content: space-between; flex-wrap: nowrap; }
      .nav .act-search, .nav .act-inquire { display: none; }
      .navtoggle { display: flex; align-items: center; justify-content: center;
                   background: none; border: 0; padding: 11px; cursor: pointer;
                   min-width: 44px; min-height: 44px; line-height: 0; flex: 0 0 auto; }
      /* With the word gone the link collapses to about 21px wide, under the
         44px minimum target and narrower than the 44px hamburger opposite,
         which pushed the logo off centre. Pinning it to 44 fixes both. */
      .nav .act-wish { min-width: 44px; min-height: 44px; justify-content: flex-end; }
      .wish-label { display: none; }
      /* The count becomes a badge on the heart rather than a word beside it.
         It is absolutely positioned so it never widens the tap target, and it
         disappears at zero — an empty wishlist has nothing to announce. */
      .wish-n { position: absolute; top: 2px; right: -4px; min-width: 16px; height: 16px;
                padding: 0 4px; box-sizing: border-box; border-radius: 9px;
                background: #F4EBE2; color: #47472E; font-family: 'Inter', system-ui, sans-serif;
                font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; }
      .wish-n::before, .wish-n::after { content: none; }
      .act-wish[data-n="0"] .wish-n { display: none; }

      .navdrawer { display: flex; flex-direction: column; position: fixed; inset: 0;
                   z-index: 60; background: #47472E; padding: 18px var(--pad-x) 32px;
                   box-sizing: border-box; overflow-y: auto;
                   opacity: 0; visibility: hidden; transform: translateY(-8px);
                   transition: opacity 220ms ease, transform 220ms ease, visibility 220ms; }
      .navdrawer.is-open { opacity: 1; visibility: visible; transform: none; }
      .dr-top { display: flex; justify-content: space-between; align-items: center; }
      .dr-close { background: none; border: 0; padding: 11px; cursor: pointer;
                  min-width: 44px; min-height: 44px; line-height: 0; }
      .dr-nav { display: flex; flex-direction: column; margin-top: 8px; }
      .dr-link { font-family: var(--dsp); font-weight: 400; font-style: italic;
                 font-size: 30px; line-height: 1.25; color: #F4EBE2;
                 padding: 14px 0; border-bottom: 1px solid rgba(244,235,226,0.14); }
      .dr-search { display: flex; align-items: center; gap: 10px; margin-top: 26px;
                   background: none; border: 0; padding: 12px 0; cursor: pointer;
                   color: #C4BDA2; font-family: 'Inter', system-ui, sans-serif;
                   font-weight: 500; text-transform: uppercase; letter-spacing: 0.075em;
                   font-size: 11px; min-height: 44px; }
      .dr-inquire { margin-top: auto; display: block; text-align: center;
                    padding: 17px 0; width: 100%; box-sizing: border-box; }
      .dr-inquire::before, .dr-inquire::after { content: none; }

      /* The bar is absolutely positioned, so it contributes nothing to the
         hero's height and the bottom-aligned copy rode straight up into it
         once the hero got short. This reserves the room for the 94px bar plus
         breathing space; the hero grows past its min-height if the copy needs
         more. */
      .hero-copy { padding-top: 130px; }
    }

    @media (max-width: 599px) {
      .root { --logo-h: 50px; --nav-gap: 14px; }
      /* Once the announcement bar wraps, the separator is left stranded at the
         end of the first line reading as a stray full stop. The two halves are
         on their own lines by then and do not need dividing. */
      .topbar-sep { display: none; }
      /* These buttons size their own horizontal padding by rendering the label
         again at half size on each side, which is what gives them the long
         look. On a phone that intrinsic width runs past the screen and the
         real label wraps inside the box while the hidden copies refuse to.
         Shrinking the copies keeps the proportional idea and lets the label
         sit on one line. The inline padding on the buttons is 15px 0, so this
         has to be done through the pseudo-elements, not padding. */
      .btn[data-label]::before,
      .btn[data-label]::after { font-size: 0.26em; }
      .cat, .cat.is-feat { flex: 0 0 min(82vw, 300px); }
      .prod, .prod.is-feat { flex: 0 0 min(72vw, 300px); }
    }
  

/* ===========================================================================
   Theme-only additions. Phase 01 was three standalone pages, so the header sat
   inside each hero. In WordPress the header is one partial shared by every
   template, so it needs two modes: overlaid on a hero, or solid on interior
   pages where there is no photograph behind it.
   =========================================================================== */
.nav--overlay { position: absolute; top: 0; left: 0; right: 0; z-index: 3; }
.nav--solid   { position: relative; background: #47472E; }
.oa-hero      { position: relative; }

/* Interior pages still need the shell's rhythm around whatever the page or a
   plugin renders into the_content(). RW Elephant's gallery and wishlist come
   through here, so this wrapper must never impose a layout on its children -
   it only sets the gutter and the measure. */
.oa-page { max-width: 1680px; margin: 0 auto; padding: var(--pad-y) var(--pad-x); }
.oa-page--wide { max-width: none; }
.oa-page h1.oa-page__title { font-family: var(--dsp); font-weight: 300;
  font-size: var(--h-48); line-height: 1.18; letter-spacing: -0.015em;
  margin: 0 0 36px; }
