/* Grooming Dogs: long-form guide enhancements (owner-approved 2026-10-05; GD-04 pilot, rolled out to guides GD-01 to GD-17).
   Prototype ideas 2 (wider layout, fewer boxes), 4 (source previews), 6 (source back-links), 7 (section links),
   8 (reading information), 9 (footer). Colors come only from the kit (DS-OD-06) tokens; the decorative
   "shine" token is used for lines only, never for text. Loaded only on guide pages (gd-guide.php). The footer styles live in the global Additional CSS. */

body.gd-guide {
	--gd-brand: var(--e-global-color-primary, #3A2318);
	--gd-text: var(--e-global-color-text, #2B2420);
	--gd-muted: var(--e-global-color-secondary, #6B5E55);
	--gd-border: var(--e-global-color-gdborder, #E6D8C8);
	--gd-soft: var(--e-global-color-gdsurfs, #F7EFE4);
	--gd-surface: var(--e-global-color-gdsurf, #FFFCF7);
	--gd-link: var(--e-global-color-gdlink, #A84A24);
	--gd-link-h: var(--e-global-color-gdlinkh, #8A3A1A);
	--gd-warn: var(--e-global-color-gdwarn, #8A5A00);
	--gd-shine: var(--e-global-color-gdshine, #E3A33B);
	--gd-focus: var(--e-global-color-gdfocus, #A84A24);
	--gd-ui: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- 2. Fewer boxes ---------- */
/* Short answer and "what you'll need": a quiet band with a rule instead of a filled card */
body.gd-guide .elementor .e-con.gd-box--short,
body.gd-guide .elementor .e-con.gd-box--note {
	background: none !important;
	border: 0 !important;
	border-top: 2px solid var(--gd-shine) !important;
	border-radius: 0 !important;
	padding: 16px 0 4px !important;
}
body.gd-guide .elementor .e-con.gd-box--note {
	border-top: 1px solid var(--gd-border) !important;
	border-bottom: 1px solid var(--gd-border) !important;
	padding-bottom: 12px !important;
}
/* Caution notes keep their meaning (warning rule) but lose the fill */
body.gd-guide .elementor .e-con.gd-box--caution {
	background: none !important;
	border-radius: 0 !important;
	padding: 4px 0 4px 20px !important;
}
/* "Where to go next" + sources: no tinted band, a rule above instead */
body.gd-guide .elementor .e-con.gd-band {
	background: none !important;
	border-top: 1px solid var(--gd-border);
}

/* ---------- 2. Wider editorial layout (desktop): contents | reading column ---------- */
.gd-toc { font: 15px/1.35 var(--gd-ui); }
.gd-toc__label {
	font: 600 13px/1.2 var(--gd-ui);
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--gd-muted);
	margin: 0 0 12px;
}
.gd-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--gd-border); }
.gd-toc li { margin: 0; }
.gd-toc a {
	display: block;
	padding: 6px 0 6px 14px;
	margin-left: -1px;
	border-left: 2px solid transparent;
	color: var(--gd-muted);
	text-decoration: none;
}
.gd-toc a:hover { color: var(--gd-brand); text-decoration: underline; text-underline-offset: 3px; }
.gd-toc a[aria-current="location"] { color: var(--gd-brand); font-weight: 600; border-left-color: var(--gd-shine); }

/* Mobile/tablet: the same list, collapsed, under the introduction */
.gd-toc-m { margin: 8px 0 0; border-top: 1px solid var(--gd-border); border-bottom: 1px solid var(--gd-border); font: 16px/1.4 var(--gd-ui); }
.gd-toc-m summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--gd-brand); }
.gd-toc-m ol { margin: 0 0 12px; padding-left: 1.3em; }
.gd-toc-m li { margin: 0 0 6px; }

@media (min-width: 1100px) {
	body.gd-guide .elementor[data-elementor-type="wp-page"] {
		display: grid;
		grid-template-columns: 200px minmax(0, 720px);
		column-gap: 56px;
		justify-content: center;
		align-items: start;
	}
	body.gd-guide .elementor[data-elementor-type="wp-page"] > .e-con { grid-column: 2; padding-left: 0 !important; padding-right: 0 !important; }
	body.gd-guide .elementor[data-elementor-type="wp-page"] > .e-con > .e-con-inner { max-width: 100%; }
	/* The introduction spans both columns so its sheen stays full width; its text aligns with the reading column */
	body.gd-guide .elementor[data-elementor-type="wp-page"] { background: radial-gradient(120% 600px at 85% 0, rgba(227, 163, 59, .16), transparent 60%) no-repeat; }
	body.gd-guide .elementor[data-elementor-type="wp-page"] > .e-con:first-child { grid-column: 1 / -1; grid-row: 1; background-image: none !important; }
	body.gd-guide .elementor[data-elementor-type="wp-page"] > .e-con:first-child > .e-con-inner { max-width: 976px; padding-left: 256px; }
	body.gd-guide .elementor[data-elementor-type="wp-page"] > .gd-toc { grid-column: 1; grid-row: 2 / span 40; align-self: stretch; padding-top: 48px; }
	body.gd-guide .gd-toc__inner { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; }
	body.gd-guide .gd-toc-m { display: none; }
}
@media (max-width: 1099px) {
	body.gd-guide .elementor[data-elementor-type="wp-page"] > .gd-toc { display: none; }
}

/* Related-guide cards: 2 × 2 in the reading column */
@media (min-width: 768px) {
	body.gd-guide .elementor .e-con.gd-band .e-con:has(> .e-con) { flex-wrap: wrap; }
	body.gd-guide .elementor .e-con.gd-band .e-con:has(> .e-con) > .e-con { flex: 1 1 calc(50% - 16px) !important; max-width: calc(50% - 8px); }
}

/* Our small buttons must not inherit the kit's primary-button look */
body.gd-guide button.gd-anchor,
body.gd-guide button.gd-pop__close {
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	min-height: 0 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
}

/* ---------- 7. Copy a link to a section (H2 only) ---------- */
.gd-h2wrap { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .4em; }
.gd-anchor {
	flex: none;
	padding: 2px 6px !important;
	border: 0;
	border-radius: 4px;
	color: var(--gd-muted) !important;
	font: 600 16px/1 var(--gd-ui) !important;
	cursor: pointer;
	opacity: 0;
	transition: opacity .15s ease;
}
.gd-h2wrap:hover .gd-anchor,
.gd-anchor:focus,
.gd-anchor:focus-visible { opacity: 1; }
body.gd-guide button.gd-anchor:hover { color: var(--gd-link) !important; background: var(--gd-soft) !important; }
.gd-anchor:focus-visible { outline: 3px solid var(--gd-focus); outline-offset: 2px; }

/* ---------- 8. Reading information: quiet metadata in the byline ---------- */
.gd-readinfo a { color: inherit; }

/* ---------- 4. Source markers and preview ---------- */
body.gd-guide .elementor[data-elementor-type="wp-page"] sup a.gd-cite {
	text-decoration: none;
	border-radius: 3px;
	padding: 0 2px;
}
body.gd-guide .elementor[data-elementor-type="wp-page"] sup a.gd-cite:hover,
body.gd-guide .elementor[data-elementor-type="wp-page"] sup a.gd-cite[aria-expanded="true"] { background: var(--gd-soft); text-decoration: underline; }
.gd-cite.is-flash { background: var(--gd-soft); box-shadow: 0 0 0 3px var(--gd-shine); }

.gd-pop {
	position: absolute;
	z-index: 50;
	display: block;
	width: min(360px, calc(100vw - 32px));
	padding: 14px 44px 12px 16px;
	background: var(--gd-surface);
	color: var(--gd-text);
	border: 1px solid var(--gd-border);
	border-radius: 8px;
	box-shadow: 0 16px 36px -18px rgba(40, 23, 15, .45);
	font: 15px/1.5 var(--gd-ui);
	text-align: left;
	white-space: normal;
}
.gd-pop[hidden] { display: none; }
.gd-pop__text { display: block; overflow-wrap: anywhere; }
.gd-pop__text a { color: var(--gd-link); }
.gd-pop__actions { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-weight: 600; }
.gd-pop__actions a { color: var(--gd-link); }
.gd-pop__close {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 36px;
	height: 36px;
	padding: 0 !important;
	border-radius: 6px !important;
	color: var(--gd-muted) !important;
	font: 400 24px/36px var(--gd-ui) !important;
	text-align: center;
	cursor: pointer;
}
body.gd-guide button.gd-pop__close:hover { background: var(--gd-soft) !important; color: var(--gd-brand) !important; }
.gd-pop a:focus-visible, .gd-pop__close:focus-visible { outline: 3px solid var(--gd-focus); outline-offset: 2px; }

/* Section source line (end of each section) */
.gd-secsrc { margin: 8px 0 0; font: 14px/1.5 var(--gd-ui); color: var(--gd-muted); }
.gd-secsrc a { color: var(--gd-muted); text-decoration: underline; text-underline-offset: 2px; }
.gd-secsrc a:hover { color: var(--gd-link-h); }

/* ---------- 6. Sources list: where each source is cited ---------- */
.gd-cited { display: block; margin-top: 4px; font: 14px/1.5 var(--gd-ui); color: var(--gd-muted); }
.gd-cited a { color: var(--gd-link); }
body.gd-guide .gd-sources li { scroll-margin-top: 24px; }
body.gd-guide .gd-sources li:target { background: var(--gd-soft); border-radius: 4px; box-shadow: 0 0 0 6px var(--gd-soft); }

/* Live status for copy confirmations */
.gd-status {
	position: fixed;
	left: 50%;
	bottom: calc(20px + env(safe-area-inset-bottom, 0px));
	transform: translateX(-50%);
	z-index: 60;
	padding: 10px 16px;
	border-radius: 6px;
	background: var(--gd-brand);
	color: var(--gd-surface);
	font: 600 14px/1.3 var(--gd-ui);
}
.gd-status:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
	.gd-anchor { transition: none; }
}

/* ---------- Sources list: collapsible (owner decision 2026-10-06) ---------- */
.gd-srcbox { margin: 8px 0 0; border-top: 1px solid var(--gd-border); border-bottom: 1px solid var(--gd-border); }
.gd-srcbox > summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 0;
	color: var(--gd-brand);
	font: 600 16px/1.3 var(--gd-ui);
}
.gd-srcbox > summary::-webkit-details-marker { display: none; }
.gd-srcbox > summary::before {
	content: "";
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--gd-link);
	border-bottom: 2px solid var(--gd-link);
	transform: rotate(-45deg);
	transition: transform .15s ease;
	flex: none;
}
.gd-srcbox[open] > summary::before { transform: rotate(45deg); }
.gd-srcbox > summary:hover { color: var(--gd-link-h); }
.gd-srcbox > summary:focus-visible { outline: 3px solid var(--gd-focus); outline-offset: 2px; }
.gd-srcbox__body { padding: 0 0 12px; }
@media (prefers-reduced-motion: reduce) { .gd-srcbox > summary::before { transition: none; } }
