/* ==========================================================
   LSAIL — Life Science and AI Lab
   Clean, BMIL-inspired academic layout
   ========================================================== */

:root {
  --primary: #1F6B43;
  --primary-dark: #164A30;
  --primary-darker: #0E3220;
  --bg-light: #EAF4EE;
  --bg-softer: #F6FAF7;
  --text: #1A1A1A;
  --muted: #384841;
  --border: #D6E3D9;
  --white: #FFFFFF;
  --max-width: 1180px;
  --nav-height: 72px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.7;
}
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(22, 74, 48, 0.04);
}
.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary-dark);
}
.brand-wrap:hover { text-decoration: none; }
.brand-wrap img { height: 40px; width: auto; }
.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
  color: var(--primary-dark);
  line-height: 1.2;
}
.brand small {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}
.lsail-logo {
  height: 40px;
  width: auto;
  display: block;
}
/* Nav links with hover dropdowns */
.mainnav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-item { position: relative; }
.nav-item > a {
  display: inline-block;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  border-radius: 8px;
  white-space: nowrap;
}
.nav-item > a:hover,
.nav-item.active > a {
  color: var(--primary);
  background: var(--bg-softer);
  text-decoration: none;
}
.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: 200px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(22, 74, 48, 0.12);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 60;
}
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.dropdown a {
  display: block;
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}
.dropdown a:hover {
  background: var(--bg-softer);
  color: var(--primary-dark);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--white);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--primary-dark);
  font-weight: 600;
}

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  color: var(--white);
  padding: 120px 24px 128px;
  background:
    linear-gradient(rgba(14, 50, 32, 0.82), rgba(22, 74, 48, 0.85)),
    url('assets/network.svg') center/cover no-repeat,
    url('assets/hero.jpg') center/cover no-repeat;
  text-align: center;
  overflow: hidden;
}
.hero * { color: var(--white); }
.hero-inner { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; }
.hero .eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.hero p.lead {
  font-size: 1.12rem;
  max-width: 740px;
  margin: 0 auto;
  color: #FFFFFF;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  font-weight: 400;
}
.hero p.lead strong {
  color: #F5E9A8;
  font-weight: 700;
}
.hero-cta {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}
.btn-primary { background: var(--white); color: var(--primary-dark) !important; }
.btn-primary:hover { background: var(--bg-light); text-decoration: none; }
.btn-outline { background: transparent; border-color: rgba(255, 255, 255, 0.7); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.14); text-decoration: none; }

/* Sub-page hero (shorter) */
.pagehero {
  background:
    linear-gradient(rgba(14, 50, 32, 0.80), rgba(22, 74, 48, 0.82)),
    url('assets/hero.jpg') center/cover no-repeat;
  color: var(--white);
  padding: 72px 24px 64px;
  text-align: center;
}
.pagehero * { color: var(--white); }
.pagehero h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin-bottom: 6px; }
.pagehero p { opacity: 0.92; }

/* ---------- Home 3-column preview ---------- */
.preview-band {
  background: var(--bg-softer);
  padding: 80px 24px;
  border-bottom: 1px solid var(--border);
}
.preview-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.preview-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(22, 74, 48, 0.04);
  transition: transform 0.18s, box-shadow 0.18s;
}
.preview-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(22, 74, 48, 0.09);
}
.preview-card .cap {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}
.preview-card h3 {
  color: var(--primary-dark);
  font-size: 1.28rem;
  margin-bottom: 12px;
}
.preview-card p {
  color: var(--muted);
  margin-bottom: 16px;
}
.preview-card ul {
  color: var(--muted);
  margin-bottom: 20px;
  padding-left: 18px;
  list-style: disc;
}
.preview-card ul li { margin-bottom: 6px; }
.preview-card .more {
  margin-top: auto;
  font-weight: 600;
  color: var(--primary);
  font-size: 0.9rem;
}
.preview-card .more::after { content: " →"; }

/* ---------- General content ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 72px 24px;
}
.section { margin-bottom: 64px; }
.section:last-child { margin-bottom: 0; }
.section h2 {
  font-size: 1.8rem;
  color: var(--primary-dark);
  margin-bottom: 16px;
}
.section > p,
.section > .lead { margin-bottom: 14px; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 820px; }

.section-title {
  text-align: center;
  margin-bottom: 40px;
}
.section-title .eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}
.section-title h2 { margin-bottom: 10px; }
.section-title p {
  color: var(--muted);
  max-width: 720px;
  margin: 0 auto;
}

/* Research area grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 4px 14px rgba(22, 74, 48, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;   /* 수평 가운데 정렬 */
  text-align: center;    /* 텍스트 가운데 */
}
.card h3 { color: var(--primary-dark); margin-bottom: 10px; }
.card p { color: var(--muted); }
.card .badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-light);
  color: var(--primary-dark);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.card img {
  width: 100px;
  height: 100px;
  object-fit: cover;
}

.feature-band {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
}
.feature-band p + p { margin-top: 12px; }

.pubs, .simple-list {
  padding-left: 22px;
  list-style: disc;
}
.pubs li, .simple-list li { margin-bottom: 14px; }
.pubs { list-style: decimal; }

/* People box */
.people-box {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: start;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 4px 14px rgba(22, 74, 48, 0.04);
}

.people-box img {
  width: 160px;
  height: 200px;
  object-fit: cover;
  object-position: center top;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(22, 74, 48, 0.08);
}
.people-box h2 { color: var(--primary-dark); margin-bottom: 6px; }
.people-box p + p { margin-top: 10px; }

.member-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: flex-start;
}

.member-card {
  width: 220px;
  flex: 0 0 220px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(22, 74, 48, 0.04);
}

.member-card .badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.member-card img {
  width: 110px !important;
  height: 110px !important;
  max-width: none !important;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  margin: 6px auto 14px;
  display: block;
}

.member-card h3 {
  margin: 4px 0 4px;
  font-size: 0.96rem;
  line-height: 1.3;
  color: var(--primary-dark);
}

.member-card p {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- Footer ---------- */
footer {
  background: var(--primary-darker);
  color: var(--white);
  padding: 48px 24px 24px;
}
footer * { color: #DCEBE1; }
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}
.footer-inner h4 {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #B8D4C2 !important;
  margin-bottom: 14px;
}
.footer-inner p { font-size: 0.93rem; margin-bottom: 10px; }
.footer-inner a { color: #DCEBE1; }
.footer-inner a:hover { color: var(--white); }
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.footer-brand img {
  height: 38px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 4px 7px;
}
.footer-brand strong {
  font-size: 1.05rem;
  color: var(--white) !important;
}
.footer-bottom {
  max-width: var(--max-width);
  margin: 36px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: #B8D4C2 !important;
}

/* ---------- Feature block (photo + text) ---------- */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px;
  box-shadow: 0 4px 14px rgba(22, 74, 48, 0.04);
}
.feature.reverse > :first-child { order: 2; }
.feature img {
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(22, 74, 48, 0.08);
}
.feature h3 {
  color: var(--primary-dark);
  font-size: 1.4rem;
  margin-bottom: 12px;
}
.feature p { color: var(--muted); margin-bottom: 10px; }

/* ---------- Album / Lightbox ---------- */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.album-item {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.album-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(22, 74, 48, 0.12);
  text-decoration: none;
}
.album-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.album-item .album-caption {
  padding: 14px 18px;
}
.album-item .album-caption .date {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 4px;
}
.album-item .album-caption h3 {
  font-size: 1.05rem;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.album-item .album-caption p {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Lightbox overlay */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 24, 16, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 40px;
  cursor: zoom-out;
  animation: lightbox-fade 0.2s ease;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox .lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.95rem;
  text-align: center;
  max-width: 80%;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.lightbox .lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox .lightbox-close:hover { background: rgba(255, 255, 255, 0.25); }
@keyframes lightbox-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* News article (dedicated news page) */
.news-article {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(22, 74, 48, 0.04);
  margin-bottom: 20px;
  align-items: start;
}
.news-article-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
}
.news-article-body h2 {
  font-size: 1.3rem;
  color: var(--primary-dark);
  margin-bottom: 10px;
}
.news-article-body .news-date {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}
.news-article-body p {
  color: var(--muted);
  margin-bottom: 10px;
}
@media (max-width: 700px) {
  .news-article { grid-template-columns: 1fr; }
}

/* News list (home-page preview) */
.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.news-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.news-item .date {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.news-item h3 {
  font-size: 1.05rem;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.news-item p { color: var(--muted); font-size: 0.95rem; }

/* Responsive */
@media (max-width: 960px) {
  .feature { grid-template-columns: 1fr; }
  .feature.reverse > :first-child { order: 0; }
}
@media (max-width: 960px) {
  .preview-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .people-box { grid-template-columns: 1fr; }
}
@media (max-width: 1160px) {
  .nav-toggle { display: inline-block; }
  .mainnav {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px 16px;
    box-shadow: 0 8px 18px rgba(22, 74, 48, 0.08);
    gap: 0;
  }
  .mainnav.open { display: flex; }
  .nav-item > a { padding: 12px 8px; display: block; }
  .dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    padding: 0 0 6px 16px;
    background: transparent;
    min-width: 0;
  }
  .topbar-inner { position: relative; }
}
@media (max-width: 820px) {
  .hero { padding: 72px 20px 84px; }
  .container { padding: 52px 24px; }
}
