/* Editorial content and course galleries use the shared site design. */
body.articles-page,
body.article-page { padding-bottom: var(--mobile-navigation-height, 0px); background: var(--paper-light, #faf8f3); }
.articles-page main,
.article-page main { overflow-wrap: anywhere; }
.articles-page [hidden],
.article-page [hidden],
.student-work-dialog [hidden] { display: none !important; }
.journal-hero { padding-block: 25px 34px; }
.journal-hero .detail-breadcrumb { margin-bottom: 22px; }
.journal-hero > .section-kicker { margin-bottom: 12px; }
.journal-hero h1 { max-width: 1050px; margin: 0 0 17px; color: var(--ink); font-size: clamp(2.3rem, 4.4vw, 4rem); line-height: 1.55; letter-spacing: -.04em; font-weight: 800; }
.journal-accent { color: var(--brand); }
.journal-hero > p:not(.section-kicker) { max-width: 810px; margin: 0; color: var(--muted); font-size: .96rem; line-height: 2.15; }
.journal-preview-note,
.journal-hero > p.journal-preview-note { margin: 18px 0 0; color: #7b7265; font-size: .69rem; line-height: 1.95; }
.journal-toolbar { padding: 23px 25px; border: 1px solid #e0d6c9; border-radius: 20px; background: #fff; }
#article-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; margin: 0 0 19px; }
#article-search label { grid-column: 1 / -1; color: var(--ink); font-size: .78rem; font-weight: 700; line-height: 1.9; }
#article-search input { width: 100%; min-width: 0; min-height: 52px; padding: 12px 16px; border: 1px solid #dcd4c9; border-radius: 11px; color: var(--ink); background: #faf8f3; font: inherit; font-size: 16px; }
#article-search input:focus { border-color: var(--brand); outline-offset: 2px; }
#article-search input::placeholder { color: #817b72; opacity: 1; }
#article-search button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 118px; min-height: 52px; padding: 11px 22px; border: 1px solid var(--brand); border-radius: 11px; color: #fff; background: var(--brand); font-size: .84rem; font-weight: 700; }
#article-search button:hover { background: var(--brand-deep); }
.journal-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 13px 18px; padding-top: 19px; border-top: 1px solid var(--line); }
#article-categories { display: flex; flex: 1 1 560px; flex-wrap: wrap; gap: 8px; min-width: 0; }
#article-categories button { min-height: 44px; max-width: 100%; padding: 8px 13px; border: 1px solid #ded5c8; border-radius: 9px; color: #6e675c; background: #faf8f3; font-size: .76rem; line-height: 1.8; font-weight: 600; }
#article-categories button:hover { border-color: #bc9d85; color: var(--brand); }
#article-categories button:is([aria-pressed="true"], [aria-current="true"], .is-active) { border-color: var(--brand); color: var(--brand); background: #fcf0e9; }
.journal-filters > label,
.journal-result-line label { display: inline-flex; align-items: center; gap: 9px; min-width: 0; color: var(--muted); font-size: .75rem; line-height: 1.9; }
.journal-filters select,
.journal-result-line select { max-width: 100%; min-width: 0; min-height: 44px; padding: 8px 11px; border: 1px solid #dbd0c2; border-radius: 9px; color: var(--ink); background: #fff; font: inherit; font-size: .76rem; cursor: pointer; }
#article-clear { min-height: 44px; padding: 7px 3px; color: var(--brand); background: transparent; font-size: .73rem; font-weight: 600; }
#article-clear:hover { text-decoration: underline; text-underline-offset: 4px; }
.journal-result-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; min-height: 60px; margin-block: 27px 21px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
#article-result-count { margin: 0; color: var(--muted); font-size: .81rem; line-height: 1.9; }
#article-result-count strong { color: var(--ink); }
.journal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 28px 24px; }
.journal-card { min-width: 0; overflow: hidden; border: 1px solid #e0d6ca; border-radius: 19px; background: #fff; box-shadow: 0 8px 26px rgba(38, 26, 15, .035); }
.journal-card__image { display: block; width: 100%; border-bottom: 1px solid #e6dccf; background: #efe7dc; }
.journal-card__image img { display: block; width: 100%; max-width: 100%; height: auto; }
.journal-card__image:focus-visible { outline-offset: -5px; }
.editorial-image-fallback { display: grid; place-items: center; min-height: 180px; padding: 28px; border: 1px dashed #d7c8b6; color: #7b6d5b; background: #f3ede2; font-size: .83rem; line-height: 2; text-align: center; }
.journal-card__body { padding: 19px 22px 16px; }
.journal-card__categories { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; margin-bottom: 9px; }
.journal-card__categories a { display: inline-flex; align-items: center; min-height: 44px; padding: 5px 9px; border: 1px solid #e5d8c8; border-radius: 7px; color: var(--brand); background: #faf4ec; font-size: .66rem; line-height: 1.8; font-weight: 600; }
.journal-card__categories a:hover { border-color: #c3a68e; }
.journal-card :is(h2, h3) { margin: 0 0 11px; color: var(--ink); font-size: 1.11rem; line-height: 1.85; font-weight: 800; }
.journal-card :is(h2, h3) a { display: inline-flex; align-items: center; min-height: 44px; }
.journal-card :is(h2, h3) a:hover { color: var(--brand); }
.journal-card__excerpt,
.journal-card__body > p { margin: 0 0 16px; color: var(--muted); font-size: .8rem; line-height: 2.05; }
.journal-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 13px; color: #7d7468; font-size: .68rem; line-height: 1.9; }
.journal-card__meta svg { display: inline-block; width: 15px; height: 15px; vertical-align: middle; margin-inline-end: 4px; }
.journal-card__course { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 14px; padding: 8px 10px; border: 1px solid #e5dccf; border-radius: 9px; color: #695e51; background: #f8f4ed; font-size: .72rem; line-height: 1.9; }
.journal-card__course:hover { color: var(--brand); border-color: #bca18b; }
.journal-card__course svg { width: 17px; height: 17px; flex: none; }
.journal-card__read { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 47px; margin-top: 15px; padding: 10px 0 2px; border-top: 1px solid var(--line); color: var(--brand); font-size: .79rem; line-height: 1.9; font-weight: 700; }
.journal-card__read svg { width: 18px; height: 18px; flex: none; }
.journal-card__read:hover { color: var(--brand-deep); }
.articles-page .content-empty { margin: 0; padding: 48px 25px; border: 1px dashed #d8ccbc; border-radius: 19px; color: var(--muted); background: #fff; text-align: center; line-height: 2; }
#article-more { display: flex; align-items: center; justify-content: center; min-width: 220px; max-width: 100%; min-height: 50px; margin: 33px auto 70px; padding: 12px 23px; border: 1px solid #d6c6b5; border-radius: 11px; color: var(--ink); background: #fff; font-size: .85rem; font-weight: 700; }
#article-more:hover { border-color: var(--brand); color: var(--brand); }
.articles-page main { padding-bottom: 60px; }
.article-hero { padding-block: 25px 36px; }
.article-heading { max-width: 1040px; margin-inline: auto; padding-block: 25px 36px; }
.article-heading > .section-kicker { margin-bottom: 12px; }
.article-heading h1 { margin: 0 0 20px; color: var(--ink); font-size: clamp(2.1rem, 3.8vw, 3.7rem); line-height: 1.65; font-weight: 800; letter-spacing: -.035em; }
.article-deck { max-width: 900px; margin: 0 0 23px; color: var(--muted); font-size: 1rem; line-height: 2.15; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: #776e62; font-size: .76rem; line-height: 1.95; }
.article-meta svg { display: inline-block; width: 16px; height: 16px; margin-inline-end: 5px; vertical-align: middle; }
.article-cover { width: min(100%, 1100px); margin: 30px auto 0; }
.article-cover img { display: block; width: 100%; max-width: 100%; height: auto; border: 1px solid #dfd3c4; border-radius: 20px; }
.article-cover figcaption { margin-top: 13px; color: var(--muted); font-size: .73rem; line-height: 1.95; text-align: center; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 36px; padding-block: 10px 55px; }
.article-layout > * { min-width: 0; }
.article-body { min-width: 0; padding: 34px 37px; border: 1px solid #e2d8ca; border-radius: 21px; color: #545951; background: #fff; font-size: .94rem; line-height: 2.2; }
.article-body > section { margin-bottom: 31px; padding-bottom: 30px; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--header-height, 86px) + 24px); }
.article-body > section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.article-body h2 { margin: 0 0 18px; color: var(--ink); font-size: 1.5rem; line-height: 1.85; font-weight: 800; }
.article-body .detail-rich-text { font-size: .93rem; line-height: 2.25; }
.article-body .detail-rich-text > :last-child { margin-bottom: 0; }
.article-body pre { max-width: 100%; padding: 15px; overflow-x: auto; border: 1px solid #e1d7c9; border-radius: 10px; background: #f7f2ea; font-size: .79rem; }
.article-sidebar { position: sticky; top: calc(var(--header-height, 86px) + 24px); max-height: calc(100dvh - var(--header-height, 86px) - 48px); padding: 23px 22px; overflow-y: auto; border: 1px solid #ded0be; border-radius: 18px; background: #f1ebe1; scrollbar-width: thin; }
.article-sidebar h2,
.article-sidebar h3 { margin: 0 0 12px; color: var(--ink); font-size: .94rem; line-height: 1.9; font-weight: 800; }
#article-toc { display: grid; gap: 4px; }
#article-toc-links { display: grid; gap: 3px; }
#article-toc a { display: flex; align-items: center; min-height: 44px; padding: 6px 0; color: #706659; font-size: .76rem; line-height: 1.95; }
#article-toc a:hover,
#article-toc a[aria-current="location"] { color: var(--brand); }
#article-toc a[aria-current="location"] { font-weight: 700; }
#article-course { margin-top: 22px; padding-top: 20px; border-top: 1px solid #dacebd; }
#article-course p { margin: 0 0 15px; color: #756b5c; font-size: .79rem; line-height: 2; }
#article-course p.section-kicker { margin: 0 0 9px; color: var(--brand); font-size: .66rem; }
#article-course .button { width: 100%; min-height: 48px; padding-inline: 12px; border-radius: 10px; font-size: .78rem; line-height: 1.8; }
.article-back-link { display: flex; align-items: center; min-height: 44px; margin-top: 17px; padding-top: 12px; border-top: 1px solid #dacebd; color: var(--brand); font-size: .73rem; line-height: 1.9; }
.article-back-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.article-related { padding-block: 15px 75px; }
.article-related > h2 { margin-bottom: 24px; color: var(--ink); font-size: 1.6rem; line-height: 1.8; }
.article-related > .journal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#article-error { min-height: 420px; padding-block: 70px; }
#article-error h1 { margin-bottom: 20px; color: var(--ink); font-size: 2rem; line-height: 1.8; }
#article-error p { color: var(--muted); line-height: 2; }
.course-article-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
.course-article-grid .journal-card__body { padding: 16px 18px 13px; }
.course-article-grid .journal-card h3 { font-size: 1rem; }
.course-articles-all { display: inline-flex; align-items: center; min-height: 44px; margin-top: 18px; padding-block: 8px; color: var(--brand); font-size: .79rem; line-height: 1.9; font-weight: 700; }
.course-articles-all:hover { text-decoration: underline; text-underline-offset: 4px; }
.detail-section > p:has(+ .course-article-grid),
.detail-section > p:has(+ .student-work-grid) { color: var(--muted); font-size: .86rem; line-height: 2; }
.work-preview-note,
.detail-section > p.work-preview-note { margin: 12px 0 18px; padding: 11px 14px; border: 1px solid #e4d8c8; border-radius: 10px; color: #7d6d56; background: #fbf6ed; font-size: .73rem; line-height: 2; }
#student-work > p:not(.work-preview-note) { color: var(--muted); font-size: .86rem; line-height: 2; }
.student-work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); align-items: start; gap: 17px; }
.student-work-card { display: flex; flex-direction: column; align-items: stretch; width: 100%; min-width: 0; padding: 0; overflow: hidden; border: 1px solid #dfd3c3; border-radius: 14px; color: var(--ink); background: #fff; text-align: start; }
.student-work-card:only-child { max-width: 480px; }
.student-work-card:hover { border-color: #ae8165; box-shadow: 0 7px 21px rgba(35, 25, 15, .06); }
.student-work-card__image { display: block; width: 100%; border-bottom: 1px solid #e8ddd0; background: #f6f0e7; }
.student-work-card__image img { display: block; width: 100%; max-width: 100%; height: auto; }
.student-work-card > .workcategory,
.student-work-card > .student-work-card__category { margin: 13px 15px 4px; color: var(--brand); font-size: .64rem; line-height: 1.9; }
.student-work-card > strong { margin: 0 15px 7px; color: var(--ink); font-size: .83rem; line-height: 1.9; font-weight: 700; }
.student-work-card > .studentlabel,
.student-work-card > .student-work-card__student { margin: 0 15px 15px; color: var(--muted); font-size: .67rem; line-height: 1.9; }
.student-work-card > .student-work-card__count { display: flex; align-items: center; min-height: 39px; margin: 0 15px 10px; padding-top: 8px; border-top: 1px solid #e8ddce; color: var(--brand); font-size: .7rem; line-height: 1.8; font-weight: 600; }
.student-work-dialog { width: min(1100px, calc(100% - 32px)); max-width: calc(100% - 32px); max-height: calc(100dvh - 32px); padding: 22px; overflow: hidden; border: 1px solid #d8c8b5; border-radius: 22px; color: var(--ink); background: var(--paper-light); box-shadow: var(--shadow-lg); }
.student-work-dialog[open] { display: flex; flex-direction: column; }
.student-work-dialog::backdrop { background: rgba(18, 22, 18, .62); backdrop-filter: blur(5px); }
.student-work-dialog > header { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.student-work-dialog > header h2 { margin: 0; color: var(--ink); font-size: 1.2rem; line-height: 1.85; }
.student-work-dialog > header button { display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; padding: 9px; border: 1px solid #d8ccbc; border-radius: 50%; color: var(--ink); background: #fff; }
.student-work-dialog > header button:hover { color: var(--brand); background: #f3ede3; }
.student-work-dialog > header button svg { width: 20px; height: 20px; }
.student-work-view { flex: 1 1 auto; min-height: 0; max-width: 100%; margin: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.student-work-view img { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(100dvh - 250px); margin-inline: auto; }
.student-work-view figcaption { margin: 12px 0 0; padding: 0 4px 5px; color: var(--muted); font-size: .78rem; line-height: 2; }
.student-work-view figcaption strong { display: block; margin-bottom: 5px; color: var(--ink); }
.student-work-view figcaption p { margin: 0 0 7px; }
.student-work-controls { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; margin-top: 17px; padding-top: 15px; border-top: 1px solid #ded2c3; }
.student-work-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 105px; padding: 9px 15px; border: 1px solid #d5c3ae; border-radius: 10px; color: var(--ink); background: #fff; font-size: .79rem; font-weight: 600; }
.student-work-controls button:hover { border-color: var(--brand); color: var(--brand); }
.student-work-controls button:disabled { border-color: #e1d9cf; color: #928b81; background: #f0ece5; cursor: default; }
.student-work-controls > span { color: var(--muted); font-size: .76rem; line-height: 1.8; text-align: center; }

@media (max-width: 1100px) {
  .journal-grid,
  .article-related > .journal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 26px; }
  .article-body { padding: 28px; }
}
@media (max-width: 900px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 23px; }
  .article-sidebar { position: static; order: -1; max-height: none; padding: 20px; overflow: visible; }
  #article-toc { display: block; }
  #article-toc-links { display: flex; flex-wrap: wrap; gap: 7px 11px; }
  #article-toc h2 { flex-basis: 100%; margin-bottom: 3px; }
  #article-toc a { min-height: 44px; padding: 7px 10px; border: 1px solid #dcd0bf; border-radius: 8px; background: #fff; }
  #article-course { margin-top: 15px; padding-top: 15px; }
  #article-course .button { width: fit-content; min-width: 220px; }
  .article-deck { font-size: .93rem; }
}
@media (max-width: 650px) {
  .journal-hero,
  .article-hero { padding-block: 17px 27px; }
  .article-heading { padding-block: 17px 27px; }
  .journal-hero .detail-breadcrumb { margin-bottom: 17px; }
  .journal-hero h1 { margin-bottom: 14px; font-size: clamp(1.95rem, 7vw, 2.5rem); }
  .journal-hero > p:not(.section-kicker) { font-size: .86rem; }
  .journal-hero > p.journal-preview-note,
  .journal-preview-note { font-size: .66rem; }
  .journal-toolbar { padding: 19px 16px; border-radius: 16px; }
  #article-search { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  #article-search input,
  #article-search button { min-height: 48px; }
  .journal-filters { gap: 12px; padding-top: 16px; }
  #article-categories { gap: 7px; }
  #article-categories button { padding-inline: 10px; font-size: .72rem; }
  .journal-filters > label { flex: 1; }
  .journal-filters select { flex: 1; }
  .journal-result-line { gap: 10px; margin-block: 22px 17px; }
  #article-result-count { font-size: .77rem; }
  .journal-result-line select { max-width: 175px; font-size: .72rem; }
  .journal-grid,
  .article-related > .journal-grid,
  .course-article-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .journal-card__body { padding: 17px 20px 14px; }
  .journal-card :is(h2, h3) { font-size: 1.08rem; }
  .journal-card__excerpt,
  .journal-card__body > p { font-size: .8rem; }
  .articles-page main { padding-bottom: 45px; }
  #article-more { width: 100%; margin-block: 26px 30px; }
  .article-heading h1 { margin-bottom: 17px; font-size: clamp(1.85rem, 6.5vw, 2.4rem); line-height: 1.75; }
  .article-deck { margin-bottom: 19px; font-size: .87rem; line-height: 2.1; }
  .article-meta { gap: 6px 13px; font-size: .71rem; }
  .article-cover { margin-top: 24px; }
  .article-cover img { border-radius: 15px; }
  .article-cover figcaption { font-size: .69rem; }
  .article-layout { gap: 20px; padding-bottom: 33px; }
  .article-body { padding: 24px 20px; border-radius: 17px; }
  .article-body > section { margin-bottom: 25px; padding-bottom: 24px; scroll-margin-top: calc(var(--header-height, 74px) + 20px); }
  .article-body h2 { margin-bottom: 15px; font-size: 1.23rem; }
  .article-body .detail-rich-text { font-size: .86rem; line-height: 2.2; }
  .article-sidebar { padding: 18px; border-radius: 16px; }
  #article-toc a { font-size: .73rem; }
  #article-course .button { width: 100%; min-width: 0; }
  .article-related { padding-block: 10px 55px; }
  .article-related > h2 { margin-bottom: 20px; font-size: 1.3rem; }
  .student-work-grid { gap: 13px; }
  .student-work-card > strong { margin-inline: 12px; font-size: .78rem; }
  .student-work-card > :is(.workcategory, .student-work-card__category) { margin-inline: 12px; font-size: .61rem; }
  .student-work-card > :is(.studentlabel, .student-work-card__student) { margin-inline: 12px; font-size: .63rem; }
  .student-work-dialog { width: calc(100% - 20px); max-width: calc(100% - 20px); max-height: calc(100dvh - 20px); padding: 16px; border-radius: 17px; }
  .student-work-dialog > header { gap: 11px; margin-bottom: 13px; }
  .student-work-dialog > header h2 { font-size: 1rem; }
  .student-work-view figcaption { font-size: .72rem; }
  .student-work-controls { gap: 8px; margin-top: 13px; padding-top: 12px; }
  .student-work-controls button { min-width: 82px; padding-inline: 10px; font-size: .73rem; }
  .student-work-controls > span { font-size: .7rem; }
}
@media (max-width: 380px) {
  .journal-toolbar { padding-inline: 14px; }
  .journal-filters > label { flex-basis: 100%; }
  .article-body { padding-inline: 17px; }
  .student-work-grid { grid-template-columns: minmax(0, 1fr); }
  .student-work-card > strong { font-size: .85rem; }
  .student-work-controls button { min-width: 72px; }
}
@media print {
  .journal-toolbar,
  .journal-result-line,
  #article-more,
  .article-sidebar,
  .student-work-dialog { display: none !important; }
  .article-layout { display: block; }
  .journal-grid,
  .article-related > .journal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journal-card,
  .student-work-card { break-inside: avoid; box-shadow: none; }
}
