/*
 * Exam prep section on license guides: plan cards, [lp_buy] output, the book list and its summary.
 * Markup is core blocks only (see prep-section-spec.md). WordPress renders a Group as
 * <div class="wp-block-group ..."> and may add layout classes, so nothing here depends on exact class
 * strings or on direct-child structure; the few grid containers also flatten an inner wrapper if one appears.
 */

/* If a Group ever renders an inner wrapper, let it drop out of the layout. */
.lp-tpl .lp-plans > .wp-block-group__inner-container,
.lp-tpl .lp-plan > .wp-block-group__inner-container,
.lp-tpl .lp-bk-pick > .wp-block-group__inner-container,
.lp-tpl .lp-bk-row > .wp-block-group__inner-container,
.lp-tpl .lp-bk-cover > .wp-block-group__inner-container,
.lp-tpl .lp-bk-main > .wp-block-group__inner-container { display: contents; }

/* ---------- Plan cards ---------- */
.lp-tpl .lp-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(235px, 100%), 1fr)); gap: 16px; align-items: stretch; margin-top: 6px; }
/* On wide screens the bundle card is a little wider than the others (Matt, 2026-11-16). */
@media (min-width: 1240px) {
	.lp-tpl .lp-plans:has(.lp-plan-bundle):has(.lp-plan-total) { grid-template-columns: 1.22fr 1fr 1fr; }
	.lp-tpl .lp-plans:has(.lp-plan-bundle):not(:has(.lp-plan-total)) { grid-template-columns: 1.22fr 1fr; }
	/* The two narrower cards take a slightly smaller title so "Exam Prep Course" stays on one line. */
	.lp-tpl .lp-plans:has(.lp-plan-bundle):has(.lp-plan-total) .lp-plan:not(.lp-plan-bundle) h3 { font-size: 20px; }
}
.lp-tpl .lp-plan { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 0 22px 22px; border: 1px solid var(--lp-line); border-radius: 16px; background: var(--lp-cream); overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.lp-tpl .lp-plan:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(26, 38, 32, 0.45); }
.lp-tpl .lp-plan::before { content: ""; display: block; flex: none; height: 138px; margin: 0 -22px 8px; background: var(--lp-sand) center / auto 104px no-repeat; border-bottom: 1px solid var(--lp-line); }
.lp-tpl .lp-plan-course::before { background-image: url(plans/course.svg); }
.lp-tpl .lp-plan-total::before { background-image: url(plans/total.svg); background-color: var(--lp-leaf-soft); }
.lp-tpl .lp-plan-bundle::before { background-image: url(plans/bundle.svg); background-color: var(--lp-forest-2); border-bottom-color: transparent; }
.lp-tpl .lp-plan p, .lp-tpl .lp-plan h3 { margin: 0; }
.lp-tpl .lp-plan-label { font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lp-leaf); }
.lp-tpl .lp-plan h3 { font-size: 23px; }
.lp-tpl .lp-plan h3 a { color: inherit; text-decoration: none; }
.lp-tpl .lp-plan h3 a::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 138px; }
.lp-tpl .lp-plan h3 a:hover { text-decoration: underline; }
.lp-tpl .lp-plan-sub { font-size: 15.5px; line-height: 1.5; }
.lp-tpl .lp-plan-plus { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--lp-line); font-size: 14px; font-weight: 700; color: var(--lp-ink); }
.lp-tpl .lp-plan .lp-plan-list { list-style: none; margin: 0; padding: 0 !important; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.45; }
.lp-tpl .lp-plan-list li { position: relative; padding-left: 28px; }
.lp-tpl .lp-plan-list li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--lp-leaf) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='m5 9.300 2.700 2.700L13 6.500' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; }

/* The fullest plan is the dark card with the gold border. */
.lp-tpl .lp-plan-bundle { background: var(--lp-forest); border: 2px solid var(--lp-honey); padding: 0 21px 21px; color: #DCE5DC; box-shadow: 0 16px 32px -22px rgba(200, 144, 30, 0.9); }
.lp-tpl .lp-plan-bundle::before { margin: 0 -21px 8px; }
.lp-tpl .lp-plan-bundle h3, .lp-tpl .lp-plan-bundle .lp-plan-plus, .lp-tpl .lp-plan-bundle strong { color: #FFFFFF; }
.lp-tpl .lp-plan-bundle .lp-plan-label { color: #F3D497; }
.lp-tpl .lp-plan-bundle .lp-plan-plus { border-top-color: rgba(255, 255, 255, 0.18); }
.lp-tpl .lp-plan-bundle .lp-plan-list li::before { background-color: var(--lp-honey); }
.lp-tpl .lp-plan-bundle a { color: #FFFFFF; }

/* "See all N books": jumps to the guide's book list under the plans. */
.lp-tpl .lp-plan-more { font-size: 14.5px; font-weight: 700; }
.lp-tpl .lp-plan-more a { text-decoration: none; }
.lp-tpl .lp-plan-more a::after { content: " \2193"; }
.lp-tpl .lp-plan-more a:hover { text-decoration: underline; }
.lp-tpl .lp-plan-bundle .lp-plan-more a { color: #F3D497; }

/* License select on the bundle card (made by lp-prep.js). */
.lp-tpl .lp-plan-pick { margin: 6px 0 0; }
.lp-tpl .lp-plan-pick label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; }
.lp-tpl .lp-plan-pick select { width: 100%; max-width: 100%; padding: 10px 34px 10px 12px; border: 1.5px solid var(--lp-line); border-radius: 10px; background: var(--lp-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='m1 1.500 5 5 5-5' stroke='%231F3A2B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 12px no-repeat; color: var(--lp-ink); font: inherit; font-size: 15px; font-weight: 600; appearance: none; cursor: pointer; }
.lp-tpl .lp-plan-pick select:focus-visible { outline: 3px solid var(--lp-honey); outline-offset: 2px; }
.lp-tpl .lp-plan-bundle .lp-plan-pick { color: #F3D497; }

/* ---------- [lp_buy] output ---------- */
.lp-tpl .lp-buy { margin: 0; min-width: 0; }
.lp-tpl .lp-buy-price { display: block; margin: 0; font-size: 14px; color: var(--lp-muted); }
.lp-tpl .lp-buy-price strong, .lp-tpl .lp-buy-price .amount { font-family: var(--wp--preset--font-family--merriweather, Merriweather, serif); font-size: 24px; font-weight: 700; line-height: 1.1; color: var(--lp-ink); }
.lp-tpl .lp-buy .lp-price-soon { display: block; font-size: 14px; color: var(--lp-muted); }
.lp-tpl .lp-buy .lp-buy-btn, .lp-tpl .lp-buy .lp-coming-soon { display: inline-block; box-sizing: border-box; margin: 0; border: 0; border-radius: 10px; background: var(--lp-forest); color: #FFFFFF; font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.3; text-align: center; text-decoration: none; cursor: pointer; }
.lp-tpl .lp-buy .lp-buy-btn { padding: 12px 18px; }
.lp-tpl .lp-buy .lp-buy-btn:hover { background: var(--lp-forest-2); color: #FFFFFF; }
.lp-tpl .lp-buy .lp-buy-btn:focus-visible { outline: 3px solid var(--lp-honey); outline-offset: 2px; }
.lp-tpl .lp-buy .lp-coming-soon { padding: 12px 18px; opacity: 0.6; cursor: not-allowed; pointer-events: none; }

/* In a plan card: price on its own line, then a full-width button. */
.lp-tpl .lp-plan .lp-buy { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 14px; }
.lp-tpl .lp-plan .lp-buy .lp-buy-btn, .lp-tpl .lp-plan .lp-buy .lp-coming-soon { display: block; width: 100%; }
.lp-tpl .lp-plan-bundle .lp-buy-price, .lp-tpl .lp-plan-bundle .lp-buy .lp-price-soon { color: #B9C8BC; }
.lp-tpl .lp-plan-bundle .lp-buy-price strong, .lp-tpl .lp-plan-bundle .lp-buy-price .amount { color: #FFFFFF; }
.lp-tpl .lp-plan-bundle .lp-buy .lp-buy-btn, .lp-tpl .lp-plan-bundle .lp-buy .lp-coming-soon { background: var(--lp-honey); color: #1A1406; }
.lp-tpl .lp-plan-bundle .lp-buy .lp-buy-btn:hover { background: #DBA63A; color: #1A1406; }

/* In a book row: right-aligned, compact; the "Price coming soon" text is hidden, only the small button stays. */
.lp-tpl .lp-bk-row .lp-buy { justify-self: end; text-align: right; }
.lp-tpl .lp-bk-row .lp-buy .lp-price-soon { display: none; }
.lp-tpl .lp-bk-row .lp-buy-price { font-size: 13px; line-height: 1.2; margin-bottom: 4px; }
.lp-tpl .lp-bk-row .lp-buy-price strong, .lp-tpl .lp-bk-row .lp-buy-price .amount { font-size: 17px; }
.lp-tpl .lp-bk-row .lp-buy .lp-buy-btn, .lp-tpl .lp-bk-row .lp-buy .lp-coming-soon { padding: 8px 16px; font-size: 14px; white-space: nowrap; }

/* In the summary: full-width, gold add-all, dark bundle button. */
.lp-tpl .lp-bk-summary .lp-buy { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.lp-tpl .lp-bk-summary .lp-buy .lp-buy-btn, .lp-tpl .lp-bk-summary .lp-buy .lp-coming-soon { display: block; width: 100%; padding: 12px 14px; }
.lp-tpl .lp-bk-summary .lp-bk-sum-add .lp-coming-soon { display: block; width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 10px; background: var(--lp-honey); color: #1A1406; font-size: 15px; font-weight: 700; text-align: center; opacity: 0.6; }

/* ---------- Books for this exam ---------- */
.lp-tpl #exam-books { scroll-margin-top: 70px; }
/* The exam list is raw material for the script: hidden on the front end, a normal list in the editor. */
body:not(.wp-admin):not(.editor-styles-wrapper) .lp-tpl .lp-bk-classes { display: none; }

/* Stand-in covers until there are product photos: the short name (IBC, OSHA) or a symbol for its kind, with the year. */
.lp-tpl .lp-bk-cover { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; box-sizing: border-box; width: 54px; height: 70px; padding: 4px 4px 4px 8px; border-radius: 3px 6px 6px 3px; background: var(--lp-forest); box-shadow: inset 5px 0 0 rgba(255, 255, 255, 0.16), 0 3px 7px -3px rgba(26, 38, 32, 0.55); color: #FFFFFF; text-align: center; overflow: hidden; }
.lp-tpl .lp-bk-cover p { margin: 0; padding: 0; color: #FFFFFF; }
.lp-tpl .lp-bk-kind-standard { background: #4A5A66; }
.lp-tpl .lp-bk-kind-guide { background: var(--lp-honey); }
.lp-tpl .lp-bk-kind-law { background: #7A4B2B; }
.lp-tpl .lp-bk-kind-book { background: var(--lp-leaf); }
.lp-tpl .lp-bk-abbr { font-family: var(--wp--preset--font-family--merriweather, Merriweather, serif); font-size: 15px; font-weight: 700; line-height: 1; letter-spacing: 0.02em; }
.lp-tpl .lp-bk-abbr-sm { font-size: 11px; }
.lp-tpl .lp-bk-yr { font-size: 10px; font-weight: 700; line-height: 1; opacity: 0.85; }
/* No short name: a symbol for the kind of book. */
.lp-tpl .lp-bk-symbol::before { content: ""; flex: none; width: 26px; height: 26px; background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.700' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6.500C10 5 7 4.500 3.500 5v13c3.500-.5 6.500 0 8.500 1.500 2-1.500 5-2 8.500-1.500V5C17 4.500 14 5 12 6.500zm0 0V19.500'/%3E%3C/svg%3E"); }
.lp-tpl .lp-bk-symbol.lp-bk-kind-guide::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.700' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='4.500' width='14' height='16' rx='2'/%3E%3Cpath d='M9 4.500V3h6v1.500M8.500 11l2 2 3.500-4M8.500 16.500h7'/%3E%3C/svg%3E"); }
.lp-tpl .lp-bk-symbol.lp-bk-kind-law::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.700' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v16M7 20h10M5 7.500h14M5 7.500 2.500 13.500a2.800 2.800 0 0 0 5 0zm14 0-2.500 6a2.800 2.800 0 0 0 5 0z'/%3E%3C/svg%3E"); }

.lp-tpl .lp-bk-title { margin: 0; font-weight: 700; color: var(--lp-ink); line-height: 1.35; overflow-wrap: anywhere; }
.lp-tpl .lp-bk-title a { color: inherit; text-decoration: none; }
.lp-tpl .lp-bk-title a:hover { color: var(--lp-leaf); text-decoration: underline; }
.lp-tpl .lp-bk-meta { margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--lp-muted); }

/* Pills: yes/no facts about a book only. */
.lp-tpl .lp-bk-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 3px 0 2px; }
.lp-tpl .lp-pill { display: inline-block; margin: 0; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.5; }
.lp-tpl .lp-pill-ok { background: var(--lp-leaf-soft); color: #23552F; }
.lp-tpl .lp-pill-note { background: var(--lp-sand); color: var(--lp-body); }
.lp-tpl .lp-pill-warn { background: var(--lp-honey-soft); color: #7A5200; }

/* "How it's used on this exam". */
.lp-tpl .lp-bk-use { padding: 0; border: 0; background: transparent; font-size: 14px; }
.lp-tpl .lp-bk-use summary { padding: 0; cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--lp-leaf); }
.lp-tpl .lp-bk-use[open] { margin-top: 4px; padding: 12px 14px; border-radius: 10px; background: var(--lp-cream); }
.lp-tpl .lp-bk-use ul { margin: 8px 0 0; padding-left: 18px !important; display: flex; flex-direction: column; gap: 5px; line-height: 1.5; }
.lp-tpl .lp-bk-use p { margin: 8px 0 0; }

/* The list: one row per book. */
.lp-tpl .lp-bk-list { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--lp-line); border-radius: 14px; background: var(--lp-white); overflow: hidden; }
.lp-tpl .lp-bk-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 14px 16px; }
.lp-tpl .lp-bk-row[hidden] { display: none; }
.lp-tpl .lp-bk-row:not([hidden]) ~ .lp-bk-row:not([hidden]) { border-top: 1px solid var(--lp-line); }
.lp-tpl .lp-bk-row:hover { background: #FDFCF8; }
.lp-tpl .lp-bk-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lp-tpl .lp-bk-old .lp-bk-cover { opacity: 0.75; }

/* Older references, tucked away. */
.lp-tpl .lp-bk-older { padding: 14px 16px; border: 1px dashed var(--lp-line); border-radius: 14px; background: transparent; }
.lp-tpl .lp-bk-older[hidden] { display: none; }
.lp-tpl .lp-bk-older > summary { cursor: pointer; font-weight: 700; color: var(--lp-ink); }
.lp-tpl .lp-bk-older .lp-note { margin: 8px 0 12px; }

/* Pick your class (chips are made by lp-prep.js). */
.lp-tpl .lp-bk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-tpl .lp-bk-chip { max-width: 100%; padding: 9px 14px; border: 1.5px solid var(--lp-line); border-radius: 10px; background: var(--lp-white); color: var(--lp-body); font: inherit; font-size: 14.5px; line-height: 1.3; text-align: left; cursor: pointer; }
.lp-tpl .lp-bk-chip:hover { border-color: var(--lp-leaf); }
.lp-tpl .lp-bk-chip:focus-visible { outline: 3px solid var(--lp-honey); outline-offset: 2px; }
.lp-tpl .lp-bk-chip[aria-pressed="true"] { border-color: var(--lp-forest); background: var(--lp-forest); color: #FFFFFF; font-weight: 700; }

/* List plus the summary beside it. */
.lp-tpl .lp-bk-pick { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 16px; align-items: start; }
.lp-tpl .lp-bk-summary { position: sticky; top: calc(var(--lp-sticky-top, 50px) + 20px); display: flex; flex-direction: column; gap: 8px; min-width: 0; box-sizing: border-box; padding: 18px; border: 1px solid #C7DCC4; border-radius: 14px; background: var(--lp-leaf-soft); }
.lp-tpl .lp-bk-summary p { margin: 0; }
.lp-tpl .lp-bk-summary .lp-plan-label { font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lp-leaf); }
.lp-tpl .lp-bk-sum-count { font-size: 15px; line-height: 1.4; }
.lp-tpl .lp-bk-sum-total[hidden] { display: none; }
.lp-tpl .lp-bk-sum-total { color: var(--lp-muted); font-size: 14px; }
.lp-tpl .lp-bk-sum-total strong { font-family: var(--wp--preset--font-family--merriweather, Merriweather, serif); font-size: 30px; line-height: 1.1; color: var(--lp-ink); }
.lp-tpl .lp-bk-or { margin-top: 6px !important; padding-top: 14px; border-top: 1px solid #C7DCC4; font-size: 14.5px; font-weight: 700; line-height: 1.45; }
.lp-tpl .lp-bk-summary .lp-bk-or ~ .lp-buy .lp-buy-btn, .lp-tpl .lp-bk-summary .lp-bk-or ~ .lp-buy .lp-coming-soon { background: var(--lp-forest); color: #FFFFFF; }
.lp-tpl .lp-bk-summary .lp-bk-or ~ .lp-buy .lp-buy-btn:hover { background: var(--lp-forest-2); color: #FFFFFF; }

@media (max-width: 781px) {
	.lp-tpl .lp-bk-row { grid-template-columns: 54px minmax(0, 1fr); padding: 14px 12px; }
	.lp-tpl .lp-bk-row .lp-buy { grid-column: 2; justify-self: start; text-align: left; }
	.lp-tpl .lp-bk-pick { grid-template-columns: minmax(0, 1fr); }
	.lp-tpl .lp-bk-summary { position: static; }
	.lp-tpl .lp-plan { padding: 0 18px 20px; }
	.lp-tpl .lp-plan::before { margin: 0 -18px 8px; }
	.lp-tpl .lp-plan-bundle { padding: 0 17px 19px; }
	.lp-tpl .lp-plan-bundle::before { margin: 0 -17px 8px; }
}
