/* HCDRC site styles — derived from the al-folio based theme of bioloid.github.io */

/* Cross-fade between pages in browsers that support cross-document view transitions. */
@view-transition { navigation: auto; }

/****************************************************************************** Themes (follow the system setting, see theme.js) */
:root { --global-bg-color: #ffffff; --global-text-color: #000000; --global-text-color-light: #6f6f6f; --global-theme-color: #0B5CAD; --global-hover-color: #0B5CAD; --global-divider-color: rgba(0,0,0,.1); }

html[data-theme='dark'] { --global-bg-color: #1C1C1D; --global-text-color: #e8e8e8; --global-text-color-light: #a6a6a6; --global-theme-color: #5AA9E6; --global-hover-color: #5AA9E6; --global-divider-color: #424246; }

/****************************************************************************** Base */
/* Always reserve the scrollbar space so short and long pages keep the same horizontal layout. */
html { background-color: var(--global-bg-color); scrollbar-gutter: stable; }

body { padding-bottom: 70px; color: var(--global-text-color); background-color: var(--global-bg-color); font-family: Roboto, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; overflow-wrap: break-word; }

body.fixed-top-nav { padding-top: 56px; }

body.sticky-bottom-footer { padding-bottom: 0; }

.container { max-width: 980px; }

p, h1, h2, h3, h4, h5, h6, em, div, li, span, strong, dt, dd { color: var(--global-text-color); }

a { color: var(--global-theme-color); }

a:hover { color: var(--global-theme-color); text-decoration: underline; }

.post-header:not(.center-header) { margin-bottom: 2rem; }

/* Every page title uses the same size and weight as the overview title. */
.post-header .post-title { margin-bottom: 0.35rem; font-size: 2.1rem; font-weight: 700; }

.post-description { margin-bottom: 2rem; font-size: 1rem; font-weight: 300; color: var(--global-text-color-light); }

/* Korean content uses Noto Sans KR for every glyph (Hangul, Latin letters and digits alike), so mixed text
   such as "제1세부" or "QoS 보장" is drawn in one font with one stroke weight. English areas keep Roboto. */
[lang="ko"] { word-break: keep-all; }

:lang(ko) { font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }

:lang(en) { font-family: Roboto, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }

:lang(ja) { font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", sans-serif; }

[lang="en"] { word-break: normal; }

:lang(ko) p, :lang(ko) li, :lang(ko) dd, :lang(ko) figcaption { font-weight: 400; }

/****************************************************************************** Navbar */
.navbar { box-shadow: none; border-bottom: 1px solid var(--global-divider-color); background-color: var(--global-bg-color); }

.navbar.navbar-light a:hover { text-decoration: none; }

.navbar.navbar-light .navbar-brand { color: var(--global-text-color); }

.navbar.navbar-light .navbar-nav .nav-item .nav-link { color: var(--global-text-color); font-weight: 400; }

.navbar.navbar-light .navbar-nav .nav-item .nav-link:hover { color: var(--global-hover-color); }

.navbar.navbar-light .navbar-nav .nav-item.active > .nav-link { background-color: inherit; font-weight: 700; color: var(--global-theme-color); }

.navbar.navbar-light .navbar-nav .nav-item.active > .nav-link:hover { color: var(--global-hover-color); }

.navbar-toggler .icon-bar { display: block; width: 22px; height: 2px; background-color: var(--global-text-color); border-radius: 1px; margin-bottom: 4px; transition: all 0.2s; }

.navbar-toggler .top-bar { transform: rotate(45deg); transform-origin: 10% 10%; }

.navbar-toggler .middle-bar { opacity: 0; }

.navbar-toggler .bottom-bar { transform: rotate(-45deg); transform-origin: 10% 90%; }

.navbar-toggler.collapsed .top-bar { transform: rotate(0); }

.navbar-toggler.collapsed .middle-bar { opacity: 1; }

.navbar-toggler.collapsed .bottom-bar { transform: rotate(0); }

/****************************************************************************** Overview page */
.center-header { display: flex; align-items: center; gap: 1.75rem; }

.center-header .center-logo { flex: 0 0 auto; width: 150px; height: auto; }

html[data-theme='dark'] .center-header .center-logo { padding: 8px; background: #ffffff; border-radius: 8px; }

.center-header .post-description { margin-bottom: 0; }

.section { margin-top: 2.5rem; }

.section h2 { margin-bottom: 1rem; font-size: 1.75rem; font-weight: 700; }

.section p { line-height: 1.8; }

.figure-block { margin: 1.5rem 0 0; }

.figure-block img { display: block; width: 100%; height: auto; padding: 0.75rem; background: #ffffff; border: 1px solid var(--global-divider-color); border-radius: 6px; }

.figure-block a { cursor: zoom-in; }

.figure-block a:hover img { border-color: var(--global-theme-color); }

.figure-block figcaption { margin-top: 0.5rem; font-size: 0.85rem; text-align: center; color: var(--global-text-color-light); }

.concept { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }

.concept .figure-block { margin-top: 0; }

.concept-points { margin: 0.75rem 0 0; padding-left: 1.1rem; }

.concept-points li { padding: 0.15rem 0; line-height: 1.7; }

.info-list { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.5rem 1rem; margin: 0; }

.info-list dt { font-weight: 500; color: var(--global-text-color-light); }

.info-list dd { margin: 0; }

.subproject { padding: 1.5rem 0; border-top: 1px solid var(--global-divider-color); }

.subproject:first-of-type { border-top: 0; padding-top: 0.25rem; }

.subproject h3 { margin-bottom: 0.4rem; font-size: 1.25rem; font-weight: 500; }

.subproject h3 .sub-no { margin-right: 0.4rem; color: var(--global-theme-color); }

.subproject .sub-goal { margin-bottom: 0; color: var(--global-text-color-light); }

.subproject .figure-block { margin-top: 1rem; }

.prof-list { margin: 1rem 0 0; padding-left: 1.1rem; }

.prof-list li { padding: 0.2rem 0; line-height: 1.7; }

@media (max-width: 767.98px) {
  .concept { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
  .center-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .center-header .center-logo { width: 120px; }
  .post-header .post-title { font-size: 1.6rem; }
  .info-list { grid-template-columns: 1fr; gap: 0; }
  .info-list dd { margin-bottom: 0.6rem; }
  .figure-block img { padding: 0.4rem; }
}

/****************************************************************************** Figure viewer (lightbox.js) */
/* The page stays put behind the viewer; scrollbar-gutter keeps the layout from shifting. */
html.lightbox-open { overflow: hidden; }

/* The dialog covers the viewport; the card is centered in it and a click outside the card closes it.
   touch-action: none hands pinch and swipe gestures to lightbox.js instead of zooming the page. */
.lightbox { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 4.5rem 5rem 2rem; border: 0; background: transparent; overflow: hidden; touch-action: none; }

.lightbox[open] { display: flex; align-items: center; justify-content: center; }

.lightbox::backdrop { background: rgba(17, 20, 26, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.2s ease; }

.lightbox.is-visible::backdrop { opacity: 1; }

html[data-theme='dark'] .lightbox::backdrop { background: rgba(0, 0, 0, 0.65); }

/* The figures are drawn on white, so the card stays white in both themes. */
/* .lightbox-zoom carries the zoom transform (set by lightbox.js), so the white card and the image scale together. */
.lightbox-zoom { position: relative; z-index: 1; margin: auto; max-width: min(1200px, 100%); transform-origin: 50% 50%; cursor: zoom-in; -webkit-user-select: none; user-select: none; }

.lightbox-zoom.is-zoomed { cursor: grab; }

.lightbox-zoom.is-dragging { cursor: grabbing; }

.lightbox-figure { margin: 0; padding: 1.25rem; background: #ffffff; border-radius: 10px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3); opacity: 0; transform: scale(0.97); transition: opacity 0.2s ease, transform 0.2s ease; }

.lightbox.is-visible .lightbox-figure { opacity: 1; transform: none; }

.lightbox-img { display: block; max-width: 100%; max-height: calc(100vh - 11rem); width: auto; height: auto; margin: 0 auto; }

.lightbox-caption { margin-top: 0.85rem; font-size: 0.95rem; text-align: center; color: #555555; }

.lightbox-counter { position: fixed; z-index: 2; top: 1.6rem; left: 50%; padding: 0.15rem 0.75rem; font-size: 0.85rem; color: #ffffff; background: rgba(0, 0, 0, 0.45); border-radius: 999px; transform: translateX(-50%); opacity: 0; transition: opacity 0.2s ease; }

.lightbox-btn { position: fixed; z-index: 2; display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; padding: 0; color: #222222; background: rgba(255, 255, 255, 0.92); border: 0; border-radius: 50%; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); cursor: pointer; opacity: 0; transition: opacity 0.2s ease, background-color 0.15s ease; }

.lightbox-btn[hidden], .lightbox-counter[hidden] { display: none; }

.lightbox.is-visible .lightbox-btn, .lightbox.is-visible .lightbox-counter { opacity: 1; }

.lightbox-btn:hover { background: #ffffff; }

.lightbox-btn:focus { outline: none; }

.lightbox-btn:focus-visible { outline: 3px solid var(--global-theme-color); outline-offset: 2px; }

.lightbox-close { top: 1rem; right: 1.25rem; }

.lightbox-prev, .lightbox-next { top: 50%; margin-top: -1.375rem; }

.lightbox-prev { left: 1.25rem; }

.lightbox-next { right: 1.25rem; }

/* On phones the arrows move to the bottom corners so the figure can use the full width. */
@media (max-width: 575.98px) {
  .lightbox { padding: 4rem 0.75rem 5rem; }
  .lightbox-figure { padding: 0.6rem; }
  .lightbox-img { max-height: calc(100vh - 13rem); }
  .lightbox-close { top: 0.75rem; right: 0.75rem; }
  .lightbox-counter { top: 1.25rem; }
  .lightbox-prev, .lightbox-next { top: auto; bottom: 1rem; margin-top: 0; }
  .lightbox-prev { left: calc(50% - 3.5rem); }
  .lightbox-next { right: calc(50% - 3.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox::backdrop, .lightbox-figure, .lightbox-btn, .lightbox-counter { transition: none; }
}

/****************************************************************************** Publication & patent lists */
.publications { margin-top: 1rem; }

.publications .year-heading { margin: 2.25rem 0 1rem; padding-bottom: 0.4rem; font-size: 1.35rem; font-weight: 500; border-bottom: 1px solid var(--global-divider-color); scroll-margin-top: 72px; }

.publications .year-heading:first-child { margin-top: 0; }

.publications ol.bibliography { list-style: none; margin: 0; padding: 0; }

.publications ol.bibliography li { margin-bottom: 1.1rem; line-height: 1.6; }

.publications ol.bibliography li:last-child { margin-bottom: 0; }

/* "Name: URL" lists (Software) have one line per entry, so the entries sit closer together,
   each with a bullet on the left. Long URLs wrap anywhere instead of widening the page. */
.publications ol.bibliography.name-list { list-style: disc; padding-left: 1.25rem; }

.publications ol.bibliography.name-list li { margin-bottom: 0.55rem; padding-left: 0.2rem; }

.publications ol.bibliography.name-list li .url { overflow-wrap: anywhere; }

.publications ol.bibliography.name-list li:last-child { margin-bottom: 0; }

.publications ol.bibliography li .title { font-weight: 400; color: var(--global-text-color); }

.publications ol.bibliography li a.title:hover { color: var(--global-theme-color); }

.publications ol.bibliography li .periodical { margin-top: 0.1rem; font-size: 0.9rem; font-style: italic; color: var(--global-text-color-light); }

.tag { display: inline-block; margin-right: 0.45rem; padding: 0 0.4rem; font-size: 0.7rem; font-weight: 500; line-height: 1.5; letter-spacing: 0.03em; text-transform: uppercase; vertical-align: 0.12em; color: var(--global-theme-color); border: 1px solid var(--global-theme-color); border-radius: 3px; white-space: nowrap; }

.empty-state { padding: 1.5rem 0; color: var(--global-text-color-light); }

/****************************************************************************** Footer */
footer.sticky-bottom { border-top: 1px solid var(--global-divider-color); padding-top: 40px; padding-bottom: 40px; font-size: 0.9rem; }

footer.sticky-bottom, footer.sticky-bottom div { color: var(--global-text-color-light); }
