/*
 * WordPress-only overrides, loaded after site.css (and after a page's own CSS) on the site and in the editor.
 * site.css is copied unchanged from the static site at deploy time; anything WordPress's block markup needs on top
 * of it goes here, measured against the static preview (https://ostrichland.evephuket.com) element by element with
 * OstrichLand/wp/tools/compare.mjs. Grouped by the markup difference each rule absorbs.
 */

/* ---------- 1. core block wrappers: no layout of their own inside our pages ---------- */
/* Buttons blocks print without WordPress's flex layout classes on our pages, and the bare wrapper around a single
   button is not printed at all (inc/render.php), so the page CSS lays out every button row as in the preview. */

/* ---------- 2. photos: figure.wp-block-image > [a >] img ---------- */
/* Core makes the photo link an inline-block and the image height:auto; the preview's photo boxes crop the image to
   the box, so the link fills the box and the image fills the link. On our pages each photo carries its focus as --pos
   and the page CSS crops it (inc/render.php); only the editor keeps the block's inline crop and focus. */
.wp-block-image > a { display: block; height: 100%; }
.card__photo img, .wide__photo img, .offer__photo img, .trio__photo img, .split__photo img, .tile__photo img, .hero__photo img, .wband__photo img { height: 100%; }

/* the farm-shop frame lost its inline --n: one column per photo, however many there are */
.split__frame { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }

/* Award badges: the preview's badges are <picture>s (display: contents), so each <source> before a badge is an empty
   flex item and every badge is preceded by one extra gap; that spacing and wrapping is the approved look. Each figure
   steps out of the layout the same way and its ::before stands in for the <source>. The badges are never cropped:
   on the site site.css contains them (.badges img, .award__badge img) once the inline crop is gone; this keeps the
   editor, which still writes the block's inline cover crop, the same for both award layouts. */
.badges > .wp-block-image { display: contents; }
.badges > .wp-block-image::before { content: ''; }
.badges img, .award__badge img { object-fit: contain !important; }
/* The awards trio (ui.njk awardsTrio) is the same in a grid: span.award__badge (site.css: grid, place-items centre,
   7.5rem high) holds the <source> as an empty first item, so its two auto rows share the free height and the badge
   sits in the lower one, below the box's centre (measured 2026-11-27: rows 29.7 px + 90.3 px on a phone, 37.2 px +
   97.8 px at 2560; the Canadian Business Awards badge 14.8 px and 18.3 px lower than centred). The figure that carries
   .award__badge here holds only the image, so its ::before stands in for the <source>. */
.award__badge.wp-block-image::before { content: ''; }

/* ---------- 3. buttons: div.wp-block-button.btn.btn--X > a.wp-block-button__link ---------- */
/* The wrapper carries the button classes, so site.css styles it as the button; core's link look is taken off and the
   link's click area stretched over the whole button. The arrow the preview drew as an inline SVG is drawn by ::after. */
.wp-block-button.btn { position: relative; display: inline-flex; }
.wp-block-button.btn > .wp-block-button__link { display: inline; width: auto; height: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: inherit; font: inherit; letter-spacing: inherit; text-decoration: none; text-align: inherit; word-break: normal; }
.wp-block-button.btn > .wp-block-button__link::before { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.wp-block-button.btn > .wp-block-button__link:focus-visible { outline: none; }
.wp-block-button.btn:has(> .wp-block-button__link:focus-visible) { outline: 2px solid var(--burgundy); outline-offset: 3px; }
/* In the preview a button inside .prose was an <a>, so ".prose a" (colour, weight 600) applied to the button itself. */
.prose .wp-block-button.btn { color: var(--burgundy); font-weight: 600; }
.btn--ico-arrow::after { content: ''; flex: none; width: 1.2em; height: 1.2em; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12h15M13.5 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12h15M13.5 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ---------- 4. text split into svg + p (notes, strip, contact, "more" links) ---------- */
.more { position: relative; }
.more a { text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
.more a::after { content: ''; position: absolute; inset: 0; }
/* the closing band's site link became p.closing__site > a: no underline, and the whole ruled row stays the link */
.closing__site { position: relative; }
.closing__site a { color: inherit; text-decoration: none; }
.closing__site a::after { content: ''; position: absolute; inset: 0; }

/* ---------- 5. photo cards: div.card / div.wide with the link on the photo and the title ---------- */
/* The whole card stays one click target (the title link stretched over it) with the preview's hover and focus look. */
.card { position: relative; }
.card__title a, .wide__title a { color: inherit; text-decoration: none; }
.card__title a::after { content: ''; position: absolute; inset: 0; }
.wide::after, .wide__cap { pointer-events: none; }
.wide__cap a { pointer-events: auto; }
.card a:focus-visible, .wide a:focus-visible { outline: none; }
.card:has(a:focus-visible), .wide:has(a:focus-visible) { outline: 2px solid var(--burgundy); outline-offset: 3px; }

/* ---------- 6. tables: figure.wp-block-table.times > table (contact, experience start times) ---------- */
/* The table's class sits on core's figure, so the figure draws the frame the preview's table drew (contact.css .times:
   surface, gold line, rounded corners, overflow hidden). Core's table look is taken off: collapsed borders, a border on
   every cell and a thick rule under the head; contact.css keeps the rule above each row and between the columns. */
.wp-block-table.times { margin: 0; }
.wp-block-table.times table { width: 100%; border-collapse: separate; border-spacing: 0; }
.wp-block-table.times thead { border-bottom: 0; }
.wp-block-table.times :is(th, td) { border-right: 0; border-bottom: 0; }
.wp-block-table.times :is(th, td):first-child { border-left: 0; }
.wp-block-table.times th { border-top: 0; }
