/*
 * Guide pages (template "Guide", body.gd-guide): live's mu-plugins/gd-guide/gd-guide.css (2026-10-05, owner-approved
 * ideas 2, 4, 6, 7, 8) ported to the block markup. Live's --gd-* names are kept and point at the theme tokens.
 * The box, table, FAQ and image styles are content classes in content.css (the editor shows them too); this file
 * has the guide layout, the guide body font and the UI the guide script (assets/js/guide.js) adds.
 */

body.gd-guide {
	--gd-brand: var(--wp--preset--color--brand);
	--gd-text: var(--wp--preset--color--body-text, #2B2420);
	--gd-muted: var(--wp--preset--color--muted);
	--gd-border: var(--wp--preset--color--line, #E6D8C8);
	--gd-soft: var(--wp--preset--color--surface-soft);
	--gd-surface: var(--wp--preset--color--surface);
	--gd-link: var(--wp--preset--color--action);
	--gd-link-h: var(--wp--preset--color--action-hover);
	--gd-shine: var(--wp--preset--color--shine);
	--gd-focus: var(--wp--custom--color--focus);
	--gd-ui: var(--wp--preset--font-family--source-sans);
}

/* Guide body text in Source Sans 3 (DS-OD-07: Elementor's text widgets in guides); headings and the FAQ keep Literata. */
.gd-guide .wp-block-post-content :is(p, ul, ol, dl, table):not(details *) { font-family: var(--gd-ui); }

/* ---------- 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: 0.06em; text-transform: uppercase; color: var(--gd-muted); margin: 0 0 16px; } /* 16px: live's kit paragraph spacing won over the 12px written here */
.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) {
	.gd-guide .wp-block-post-content { display: grid; grid-template-columns: 200px minmax(0, 720px); column-gap: 56px; justify-content: center; align-items: start; }
	.gd-guide .wp-block-post-content > .gdb-sec { grid-column: 2; padding-left: 0; padding-right: 0; }
	/* The introduction spans both columns so its sheen stays full width; its text aligns with the reading column */
	.gd-guide .wp-block-post-content { background: radial-gradient(120% 600px at 85% 0, color-mix(in srgb, var(--gd-shine) 16%, transparent), transparent 60%) no-repeat; }
	.gd-guide .wp-block-post-content > .gdb-sec-lead { grid-column: 1 / -1; grid-row: 1; background-image: none; padding-left: 256px; }
	.gd-guide .wp-block-post-content > .gd-toc { grid-column: 1; grid-row: 2 / span 40; align-self: stretch; padding-top: 48px; }
	.gd-guide .gd-toc__inner { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; }
	.gd-guide .gd-toc-m { display: none; }
}
@media (max-width: 1099px) {
	.gd-guide .wp-block-post-content > .gd-toc { display: none; }
}

/* Our small buttons must not take the theme's button look */
.gd-guide :is(button.gd-anchor, button.gd-pop__close) { background: none; border: 0; box-shadow: none; min-height: 0; text-transform: none; letter-spacing: 0; }

/* ---------- 7. Copy a link to a section (H2 only) ---------- */
.gdb-sec > .gd-h2wrap { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.4em; row-gap: var(--wp--preset--spacing--40); margin-bottom: var(--wp--preset--spacing--40); } /* row gap: the button wraps 16px below a long heading, as in the Elementor widget */
.gdb-sec > .gd-h2wrap > h2 { margin: 0; }
.gd-guide button.gd-anchor { flex: none; padding: 2px 6px; border-radius: 4px; color: var(--gd-muted); font: 600 16px/1 var(--gd-ui); cursor: pointer; opacity: 0; transition: opacity 0.15s ease; }
.gd-h2wrap:hover .gd-anchor, .gd-anchor:focus, .gd-anchor:focus-visible { opacity: 1; }
.gd-guide button.gd-anchor:hover { color: var(--gd-link); background: var(--gd-soft); }
.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 ---------- */
.gd-guide .wp-block-post-content sup a.gd-cite { text-decoration: none; border-radius: 3px; padding: 0 2px; }
.gd-guide .wp-block-post-content sup a.gd-cite:hover,
.gd-guide .wp-block-post-content 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 color-mix(in srgb, var(--wp--preset--color--brand-dark) 45%, transparent); 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-guide button.gd-pop__close { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; padding: 0; border-radius: 6px; color: var(--gd-muted); font: 400 24px/36px var(--gd-ui); text-align: center; cursor: pointer; }
.gd-guide button.gd-pop__close:hover { background: var(--gd-soft); color: var(--gd-brand); }
.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 16px; font: 14px/1.5 var(--gd-ui); color: var(--gd-muted); } /* bottom 16px: live's kit paragraph spacing */
.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); }

/* A sideways-scrolling table the script made focusable (owner P1): the site's focus ring. */
.gd-table-wrap[tabindex]:focus-visible { outline: 3px solid var(--gd-focus); outline-offset: 2px; }

/* 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: ""; box-sizing: border-box; width: 8px; height: 8px; border-right: 2px solid var(--gd-link); border-bottom: 2px solid var(--gd-link); transform: rotate(-45deg); transition: transform 0.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; } }

/* What the script inserts into a section sat in Elementor's flex column with its 16px gap on live; the block sections
   have no gap (block margins carry the spacing), so the gap is added to their own top margin. */
.gdb-sec > :is(.gd-toc-m, .gd-secsrc) { margin-top: calc(8px + var(--wp--preset--spacing--40)); } /* the source box replaces the label in place: its 8px stays */
.gd-toc a, .gd-toc-m a { text-decoration: none; }
