/* Professional Learning index skin. The shared index-navigation.css owns sticky behavior,
   viewport budgets, target sizes, and pagination layout; this file owns only how the hub's
   world dresses that skeleton — copper subject rails, harbor date stacks, paper cards.

   One deliberate decision: an offering is a bordered slab rather than a grid card. These
   are dated, contact-bearing records a teacher scans vertically looking for a date that
   fits their calendar, so a single readable column beats a three-across wall of equal
   boxes that hides the dates below the fold. */

/* Two columns, each its own scrolling context: the subject rail on the left, and one tall
   column on the right holding the controls, the results, and the pager. The controls are
   sticky INSIDE that column — a grid area only one row tall gives position:sticky nothing to
   travel within, which is how the page-local search silently scrolled away on the first
   build of this route. */
.pd-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 0 2.4rem;
  align-items: start;
  padding-bottom: 3.5rem;
}
.pd-main { min-width: 0; }

/* ---- page-local search ----
   The shared stylesheet gives the controls their sticky behavior and 44px targets; the hub
   dresses them like the masthead omnibox so the page-local search reads as the same tool,
   one level down, rather than a stray browser form. */
[data-stoa-index-controls] {
  background: var(--paper);
  padding: 1rem 0 .8rem;
}
[data-stoa-index-controls] form {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}
[data-stoa-index-controls] label {
  flex: 1 0 100%;
  font-family: var(--display);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
[data-stoa-index-controls] input[type="search"] {
  flex: 1 1 12rem;
  min-width: 0;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: .62rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--harbor);
}
[data-stoa-index-controls] input[type="search"]:focus-visible { border-color: var(--accent-700); }
[data-stoa-index-controls] button {
  flex: none;
  border: 2px solid var(--accent-700);
  border-radius: 999px;
  background: var(--accent-700);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: .95rem;
  padding: .62rem 1.4rem;
  cursor: pointer;
}
[data-stoa-index-controls] button:hover { background: var(--accent-500); border-color: var(--accent-500); }
[data-stoa-index-summary] {
  margin: .55rem 0 0;
  font-size: .9rem;
  color: var(--muted);
}


/* ---- subject rail ---- */
.pd-subjects {
  position: sticky;
  top: var(--stoa-index-sticky-top, 1rem);
  padding: 1rem 0 0;
}
.pd-subjects-label {
  font-family: var(--display);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .6rem;
}
.pd-subjects ul { list-style: none; margin: 0; padding: 0; }
.pd-subjects li { margin: 0 0 .18rem; }
.pd-subjects a {
  display: block;
  padding: .5rem .7rem;
  min-height: 24px;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--harbor);
  text-decoration: none;
  font-size: .9rem;
  line-height: 1.35;
}
.pd-subjects a:hover { background: var(--sky); border-left-color: var(--accent-500); }
.pd-subjects a[aria-current="true"] {
  background: #fff;
  border-left-color: var(--accent-700);
  font-weight: 700;
  box-shadow: var(--shadow);
}

/* ---- head ---- */
.pd-head .lede { max-width: 62ch; }
.pd-scope {
  font-family: var(--display);
  font-weight: 600;
  color: var(--muted);
  margin: .4rem 0 0;
}
.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0 0 1rem;
  padding: 0;
  font-size: .85rem;
  color: var(--muted);
}
.crumbs li + li::before { content: "/"; margin-right: .4rem; color: var(--line); }
.crumbs a { color: var(--harbor); }

/* ---- offering ---- */
.pd-item {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-500);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin: 0 0 .9rem;
  scroll-margin-top: 6rem;
}
.pd-item:target { border-left-color: var(--accent-700); box-shadow: var(--shadow); }
.pd-item--cover {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}
.pd-cover img {
  display: block;
  width: 170px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.pd-item h3 { margin: .35rem 0 .5rem; font-size: 1.12rem; line-height: 1.3; }
.pd-item h3 a { color: var(--harbor); text-decoration: none; }
.pd-item h3 a:hover { text-decoration: underline; }

.pd-dates {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .5rem;
  list-style: none;
  margin: 0 0 .6rem;
  padding: 0;
}
.pd-dates li {
  font-family: var(--display);
  font-weight: 600;
  font-size: .82rem;
  color: var(--harbor);
  background: var(--sky);
  border-radius: 999px;
  padding: .22rem .62rem;
}
.pd-when, .pd-contact { margin: 0 0 .5rem; font-size: .9rem; }
.pd-summary { margin: 0 0 .7rem; color: var(--muted); line-height: 1.55; max-width: 68ch; }
.pd-flyer { margin: 0; }
.pd-flyer--none { font-size: .88rem; color: var(--muted); }
.chip.district { background: var(--harbor); color: #fff; }

.pd-detail { margin: .7rem 0 0; }
.pd-detail summary {
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  color: var(--bay, var(--harbor));
  padding: .35rem 0;
  min-height: 24px;
}
.pd-detail-body pre {
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--muted);
  background: var(--sky);
  border-radius: 8px;
  padding: .9rem 1rem;
  margin: .4rem 0 0;
  max-width: 74ch;
}

.pd-empty { padding: 1.2rem 0; color: var(--muted); }
.pd-source p { max-width: 68ch; }

/* ---- Educator Resource Center teaser ---- */
.pl-stat {
  font-family: var(--display);
  font-weight: 600;
  color: var(--copper-deep);
  margin: .9rem 0 0;
}
.pl-upcoming {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  margin: 1.2rem 0 0;
  max-width: 62rem;
}
.pl-upcoming-head {
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .7rem;
}
.pl-upcoming-list { list-style: none; margin: 0; padding: 0; }
.pl-upcoming-list li {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) auto;
  gap: .5rem 1rem;
  align-items: baseline;
  padding: .55rem 0;
  border-top: 1px solid var(--line);
}
.pl-upcoming-list li:first-child { border-top: 0; }
.pl-upcoming-list time {
  font-family: var(--display);
  font-weight: 700;
  font-size: .88rem;
  color: var(--harbor);
}
.pl-upcoming-list a { color: var(--harbor); }
.pl-upcoming-note { margin: .6rem 0 0; color: var(--muted); font-size: .9rem; }

@media (max-width: 640px) {
  .pl-upcoming-list li { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .pl-upcoming-list .chip { justify-self: start; }
}

@media (max-width: 640px) {
  /* The cover stacks above the text on a phone: 170px beside a title leaves the title in a
     two-word-per-line column, which is worse than no image at all. */
  .pd-item--cover { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
  .pd-cover img { width: 130px; }
}

@media (max-width: 900px) {
  .pd-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  /* The rail becomes a horizontal scroller above the results on narrow screens; keeping it
     sticky there would eat the mobile viewport budget the standard caps at 30%. */
  .pd-subjects { position: static; padding: .2rem 0 1rem; }
  .pd-subjects ul {
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    padding-bottom: .3rem;
    -webkit-overflow-scrolling: touch;
  }
  .pd-subjects li { margin: 0; }
  .pd-subjects a {
    white-space: nowrap;
    border-left: 0;
    border-bottom: 3px solid transparent;
    border-radius: 6px 6px 0 0;
  }
  .pd-subjects a:hover { border-left: 0; border-bottom-color: var(--accent-500); }
  .pd-subjects a[aria-current="true"] { border-left: 0; border-bottom-color: var(--accent-700); }
}

/* ---- index head media ----
   The chart and the classroom photo sit side by side above the list. Together they answer
   "when is this busy" and "where does it happen" before the visitor reads a single row. */
.pd-head-media {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1.6rem;
  align-items: end;
  margin: 1.6rem 0 0;
}
.pd-chart { margin: 0; }
.pd-chart svg { width: 100%; height: auto; display: block; }
.pd-chart-n {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  fill: var(--copper-deep);
}
.pd-chart-m {
  font-family: var(--display);
  font-size: 11px;
  fill: var(--muted);
}
.pd-chart figcaption,
.pd-head-photo figcaption {
  font-size: .85rem;
  color: var(--muted);
  margin-top: .5rem;
  line-height: 1.45;
}
.pd-head-photo { margin: 0; }
.pd-head-photo .duotone {
  border-radius: 12px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  overflow: hidden;
}
.pd-head-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 780px) {
  .pd-head-media { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
}

@media (max-width: 640px) {
  /* A 253px sticky search bar ate a third of a phone screen and sat right on the standard's
     30% budget. The visible label is redundant on mobile — the placeholder and the
     programmatic <label for> both still say what the field is — so it is hidden visually and
     the field and button share one row, taking the bar to roughly a tenth of the viewport. */
  [data-stoa-index-controls] { padding: .6rem 0 .5rem; }
  [data-stoa-index-controls] label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  [data-stoa-index-controls] form { flex-wrap: nowrap; }
  [data-stoa-index-controls] input[type="search"] { flex: 1 1 6rem; min-width: 0; }
  [data-stoa-index-controls] button { padding: .62rem 1rem; }
  [data-stoa-index-summary] { margin-top: .4rem; font-size: .85rem; }
}

/* The theme sets html{scroll-behavior:smooth}, which is pleasant on a short page and wrong
   on a long index: jumping to an offering anchor or a pager link animates a glide across
   several thousand pixels, and the visitor loses their place on the way. Scope it back to an
   instant jump wherever a long index is on the page. */
:root:has([data-stoa-index]) { scroll-behavior: auto; }

@media (max-width: 640px) {
  /* On a phone the chrome, breadcrumb, heading, lede, scope line, and subject rail together
     pushed the search field's lower edge exactly to the fold, so page-local discovery was
     off-screen on arrival. Everything above the search is tightened so the control a visitor
     came here to use is fully visible without scrolling. */
  .pd-head .wrap { padding-top: 1.1rem; padding-bottom: .6rem; }
  .crumbs ol { margin-bottom: .5rem; font-size: .8rem; }
  .pd-head h1 { font-size: 1.75rem; }
  .pd-head .lede { font-size: .95rem; line-height: 1.45; margin-bottom: .4rem; }
  .pd-scope { font-size: .88rem; }
  .pd-subjects { padding: 0 0 .6rem; }
  .pd-subjects-label { margin-bottom: .35rem; }
  .pd-subjects a { padding: .4rem .6rem; font-size: .85rem; }
}

/* The at-a-glance band sits inside the results column, below the pager. Two reasons: the
   chart describes the filtered set it follows, and keeping it inside the index root gives
   the sticky controls a containing block long enough that page-local discovery stays pinned
   even on a subject view holding a single offering. */
.pd-glance {
  margin: 2.4rem 0 0;
  padding: 1.6rem 0 0;
  border-top: 1px solid var(--line);
}
.pd-glance .lead-head { margin-top: 0; }
