/* GeoCARE Courses — front-end styles for [geocare_courses].
   Ported from the hand-written Teaching page (same maroon system). Loaded after
   publications.css, which supplies the editor toolbar and .pub-edit pill. */

.courses-page, .courses-page * { box-sizing: border-box; }
:where(.courses-page) :where(h2, h3, h4, p, table, caption) { margin: 0; padding: 0; }
.courses-page [role="list"] { list-style: none; }

/* ---------- Page shell ---------- */
.courses-page {
  max-width: 1160px; margin: 0.6rem auto 3rem;
  font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif; font-size: 1rem; line-height: 1.6; color: #322427;
}
.courses-title {
  color: #6b1239;
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 2rem; font-weight: 800; line-height: 1.2; letter-spacing: .02em;
  text-align: center; margin: 3rem 0 2rem; scroll-margin-top: 110px;
}
.courses-title::after { content: ""; display: block; width: 64px; height: 4px; margin: 0.9rem auto 0; background: #6b1239; border-radius: 2px; }
.courses-page .pub-admin-bar { margin-bottom: 1.6rem; }

/* ---------- Teaching philosophy ---------- */
.philosophy {
  position: relative; width: 100%; margin-bottom: 2rem; padding: 1.7rem 2rem 1.8rem;
  background: linear-gradient(135deg, #ffffff 50%, #f8f0f4 100%);
  border: 1.8px solid #d9bcd5; border-radius: 16px; overflow: hidden;
  box-shadow: 0 6px 16px rgba(107, 18, 57, 0.1);
}
.philosophy::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: linear-gradient(#6b1239, #a8477a); }
.philosophy__title {
  color: #6b1239; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  font-size: 0.82rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 0.8rem;
}
.philosophy__lead {
  position: relative; margin: 0 0 1.5rem; padding-left: 1.1rem; max-width: 46em;
  color: #3a0a20; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 1.3rem; font-weight: 600; line-height: 1.45;
}
.philosophy__lead::before { content: ""; position: absolute; left: 0; top: 0.3rem; bottom: 0.3rem; width: 3px; border-radius: 2px; background: #f0c14b; }
.philosophy__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.philosophy__pt {
  padding: 1.05rem 1.1rem 1.1rem; background: #fff; border: 1px solid #e2cdd9; border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.philosophy__pt:hover { transform: translateY(-2px); border-color: #d9bcd5; box-shadow: 0 8px 18px rgba(107, 18, 57, 0.1); }
.philosophy__ico { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; margin-bottom: 0.6rem; border-radius: 10px; background: #f6eef2; color: #6b1239; }
.philosophy__ico svg { width: 22px; height: 22px; }
.philosophy__pt-title { margin: 0 0 0.35rem; color: #6b1239; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 1rem; font-weight: 700; line-height: 1.3; }
.philosophy__pt-text { margin: 0; color: #4a3a40; font-size: 0.93rem; line-height: 1.6; }
.philosophy__body { margin-top: 1.3rem; }
.philosophy__body p { font-size: 1rem; line-height: 1.7; margin: 0 0 0.8rem; color: #322427; font-style: italic; }
.philosophy__body p:last-child { margin-bottom: 0; }

/* ---------- Summary table ---------- */
.summary-wrap { width: 100%; margin-bottom: 2rem; overflow-x: auto; }
.course-summary {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1.8px solid #d9bcd5; border-radius: 14px; overflow: hidden;
  box-shadow: 0 6px 16px rgba(107, 18, 57, 0.1);
}
.course-summary__caption {
  caption-side: top; padding: 0.85rem 1.1rem; background: #6b1239; color: #fff;
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 0.82rem; font-weight: 700; letter-spacing: .03em; text-align: left;
}
.course-summary thead th {
  padding: 0.7rem 1.1rem; background: #f6eef2; border-bottom: 2px solid #e2cdd9; color: #6b1239;
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 0.72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  text-align: left; white-space: nowrap;
}
.course-summary tbody th, .course-summary tbody td { padding: 0.75rem 1.1rem; border-bottom: 1px solid #efe2e9; text-align: left; vertical-align: middle; font-weight: 400; }
.course-summary tbody tr:last-child th, .course-summary tbody tr:last-child td { border-bottom: none; }
.summary-code { color: #6b1239; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 0.9rem; font-weight: 800; letter-spacing: .05em; white-space: nowrap; margin-right: 0.6rem; }
.summary-name { color: #4c3748; font-size: 0.92rem; }
.col-count { width: 1%; text-align: center; white-space: nowrap; }
.course-summary tbody .col-count { color: #6b1239; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 1.1rem; font-weight: 800; }
.terms { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.term { padding: 0.2rem 0.6rem; background: #f6eef2; border: 1px solid #e2cdd9; border-radius: 999px; color: #6b1239; font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
.term--current { background: #6b1239; border-color: #6b1239; color: #fff; }

/* ---------- Semester heading ---------- */
.semester-title {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.7rem;
  color: #6b1239; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  font-size: 1.25rem; font-weight: 800; line-height: 1.3; letter-spacing: .02em;
  margin-top: 2.4rem; margin-bottom: 1rem; padding-bottom: 0.6rem; border-bottom: 2px solid #e2cdd9;
  scroll-margin-top: 96px;
}
.semester-badge { padding: 0.25rem 0.7rem; background: #6b1239; border-radius: 999px; color: #fff; font-size: 0.68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.semester-badge--upcoming { background: #fff; color: #6b1239; border: 1.5px dashed #6b1239; }

/* ---------- Course cards ---------- */
.course-list { display: flex; flex-direction: column; gap: 0.9rem; }
.course-card {
  position: relative; width: 100%; padding: 1.1rem 1.4rem;
  background: #fff; border: 1.8px solid #d9bcd5; border-radius: 14px;
  box-shadow: 0 4px 12px rgba(107, 18, 57, 0.08);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.course-card:hover { box-shadow: 0 10px 22px rgba(107, 18, 57, 0.14); border-color: #6b1239; }
.course-card.people-card--editable { padding-right: 5.2rem; }
.course-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.7rem; margin-bottom: 0.55rem; }
.course-code { color: #7f4862; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 0.8rem; font-weight: 800; letter-spacing: .1em; white-space: nowrap; }
.course-name { color: #6b1239; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 1.12rem; font-weight: 800; line-height: 1.3; margin-right: 0.2rem; }
.tag { padding: 0.15rem 0.6rem; background: #f6eef2; border: 1px solid #e2cdd9; border-radius: 999px; color: #6b1239; font-size: 0.74rem; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.course-ta { margin-left: auto; color: #4c3748; font-size: 0.85rem; white-space: nowrap; }
.course-ta__label { color: #7f4862; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 0.68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-right: 0.3rem; }
.course-ta a { color: #6b1239; text-decoration: none; border-bottom: 1.5px solid #d9bcd5; }
.course-ta a:hover, .course-ta a:focus-visible { border-bottom-color: #6b1239; }
.course-meta { color: #7f4862; font-size: 0.84rem; margin: -0.2rem 0 0.5rem; }
.course-meta__k { font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 0.7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.course-meta__sep { color: #c9a7bd; padding: 0 0.2rem; }

.course-desc {
  color: #322427; font-size: 0.94rem; line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.course-toggle { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.course-toggle:checked ~ .course-desc { display: block; -webkit-line-clamp: none; line-clamp: none; overflow: visible; }
.course-more {
  display: inline-block; margin-top: 0.6rem; cursor: pointer; color: #6b1239;
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 0.82rem; font-weight: 700; line-height: 1.4;
  border-bottom: 2px solid rgba(107, 18, 57, 0.3); padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.course-more__close { display: none; }
.course-toggle:checked ~ .course-more .course-more__open { display: none; }
.course-toggle:checked ~ .course-more .course-more__close { display: inline; }
.course-more:hover { color: #4d0c29; border-bottom-color: #6b1239; }
.course-toggle:focus-visible ~ .course-more { outline: 2px solid #6b1239; outline-offset: 3px; border-radius: 3px; }

.course-link {
  display: inline-flex; align-items: baseline; gap: 0.45rem;
  margin-top: 0.6rem; margin-left: 1.1rem; padding: 0.28rem 0.75rem;
  background: #f6eef2; border: 1px solid #e2cdd9; border-radius: 999px; color: #6b1239;
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 0.8rem; font-weight: 700; line-height: 1.4;
  text-decoration: none; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.course-link__note { color: #7f4862; font-size: 0.66rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.course-link:hover, .course-link:focus-visible { background: #6b1239; border-color: #6b1239; color: #fff; }
.course-link:hover .course-link__note, .course-link:focus-visible .course-link__note { color: #eccfdc; }
.course-link:focus-visible { outline: 2px solid #6b1239; outline-offset: 3px; }
.course-link--editors { border-style: dashed; background: #fff8e1; border-color: #e0b84a; }

/* ---------- Preferences, print, small screens ---------- */
@media (prefers-reduced-motion: reduce) { .course-card, .course-more, .course-link { transition: none; } }
@media print {
  .course-desc { display: block; -webkit-line-clamp: none; line-clamp: none; overflow: visible; }
  .course-more, .course-link, .pub-admin-bar, .people-edit { display: none; }
  .course-card { box-shadow: none; break-inside: avoid; page-break-inside: avoid; }
}
@media (max-width: 780px) {
  .courses-page { margin: 0.4rem auto 2rem; }
  .courses-title { font-size: 1.6rem; }
  .philosophy { padding: 1.2rem 1.1rem 1.3rem; }
  .philosophy__grid { grid-template-columns: 1fr; }
  .philosophy__lead { font-size: 1.1rem; }
  .course-card { padding: 1rem 1.1rem; }
  .course-card.people-card--editable { padding-right: 1.1rem; padding-top: 2.6rem; }
  .course-ta { margin-left: 0; white-space: normal; flex-basis: 100%; }
  .course-desc { -webkit-line-clamp: 3; line-clamp: 3; }
  .course-link { margin-left: 0; }
  .course-summary__caption, .course-summary thead th, .course-summary tbody th, .course-summary tbody td { padding-left: 0.7rem; padding-right: 0.7rem; }
}

/* ---------- What Students Say ---------- */
.feedback { margin-top: 2.4rem; }
.feedback__title { margin-top: 0; }
.feedback__intro { color: #7f4862; font-size: 0.92rem; margin: -0.3rem 0 1.1rem; }
.feedback__filters { margin-bottom: 1.2rem; padding-bottom: 1rem; }
.pub-filter__sub { font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif; font-weight: 400; letter-spacing: 0; color: #7f4862; margin-left: 2px; }

/* Spotlight: featured comments, wide cards side by side. */
.feedback__spotlight { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.feedback__spotlight--stack { grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(0, auto); }
.feedback__spotlight--stack .quote:first-child { grid-row: span 2; }
/* The rest: compact three-up grid, clamped with Read more. */
.feedback__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }

.quote {
  position: relative; display: flex; flex-direction: column; margin: 0;
  padding: 1.5rem 1.3rem 1rem;
  background: #fff; border: 1.8px solid #d9bcd5; border-radius: 14px;
  box-shadow: 0 4px 12px rgba(107, 18, 57, 0.08);
  transition: box-shadow .25s ease, border-color .25s ease;
}
.quote:hover { box-shadow: 0 10px 22px rgba(107, 18, 57, 0.14); border-color: #6b1239; }
.quote::before {
  content: "\201C"; position: absolute; top: -0.2rem; left: 0.9rem;
  color: #6b1239; font-family: Georgia, 'Times New Roman', serif; font-size: 3.2rem; line-height: 1; opacity: .9;
}
.quote--featured {
  padding: 1.9rem 1.7rem 1.2rem;
  background: linear-gradient(135deg, #ffffff 55%, #f8f0f4 100%); border-color: #6b1239;
}
.quote--featured::before { font-size: 4rem; top: -0.3rem; }
.quote--featured .quote__text p { font-size: 1.05rem; line-height: 1.7; }
.quote__text { margin: 0; padding: 0; border: 0; }
.quote__text p { margin: 0.2rem 0 0.8rem; color: #322427; font-size: 0.93rem; line-height: 1.65; font-style: italic; }
.quote__text--clamp p { display: -webkit-box; -webkit-line-clamp: 5; line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 0.4rem; }
.quote__toggle:checked ~ .quote__text--clamp p { display: block; -webkit-line-clamp: none; line-clamp: none; overflow: visible; }
.quote__more { margin: 0 0 0.8rem; font-size: 0.78rem; align-self: flex-start; }
.quote__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: auto; }
.quote__code { padding: 0.15rem 0.6rem; background: #6b1239; border-radius: 999px; color: #fff; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 0.7rem; font-weight: 800; letter-spacing: .08em; }
.quote__course { color: #6b1239; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 0.8rem; font-weight: 700; }
.quote__term, .quote__source { color: #7f4862; font-size: 0.78rem; }
.quote__term::before, .quote__source::before { content: "\00B7"; color: #c9a7bd; margin-right: 0.4rem; }
.quote .people-edit { top: 8px; right: 8px; }

/* Inline add form (editors only) */
.fb-add { margin-top: 1.2rem; border: 1.5px dashed #e0b84a; border-radius: 12px; background: #fff8e1; }
.fb-add__s { cursor: pointer; padding: 0.8rem 1rem; color: #6b4d00; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 0.88rem; font-weight: 800; list-style: none; }
.fb-add__s::-webkit-details-marker { display: none; }
.fb-add__ok { margin: 0 1rem; padding: 0.5rem 0.8rem; background: #e6f3ea; color: #1e6b3a; border-radius: 8px; font-size: 0.88rem; }
.fb-add__form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem 1rem; padding: 0.6rem 1rem 1rem; }
.fb-add__form label { display: block; font-size: 0.82rem; font-weight: 700; color: #6b1239; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; }
.fb-add__form label span:not(.fb-add__inline) { font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif; font-weight: 400; color: #7f4862; margin-left: 4px; }
.fb-add__form textarea, .fb-add__form input[type=text], .fb-add__form select { display: block; width: 100%; margin-top: 4px; padding: 0.5rem 0.6rem; border: 1.5px solid #d9bcd5; border-radius: 8px; font: inherit; font-size: 0.92rem; background: #fff; color: #322427; }
.fb-add__full { grid-column: 1 / -1; }
.fb-add__inline { display: flex; gap: 6px; }
.fb-add__check { align-self: end; font-weight: 600 !important; color: #322427 !important; font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif !important; }
.fb-add__actions { grid-column: 1 / -1; display: flex; gap: 8px; margin: 0; }
.fb-add__actions button { cursor: pointer; font: inherit; }

/* Fold-out on a course card */
.course-fb { margin-top: 0.8rem; border-top: 1.5px dashed #e2cdd9; padding-top: 0.6rem; }
.course-fb__list { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.6rem; }
.course-fb__q { margin: 0; padding: 0.7rem 0.9rem 0.7rem 1.1rem; border-left: 3px solid #6b1239; background: #fcf7fa; border-radius: 0 10px 10px 0; }
.course-fb__q p { margin: 0; color: #322427; font-size: 0.88rem; line-height: 1.6; font-style: italic; }
.course-fb__q cite { display: block; margin-top: 0.3rem; color: #7f4862; font-size: 0.74rem; font-style: normal; }
@media (max-width: 780px) { .feedback__grid, .feedback__spotlight, .feedback__spotlight--stack { grid-template-columns: 1fr; } .feedback__spotlight--stack .quote:first-child { grid-row: auto; } .fb-add__form { grid-template-columns: 1fr; } }
@media print { .feedback__filters, .fb-add { display: none; } .quote { box-shadow: none; } .quote__text--clamp p { display: block; -webkit-line-clamp: none; line-clamp: none; } .quote__more { display: none; } }
