/* ESUO Article Format v1. Only imported educational posts; no theme-wide resets. */
body.esuo-educational-material .entry-content,
body.esuo-educational-material .entry-content :is(.rov-lesson,.sg-work){min-width:0;max-width:100%;overflow-wrap:break-word}
body.esuo-educational-material .entry-content :is(.rov-lesson,.sg-work){font-size:16px;line-height:1.72;color:#243b4a}
body.esuo-educational-material .entry-content :is(.rov-lesson,.sg-work) :is(p,ul,ol){margin:0 0 20px}
body.esuo-educational-material .entry-content :is(.rov-lesson,.sg-work) :is(h2,h3,h4){color:#153e62;line-height:1.32;margin:34px 0 14px;scroll-margin-top:90px}
body.esuo-educational-material .entry-content :is(.rov-lesson,.sg-work) h2{font-size:clamp(22px,2.3vw,28px)}
body.esuo-educational-material .entry-content :is(.rov-lesson,.sg-work) h3{font-size:clamp(18px,1.8vw,22px)}
body.esuo-educational-material .entry-content :is(.rov-lesson,.sg-work) a{color:#14689e;text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere}
body.esuo-educational-material .entry-content :is(.rov-lesson,.sg-work) img{display:block;max-width:100%;height:auto;border-radius:12px}
body.esuo-educational-material .entry-content :is(.rov-lesson,.sg-work) :is(video,iframe,object,embed){display:block;max-width:100%;width:100%;height:auto;aspect-ratio:16/9}
body.esuo-educational-material .entry-content :is(.rov-lesson,.sg-work) iframe{border:0;border-radius:10px}
body.esuo-educational-material .entry-content :is(.rov-lesson,.sg-work) table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;margin:20px 0 26px}
body.esuo-educational-material .entry-content :is(.rov-lesson,.sg-work) th,
body.esuo-educational-material .entry-content :is(.rov-lesson,.sg-work) td{border:1px solid #d8e6f0;padding:11px 13px;text-align:left;vertical-align:top}
body.esuo-educational-material .entry-content :is(.rov-lesson,.sg-work) th{background:#eff5fa}
body.esuo-educational-material .entry-content :is(.rov-lesson,.sg-work) ul{padding-left:25px}

/* Lesson covers: Kadence already displays the post's featured image above the text. */
/* v1.2: never suppress the inline lesson cover merely because a featured image exists. */
body.esuo-featured-cover-duplicate .entry-content .rov-lesson img.rov-cover{display:block!important}

/* Imported lesson hero and navigation. */
body.esuo-educational-material .entry-content .rov-lesson .rov-hero{background:#f6f9fc;border:1px solid #dbe7ef;border-left:5px solid #2b75ae;border-radius:14px;padding:24px;margin:0 0 26px}
body.esuo-educational-material .entry-content .rov-lesson .rov-kicker{display:block;font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#2b6796;margin-bottom:9px}
body.esuo-educational-material .entry-content .rov-lesson .rov-topic{font-size:clamp(22px,2.5vw,29px);font-weight:750;color:#173d62;line-height:1.3;margin:7px 0 17px}
body.esuo-educational-material .entry-content .rov-lesson .rov-tags,
body.esuo-educational-material .entry-content .rov-lesson :is(.rov-nav,.rov-grade-nav){display:flex;flex-wrap:wrap;gap:9px;margin:15px 0 23px;align-items:center}
body.esuo-educational-material .entry-content .rov-lesson .rov-tags span,
body.esuo-educational-material .entry-content .rov-lesson :is(.rov-nav,.rov-grade-nav) :is(a,strong){display:inline-flex;align-items:center;background:#eff5fa;border:1px solid #dce7f0;padding:8px 12px;border-radius:8px;text-decoration:none;font-weight:650;font-size:13px;color:#265575}
body.esuo-educational-material .entry-content .rov-lesson .rov-quick{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:20px 0}
body.esuo-educational-material .entry-content .rov-lesson .rov-quick a{display:block;background:#f2f7fb;border:1px solid #dae7f2;border-radius:12px;padding:16px;text-decoration:none;font-weight:700}
body.esuo-educational-material .entry-content .rov-lesson .rov-quick small{display:block;color:#607689;font-size:13px;font-weight:400;margin-top:4px}
body.esuo-educational-material .entry-content .rov-lesson .rov-archive{display:block;border-radius:10px;background:#173d62;color:white;padding:16px 20px;text-decoration:none;font-weight:700;margin:18px 0}
body.esuo-educational-material .entry-content .rov-lesson :is(.rov-note,.rov-source){background:#fffbec;border-left:4px solid #d7a03c;border-radius:0 9px 9px 0;padding:15px 17px;margin:20px 0}

/* Document lists: readable cards and prominent links instead of a run-on line. */
body.esuo-educational-material .entry-content .rov-lesson .rov-resource{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:14px;min-width:0;background:#fff;border:1px solid #dbe7f0;padding:16px 18px;margin:0 0 12px;border-radius:13px;box-shadow:0 3px 10px rgba(13,56,89,.035)}
body.esuo-educational-material .entry-content .rov-lesson .rov-resource-name{font-size:17px;font-weight:700;line-height:1.45;flex:1 1 220px;min-width:0}
body.esuo-educational-material .entry-content .rov-lesson .rov-file-links{display:flex;flex:0 1 auto;gap:8px;flex-wrap:wrap;min-width:0;max-width:100%;align-items:center}
body.esuo-educational-material .entry-content .rov-lesson a.rov-file{display:inline-flex;flex-direction:column;justify-content:center;gap:3px;background:#e8f3fa;border:1px solid #c5dfef;border-radius:9px;padding:10px 13px;color:#155b8e;font-size:14px;font-weight:700;text-decoration:none;line-height:1.35}
body.esuo-educational-material .entry-content .rov-lesson .rov-file small{font-size:12px;font-weight:400;color:#536a7d;line-height:1.4}
body.esuo-educational-material .entry-content .rov-lesson .rov-video{background:#f7fafc;border:1px solid #deebf3;padding:18px;border-radius:13px;margin:22px 0}
body.esuo-educational-material .entry-content .rov-lesson .rov-video :is(h3,p){margin-top:0}
body.esuo-educational-material .entry-content .rov-lesson details{border:1px solid #dbe7f0;border-radius:9px;margin:11px 0;padding:14px 16px}
body.esuo-educational-material .entry-content .rov-lesson summary{font-weight:700;cursor:pointer}
body.esuo-educational-material .entry-content .rov-lesson details p{margin:12px 0 0}
body.esuo-educational-material .entry-content .esuo-media-notice{background:#f0f6fb;border-radius:11px;padding:14px 16px;margin:12px 0 16px}
body.esuo-educational-material .entry-content a.esuo-media-button{display:inline-block;color:#fff;background:#1d6599;padding:10px 16px;border-radius:8px;text-decoration:none;font-weight:700}

/* Generic imported StatGrad blocks (classes vary across articles). */
body.esuo-educational-material .entry-content .sg-work :is(.sg-hero,.sg-intro,.sg-note){background:#eff6fb;border:1px solid #dceaf3;border-radius:13px;padding:18px 22px;margin:16px 0 24px}
body.esuo-educational-material .entry-content .sg-work :is(.sg-quick,.sg-nav,.sg-links){display:flex;gap:10px;flex-wrap:wrap;margin:16px 0 24px}
body.esuo-educational-material .entry-content .sg-work :is(.sg-quick,.sg-nav,.sg-links) a{border:1px solid #cfdfec;background:#eff6fb;border-radius:8px;padding:9px 13px;text-decoration:none}
body.esuo-educational-material .entry-content .sg-work :is(.sg-card,.sg-resource,.sg-file){border:1px solid #dce7f0;border-radius:12px;padding:16px 20px;margin:14px 0;background:#fff}

@media(max-width:720px){
body.esuo-educational-material .entry-content .rov-lesson .rov-quick{grid-template-columns:1fr}
body.esuo-educational-material .entry-content .rov-lesson .rov-resource{display:block}
body.esuo-educational-material .entry-content .rov-lesson .rov-resource-name{margin-bottom:12px}
body.esuo-educational-material .entry-content .rov-lesson .rov-file-links{margin-top:10px}
body.esuo-educational-material .entry-content .rov-lesson .rov-hero{padding:17px}
}

/* 1.2 — The Kadence featured image was turned off, so the inline cover must remain visible. */
body.single-post.esuo-af-inline-cover-visible .entry-content .rov-lesson img.rov-cover,
body.single-post.esuo-featured-cover-duplicate .entry-content .rov-lesson img.rov-cover{
  display:block !important; width:100%; max-width:100%; height:auto; margin:0 0 22px;
}
body.single-post.esuo-af-inline-cover-visible .entry-header .post-thumbnail,
body.single-post.esuo-af-featured-inside .entry-header .post-thumbnail,
body.single-post.esuo-af-inline-cover-visible .post-thumbnail:not(.esuo-af-hero),
body.single-post.esuo-af-featured-inside .post-thumbnail:not(.esuo-af-hero){display:none!important}
body.esuo-educational-material .entry-content .esuo-af-hero{max-width:100%;margin:0 0 24px;line-height:0}
body.esuo-educational-material .entry-content .esuo-af-hero img{display:block;width:100%;height:auto;max-height:520px;object-fit:contain;border-radius:12px;background:#f3f7fb}
body.esuo-educational-material .entry-content :is(.sg-work,.rov-lesson) a[href]{text-decoration:underline;text-underline-offset:3px;cursor:pointer}
body.esuo-educational-material .entry-content .sg-work :is(.sg-card,.sg-resource,.sg-file) a[href*=".pdf"],
body.esuo-educational-material .entry-content .sg-work a[href*=".pdf"]{display:inline-block;background:#e9f4fc;border:1px solid #cce3f3;border-radius:7px;padding:7px 12px;margin:6px 6px 6px 0;font-weight:650;text-decoration:none}
body.esuo-educational-material .entry-content :is(.sg-work,.rov-lesson) :is(p,li,div){overflow-wrap:anywhere}
body.esuo-educational-material .entry-content :is(.sg-work,.rov-lesson) :is(video,iframe){max-width:100%;width:100%}
/* Recover spacing lost when original StatGrad inline CSS was stripped. */
body.esuo-educational-material .entry-content .sg-work :is(.sg-meta,.sg-tags,.sg-chips,.sg-badges,.sg-nav,.sg-links) > :is(a,span,strong,small){display:inline-block;margin:0 10px 8px 0;vertical-align:middle}
body.esuo-educational-material .entry-content .sg-work a + a{margin-left:9px}
body.esuo-educational-material .entry-content .sg-work :is(h2,h3,h4){margin-top:30px;margin-bottom:13px}
body.esuo-educational-material .entry-content .sg-work :is(p,ul,ol){margin-bottom:17px}
/* Clearly clickable links in imported WooCommerce descriptions. */
.single-product .woocommerce-Tabs-panel--description a.esuo-af-product-link{display:inline-block;border-radius:8px;background:#e8f4fb;border:1px solid #c5dfef;padding:10px 16px;color:#175a8b;text-decoration:none;font-weight:700;margin:6px 10px 6px 0}
/* The full description, not the price/CTA, gets readable item markers. */
body.esuo-af-statgrad-product .woocommerce-Tabs-panel--description > p:not(:has(a.esuo-af-product-link)){
  position:relative;padding-left:20px;margin:0 0 14px;line-height:1.7;
}
body.esuo-af-statgrad-product .woocommerce-Tabs-panel--description > p:not(:has(a.esuo-af-product-link))::before{
  content:"•";position:absolute;left:0;top:0;color:#2877b2;font-weight:700;
}

/* ESUO_STATGRAD_LAYOUT_V3 — append after the existing article-format.css. */
/* Only imported StatGrad article blocks and their product descriptions. */

body.esuo-educational-material .entry-content .sg-work .sg-page-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin: 0 0 22px;
  min-width: 0;
}

body.esuo-educational-material .entry-content .sg-work :is(.sg-actions, .sg-nav-links, .sg-links) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 16px 0 22px;
  min-width: 0;
}

body.esuo-educational-material .entry-content .sg-work :is(.sg-actions, .sg-nav-links, .sg-links) > :is(a, span, strong, small, p) {
  max-width: 100%;
  min-width: 0;
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body.esuo-educational-material .entry-content .sg-work :is(.sg-actions, .sg-nav-links, .sg-links) a[href] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 42px;
  max-width: 100%;
  margin: 0;
  padding: 9px 13px;
  border: 1px solid #c9dfed;
  border-radius: 9px;
  background: #edf6fc;
  color: #155b8e;
  font-weight: 650;
  line-height: 1.45;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.esuo-educational-material .entry-content .sg-work :is(.sg-actions, .sg-nav-links, .sg-links) a[href]:hover {
  background: #e0eff9;
  border-color: #9bc4df;
  text-decoration: underline;
}

body.esuo-educational-material .entry-content .sg-work :is(.sg-actions, .sg-nav-links, .sg-links, .sg-pdf-card) a[href]:focus-visible {
  outline: 3px solid #2877b2;
  outline-offset: 3px;
}

/* Supports both <dl><div><dt/><dd/></div></dl> and div/dl fact groups. */
body.esuo-educational-material .entry-content .sg-work .sg-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  margin: 16px 0 22px;
  padding: 0;
}

body.esuo-educational-material .entry-content .sg-work .sg-facts > :is(div, dl) {
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #dce7ef;
  border-radius: 9px;
  background: #f5f9fc;
}

body.esuo-educational-material .entry-content .sg-work .sg-facts dt {
  margin: 0 0 4px;
  padding: 0;
  color: #526d81;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

body.esuo-educational-material .entry-content .sg-work .sg-facts dd {
  min-width: 0;
  margin: 0;
  padding: 0;
  color: #173d62;
  font-weight: 650;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body.esuo-educational-material .entry-content .sg-work .sg-facts dd + dt {
  margin-top: 10px;
}

/* A flat definition list needs a label/value grid instead of fact cards. */
body.esuo-educational-material .entry-content .sg-work .sg-facts:has(> dt) {
  grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.8fr);
  gap: 8px 16px;
  padding: 14px;
  border: 1px solid #dce7ef;
  border-radius: 9px;
  background: #f5f9fc;
}

body.esuo-educational-material .entry-content .sg-work .sg-facts > :is(dt, dd) {
  margin: 0;
}

body.esuo-educational-material .entry-content .sg-work .sg-pdf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  margin: 18px 0 24px;
  min-width: 0;
}

body.esuo-educational-material .entry-content .sg-work .sg-pdf-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 16px;
  border: 1px solid #d8e6f0;
  border-radius: 12px;
  background: #fff;
}

body.esuo-educational-material .entry-content .sg-work .sg-pdf-card > :is(p, h2, h3, h4, figure, .sg-actions, .sg-links) {
  margin: 0;
}

body.esuo-educational-material .entry-content .sg-work .sg-pdf-card img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  border-radius: 8px;
  object-fit: contain;
}

/* A clickable PDF preview remains an image, without the text-button frame. */
body.esuo-educational-material .entry-content .sg-work .sg-pdf-card a:has(img) {
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  line-height: inherit;
}

body.esuo-educational-material .entry-content .sg-work .sg-answer-box {
  min-width: 0;
  margin: 22px 0;
  padding: 18px;
  border: 1px solid #d2e4f0;
  border-left: 4px solid #2877b2;
  border-radius: 10px;
  background: #f2f8fc;
}

body.esuo-educational-material .entry-content .sg-work .sg-answer-box > :is(h2, h3, h4):first-child {
  margin-top: 0;
}

body.esuo-educational-material .entry-content .sg-work .sg-answer-box > :last-child {
  margin-bottom: 0;
}

/* The site-polish plugin wraps the description in .esuo-readable-description. */
body.esuo-af-statgrad-product .woocommerce-Tabs-panel--description > .esuo-readable-description > p:not(.esuo-product-original-intro):not(:has(a, button, ul, ol, li)):not(:empty) {
  position: relative;
  padding-left: 20px;
  margin: 0 0 14px;
  line-height: 1.7;
}

body.esuo-af-statgrad-product .woocommerce-Tabs-panel--description > .esuo-readable-description > p:not(.esuo-product-original-intro):not(:has(a, button, ul, ol, li)):not(:empty)::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: #2877b2;
  font-weight: 700;
}

/* Do not add paragraph bullets to headings, controls, links, or real lists. */
body.esuo-af-statgrad-product .woocommerce-Tabs-panel--description > p:is(.esuo-product-original-intro, :has(a, button, ul, ol, li), :empty),
body.esuo-af-statgrad-product .woocommerce-Tabs-panel--description > .esuo-readable-description > p:is(.esuo-product-original-intro, :has(a, button, ul, ol, li), :empty) {
  padding-left: 0;
}

body.esuo-af-statgrad-product .woocommerce-Tabs-panel--description > p:is(.esuo-product-original-intro, :has(a, button, ul, ol, li), :empty)::before,
body.esuo-af-statgrad-product .woocommerce-Tabs-panel--description > .esuo-readable-description > p:is(.esuo-product-original-intro, :has(a, button, ul, ol, li), :empty)::before {
  content: none;
}

@media (max-width: 600px) {
  body.esuo-educational-material .entry-content .sg-work :is(.sg-facts, .sg-pdf-grid) {
    grid-template-columns: minmax(0, 1fr);
  }

  body.esuo-educational-material .entry-content .sg-work .sg-facts:has(> dt) {
    grid-template-columns: minmax(88px, 0.8fr) minmax(0, 1.6fr);
    gap: 8px 12px;
    padding: 12px;
  }

  body.esuo-educational-material .entry-content .sg-work :is(.sg-pdf-card, .sg-answer-box) {
    padding: 14px;
  }

  body.esuo-educational-material .entry-content .sg-work :is(.sg-actions, .sg-nav-links, .sg-links) {
    gap: 8px;
  }

  body.esuo-educational-material .entry-content .sg-work :is(.sg-actions, .sg-nav-links, .sg-links) a[href] {
    padding: 9px 11px;
    text-align: left;
  }
}
