@charset "UTF-8";
/* 충남아이키움포털 — Mobile Layout (Figma: 메가파크 공유 문서, 01-1 메인A / 01-2 메뉴) */

@font-face {
    font-family: 'GmarketSans';
    src: url('../fonts/GmarketSansBold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ===== Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, sans-serif;
    color: #282828;
    background: #e9ebef;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    word-break: keep-all;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
ul, ol { list-style: none; }
/* hidden 속성은 항상 감춥니다.
   (브라우저 기본 규칙 [hidden]{display:none} 은 우선순위가 가장 낮아
    .클래스{display:flex} 같은 선언에 밀립니다. JS 로 hidden 을 켜고 끄는
    영역이 많으므로 여기서 한 번에 못 박아 둡니다) */
[hidden] { display: none !important; }

/* ===== Design tokens ===== */
:root {
    --color-primary: #009184;
    --color-primary-dark: #436557;
    --color-secondary: #67bcda;
    --color-accent: #ffa000;
    --color-text: #282828;
    --color-text-soft: #3c3c3c;
    --color-text-deep: #1d3a42;
    --color-bg: #f8f8f8;
    --color-card: #ffffff;
    --color-border: #f0f0f0;
    --color-border-strong: #e0e0e0;
    --color-footer-bg: #f0f0f0;
    --color-submenu-bg: #fafafa;
    --topbar-h: 60px;
    --bnb-h: 92px;
    --shadow-card: 0 0 6px rgba(0,0,0,.04);
}

/* ===== App shell ===== */
.app {
    position: relative;
    max-width: 440px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--color-bg);
    padding-bottom: var(--bnb-h);
    overflow-x: hidden;
}

/* ===== Top bar ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-h);
    padding: 17px 24px;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar__logo img { height: 26px; width: auto; }
.topbar__actions { display: flex; align-items: center; gap: 20px; }
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 36px;
    padding: 8px;
    border: 2px solid var(--color-primary);
    border-radius: 12px;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 14px;
    line-height: 24px;
}
.btn-hamburger {
    display: inline-flex;
    align-items: center;
    padding: 4px;
}
.btn-hamburger img { height: 8px; width: 22px; }

/* ===== Hero ===== */
.hero {
    position: relative;
    height: 200px;
    background: var(--color-primary);
    overflow: hidden;
}
.hero__inner {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.8);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    padding: 24px 148px 60px 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.hero__title {
    font-weight: 800;
    color: var(--color-text-soft);
    font-size: clamp(20px, 7.2vw, 28px);
    line-height: 1.28;
    letter-spacing: -0.03em;
}
.hero__character {
    position: absolute;
    right: 20px;
    top: 20px;
    width: clamp(82px, 24.5vw, 108px);
    aspect-ratio: 108 / 118;
    pointer-events: none;
}
/* tighten character padding when the hero shrinks below ~380 viewport */
@media (max-width: 380px) {
    .hero__inner { padding-right: clamp(110px, 30vw, 148px); }
}

/* ===== Sections ===== */
.section {
    padding: 16px 20px 0;
}
/* First section overlaps the hero bottom by ~44px (matches Figma top:216 vs hero end:260) */
.hero + .section {
    margin-top: -44px;
    position: relative;
    z-index: 2;
}
.card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 28px;
    box-shadow: var(--shadow-card);
}
.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 8px;
}
.card__head-title {
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    color: var(--color-text);
}
.card__head .chevron {
    transform: rotate(180deg);
}
.chevron { width: 4px; height: 8px; }

/* ===== Schedule (교육 및 행사 일정) ===== */
.schedule__days {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 0 16px;
}
.schedule__day {
    flex: 1 0 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 4px 12px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
}
.schedule__day-date { font-size: 12px; font-weight: 500; opacity: .5; line-height: 20px; text-align: center; }
.schedule__day-name { font-size: 14px; font-weight: 700; line-height: 20px; color: #000; text-align: center; }
.schedule__dots { display: flex; align-items: center; gap: 2px; min-height: 8px; }
.dot { width: 8px; height: 8px; border-radius: 2px; }
.dot--primary { background: var(--color-primary); }
.dot--secondary { background: var(--color-secondary); }
.dot--accent { background: var(--color-accent); }
.schedule__legend {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 20px 16px;
}
.schedule__legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
    color: var(--color-text);
    opacity: .5;
}

/* ===== Menu cards (3 cards with circle deco — image-driven, see card-*.png) ===== */
.menu-card {
    display: block;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.menu-card img {
    width: 100%;
    height: auto;
    display: block;
}
.menu-card + .menu-card { margin-top: 12px; }

/* ===== Banner (새단장 안내) ===== */
.banner {
    position: relative;
    height: 300px;
    padding: 40px 41px;
    border-radius: 28px;
    background: linear-gradient(180deg, #e1edec 0%, #c0f6f2 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    text-align: center;
}
.banner__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    border-radius: 28px;
    z-index: 0;
}
.banner > *:not(.banner__bg) { position: relative; z-index: 1; }
.banner__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.banner__logo { height: 26px; width: 132px; }
.banner__title {
    font-family: 'GmarketSans', 'Pretendard', sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 1;
    color: var(--color-text-deep);
}
.banner__desc {
    color: var(--color-text-deep);
    font-size: 14px;
    line-height: 24px;
    font-weight: 600;
}
.banner__desc strong { font-weight: 700; }
.banner__desc p + p { margin-top: 12px; }

.carousel-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 0 0;
}
.carousel-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d9d9d9;
}
.carousel-dots span.is-active {
    background: var(--color-primary);
}

/* ===== Notice list (공지사항) ===== */
.notice {
    padding: 0;
}
.notice .card__head { padding: 16px 20px 8px; }
.notice__list { padding: 0 0 8px; }
.notice__item {
    padding: 12px 20px;
    border-top: 1px solid var(--color-border);
}
.notice__item-title {
    font-weight: 500;
    font-size: 14px;
    line-height: 24px;
    color: var(--color-text);
    opacity: .8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.notice__item-date {
    font-weight: 500;
    font-size: 12px;
    line-height: 24px;
    color: var(--color-text);
    opacity: .5;
}

/* ===== Partner logo strip ===== */
.partners {
    margin-top: 24px;
    padding: 12px 0;
    background: #fff;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.partners__inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    min-width: min-content;
}
.partners__inner img { height: 37px; flex-shrink: 0; }

/* ===== Footer ===== */
.footer {
    background: var(--color-footer-bg);
}
.footer__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 8px 24px;
    border-bottom: 1px solid var(--color-border-strong);
}
.footer__row-label {
    font-weight: 600;
    font-size: 12px;
    line-height: 20px;
    color: var(--color-text);
    opacity: .5;
}
.footer__row .chevron { transform: rotate(180deg); opacity: .5; }
.footer__info {
    padding: 24px 24px 32px;
    color: var(--color-text);
    opacity: .5;
    font-size: 12px;
    line-height: 20px;
    font-weight: 500;
}
.footer__info p { margin: 0; }

/* ===== Bottom navigation ===== */
.bnb {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: 440px;
    height: var(--bnb-h);
    z-index: 20;
    pointer-events: none;
}
.bnb__shape {
    position: absolute;
    inset: 32px 0 0;
    background-image: url('../img/bnb-shape.svg');
    background-position: center top;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    pointer-events: auto;
    filter: drop-shadow(0 -2px 6px rgba(0,0,0,.06));
}
.bnb__items {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 100%;
    align-items: flex-end;
    padding-bottom: 8px;
    pointer-events: auto;
}
.bnb__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    opacity: .55;
}
.bnb__item.is-active { opacity: 1; color: var(--color-primary); }
.bnb__item img { width: 20px; height: 20px; }
.bnb__item-label {
    font-weight: 700;
    font-size: 12px;
    line-height: 12px;
}
.bnb__home {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,145,132,.25);
    pointer-events: auto;
}
.bnb__home img { width: 24px; height: 24px; filter: brightness(0) invert(1); }
.bnb__home-label {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

/* ===== Side drawer (01-2 메뉴) ===== */
.drawer {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
}
.drawer.is-open { display: block; }
.drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(40,40,40,.45);
    animation: fadeIn .2s ease-out;
}
.drawer__panel {
    position: absolute;
    top: var(--topbar-h);
    right: 0;
    bottom: 0;
    width: calc(100% - 132px);
    max-width: 308px;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation: slideInRight .25s ease-out;
    overflow: hidden;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* drawer wider than 440 viewport just keeps panel centered with main column */
@media (min-width: 441px) {
    .drawer { left: calc(50% - 220px); right: calc(50% - 220px); inset: 0 calc(50% - 220px); width: 440px; margin: 0 auto; }
}

.drawer__cta {
    display: flex;
    gap: 12px;
    padding: 16px;
}
.drawer__cta a {
    flex: 1 0 0;
    min-width: 0;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    line-height: 20px;
}
.drawer__cta a.is-primary { background: var(--color-primary); }
.drawer__cta a.is-secondary { background: var(--color-primary-dark); }

.drawer__menu { padding: 0; }
.drawer__item { border-bottom: 1px solid var(--color-border); }
.drawer__item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 48px;
    padding: 8px 20px;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-text);
    opacity: .9;
    text-align: left;
}
.drawer__item-head .chevron { transition: transform .15s; transform: rotate(-90deg); }
.drawer__item.is-open .drawer__item-head .chevron { transform: rotate(90deg); }
.drawer__sub {
    display: none;
    background: var(--color-submenu-bg);
    padding: 8px 0;
    grid-template-columns: 1fr 1fr;
}
.drawer__item.is-open .drawer__sub { display: grid; }
.drawer__sub a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-text);
    opacity: .6;
}

.drawer__bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    flex-shrink: 0;
}
.drawer__bottom-logo {
    width: 60px;
    height: 34.287px;
    flex-shrink: 0;
    display: block;
}
.drawer__bottom-cta {
    flex: 1 0 0;
    min-width: 0;
    height: 52px;
    padding: 0 16px;
    background: var(--color-accent);
    color: #fff;
    border-radius: 16px;
    font-weight: 700;
    font-size: 16px;
    line-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* hide drawer in print etc. */
@media print { .drawer, .bnb { display: none !important; } }

/* ===== 데이터 로딩 상태 (API 연동 공통) ===== */
.ik-state {
    padding: 40px 16px;
    text-align: center;
    font-size: 14px;
    line-height: 20px;
    color: #8b8b8b;
    grid-column: 1 / -1;
}
.ik-state--error { color: #d64545; }
.ik-state--loading { color: #a0a0a0; }

/* 페이지네이션 비활성 버튼 */
.pager__btn[disabled] { opacity: .35; pointer-events: none; }
.pager__page { cursor: pointer; }

/* ===== 메인 일정 위젯 — API 연동 추가 스타일 ===== */

/* 카드 헤더가 링크가 되어도 색을 유지합니다. */
.card__head { color: inherit; text-decoration: none; }

/* 일자 칸 (링크/비링크 공통) */
.schedule__day { color: inherit; text-decoration: none; }
.schedule__day.is-today {
    border-color: var(--color-primary);
    background: #f4faf8;
}
.schedule__day.is-today .schedule__day-date { opacity: 1; color: var(--color-primary); }
.schedule__day.is-sun .schedule__day-name { color: #d64545; }
.schedule__day.is-sat .schedule__day-name { color: #3b6fd4; }

/* 일정·공지 로딩/빈 상태가 가로 폭을 차지하도록 */
.schedule__days .ik-state,
.notice__list .ik-state { flex: 1 1 100%; padding: 24px 0; }

/* ===== 메인 배너(팝업존) 슬라이드 ===== */
.bannerslide {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
}
.bannerslide__track {
    display: flex;
    transition: transform .4s ease;
    will-change: transform;
}
.bannerslide__item {
    flex: 0 0 100%;
    min-width: 0;
    display: block;
    line-height: 0;
}
.bannerslide__img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 28px;
    background: #f2f2f2;
}

/* 공지 항목이 링크가 되어도 레이아웃·색을 유지합니다. */
.notice__item-link { display: block; color: inherit; text-decoration: none; }

/* ===== 이미지 확대 보기 (공용 라이트박스) ===== */
[data-zoom] { cursor: zoom-in; }
.imgviewer {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
}
.imgviewer.is-open { display: block; }
.imgviewer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.9);
    animation: fadeIn .2s ease-out;
}
.imgviewer__panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: max(8px, env(safe-area-inset-top)) 8px max(16px, env(safe-area-inset-bottom));
}
.imgviewer__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    height: 44px;
    padding: 0 8px;
}
.imgviewer__count {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,.8);
}
.imgviewer__close {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
}
.imgviewer__close::before,
.imgviewer__close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    margin: -1px 0 0 -9px;
    background: #fff;
}
.imgviewer__close::before { transform: rotate(45deg); }
.imgviewer__close::after { transform: rotate(-45deg); }
.imgviewer__stage {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}
.imgviewer__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    animation: fadeIn .2s ease-out;
}
.imgviewer__nav {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
}
.imgviewer__nav[hidden] { display: none; }
.imgviewer__nav--prev { left: 4px; }
.imgviewer__nav--next { right: 4px; }
.imgviewer__nav::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
}
.imgviewer__nav--prev::before { transform: rotate(-135deg); margin-left: -3px; }
.imgviewer__nav--next::before { transform: rotate(45deg); margin-left: -9px; }
.imgviewer__caption {
    flex: 0 0 auto;
    padding: 12px 16px 0;
    text-align: center;
    font-size: 14px;
    line-height: 22px;
    color: rgba(255,255,255,.85);
}
.imgviewer__caption[hidden] { display: none; }

/* ===== 가로 스크롤 영역 (PC 휠·드래그 지원) ===== */
.ptabs__scroll,
.subtabs__scroll,
.subtabs2,
.roomtabs,
[data-hscroll] {
    overscroll-behavior-x: contain;
}
.ptabs__scroll.is-dragging,
.subtabs__scroll.is-dragging,
.subtabs2.is-dragging,
.roomtabs.is-dragging,
[data-hscroll].is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
}
.ptabs__scroll.is-dragging a,
.subtabs__scroll.is-dragging a,
.subtabs2.is-dragging a,
.roomtabs.is-dragging a,
[data-hscroll].is-dragging a { pointer-events: none; }
