.teacher-portrait{display:block;position:relative;overflow:hidden}
.teacher-portrait img{display:block;width:100%;aspect-ratio:4/5;object-fit:cover}
.teacher-portrait:focus-visible{outline:3px solid #456345;outline-offset:-5px}
.teacher-portrait-gold::after{content:"";position:absolute;inset:0;border:4px solid #c69c48;pointer-events:none}
.teacher-gold-badge{position:absolute;z-index:1;top:12px;left:12px;padding:7px 14px;background:#f2d58a;color:#422b0c;border:1px solid #9c7127;border-radius:5px;font-weight:700}
.teacher-profile{max-width:1120px;margin-inline:auto}
.teacher-back{display:inline-block;margin-bottom:24px}
.teacher-profile-overview{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.6fr);gap:clamp(24px,5vw,64px);align-items:start}
.teacher-profile-overview .teacher-portrait{border-radius:12px}
.teacher-profile-intro h1{margin:0 0 12px}
.teacher-profile-specialty{color:#52664b;white-space:pre-line}
.teacher-profile-text{white-space:pre-line;overflow-wrap:anywhere;line-height:1.8}
.teacher-profile-records{margin-top:48px}
.teacher-record-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:20px}
.teacher-record-card{border:1px solid #dfe5d5;border-radius:12px;overflow:hidden;background:#fcfbf6}
.teacher-record-card img{display:block;width:100%;height:auto}
.teacher-record-card p{padding:0 16px}
.teacher-records-editor{margin-top:20px}
.teacher-records-editor fieldset{min-width:0;margin:12px 0;border:1px solid #dfe5d5;border-radius:8px}
.teacher-records-editor button{margin:4px}
.teacher-gold-toggle[aria-pressed="true"]{background:#f2d58a;color:#422b0c}
@media(max-width:560px){.teacher-card .teacher-portrait img{aspect-ratio:4/3}.teacher-profile-overview{grid-template-columns:1fr}.teacher-profile-overview .teacher-portrait{max-width:340px}}

.teacher-details-link{display:inline-block;color:#274b35;font-size:15px;font-weight:600;text-underline-offset:4px}
.teacher-card .teacher-specialty{color:#43533c;font-size:14px;line-height:1.65}
.teacher-profile-specialty{color:#43533c;font-size:16px;line-height:1.65;overflow-wrap:anywhere}
.teacher-profile-bio{margin-top:24px;padding-top:20px;border-top:1px solid #dfe5d5}
.teacher-profile-bio h2{font-size:clamp(20px,3vw,24px);margin:0 0 12px}
.teacher-profile-bio .teacher-profile-text{max-width:42em;margin:0;color:#243326;font-size:clamp(17px,2vw,19px);line-height:1.85}

.teacher-photo-slots{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(230px,100%),1fr));gap:12px}
.teacher-photo-slots fieldset{margin:0;padding:12px}
.teacher-photo-slots legend{font-weight:700}
.teacher-carousel{max-width:900px;margin-bottom:20px}
.teacher-carousel figure{margin:0}
.teacher-carousel figure img{width:100%;height:auto;aspect-ratio:4/3;object-fit:contain;background:#eef0e7}
.teacher-carousel figcaption{padding:12px 16px;color:#243326}
.teacher-carousel-controls{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:12px}
.teacher-carousel-controls button{border:1px solid #536b54;border-radius:6px;background:#f9faf4;color:#243326;padding:9px 12px;font:inherit;cursor:pointer}
.teacher-carousel-counter{color:#43533c;font-variant-numeric:tabular-nums}

details.teacher-editor{margin-top:12px;padding:0 16px}
details.teacher-editor[open]{padding-bottom:16px}
.teacher-editor summary{cursor:pointer;padding:12px 0;font-weight:700;color:#294733;overflow-wrap:anywhere}
.teacher-editor summary:focus-visible{outline:2px solid #456345;outline-offset:2px}
.teacher-editor[open]>summary{border-bottom:1px solid #dbe2d3}
.teacher-records-editor{border-top:1px solid #dbe2d3}
.teacher-photo-slots{align-items:start}
.teacher-photo-slots details{min-width:0;border:1px solid #dbe2d3;border-radius:8px;padding:0 10px}
.teacher-photo-slots details[open]{padding-bottom:10px}
.teacher-photo-slots img{max-width:100%}
.teacher-editor img[hidden]{display:none}

.teacher-detail-page{height:100vh;height:100dvh;overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr)}
.teacher-detail-page .site-header{height:70px}
.teacher-detail-page .site-header .brand-image{width:76px;height:60px}
.teacher-detail-page .page-main{width:100%;min-height:0;margin:0 auto}
.teacher-detail-page .page-main .teacher-profile{box-sizing:border-box;width:100%;max-width:1440px;height:100%;padding:clamp(10px,2vw,24px) clamp(12px,3vw,44px);display:grid;grid-template-rows:auto minmax(0,1fr)}
.teacher-detail-page .teacher-back{justify-self:start;margin:0 0 12px;font-size:14px}
.teacher-detail-page #teacher-profile{min-height:0;display:grid;grid-template-rows:minmax(0,1fr)}
.teacher-detail-page #teacher-profile.teacher-profile-split{grid-template-columns:minmax(0,1fr) minmax(0,1.12fr);gap:clamp(12px,2vw,24px)}
.teacher-detail-page .teacher-profile-overview,.teacher-detail-page .teacher-profile-records{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;margin:0;padding:clamp(14px,2vw,26px);background:#fcfbf6;border:1px solid #d7dfcf;border-radius:16px;box-shadow:0 5px 18px #2433260b}
.teacher-detail-page .teacher-profile-overview{grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:clamp(12px,2vw,24px)}
.teacher-detail-page .teacher-profile-overview .teacher-portrait{border-radius:10px}
.teacher-detail-page .teacher-profile-intro h1{font-size:clamp(21px,2.25vw,32px);overflow-wrap:anywhere}
.teacher-detail-page .teacher-profile-records h2{font-size:clamp(19px,2vw,26px);margin:0 0 12px}
.teacher-detail-page .teacher-carousel{max-width:none}
.teacher-detail-page .teacher-carousel figure img{aspect-ratio:auto;height:clamp(120px,49dvh,510px);background:#edf0e7}
.teacher-detail-page .teacher-carousel figure{border-color:#d7dfcf}
.teacher-detail-page .teacher-profile-switch{display:none}
@media(max-width:850px){
  .teacher-detail-page .site-header nav{top:70px}
  .teacher-detail-page #teacher-profile.teacher-profile-split{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:10px}
  .teacher-detail-page .teacher-profile-switch{display:flex;gap:8px}
  .teacher-detail-page .teacher-profile-switch button{flex:1;border:1px solid #a7b7a1;border-radius:8px;padding:8px;background:#fcfbf6;color:#294733;font:inherit;cursor:pointer}
  .teacher-detail-page .teacher-profile-switch button[aria-pressed="true"]{background:#294733;color:#fff}
  .teacher-detail-page [data-panel="intro"]>.teacher-profile-records,.teacher-detail-page [data-panel="records"]>.teacher-profile-overview{display:none}
}

/* The profile portrait keeps its original crop and places the award below it. */
.teacher-detail-page .teacher-profile-overview{
  grid-template-columns:minmax(0,1.15fr) minmax(0,1.85fr);
}
.teacher-detail-page .teacher-profile-overview .teacher-portrait{
  display:flex;flex-direction:column;gap:8px;
  width:100%;max-width:240px;justify-self:start;
}
.teacher-detail-page .teacher-profile-overview .teacher-portrait img{
  box-sizing:border-box;order:-1;aspect-ratio:auto;height:auto;
  max-height:min(40dvh,320px);object-fit:contain;object-position:center top;
  background:#eef0e7;border:1px solid #d7dfcf;border-radius:10px;
}
.teacher-detail-page .teacher-profile-overview .teacher-portrait-gold img{
  border:2px solid #c69c48;
}
.teacher-detail-page .teacher-profile-overview .teacher-portrait-gold::after{
  content:none;
}
.teacher-detail-page .teacher-profile-overview .teacher-gold-badge{
  position:static;align-self:center;max-width:100%;box-sizing:border-box;
  padding:4px 8px;font-size:clamp(11px,1.6vw,13px);text-align:center;
}

.teacher-detail-page .teacher-profile-overview{
  grid-template-columns:clamp(64px,18%,108px) minmax(0,1fr);
  grid-template-rows:auto minmax(0,1fr) auto;
  align-content:start;align-items:start;gap:10px 16px;overflow:hidden;
}
.teacher-detail-page .teacher-profile-overview .teacher-portrait img{max-height:min(16dvh,110px)}
.teacher-detail-page .teacher-profile-overview .teacher-portrait{gap:4px}
.teacher-detail-page .teacher-profile-overview .teacher-gold-badge{padding:2px 4px}
.teacher-detail-page .teacher-profile-intro{align-self:center;min-width:0}
.teacher-detail-page .teacher-profile-specialty{margin:4px 0;font-size:14px}
.teacher-detail-page .teacher-profile-bio{
  grid-column:1/-1;min-height:0;height:100%;box-sizing:border-box;
  overflow:hidden;margin:0;padding-top:10px;direction:ltr;text-align:left;
}
.teacher-detail-page .teacher-profile-bio h2{margin-bottom:7px;font-size:20px}
.teacher-detail-page .teacher-profile-bio .teacher-profile-text{
  max-width:none;font-size:clamp(14px,1.25vw,16px);line-height:1.5;
}
.teacher-detail-page .teacher-bio-more{
  grid-column:1/-1;justify-self:start;padding:5px 10px;color:#294733;
  background:#fcfbf6;border:1px solid #a7b7a1;border-radius:6px;cursor:pointer;font:inherit;
}
.teacher-detail-page .teacher-bio-dialog{
  width:min(620px,calc(100% - 32px));max-height:85dvh;overflow:auto;
  box-sizing:border-box;border:1px solid #d7dfcf;border-radius:14px;padding:20px;
  background:#fcfbf6;color:#243326;
}
.teacher-bio-dialog::backdrop{background:#13261980}

.teacher-detail-page .teacher-profile-overview,
.teacher-detail-page .teacher-profile-records{
  border-color:#d5dece;border-radius:18px;
  background:#fffef9;box-shadow:0 6px 20px #263c2a10;
}
.teacher-detail-page .teacher-profile-records{
  display:grid;grid-template-rows:auto minmax(0,1fr);
  gap:clamp(6px,1.5vh,14px);overflow:hidden;
}
.teacher-detail-page .teacher-profile-records h2{margin:0;line-height:1.25}
.teacher-detail-page .teacher-carousel{
  display:grid;grid-template-rows:minmax(0,1fr) auto;
  gap:8px;min-height:0;margin:0;
}
.teacher-detail-page .teacher-carousel figure{
  display:grid;grid-template-rows:minmax(0,1fr) auto;min-height:0;
  border-radius:12px;background:#f4f6ee;
}
.teacher-detail-page .teacher-carousel figure img{
  width:100%;height:100%;min-height:0;object-fit:contain;background:#edf1e8;
}
.teacher-detail-page .teacher-carousel figure img[hidden]{display:none}
.teacher-detail-page .teacher-carousel figure:not(:has(img:not([hidden]))){grid-template-rows:minmax(0,1fr)}
.teacher-detail-page .teacher-carousel figcaption{min-width:0;padding:0;background:#fffef9}
.teacher-detail-page .teacher-carousel figcaption button{
  display:block;width:100%;padding:6px 10px;border:0;text-align:left;
  color:#294733;background:transparent;font:inherit;font-size:14px;cursor:pointer;
}
.teacher-detail-page .teacher-carousel figcaption button span{
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.35;overflow-wrap:anywhere;
}
.teacher-detail-page .teacher-carousel-controls{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin:0;align-items:center;
}
.teacher-detail-page .teacher-carousel-controls button{
  padding:5px 2px;min-height:34px;border-color:#cbd7c8;border-radius:8px;
  background:#f2f6ee;font-size:clamp(10px,2.7vw,14px);
}
.teacher-detail-page .teacher-carousel-controls button:hover{background:#e3eddf}
.teacher-detail-page .teacher-carousel-counter{text-align:center;font-size:13px}
.teacher-detail-page .teacher-bio-dialog p{white-space:pre-wrap;overflow-wrap:anywhere}
