/*
Theme Name: Deluisio Angus
Theme URI: https://deluisioangus.com
Template: agrovision-fse
Description: Deluisio Angus brand child theme for AgroVision FSE. Dark-first, Jost type, Bright blue accent, with patterns for reference animals, animal profiles with dated EPDs, and contact.
Author: Deluisio Angus
Version: 1.3.1
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: deluisio-angus
*/

/* ---------- Base ---------- */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
:where(a, button, .wp-element-button):focus-visible {
	outline: 2px solid var(--wp--preset--color--blue);
	outline-offset: 2px;
	border-radius: 4px;
}
.wp-element-button:hover, .wp-block-button__link:hover { filter: brightness(1.08); text-decoration: none; }
::selection { background: var(--wp--preset--color--blue); color: var(--wp--preset--color--on-blue); }

/* The parent theme floats its header over the front-page hero; keep it solid on our dark ground. */
body.page-template-front .site-main-header { position: sticky !important; top: 0; background: var(--wp--preset--color--paper) !important; }

/* ---------- Header / footer ---------- */
.da-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--wp--preset--color--paper) 88%, transparent);
	backdrop-filter: saturate(180%) blur(16px);
	-webkit-backdrop-filter: saturate(180%) blur(16px);
	border-bottom: 1px solid var(--wp--preset--color--line-soft);
}
.da-header .wp-block-navigation a:hover,
.da-header .wp-block-navigation .current-menu-item > a,
.da-header .wp-block-navigation a[aria-current="page"] { color: var(--wp--preset--color--blue); text-decoration: none; }
.da-footer { border-top: 1px solid var(--wp--preset--color--line-soft); color: var(--wp--preset--color--ink-muted); font-size: 13px; }
.da-footer .da-footer-name { color: var(--wp--preset--color--ink); font-weight: 600; font-size: 15px; }

/* ---------- Sections ---------- */
.da-section { padding-top: var(--wp--preset--spacing--90); padding-bottom: var(--wp--preset--spacing--90); }
.da-raised { background: var(--wp--preset--color--surface-raised); }
.has-display-font-size { line-height: 1.03 !important; letter-spacing: -0.015em; }
.da-lead { color: var(--wp--preset--color--ink-muted); font-size: var(--wp--preset--font-size--medium); line-height: 1.48; }
.da-hero-img img { border-radius: 18px 18px 0 0; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.da-rounded img { border-radius: 12px; }

/* ---------- Block styles (registered in functions.php) ---------- */
/* Paragraph: Eyebrow */
.is-style-da-label {
	font-size: 12px !important; line-height: 16px; font-weight: 500;
	letter-spacing: 0.08em; text-transform: uppercase;
	color: var(--wp--preset--color--ink-muted);
}
/* Paragraph: EPD line */
.is-style-da-data {
	font-size: 13px !important; line-height: 18px; font-weight: 500;
	font-variant-numeric: tabular-nums;
	border-top: 1px solid var(--wp--preset--color--ink);
	padding-top: 8px;
}
/* Paragraph: EPD date */
.is-style-da-asof { font-size: 12px !important; line-height: 16px; color: var(--wp--preset--color--ink-muted); }
/* Group: Card */
.is-style-da-card {
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--line-soft);
	border-radius: 12px; overflow: hidden;
}
.da-raised .is-style-da-card, .is-style-da-card.is-style-da-card { background: var(--wp--preset--color--paper); }
.is-style-da-card > .wp-block-image { margin: 0; }
.is-style-da-card > .wp-block-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.is-style-da-card > :not(.wp-block-image) { margin-left: 24px; margin-right: 24px; }
.is-style-da-card > :last-child { margin-bottom: 24px; }
.is-style-da-card > .wp-block-image + * { margin-top: 24px; }
.is-style-da-card > * + * { margin-block-start: 6px; }
.is-style-da-card .is-style-da-data { margin-top: 16px; }
.is-style-da-card:hover { border-color: var(--wp--preset--color--line-strong); }
/* Button: Text link */
.wp-block-button.is-style-da-link .wp-block-button__link {
	background: transparent; color: var(--wp--preset--color--blue); padding-left: 0; padding-right: 0;
}
.wp-block-button.is-style-da-link .wp-block-button__link:hover { text-decoration: underline; filter: none; }

/* ---------- Animal profile ---------- */
.da-facts { border-top: 1px solid var(--wp--preset--color--line-soft); }
.da-facts table { border-collapse: collapse; width: 100%; }
.da-facts td { border: 0; border-bottom: 1px solid var(--wp--preset--color--line-soft); padding: 12px 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.da-facts td:first-child { color: var(--wp--preset--color--ink-muted); }
.da-facts td:last-child { text-align: right; }
.da-epd { background: var(--wp--preset--color--paper); border: 1px solid var(--wp--preset--color--line-soft); border-radius: 12px; padding: 20px 20px 16px; margin: 0; }
.da-epd table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.da-epd th { border: 0; border-bottom: 1px solid var(--wp--preset--color--ink); text-align: left; font-size: 13px; font-weight: 500; color: var(--wp--preset--color--ink-muted); padding: 0 0 6px; }
.da-epd td { border: 0; padding: 8px 0 0; font-size: 22px; font-weight: 600; }
.da-epd tbody tr + tr td { font-size: 12px; font-weight: 400; color: var(--wp--preset--color--ink-muted); }
.da-epd figcaption { text-align: left; margin: 0 0 4px; font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--ink-muted); caption-side: top; }
.da-epd .wp-element-caption { order: -1; }
.da-epd { display: flex; flex-direction: column; }
.da-pedigree { border: 1px solid var(--wp--preset--color--line-soft); border-radius: 12px; overflow: hidden; background: var(--wp--preset--color--paper); }
.da-pedigree .wp-block-column { display: flex; flex-direction: column; margin: 0 !important; }
.da-pedigree .wp-block-column + .wp-block-column { border-left: 1px solid var(--wp--preset--color--line-soft); }
.da-pedigree .wp-block-column > p { flex: 1; margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--wp--preset--color--line-soft); display: flex; flex-direction: column; justify-content: center; }
.da-pedigree .wp-block-column > p:last-child { border-bottom: 0; }
.da-pedigree small { color: var(--wp--preset--color--ink-muted); font-size: 12px; }
@media (max-width: 781px) {
	.da-pedigree .wp-block-column + .wp-block-column { border-left: 0; border-top: 1px solid var(--wp--preset--color--line-soft); }
}
.da-header-inner, .da-footer-inner { padding-top: 12px; padding-bottom: 12px; }
.da-footer-inner { padding-top: 32px; padding-bottom: 48px; }
.da-page { padding-top: var(--wp--preset--spacing--80); padding-bottom: var(--wp--preset--spacing--90); }
.da-header .wp-block-site-logo, .da-footer .wp-block-site-logo { width: 28px; flex: 0 0 28px; }
.da-header .wp-block-site-logo img, .da-footer .wp-block-site-logo img { width: 28px !important; height: 28px !important; max-width: none; }
.da-pill { display: inline-block; background: var(--wp--preset--color--blue-tint); color: var(--wp--preset--color--ink); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 500; }
.da-facts.da-list td:last-child { text-align: left; color: var(--wp--preset--color--ink); }
.da-facts.da-list td:first-child { color: var(--wp--preset--color--ink); font-weight: 600; width: 40%; }
.da-portrait img { border-radius: 12px; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.wp-block-columns.da-pedigree { gap: 0 !important; }
/* Whole card is clickable: the card's own link (e.g. "View profile ›") stretches over the photo and text. */
.is-style-da-card { position: relative; }
.is-style-da-card a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.is-style-da-card:hover img { filter: brightness(1.06); }
.is-style-da-card:has(a:focus-visible) { outline: 2px solid var(--wp--preset--color--blue); outline-offset: 2px; }

/* ---------- v1.1: proof-first homepage ---------- */
.da-muted { color: var(--wp--preset--color--ink-muted); }
.da-status { display: inline-block; background: var(--wp--preset--color--blue-tint); color: var(--wp--preset--color--ink); border-radius: 999px; padding: 2px 10px; letter-spacing: 0; text-transform: none; font-weight: 500; }
.wp-block-button.is-style-da-outline .wp-block-button__link { background: transparent; color: var(--wp--preset--color--ink); border: 1px solid var(--wp--preset--color--line-strong); padding: 11px 23px; }
.wp-block-button.is-style-da-outline .wp-block-button__link:hover { border-color: var(--wp--preset--color--ink); filter: none; }
.da-hero { padding-top: var(--wp--preset--spacing--80); padding-bottom: 0; }
.da-hero-top { margin-bottom: var(--wp--preset--spacing--70); }
.da-hero .da-hero-img img { aspect-ratio: 21 / 9; }
.da-trust { background: var(--wp--preset--color--surface-raised); border-top: 1px solid var(--wp--preset--color--line-soft); border-bottom: 1px solid var(--wp--preset--color--line-soft); }
.da-trust-inner { gap: 8px 28px !important; padding: 16px 0; }
.da-trust-inner p { margin: 0; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.da-trust-inner p::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--wp--preset--color--blue); flex: none; }
.da-tight-bottom { padding-bottom: 0; }
.da-tight-top { padding-top: var(--wp--preset--spacing--70); }
.da-tight { padding-top: var(--wp--preset--spacing--70); padding-bottom: var(--wp--preset--spacing--70); }
.da-narrow > * { max-width: 680px; margin-left: auto !important; margin-right: auto !important; }
.da-avail { background: var(--wp--preset--color--paper); border: 1px solid var(--wp--preset--color--line-soft); border-radius: 18px; padding: 32px; }
.da-avail .wp-block-buttons { justify-content: flex-end; }
.da-photo-slot { border: 1px dashed var(--wp--preset--color--line-strong); border-radius: 18px; background: var(--wp--preset--color--surface-raised); aspect-ratio: 4 / 5; padding: 24px; color: var(--wp--preset--color--ink-muted); font-size: 14px; }
.da-thumbs .da-photo-slot { aspect-ratio: 3 / 2; border-radius: 10px; padding: 8px; font-size: 12px; }
.da-section > .da-photo-slot { aspect-ratio: 16 / 9; max-width: 760px; margin-top: 24px; }
.da-fact, .da-note { border-top: 1px solid var(--wp--preset--color--ink); padding-top: 12px; color: var(--wp--preset--color--ink-muted); font-size: 14px; }
.da-fact strong { display: block; font-size: 22px; line-height: 28px; font-weight: 600; color: var(--wp--preset--color--ink); margin-bottom: 4px; }
.da-note strong { display: block; color: var(--wp--preset--color--ink); font-size: 17px; margin-bottom: 6px; }
.da-facts figcaption { text-align: left; margin: 0 0 4px; font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--ink-muted); }
.da-raised .da-facts:has(figcaption) { background: var(--wp--preset--color--paper); border: 1px solid var(--wp--preset--color--line-soft); border-radius: 12px; padding: 16px 20px 4px; display: flex; flex-direction: column; }
.da-facts:has(figcaption) figcaption { order: -1; }
.da-facts:has(figcaption) tr:last-child td { border-bottom: 0; }
.da-updates .wp-block-post-featured-image { margin: 0; }
.da-updates .wp-block-post-featured-image img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.da-updates .wp-block-post-title { font-size: 20px; line-height: 26px; }
.da-updates .wp-block-post-title a { color: var(--wp--preset--color--ink); }
.wp-block-post-date.is-style-da-label { margin-top: 20px; }
@media (max-width: 781px) {
	.da-avail .wp-block-buttons { justify-content: flex-start; }
	.da-photo-slot { aspect-ratio: 4 / 3; }
	.da-hero .da-hero-img img { aspect-ratio: 4 / 3; }
}

/* ---------- Selection goals chart ---------- */
.da-goals { margin: 0 0 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--wp--preset--color--paper, var(--paper)); border: 1px solid var(--wp--preset--color--line-soft, var(--line-soft)); border-radius: 12px; padding: 4px 16px 12px; }
.da-goals table { min-width: 820px; width: 100%; border-collapse: separate; border-spacing: 3px; font-variant-numeric: tabular-nums; table-layout: fixed; }
.da-goals figcaption, .da-goals caption { caption-side: top; text-align: left; font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--ink-muted, var(--ink-muted)); margin: 12px 0 4px; padding: 0; }
.da-goals thead th { border: 0; border-bottom: 1px solid var(--wp--preset--color--ink, var(--ink)); font-size: 12px; font-weight: 500; color: var(--wp--preset--color--ink-muted, var(--ink-muted)); padding: 6px 4px; text-align: center; line-height: 1.25; }
.da-goals thead th:first-child, .da-goals thead th:last-child { text-align: left; }
.da-goals th:first-child, .da-goals td:first-child { width: 14%; }
.da-goals th:last-child, .da-goals td:last-child { width: 32%; }
.da-goals td { border: 0; padding: 10px 6px; text-align: center; font-size: 12px; line-height: 1.3; border-radius: 6px; vertical-align: middle; }
.da-goals td:first-child { text-align: left; font-size: 16px; padding-left: 0; }
.da-goals td:last-child { text-align: left; font-size: 13px; color: var(--wp--preset--color--ink-muted, var(--ink-muted)); padding-left: 12px; }
.da-goals td:not(:first-child):not(:last-child) { background: color-mix(in srgb, var(--wp--preset--color--line-soft, var(--line-soft)) 35%, transparent); }
.da-goals td > strong, .da-goals td > em, .da-goals td > code, .da-goals td > kbd, .da-goals td > s,
.da-legend strong, .da-legend em, .da-legend code, .da-legend kbd, .da-legend s { font: 600 11px/1.2 inherit; font-family: inherit; letter-spacing: .06em; text-transform: uppercase; font-style: normal; text-decoration: none; background: none; border: 0; padding: 0; }
.da-goals td:first-child > strong { font-size: 16px; letter-spacing: 0; text-transform: none; }
.da-goals td:has(> strong):not(:first-child) { background: var(--wp--preset--color--blue, var(--blue)) !important; color: var(--wp--preset--color--on-blue, var(--on-blue)); }
.da-goals td:has(> em) { background: var(--wp--preset--color--blue-tint, var(--blue-tint)) !important; color: var(--wp--preset--color--ink, var(--ink)); }
.da-goals td:has(> code) { background: transparent !important; box-shadow: inset 0 0 0 1px var(--wp--preset--color--line-strong, var(--line-strong)); color: var(--wp--preset--color--ink, var(--ink)); }
.da-goals td:has(> kbd) { background: transparent !important; outline: 1px dashed var(--wp--preset--color--line-strong, var(--line-strong)); outline-offset: -1px; color: var(--wp--preset--color--ink, var(--ink)); }
.da-goals td:has(> s) { background: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, var(--wp--preset--color--ink-muted, var(--ink-muted)) 30%, transparent) 5px 6px) !important; color: var(--wp--preset--color--ink-muted, var(--ink-muted)); }
.da-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 16px; padding: 0; list-style: none; font-size: 13px; color: var(--wp--preset--color--ink-muted, var(--ink-muted)); }
.da-legend li { display: flex; align-items: center; gap: 8px; }
.da-legend li > :first-child { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 26px; border-radius: 6px; padding: 0 8px; color: var(--wp--preset--color--ink, var(--ink)); }
.da-legend strong { background: var(--wp--preset--color--blue, var(--blue)) !important; color: var(--wp--preset--color--on-blue, var(--on-blue)) !important; }
.da-legend em { background: var(--wp--preset--color--blue-tint, var(--blue-tint)) !important; }
.da-legend code { box-shadow: inset 0 0 0 1px var(--wp--preset--color--line-strong, var(--line-strong)); }
.da-legend kbd { outline: 1px dashed var(--wp--preset--color--line-strong, var(--line-strong)); outline-offset: -1px; }
.da-legend s { background: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, var(--wp--preset--color--ink-muted, var(--ink-muted)) 30%, transparent) 5px 6px) !important; color: var(--wp--preset--color--ink-muted, var(--ink-muted)) !important; }
.da-scroll-hint { display: none; font-size: 12px; color: var(--wp--preset--color--ink-muted, var(--ink-muted)); }
@media (max-width: 860px) { .da-scroll-hint { display: block; } }
.da-goals { display: flex; flex-direction: column; }
.da-goals figcaption { order: -1; }
.da-goals thead { border: 0; }
.da-legend, .da-notes { padding-left: 0 !important; }
.da-legend li > :first-child { flex: none; }
.da-notes { list-style: none; margin: 8px 0 0; display: grid; gap: 8px; font-size: 14px; color: var(--wp--preset--color--ink-muted); }
.da-notes li { display: flex; gap: 10px; }
.da-notes li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--wp--preset--color--blue); flex: none; margin-top: 9px; }
p.da-scroll-hint { margin: 0 0 8px; }

/* ---------- v1.3: accessibility and privacy ---------- */
.screen-reader-text {
	border: 0; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden;
	padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
}
.skip-link.screen-reader-text:focus {
	clip-path: none; height: auto; width: auto; margin: 0; z-index: 100000;
	top: 8px; left: 8px; padding: 12px 20px; border-radius: 999px;
	background: var(--wp--preset--color--blue); color: var(--wp--preset--color--on-blue);
	font-weight: 500; text-decoration: none;
}
/* Links in running text are underlined so they don't depend on color alone (WCAG 1.4.1). */
:where(.wp-block-post-content, .da-footer) :where(p, li, td, figcaption) a:not(.wp-element-button),
.da-legal a {
	text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em;
}
.is-style-da-card a { text-decoration: none !important; }
.da-legal-links { width: 100%; }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
	.da-goals td:has(> strong), .da-goals td:has(> em), .da-legend li > :first-child { border: 1px solid CanvasText; }
	.wp-element-button { border: 1px solid ButtonText; }
}
/* Legal pages */
.da-legal h2 { margin-top: var(--wp--preset--spacing--70); }
.da-legal p, .da-legal li { color: var(--wp--preset--color--ink); }
.da-legal-list { padding-left: 1.2em; }
.da-legal-list li + li { margin-top: 8px; }
/* Click-to-load embeds */
.da-embed { margin: var(--wp--preset--spacing--50) 0; }
.da-embed-facade {
	display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px;
	min-height: 220px; aspect-ratio: 16 / 9; max-width: 760px; padding: 28px;
	border: 1px solid var(--wp--preset--color--line-soft); border-radius: 18px;
	background: var(--wp--preset--color--surface-raised);
}
.da-embed--tiktok .da-embed-facade, .da-embed--instagram .da-embed-facade { aspect-ratio: auto; max-width: 420px; min-height: 320px; }
.da-embed-title { margin: 0; font-size: 20px; font-weight: 600; }
.da-embed-note { margin: 0; font-size: 14px; color: var(--wp--preset--color--ink-muted); max-width: 46ch; }
.da-embed-loaded:focus { outline: none; }
