/* ===========================
   파란약국 홈페이지
   style.css  (홈 · 공부방 공통, 파란약국 블루톤)
=========================== */

/* Google Font */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&family=Pacifico&display=swap');

/* 파란약국 색상 (간판의 파란색 기준) */
:root{
    --blue:#0b63ad;        /* 대표 파랑 */
    --blue-dark:#08497f;   /* 진한 파랑 (호버, 강조 제목) */
    --blue-soft:#e4f1fb;   /* 연한 파랑 (태그, 구분선) */
    --blue-line:#cfe3f4;   /* 카드 테두리 */
    --hero-from:#cfe6f7;
    --hero-to:#f7fbff;
    --bg:#f3f8fc;
    --text:#1f2d3d;
    --sub:#5b6b7c;
    --navy:#0b2a4a;        /* 푸터 */
}

/* Reset */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{
    font-family:'Noto Sans KR',sans-serif;
    background:var(--bg);
    color:var(--text);
    line-height:1.7;
}

/* 공통 */
.container{
    width:1100px;
    max-width:95%;
    margin:auto;
}

/* Header */

header{
    background:#ffffff;
    border-top:4px solid var(--blue);
    box-shadow:0 2px 10px rgba(11,99,173,.12);
    position:sticky;
    top:0;
    z-index:999;
}

nav{
    display:flex;
    justify-content:space-between;
    align-items:center;
    height:70px;
}

.logo{
    font-size:28px;
    font-weight:700;
    color:var(--blue);
    text-decoration:none;
}

.logo img{
    display:block;
    height:60px;
    width:auto;
}

.menu{
    display:flex;
    gap:28px;
}

.menu a{
    text-decoration:none;
    color:#3d4b5c;
    font-weight:500;
    padding:6px 0;
    border-bottom:2px solid transparent;
    transition:.25s;
}

.menu a:hover,
.menu a.active{
    color:var(--blue);
    border-bottom-color:var(--blue);
}

/* Daily 1 은 어디서나 손글씨 로고체 */
.daily-font,
.daily-link{
    font-family:'Pacifico','Brush Script MT',cursive !important;
    font-weight:400 !important;
}
.menu a.daily-link{
    font-size:1.1em;
}

/* 메뉴 안의 Daily 1 은 메뉴 글자색을 따라가게 (선택됐을 때 흰색) */
.menu a .daily-font{
    color:inherit;
}

/* Hero */

.hero{
    background:linear-gradient(135deg,var(--hero-from),var(--hero-to));
    padding:90px 0;
}

.hero h1{
    font-size:48px;
    color:var(--blue-dark);
    margin-bottom:15px;
}

.hero p{
    font-size:20px;
    color:var(--sub);
}

/* 카드 */

.cards{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:30px;
    max-width:760px;
    margin:70px auto;
}

.card{
    aspect-ratio:1/1;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    align-items:flex-start;
    background:white;
    border:1px solid var(--blue-line);
    border-radius:18px;
    padding:30px;
    box-shadow:0 5px 15px rgba(11,99,173,.08);
    transition:.25s;
}

.card:hover{
    transform:translateY(-8px);
    box-shadow:0 10px 25px rgba(11,99,173,.16);
}

.card h2{
    color:var(--blue);
    margin-bottom:15px;
    font-size:24px;
}

.card p{
    color:var(--sub);
    margin-bottom:20px;
    flex:1;
}

/* 버튼 */

.btn{
    display:inline-block;
    padding:12px 22px;
    background:var(--blue);
    color:white;
    border-radius:10px;
    text-decoration:none;
    transition:.25s;
}

.btn:hover{
    background:var(--blue-dark);
}

/* 본문 링크 */

.post-detail a{
    color:var(--blue);
}

/* 입력칸 */

input[type="text"]:focus{
    outline:2px solid var(--blue);
    border-color:var(--blue);
}

/* Footer */

footer{
    background:var(--navy);
    color:#dbe8f5;
    padding:40px;
    text-align:center;
    margin-top:70px;
}

.hit-counter{display:inline-block;margin-top:10px;line-height:0;}
.footer-tools{display:inline-flex;align-items:center;gap:10px;margin-top:10px;}
.footer-tools .hit-counter{margin-top:0;}
.sns-link{display:inline-block;line-height:0;transition:transform .2s;}
.sns-link:hover{transform:translateY(-2px);}
.hit-footer{text-align:center;padding:26px 16px 30px;color:#5b6b7c;font-size:14px;}

/* 모바일 */

@media(max-width:768px){

nav{
    flex-direction:column;
    height:auto;
    padding:20px 0;
}

.menu{
    margin-top:12px;
    width:100%;
    display:grid;
    grid-template-columns:repeat(6,1fr);
    gap:8px;
    padding:0 4px 4px;
}

.menu a{
    grid-column:span 2;
}

.menu a:nth-child(n+4){
    grid-column:span 3;
}

.menu a{
    text-align:center;
    padding:10px 4px;
    font-size:14px;
    background:var(--blue-soft);
    border:1px solid var(--blue-line);
    border-radius:10px;
    border-bottom:1px solid var(--blue-line);
    white-space:nowrap;
}

.menu a:hover,
.menu a.active{
    background:var(--blue);
    color:#fff;
    border-color:var(--blue);
}

.hero{
    padding:60px 20px;
}

.hero h1{
    font-size:34px;
}

.hero p{
    font-size:17px;
}

.cards{
    gap:14px;
}

.card{
    aspect-ratio:auto;
    padding:18px;
}

.card h2{
    font-size:17px;
    margin-bottom:8px;
}

.card p{
    font-size:13px;
    line-height:1.5;
    margin-bottom:10px;
}

.btn{
    padding:9px 14px;
    font-size:14px;
}

/* 공부방: 좁은 화면에서 양옆 여백 */
.search-box,
.toolbar,
.post-list{
    padding-left:16px;
    padding-right:16px;
}

}

/* 홈 BGM 플레이어 (오른쪽 아래 떠 있는 버튼) */
.bgm-player-box{
    position:fixed;
    bottom:20px;
    right:20px;
    background:#fff;
    padding:10px 15px;
    border-radius:30px;
    box-shadow:0 4px 15px rgba(0,0,0,.15);
    display:flex;
    align-items:center;
    gap:10px;
    z-index:1000;
    border:1px solid var(--blue-line);
}
.bgm-btn{
    background:var(--blue);
    color:#fff;
    border:none;
    padding:8px 14px;
    border-radius:20px;
    cursor:pointer;
    font-weight:bold;
    font-size:14px;
    font-family:inherit;
    transition:background .2s;
}
.bgm-btn:hover{background:var(--blue-dark)}
.bgm-status{font-size:13px;color:var(--sub)}
/* 맨 위로 버튼이 BGM 플레이어에 가려지지 않게 */
#topBtn{bottom:90px !important;z-index:1001 !important}

/* 책장 (홈) */
.bc{border-radius:12px;background:#9a6a2e;padding:12px 10px 10px;box-shadow:inset 0 0 0 3px #6f4616,0 8px 18px rgba(60,35,5,.3);}
.bc-row{position:relative;margin-bottom:10px;padding:0 4px;border-radius:4px 4px 0 0;
  background:repeating-linear-gradient(90deg,#c99a55 0,#c99a55 7px,#c0914c 7px,#c0914c 11px,#caa05e 11px,#caa05e 20px);box-shadow:inset 0 10px 14px rgba(70,40,5,.35);}
.bc-row:last-child{margin-bottom:0;}
.bc-slots{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;align-items:end;min-height:96px;padding:10px 0 0;}
.bc-slot{margin:0 auto;width:100%;max-width:56px;}
.bc-year{text-align:center;font-family:'Pacifico','Brush Script MT',cursive;font-weight:400;font-size:.78rem;line-height:1;color:#fff;text-shadow:0 1px 3px rgba(60,35,5,.9);white-space:nowrap;}
.bc-book{display:block;width:100%;aspect-ratio:2/3;border-radius:2px 4px 4px 2px;overflow:hidden;position:relative;text-decoration:none;box-shadow:2px 3px 6px rgba(0,0,0,.45),inset 3px 0 0 rgba(255,255,255,.22);}
a.bc-book{cursor:pointer;transition:transform .15s;}a.bc-book:hover{transform:translateY(-5px);}
.bc-book:has(img){box-shadow:none;overflow:visible;border-radius:0;aspect-ratio:5/8;}
.bc-book img{width:100%;height:100%;object-fit:contain;object-position:bottom;display:block;filter:drop-shadow(2px 3px 3px rgba(0,0,0,.5));}
.bc-book .bc-t{min-height:100%;}
.bc-book .bc-t{display:flex;align-items:center;justify-content:center;text-align:center;width:100%;height:100%;padding:4px;color:#fff;font-weight:800;font-size:.55rem;line-height:1.25;word-break:keep-all;}
.bc-plank{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;align-items:center;min-height:20px;padding:2px 8px;margin:0 -4px;background:linear-gradient(180deg,#8a5a22 0%,#a8742f 55%,#6a4212 100%);box-shadow:0 4px 6px rgba(50,28,4,.4);}
.bc-note{font-size:.82rem;color:var(--sub);margin:8px 2px 0;}
@media(min-width:769px){.bc-slot{max-width:92px;}.bc-year{font-size:1.15rem;}.bc-plank{min-height:28px;padding:3px 8px;}.bc-slots{min-height:160px;}}
.bookcase-section{scroll-margin-top:80px;max-width:760px;margin:0 auto 70px;}
.bookcase-section h2{font-size:1.25rem;color:var(--blue-dark);margin:0 0 12px;text-align:center;}
.bookcase-section h2 small{font-size:.75rem;color:var(--sub);font-weight:600;margin-left:6px;}

/* 책장 윗줄: 나무 막대 + 버튼 */
.bc-wrap{border-radius:14px;overflow:hidden;box-shadow:0 10px 22px rgba(60,35,5,.32);background:#6f4616;}
.bc-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;
  background:linear-gradient(180deg,#e6b870 0%,#c98d42 55%,#b27530 100%);border-bottom:3px solid #6f4616;box-shadow:inset 0 1px 0 rgba(255,255,255,.45);}
.bc-bar-title{flex:1;text-align:left;font-family:'Gungsuh','GungsuhChe','궁서','궁서체','Batang','Noto Serif KR',serif;font-weight:700;font-size:1.45rem;letter-spacing:.04em;color:#1c0f04;opacity:.9;text-shadow:0 1px 0 rgba(255,225,170,.35),0 0 3px rgba(40,18,0,.55),1px 1px 1px rgba(40,18,0,.4);}
.bc-btn{display:inline-block;min-width:72px;text-align:center;padding:7px 12px;border-radius:8px;text-decoration:none;color:#fff;font-weight:800;font-size:.88rem;
  text-shadow:0 -1px 0 rgba(80,45,5,.7);background:linear-gradient(180deg,#d89a50 0%,#b97a32 55%,#a86a26 100%);
  border:1px solid #7a4c18;box-shadow:inset 0 1px 0 rgba(255,255,255,.45),0 1px 2px rgba(60,35,5,.4);}
.bc-btn:hover{filter:brightness(1.08);}
.bc-btn:active{filter:brightness(.92);}
.bc-wrap .bc{border-radius:0;box-shadow:inset 0 0 0 3px #6f4616;}

/* 책 펼침 효과: 책장에 꽂힌 자리 그대로, 책 크기 그대로 펼쳐져요 */
.bc-slot{perspective:700px;}
.bc-book .bc-cover{position:absolute;inset:0;transform-style:preserve-3d;transform-origin:left center;}
.bc-book .bc-cover img{position:absolute;inset:0;backface-visibility:hidden;-webkit-backface-visibility:hidden;}
.bc-book .bc-back{position:absolute;inset:0;backface-visibility:hidden;-webkit-backface-visibility:hidden;transform:rotateY(180deg);background:url(books/page.svg) 0 0/100% 100%;box-shadow:inset -6px 0 8px rgba(110,80,30,.35);}
.bc-book .bc-pages{position:absolute;inset:2% 1% 1% 3%;background:url(books/page.svg) 0 0/100% 100%;box-shadow:0 2px 5px rgba(0,0,0,.45),inset 5px 0 6px rgba(110,80,30,.4);opacity:0;}
.bc-book.opening{z-index:20;animation:bcShift .9s ease-in-out forwards;}
.bc-book.opening .bc-pages{opacity:1;}
.bc-book.opening .bc-cover{animation:bcOpen .9s cubic-bezier(.45,.05,.3,1) forwards;}
@keyframes bcShift{from{transform:translateX(0)}to{transform:translateX(var(--shift,50%))}}
@keyframes bcOpen{0%{transform:rotateY(0)}20%{transform:rotateY(0)}100%{transform:rotateY(-180deg)}}
@media (prefers-reduced-motion:reduce){.bc-book.opening,.bc-book.opening .bc-cover{animation-duration:.01s}}

.bc-book.has-sp .bc-pages{inset:0;background:var(--sp) 100% 0/200% 100%;box-shadow:0 2px 6px rgba(0,0,0,.5);border-radius:0 2px 2px 0;}
.bc-book.has-sp .bc-back{background:var(--sp) 0 0/200% 100%;box-shadow:0 2px 6px rgba(0,0,0,.5);border-radius:2px 0 0 2px;}

/* Daily 1 페이지: 영상 오른쪽에 책장 */
.vrow{display:flex;gap:22px;align-items:flex-start;justify-content:center;margin:20px 0;}
.vrow .video-container{flex:0 0 315px;margin:0;}
.vrow .bookcase-section{flex:1;min-width:0;max-width:640px;margin:0;scroll-margin-top:80px;container-type:inline-size;}
@media(max-width:760px){.vrow{flex-direction:column;align-items:center;}.vrow .video-container{flex:none;margin:0 auto;}.vrow .bookcase-section{width:100%;}}
@container (max-width:559px){.bc-slot{max-width:56px;}.bc-year{font-size:.78rem;}.bc-plank{min-height:20px;padding:2px 8px;}.bc-slots{min-height:96px;}}

/* 영상 아래에 책장: 세로로 쌓기 */
.vrow{flex-direction:column;align-items:center;gap:18px;}
.vrow .video-container{flex:none;margin:0 auto;}
.vrow .bookcase-section{width:100%;max-width:640px;}
.envy{text-align:center;font-size:1.05rem;line-height:1.7;margin:22px 0 8px;color:var(--blue-dark);}

/* 펼쳐진 책이 옆 책 위로 오도록 */
.bc-slot{position:relative;}
.bc-slot:has(.bc-book.opening){z-index:30;}

/* 일본어 손님용 안내 */
.ja-box{margin:22px 0;border:1px solid var(--blue-line);border-radius:12px;background:#f7fbff;padding:0;}
.ja-box summary{cursor:pointer;padding:13px 16px;font-weight:800;color:var(--blue-dark);list-style:none;}
.ja-box summary::-webkit-details-marker{display:none;}
.ja-box summary::after{content:'▾';float:right;opacity:.6;}
.ja-box[open] summary::after{content:'▴';}
.ja-box .ja-body{padding:2px 16px 16px;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic",Meiryo,sans-serif;line-height:1.75;}
.ja-box h4{margin:16px 0 6px;color:var(--blue-dark);}
.ja-box .download-btn{display:inline-block;}

/* 더보기 */
details.more{margin:10px 0;}
details.more>summary{display:inline-block;cursor:pointer;list-style:none;padding:8px 18px;border:1px solid var(--blue-line);border-radius:999px;background:#fff;color:var(--blue-dark);font-weight:700;font-size:.92rem;}
details.more>summary::-webkit-details-marker{display:none;}
details.more>summary:hover{background:var(--blue-soft,#eef6ff);}
details.more .m-open{display:none;}
details.more[open]>summary .m-open{display:inline;}
details.more[open]>summary .m-closed{display:none;}
details.more[open]>summary{margin-bottom:10px;}

.jp-flag{width:20px;height:14px;vertical-align:-2px;margin-right:2px;}
.ja-box[hidden]{display:none;}

/* 日本語モード */
body.ja-mode .study-header,body.ja-mode .search-box,body.ja-mode .toolbar,body.ja-mode #posts,body.ja-mode #board,body.ja-mode .header .menu,body.ja-mode header .menu,body.ja-mode .notice-back{display:none!important;}
#jaPage{max-width:860px;margin:0 auto;padding:18px 16px 40px;}
#jaPage[hidden]{display:none;}
#jaPage .ja-top{text-align:center;margin-bottom:14px;}
#jaPage .ja-top h1{margin:6px 0;}
#jaPage .ja-top p{color:var(--sub);margin:4px 0 12px;}
.lang-btn{cursor:pointer;border:1px solid var(--blue-line);background:#fff;color:var(--blue-dark);font-weight:800;padding:9px 18px;border-radius:999px;font-size:.95rem;}
.lang-btn:hover{background:#eef6ff;}
.lang-btn .jp-flag{vertical-align:-3px;}
#jaPage .ja-box{margin-top:0;}
#jaPage .download-btn{display:inline-block;background:var(--blue-dark);color:#fff!important;text-decoration:none;font-weight:800;padding:11px 18px;border-radius:10px;}
#jaPage .ja-box{border:none;background:transparent;}

.home-case{max-width:760px;margin:34px auto 10px;}
.home-case .bc-note{margin:10px 0 0;color:var(--sub);font-size:.9rem;}

.bc-author{text-align:center;font-weight:700;font-size:.56rem;line-height:1.15;color:#fff;text-shadow:0 1px 3px rgba(60,35,5,.9);word-break:keep-all;}
@media(min-width:769px){.bc-author{font-size:.8rem;}}
@container (max-width:559px){.bc-author{font-size:.56rem;}}
