/* Department home pages (/department/{dept}/about, /department/mechanical/mech): the department's front door.
   A full-width navy band holds the department's name and its sections as a directory board; below it one reading
   column sits beside the notice desk. The introduction comes from page_section in several shapes (bold first paragraph,
   h2, h3, h4), so its rules style what staff type and change no text. sidebar.jsp is the board: on phones the shared
   script in header.jsp folds it into one toggle bar. Prefix kda-. */
.kda-hero, .kda-layout {
  --kda-navy: var(--kc-navy, #0d2847);
  --kda-blue: var(--kc-blue, #285690);
  --kda-gold: var(--kc-gold, #e0a526);
  --kda-ink: var(--kc-ink, #1b2a3d);
  --kda-line: var(--kc-line, #e3e8f0);
  --kda-soft: var(--kc-soft, #f3f6fb);
  --kda-rule: var(--kc-rule-on-navy, rgba(255, 255, 255, .14));
  --kda-mist: var(--kc-on-navy-soft, #b9c7dc);
  --kda-ease: var(--kc-ease, cubic-bezier(.2, .7, .2, 1));
  --kda-edge: max(24px, calc((100vw - 1280px) / 2 + 24px));
}

/* Reading column and notice desk */
.kda-layout {
  display: grid !important; grid-template-columns: minmax(0, 1fr) 372px; gap: 64px; align-items: start;
  max-width: none !important; width: 100%; margin: 0; padding: 56px var(--kda-edge) 64px !important; background: #fff;
}
.kda-layout > div { width: auto !important; max-width: none !important; min-width: 0; margin: 0 !important; padding: 0 !important; float: none; }
/* the newest five notices with View All in sight; the rest are one click away */
.kda-layout div:has(> #noticeBoardItems) { max-height: none !important; overflow: visible !important; }
.kda-layout #noticeBoardItems > li:nth-child(n+6) { display: none; }

.kda-text {
  max-width: 68ch; color: var(--kda-ink);
  font-family: Inter, 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px; font-weight: 400; line-height: 1.7; text-align: justify; text-wrap: pretty; overflow-wrap: break-word;
}
.kda-text ::selection { background: var(--kda-gold); color: var(--kda-navy); }
.kda-text p, .kda-text ul:not(.kda-short) > li, .kda-text ol > li { text-align: justify !important; text-justify: inter-word; -webkit-hyphens: auto; hyphens: auto; }
.kda-text ul.kda-short li { text-align: left !important; }
.kda-text p { margin: 0 0 18px; }
.kda-text p:last-child { margin-bottom: 0; }

/* The title, whichever way it was typed. Typed capitals are set in sentence case; the stored text stays as it is. */
.kda-text :is(h1, h2, h3):first-child,
.kda-text p:first-child > strong:only-child {
  display: block; margin: 0 0 16px; color: var(--kda-navy); font-family: Lora, Georgia, 'Times New Roman', serif;
  font-size: clamp(26px, 2.2vw, 32px); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; text-wrap: balance;
}
.kda-text p:first-child:has(> strong:only-child) { margin: 0; }
.kda-text p:first-child > strong:only-child { text-transform: lowercase; }
.kda-text p:first-child > strong:only-child::first-letter { text-transform: uppercase; }

/* The opening paragraph leads */
.kda-text :is(h1, h2, h3):first-child + p,
.kda-text p:first-child:has(> strong:only-child) + p { margin-bottom: 24px; color: var(--kda-navy); font-size: 19px; line-height: 1.55; }

/* Sections inside long introductions */
.kda-text :is(h2, h3, h4, h5):not(:first-child) {
  margin: 36px 0 12px; color: var(--kda-navy); font-family: Lora, Georgia, 'Times New Roman', serif; font-size: 22px; font-weight: 600; line-height: 1.25; text-wrap: balance;
}
.kda-text a { color: var(--kda-blue); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.kda-text a:focus-visible { outline: 2px solid var(--kda-gold); outline-offset: 2px; }

/* Lists: a gold mark in place of the browser's bullet */
.kda-text :is(ul, ol) { margin: 0 0 22px; padding: 0; list-style: none; }
.kda-text li { position: relative; margin: 0; padding: 4px 0 4px 22px; }
.kda-text li::before { content: ""; position: absolute; top: calc(4px + .85em - 1px); left: 2px; width: 10px; height: 2px; background: var(--kda-gold); }
.kda-text ol { counter-reset: kda; }
.kda-text ol > li { counter-increment: kda; padding-left: 30px; }
.kda-text ol > li::before { content: counter(kda) "."; top: 4px; left: 0; width: auto; height: auto; background: none; color: var(--kda-blue); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Lists of short names (subjects, recruiters) sit in a tinted two-column panel; js/department-about.js marks them */
.kda-text ul.kda-short { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 2px 24px; padding: 16px 20px; border-radius: 10px; background: var(--kda-soft); }
.kda-text ul.kda-short li { font-size: 16px; font-weight: 500; line-height: 1.45; }
.kda-text ul.kda-short li::before { top: calc(4px + .725em - 1px); }

/* Alignment with the shared parts of these pages */
.row.scrollingnews { margin-right: 0; margin-left: 0; overflow: hidden; }
#page-blocks.kec-blocks { box-sizing: border-box; width: calc(100% - 48px); max-width: 1232px !important; margin-right: auto; margin-left: auto; }

@media (min-width: 1100px) and (min-height: 760px) {
  .kda-layout > div:nth-child(2) { position: sticky; top: calc(24px + var(--kc-nav-offset, 0px)); }
}
@media (max-width: 1099.98px) {
  .kda-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 40px !important; padding-bottom: 48px !important; }
}
@media (max-width: 767.98px) {
  .kda-layout { padding: 28px 16px 40px !important; }
  .kda-text { font-size: 16px; }
  .kda-text :is(h1, h2, h3):first-child + p,
  .kda-text p:first-child:has(> strong:only-child) + p { font-size: 18px; }
  #page-blocks.kec-blocks { width: calc(100% - 32px); }
}
@media (prefers-reduced-motion: reduce) {
}
