/* APTB Courses – course landing + lesson pages (loaded only on course pages). */
.aptb-course { margin-top: 0 !important; padding-bottom: 3rem; overflow-x: clip; }
.aptb-course :where(img) { max-width: 100%; height: auto; }
.aptb-course .wp-block-image img { border-radius: 24px; }
.aptb-course .aptb-course-hero { margin-top: 0 !important; margin-bottom: 0; }
.aptb-course .aptb-course-hero img { border-radius: 0; width: 100%; height: clamp(160px, 24vw, 340px); object-fit: cover; object-position: center; display: block; }
.aptb-course h1, .aptb-course h2, .aptb-course h3, .aptb-course h4 { font-family: var(--wp--preset--font-family--bree-serif); font-weight: 400; }
.aptb-course-landing .aptb-course-title { font-size: clamp(2.1rem, 4vw, 3rem); margin-top: 2.5rem; margin-bottom: 1.2rem; }
.aptb-course-landing .aptb-course-intro { margin-bottom: 1.6rem; }
.aptb-course-start { margin: 1.6rem 0 2.6rem; }
.aptb-course-start .wp-block-button__link { background: #000; border-radius: 6px; text-transform: none; font-size: .9rem; }
.aptb-course-start .wp-block-button__link:hover { background: var(--wp--preset--color--accent-3); }

/* Course list */
.aptb-course-list { display: flex; flex-direction: column; gap: 1.1rem; margin-bottom: 3rem; }
.aptb-chapter { background: var(--wp--preset--color--accent-2); border-radius: 6px; padding: 0 1.4rem .6rem; }
.aptb-chapter__head { list-style: none; cursor: pointer; display: flex; flex-direction: column; padding: 1.2rem 2rem 1rem 0; position: relative; border-bottom: 1px solid rgba(0,0,0,.12); }
.aptb-chapter__head::-webkit-details-marker { display: none; }
.aptb-chapter__head::after { content: ""; position: absolute; right: 4px; top: 1.65rem; width: 9px; height: 9px; border-right: 2px solid #000; border-bottom: 2px solid #000; transform: rotate(45deg); transition: transform .2s; }
.aptb-chapter:not([open]) .aptb-chapter__head { border-bottom: 0; }
.aptb-chapter[open] .aptb-chapter__head::after { transform: rotate(-135deg); top: 1.95rem; }
.aptb-chapter__name { font-family: var(--wp--preset--font-family--bree-serif); font-size: 1.55rem; line-height: 1.2; }
.aptb-chapter__meta { font-size: .72rem; margin-top: .2rem; }
.aptb-chapter__lessons { list-style: none; margin: 0; padding: 0; }
.aptb-lesson-card + .aptb-lesson-card { border-top: 1px solid rgba(0,0,0,.08); }
.aptb-lesson-card a { display: flex; gap: 1.1rem; align-items: center; padding: 1rem 0; text-decoration: none; color: inherit; }
.aptb-lesson-card a:hover .aptb-lesson-card__title { text-decoration: underline; text-underline-offset: 4px; }
.aptb-lesson-card__thumb { flex: 0 0 auto; width: 64px !important; height: 64px !important; object-fit: cover; border-radius: 10px; background: rgba(0,0,0,.06); }
.aptb-lesson-card__text { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.aptb-lesson-card__title { font-size: 1rem; }
.aptb-lesson-card__excerpt { font-size: .8rem; line-height: 1.5; opacity: .85; }

/* Lesson top bar */
.aptb-lesson-bar { border-bottom: 1px solid rgba(0,0,0,.15); background: #fff; position: sticky; top: 0; z-index: 20; margin-top: 0 !important; }
.admin-bar .aptb-lesson-bar { top: 32px; }
.aptb-lesson-bar__inner { max-width: var(--wp--style--global--wide-size, 1240px); margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding: .8rem 4vw; }
.aptb-lesson-bar__course { font-family: var(--wp--preset--font-family--bree-serif); font-size: clamp(1.15rem, 2.2vw, 1.6rem); color: inherit; text-decoration: none; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aptb-lesson-bar__course:hover { text-decoration: underline; }
.aptb-lesson-bar__next.wp-element-button { flex: 0 0 auto; text-decoration: none; text-transform: none; font-size: .85rem; padding: .9em 1.8em; }
.aptb-lesson-menu { position: relative; flex: 0 0 auto; }
.aptb-lesson-menu summary { list-style: none; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; background: var(--wp--preset--color--accent-2); display: grid; place-items: center; }
.aptb-lesson-menu summary::-webkit-details-marker { display: none; }
.aptb-lesson-menu__icon, .aptb-lesson-menu__icon::before, .aptb-lesson-menu__icon::after { display: block; width: 14px; height: 2px; background: #000; position: relative; }
.aptb-lesson-menu__icon::before, .aptb-lesson-menu__icon::after { content: ""; position: absolute; left: 0; }
.aptb-lesson-menu__icon::before { top: -5px; } .aptb-lesson-menu__icon::after { top: 5px; }
.aptb-lesson-menu__panel { position: absolute; left: 0; top: calc(100% + 10px); width: min(360px, 88vw); max-height: 70vh; overflow: auto; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.15); border-radius: 8px; padding: 1rem 1.2rem; z-index: 30; }
.aptb-lesson-menu__chapter { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin: .8rem 0 .3rem; }
.aptb-lesson-menu__chapter:first-child { margin-top: 0; }
.aptb-lesson-menu ol { margin: 0; padding-left: 1.2rem; font-size: .88rem; }
.aptb-lesson-menu li { margin: .25rem 0; }
.aptb-lesson-menu li a { color: inherit; text-decoration: none; }
.aptb-lesson-menu li a:hover { text-decoration: underline; }
.aptb-lesson-menu li.is-current a { font-weight: 600; color: var(--wp--preset--color--accent-3); }

/* Lesson content */
.aptb-lesson-head { padding-top: 1.4rem; padding-bottom: 1.4rem; border-bottom: 1px solid rgba(0,0,0,.8); margin-bottom: 2rem; }
.aptb-lesson-chapter { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin: 0 0 .4rem; }
.aptb-lesson-title { font-size: clamp(2rem, 4.2vw, 3rem); margin: 0; line-height: 1.15; }
.aptb-lesson-video { margin-top: 0 !important; margin-bottom: 0; }
.aptb-lesson-video .wp-block-embed__wrapper iframe { width: 100%; }
.aptb-lesson-section { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.aptb-lesson-section .wp-block-columns { gap: clamp(1.5rem, 5vw, 4rem); }
.aptb-course .wp-block-details { border-top: 1px solid #000; border-bottom: 1px solid #000; padding: .9rem 0; margin: 0; }
.aptb-course .wp-block-details + .wp-block-details { border-top: 0; }
.aptb-course .wp-block-details summary { font-family: var(--wp--preset--font-family--bree-serif); font-size: 1.25rem; cursor: pointer; list-style: none; position: relative; padding-right: 2rem; }
.aptb-course .wp-block-details summary::-webkit-details-marker { display: none; }
.aptb-course .wp-block-details summary::after { content: ""; position: absolute; right: 6px; top: .45em; width: 8px; height: 8px; border-right: 1.5px solid #000; border-bottom: 1.5px solid #000; transform: rotate(45deg); transition: transform .2s; }
.aptb-course .wp-block-details[open] summary::after { transform: rotate(-135deg); top: .65em; }
.aptb-course .wp-block-details > :not(summary) { font-size: .9rem; }
.aptb-course .is-style-aptb-secondary .wp-block-button__link { background: #000; color: #fff; border-radius: 6px; text-transform: none; }
.aptb-course .is-style-aptb-secondary .wp-block-button__link:hover { background: var(--wp--preset--color--accent-3); }

/* Bottom lesson navigation */
.aptb-lesson-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; margin-top: 3rem !important; padding: 1.5rem 0; border-top: 1px solid rgba(0,0,0,.15); }
.aptb-lesson-nav a { color: inherit; text-decoration: none; }
.aptb-lesson-nav__prev, .aptb-lesson-nav__next { display: flex; flex-direction: column; gap: .2rem; }
.aptb-lesson-nav__next { text-align: right; align-items: flex-end; }
.aptb-lesson-nav__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.aptb-lesson-nav__title { font-family: var(--wp--preset--font-family--bree-serif); font-size: 1.1rem; }
.aptb-lesson-nav a:hover .aptb-lesson-nav__title { text-decoration: underline; }
.aptb-lesson-nav__course { background: var(--wp--preset--color--accent-2); border-radius: 999px; padding: .7em 1.5em; font-size: .85rem; white-space: nowrap; }
.aptb-lesson-nav__course:hover { background: var(--wp--preset--color--accent-1); }

@media (max-width: 781px) {
  .aptb-lesson-bar__inner { padding: .6rem 5vw; gap: .6rem; }
  .aptb-lesson-bar__next.wp-element-button { font-size: .75rem; padding: .8em 1.2em; }
  .aptb-lesson-nav { grid-template-columns: 1fr 1fr; }
  .aptb-lesson-nav__course { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .aptb-chapter { padding: 0 1rem .4rem; }
  .aptb-chapter__name { font-size: 1.3rem; }
}

/* Squarespace "highlight" (hand-drawn circle) and boxed text blocks */
.aptb-course mark.aptb-highlight { background: transparent; color: inherit; border: 2px solid var(--wp--preset--color--accent-1); border-radius: 50%; padding: 0 .25em; }
.aptb-course .aptb-box { padding: 6%; }
.aptb-course .aptb-box > * { font-size: .9rem; }
.aptb-course-start.is-content-justification-center { justify-content: center; }
.aptb-course .wp-block-column > .wp-block-image:first-child { margin-top: 0; }
.aptb-course .aptb-course-hero--medium img { height: clamp(200px, 33vw, 440px); }
.aptb-course-start { display: flex; flex-wrap: wrap; gap: .5em; }
.aptb-lesson-card__excerpt p { margin: 0; }
.aptb-lesson-card__excerpt ul { margin: .2rem 0 0; padding-left: 1.1rem; }
