/* ============================================================
   AIoT Lab — 공통 페이지 디자인 시스템
   (Resume/Research/Development/Member/Teaching/Contact/Publication)
   모바일 우선 · 반응형 · 일관된 섹션/카드/타임라인/탭
   브랜드 컬러: 로고 블루 계열
   ============================================================ */

:root {
    --lab-accent: #1f7ec4;        /* AIoT 브랜드 블루 */
    --lab-accent-bright: #8ecbff; /* 로고·히어로 강조·로그인 링크에 쓰는 밝은 블루 */
    --lab-accent-ink: #1a6ca8;
    --lab-accent-soft: #e9f2fb;
    --lab-accent-border: #c5ddf5;
    --lab-ink: #1f2937;
    --lab-muted: #6b7280;
    --lab-border: #e6e8eb;
    --lab-bg-soft: #f8fafc;
}

/* 페이지 컨테이너 */
.lab {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.75rem 1rem 4rem;
    color: var(--lab-ink);
    overflow-wrap: break-word;
    word-break: break-word;
}
.lab img { max-width: 100%; height: auto; }
.lab a { color: var(--lab-accent); text-decoration: none; }
.lab a:hover { text-decoration: underline; }

/* ── 섹션 제목 ── */
.lab-h2 {
    display: flex; align-items: center; gap: .55rem;
    font-size: 1.3rem; font-weight: 700; line-height: 1.25;
    margin: 2.25rem 0 1.1rem; padding-left: .7rem;
    border-left: 5px solid var(--lab-accent);
}
.lab-h2:first-of-type { margin-top: .25rem; }

/* 카드 안 소제목 (Goal/Function/Award 등) */
.lab-sub-h {
    font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--lab-accent-ink); margin: 1.1rem 0 .4rem;
}
.lab-sub-h:first-child { margin-top: 0; }

/* ── 카드 ── */
.lab-card {
    background: #fff; border: 1px solid var(--lab-border); border-radius: 14px;
    padding: 1.2rem 1.35rem; box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.lab-card.pad-0 { padding: 0; overflow: hidden; }
.lab-card-lift { transition: box-shadow .15s ease, transform .15s ease; }
.lab-card-lift:hover { box-shadow: 0 .6rem 1.4rem rgba(16,24,40,.10); transform: translateY(-2px); }

/* ── 목록 (일관된 행 간격) ── */
.lab-list { margin: 0; padding-left: 1.15rem; }
.lab-list li { margin: .45rem 0; line-height: 1.6; }
.lab-list li:first-child { margin-top: 0; }
.lab-list ul { margin: .35rem 0; }

/* 한 항목씩 세로 나열 (2단 사용 안 함) */
.lab-cols { column-count: 1; }

/* ── 칩/태그 ── */
.lab-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.lab-chip {
    display: inline-block; background: var(--lab-accent-soft); color: var(--lab-accent-ink);
    border: 1px solid var(--lab-accent-border); border-radius: 999px;
    padding: .34rem .82rem; font-size: .86rem; font-weight: 500;
}
.lab-chip.gray { background: #eef2f7; color: #475467; border-color: #dfe4ea; }
/* 클릭 가능한 칩(예: 학생 이름) — 호버 시 색 채워 클릭 가능함을 표시 */
a.lab-chip { cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
a.lab-chip:hover { background: var(--lab-accent); color: #fff; border-color: var(--lab-accent); text-decoration: none; }

/* ── 타임라인 (일관된 행 간격) ── */
.lab-timeline { position: relative; margin: 0; padding: 0 0 0 1.4rem; list-style: none; border-left: 2px solid var(--lab-border); }
.lab-timeline > li { position: relative; padding: 0 0 1.25rem .35rem; }
.lab-timeline > li:last-child { padding-bottom: 0; }
.lab-timeline > li::before {
    content: ""; position: absolute; left: calc(-1.4rem - 6px); top: .3rem;
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--lab-accent); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--lab-accent-soft);
}
.lab-date { font-size: .8rem; font-weight: 700; color: var(--lab-accent-ink); display: block; margin-bottom: .1rem; }
.lab-badge {
    display: inline-block; font-size: .7rem; font-weight: 700; padding: .08rem .45rem;
    border-radius: 6px; background: var(--lab-accent-soft); color: var(--lab-accent-ink); margin-left: .4rem;
    vertical-align: middle;
}
.lab-badge.gray { background: #eef2f7; color: #475467; }

/* ── 반응형 임베드/이미지 ── */
.lab-media { border-radius: 12px; overflow: hidden; border: 1px solid var(--lab-border); background: #000; }
.lab-figure { max-width: 760px; }

/* Contact 페이지 컴팩트 모드 (섹션/카드/행 간격 축소) */
.contact-compact .lab-h2 { font-size: 1.12rem; margin: 1.35rem 0 .5rem; }
.contact-compact .lab-h2:first-of-type { margin-top: .25rem; }
.contact-compact .lab-card { padding: .6rem 1rem; }
.contact-compact .contact-list li { padding: .32rem 0; line-height: 1.45; }
.contact-compact .contact-list .k { flex-basis: 100px; }

/* 라벨·값 목록 (Contact 등) */
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li {
    display: flex; gap: 1rem; padding: .6rem 0; line-height: 1.6;
    border-bottom: 1px solid var(--lab-border);
}
.contact-list li:last-child { border-bottom: 0; }
.contact-list .k { flex: 0 0 116px; font-weight: 700; }
.contact-list .v { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
@media (max-width: 480px) {
    .contact-list li { flex-direction: column; gap: .15rem; }
    .contact-list .k { flex: none; font-size: .85rem; color: var(--lab-muted); }
}

/* 연락처 아이콘 원형 */
.lab-ic {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--lab-accent); color: #fff; font-size: 20px;
}

/* ── 페이지 내 서브 탭 (Research: Areas/Projects, Publication: 카테고리) ── */
.lab-tabbar {
    display: flex; align-items: flex-end; gap: 1rem;
    border-bottom: 2px solid var(--lab-border); margin: 0 0 2rem;
}
.lab-tabs {
    display: flex; gap: .25rem; overflow-x: auto; overflow-y: hidden; flex: 1 1 auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none;
}
.lab-tabs::-webkit-scrollbar { display: none; }
.lab-tabbar-actions { flex: 0 0 auto; padding-bottom: .5rem; }
.lab-tab {
    flex: 0 0 auto; padding: .65rem 1rem; font-size: 1rem; font-weight: 700;
    color: #334155; text-decoration: none; border-bottom: 3px solid transparent;
    white-space: nowrap; transition: color .15s; margin-bottom: -2px;
}
.lab-tab:hover { color: var(--lab-accent); text-decoration: none; }
.lab-tab.active { color: var(--lab-accent); border-bottom-color: var(--lab-accent); }

/* ── NAV(상단 메뉴) 프로 스타일 + 현재 페이지 표시 ── */
.navbar .nav-link {
    position: relative; letter-spacing: .01em;
    padding-top: 1.35rem !important; padding-bottom: 1.35rem !important;
    transition: opacity .15s ease;
}
.navbar .nav-link:hover { opacity: .82; }
.navbar .nav-link.active::after {
    content: ""; position: absolute; left: .35rem; right: .35rem; bottom: .55rem;
    height: 3px; border-radius: 2px; background: var(--lab-accent);
}

/* 게시판 첨부 드래그&드롭 영역 / 편집기 드롭 표시 */
.board-drop {
    border: 2px dashed #c9d2dc; border-radius: 10px; padding: 1rem; text-align: center;
    color: #6b7280; cursor: pointer; background: #fbfcfd; transition: background .15s, border-color .15s;
    min-height: 92px; display: flex; align-items: center; justify-content: center;
}
.board-drop.dragover { border-color: var(--lab-accent); background: var(--lab-accent-soft); color: var(--lab-accent-ink); }
#board-editor.dragover { outline: 2px dashed var(--lab-accent); outline-offset: -4px; }
#board-editor img { max-width: 100%; height: auto; }

/* ── 홈 히어로 캐러셀 ── */
.hero-carousel {
    position: relative;
    max-width: 1240px;
    margin: 0 auto;
    border-radius: 18px;
    overflow: hidden;
    background: #0b1622;
    box-shadow: 0 20px 44px -26px rgba(12, 34, 58, .6), 0 1px 3px rgba(12, 34, 58, .08);
}
.hero-carousel .carousel-item { transition: opacity 1s ease-in-out; }

#header-carousel .carousel-item img {
    height: clamp(160px, 21vw, 280px);
    width: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.04);
    filter: saturate(1.05) contrast(1.02);
}
/* 켄 번즈: 활성 슬라이드만 아주 천천히 줌아웃 */
.hero-carousel .carousel-item.active img { animation: heroPan 8s ease-out both; }
@keyframes heroPan {
    from { transform: scale(1.12); }
    to   { transform: scale(1); }
}

/* 텍스트 가독용 그라데이션 + 브랜드 블루 글로우 */
.hero-scrim {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(100deg, rgba(7, 19, 33, .86) 0%, rgba(7, 19, 33, .6) 38%, rgba(7, 19, 33, .16) 72%, rgba(7, 19, 33, .42) 100%);
}
.hero-scrim::after {
    content: ""; position: absolute; inset: 0; mix-blend-mode: screen;
    background: radial-gradient(120% 95% at 88% 12%, rgba(31, 126, 196, .38), transparent 62%);
}

.hero-caption {
    inset: 0; background: none; padding: clamp(.9rem, 3vw, 2.4rem);
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    text-align: left;
}
.hero-kicker {
    display: inline-flex; align-items: center;
    font-size: clamp(.58rem, 1.05vw, .7rem); font-weight: 700;
    letter-spacing: .18em; text-transform: uppercase; color: #cfe6fb;
    padding: .26rem .62rem; border-radius: 999px;
    background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .24);
    backdrop-filter: blur(6px);
}
.hero-title {
    margin: .55rem 0 0; color: #fff; font-weight: 800; line-height: 1.22;
    font-size: clamp(1.02rem, 2.45vw, 2.05rem); letter-spacing: -.015em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, .45);
    max-width: min(660px, 78%);
}
.hero-title .accent { color: var(--lab-accent-bright); }
.hero-sub {
    margin: .45rem 0 0; color: rgba(255, 255, 255, .82);
    font-size: clamp(.72rem, 1.25vw, .95rem); font-weight: 500;
    text-shadow: 0 1px 12px rgba(0, 0, 0, .45);
}

/* 캡션 등장: 아래에서 살짝 올라오며 초점이 맞는 느낌 */
.hero-caption > * { opacity: 0; transform: translateY(14px); filter: blur(6px); }
.carousel-item.active .hero-kicker { animation: heroRise .75s .12s cubic-bezier(.2, .7, .2, 1) forwards; }
.carousel-item.active .hero-title  { animation: heroRise .85s .26s cubic-bezier(.2, .7, .2, 1) forwards; }
.carousel-item.active .hero-sub    { animation: heroRise .85s .42s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes heroRise { to { opacity: 1; transform: none; filter: blur(0); } }

/* 인디케이터: 얇은 알약 바 — 캡션 왼쪽 정렬선에 맞춤 */
.hero-carousel .carousel-indicators {
    margin: 0; gap: .4rem; bottom: 1rem; right: auto;
    left: clamp(.9rem, 3vw, 2.4rem); justify-content: flex-start;
}
.hero-carousel .carousel-indicators [data-bs-target] {
    width: 24px; height: 4px; border: 0; border-radius: 999px; opacity: 1;
    background: rgba(255, 255, 255, .42);
    transition: width .35s ease, background .35s ease;
}
.hero-carousel .carousel-indicators .active { width: 46px; background: #fff; }

/* 좌우 컨트롤: 캡션을 가리지 않도록 우측 하단 코너에 유리질 원형 버튼으로 */
.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    top: auto; left: auto; bottom: .55rem;
    width: auto; padding: 0; opacity: .55;
    transition: opacity .25s ease;
}
.hero-carousel .carousel-control-prev { right: 3.55rem; }
.hero-carousel .carousel-control-next { right: .75rem; }
.hero-carousel:hover .carousel-control-prev,
.hero-carousel:hover .carousel-control-next { opacity: 1; }
.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
    width: 36px; height: 36px; background-size: 13px; border-radius: 50%;
    background-color: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .32);
    backdrop-filter: blur(8px);
    transition: background-color .2s ease;
}
.hero-carousel .carousel-control-prev:hover .carousel-control-prev-icon,
.hero-carousel .carousel-control-next:hover .carousel-control-next-icon {
    background-color: rgba(255, 255, 255, .3);
}
@media (hover: none) {
    .hero-carousel .carousel-control-prev,
    .hero-carousel .carousel-control-next { opacity: .8; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-carousel .carousel-item.active img { animation: none; transform: none; }
    .hero-caption > * { opacity: 1; transform: none; filter: none; animation: none !important; }
}

@media (max-width: 576px) {
    .lab { padding: 1.25rem .85rem 3rem; }
    .lab-h2 { font-size: 1.12rem; }
    .hero-carousel { border-radius: 14px; }
    #header-carousel .carousel-item img { height: 150px; }
    .hero-title { max-width: 100%; }
    .hero-sub { display: none; }
    .hero-carousel .carousel-control-prev,
    .hero-carousel .carousel-control-next { display: none; }
}
