/* Course catalog (/cursos/, /en/courses/). Uses the tokens from styles.css. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:root { --hex: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }

/* Hero */
.catalog-hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2.5rem, 5vw, 3.5rem); }
.catalog-hero__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.catalog-hero h1 { font-size: clamp(2.3rem, 5.6vw, 4.2rem); max-width: 16ch; margin-top: .6rem; }
.back-link { display: table; margin-bottom: 1.2rem; color: var(--muted); font-size: .92rem; text-decoration: none; }
.back-link:hover { color: var(--text); }
.facts { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; margin: 1.6rem 0 0; padding: 0; }
.facts li { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .85rem .4rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .9rem; font-weight: 600; }
.facts__hex { width: 14px; height: 12px; background: var(--honey); clip-path: var(--hex); flex: none; }
.route { width: 100%; height: auto; }
.route__line { stroke: var(--line); stroke-width: 3; }
.route__cell polygon { fill: var(--surface); stroke: var(--honey); stroke-width: 2; }
.route__cell.is-on polygon { fill: var(--honey); }
.route__cell text { font: 600 13px var(--display); fill: var(--text); text-anchor: middle; }
.route__cell.is-on text { fill: var(--ink-on-honey); }
.route__dance { fill: none; stroke: var(--honey); stroke-width: 4; stroke-dasharray: 8 10; stroke-linecap: round; }
.route__label { font: 600 12px var(--text-font); fill: var(--muted); text-anchor: middle; letter-spacing: .04em; text-transform: uppercase; }
.note { position: relative; margin: 2rem 0 0; padding: 1rem 1.2rem 1rem 2.6rem; border: 1px solid var(--line); border-left: 3px solid var(--honey); border-radius: 0 12px 12px 0; background: var(--surface); color: var(--muted); max-width: 80ch; }
.note::before { content: ""; position: absolute; left: 1rem; top: 1.35rem; width: 12px; height: 10px; background: var(--honey); clip-path: var(--hex); }

/* Catalog */
.catalog-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.catalog-count { margin: 0; color: var(--muted); font-weight: 600; }
.catalog-controls { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.catalog-controls[hidden] { display: none; }
.catalog-controls label { display: grid; gap: .35rem; font-size: .88rem; font-weight: 600; color: var(--muted); }
.catalog-controls input, .catalog-controls select { width: 100%; min-height: 46px; padding: .6rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-weight: 400; }
.catalog-controls input:focus, .catalog-controls select:focus { border-color: var(--accent); }
.catalog-status { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.status { margin: 0 0 1rem; color: var(--muted); }
.status[hidden] { display: none; }
.status.is-error { padding: .9rem 1.1rem; border: 1px solid var(--error-line); border-radius: 12px; background: var(--error-bg); color: var(--error-text); }
.catalog-status .button { margin-bottom: 1rem; }
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.course-grid[aria-busy="true"]:empty { min-height: 6rem; }

.course-card { display: flex; flex-direction: column; min-width: 0; padding: 1.5rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.course-card h3 { margin-top: .9rem; font-size: 1.25rem; line-height: 1.2; }
.course-card__summary { margin: .55rem 0 1.1rem; color: var(--muted); }
.course-card__tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); }
.chip--status { color: var(--muted); background: transparent; border: 1px solid var(--line); }
.chip--status.is-open { color: var(--ink-on-accent); background: var(--accent); border-color: transparent; }
.course-meta { margin: .8rem 0 0; color: var(--muted); font-size: .9rem; }
.course-meta--soft { margin-top: auto; padding-top: 1rem; font-size: .85rem; }
.course-project { margin-top: 1rem; padding: .9rem 1rem; border-radius: 12px; background: var(--surface-2); }
.course-project strong, .course-project h3 { display: block; margin: 0 0 .25rem; font-family: var(--display); font-size: .85rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--honey-ink); }
.course-project p { margin: 0; font-size: .93rem; }
.course-card__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.course-card__actions .button { min-height: 42px; padding: .55rem 1rem; font-size: .93rem; }

/* Hexagon progress path (card) */
.hexpath { position: relative; display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.hexpath__cell { position: relative; display: grid; place-items: center; width: 36px; height: 31px; background: var(--honey); clip-path: var(--hex); }
.hexpath__cell::before { content: ""; position: absolute; inset: 2px; background: var(--surface); clip-path: var(--hex); transition: opacity .25s ease calc(var(--i, 0) * 60ms); }
.hexpath__cell:first-child::before, .course-card:hover .hexpath__cell::before, .course-card:focus-within .hexpath__cell::before { opacity: 0; }
.hexpath__num { position: relative; font: 600 .74rem var(--display); color: var(--text); transition: color .25s ease calc(var(--i, 0) * 60ms); }
.hexpath__cell:first-child .hexpath__num, .course-card:hover .hexpath__num, .course-card:focus-within .hexpath__num { color: var(--ink-on-honey); }

/* Dialog */
.course-dialog { width: min(860px, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); padding: 0; border: 1px solid var(--line); border-radius: 20px; color: var(--text); background: var(--bg); box-shadow: 0 30px 90px rgba(6, 35, 34, .35); }
.course-dialog::backdrop { background: rgba(6, 35, 34, .6); backdrop-filter: blur(4px); }
.course-dialog__top { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem .8rem 1.5rem; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); }
.course-dialog__close { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 1.5rem; line-height: 1; cursor: pointer; }
[data-course-detail] { padding: 1.5rem clamp(1.2rem, 4vw, 2.2rem) 2rem; }
[data-course-detail] h2 { margin-top: .8rem; font-size: clamp(1.6rem, 4vw, 2.3rem); }
.course-detail__lede { color: var(--muted); margin: .8rem 0 0; }
[data-course-detail] .note { margin-top: 1.2rem; padding-block: .8rem; }
[data-course-detail] .note::before { top: 1.15rem; }
.course-detail__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.course-detail__block { min-width: 0; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.course-detail__block h3 { font-size: 1rem; }
.course-detail__block ul, .module-path__body ul { margin: .5rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.course-detail__block li, .module-path__body li { margin: .25rem 0; }
[data-course-detail] .course-project { margin-top: 1rem; }
.course-detail__path-title { margin: 2rem 0 1rem; font-size: 1.2rem; }

/* Hexagon progress path (outline) */
.module-path { position: relative; list-style: none; margin: 0; padding: 0; }
.module-path::before { content: ""; position: absolute; left: 23px; top: 20px; bottom: 20px; border-left: 2px dashed var(--honey); opacity: .8; }
.module-path__item { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 1rem; padding-bottom: 1.4rem; }
.module-path__item:last-child { padding-bottom: 0; }
.module-path__hex { display: grid; place-items: center; width: 48px; height: 42px; background: var(--honey); color: var(--ink-on-honey); clip-path: var(--hex); font: 700 .9rem var(--display); }
.module-path__body { min-width: 0; padding-top: .2rem; }
.module-path__label { display: block; color: var(--honey-ink); font-size: .76rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.module-path__body h4 { margin: .2rem 0 0; font-family: var(--display); font-size: 1.05rem; line-height: 1.25; letter-spacing: -.01em; }
.module-path__body p { margin: .4rem 0 0; color: var(--muted); }
.module-path__practice { padding: .6rem .8rem; border-radius: 10px; background: var(--surface); }
.module-path__practice strong { color: var(--text); }
[data-course-detail] .course-card__actions { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }

/* Custom course */
.custom-panel { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.5rem; padding: clamp(1.4rem, 4vw, 2.2rem); border: 1px solid var(--line); border-radius: 20px; background: var(--accent-soft); }
.custom-panel > div { flex: 1 1 32rem; min-width: 0; }
.custom-panel h3 { margin-top: .4rem; font-size: clamp(1.3rem, 3vw, 1.7rem); }
.custom-panel p { margin: .6rem 0 0; color: var(--muted); max-width: 64ch; }

/* IECA */
.ieca { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.ieca h2 { margin: .5rem 0 1rem; font-size: clamp(1.6rem, 3.4vw, 2.4rem); max-width: 22ch; }
.ieca .section-copy { max-width: 72ch; margin: 0 0 1rem; }
.ieca .button { margin-top: .5rem; }
.ieca__badge svg { width: 100%; height: auto; }
.ieca__badge polygon { fill: var(--honey-soft); stroke: var(--honey); stroke-width: 3; }
.ieca__badge path { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }

/* FAQ */
.faq { display: grid; gap: .75rem; }
.faq details { padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.faq summary { cursor: pointer; font-family: var(--display); font-weight: 600; }
.faq p { margin: .7rem 0 0; color: var(--muted); }

@media (max-width: 1060px) { .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .catalog-hero__grid { grid-template-columns: 1fr; }
  .route { max-width: 360px; }
  .catalog-controls, .course-grid, .course-detail__grid { grid-template-columns: 1fr; }
  .ieca { grid-template-columns: 1fr; }
  .ieca__badge { width: 88px; }
}
@media (prefers-reduced-motion: reduce) { .hexpath__cell::before, .hexpath__num { transition: none; } }
