/* ══════════════════════════════════════════
   언니케어 공통 스타일 (styles.css)
   헤더 / 사이드바 / blob / float-pill /
   btn / :root / reveal / footer 등
   모든 페이지 공통 요소
══════════════════════════════════════════ */

/* ── CSS 변수 ── */
:root {
    --bg:     #FAF6F5;
    --white:  #FFFFFF;
    --pink:   #F7CBD3;
    --pink-d: #FF540F;
    --yellow: #FCE2B6;
    --blue:   #C1DBE3;
    --text:   #665853;
    --light:  #94857F;
    --div:    rgba(148,133,127,0.12);
    --serif:  'Nanum Myeongjo', Georgia, serif;
    --sans:   'Pretendard', 'Noto Sans KR', sans-serif;
    --script: 'Caveat', cursive;
    --shadow: 0 10px 40px rgba(102,88,83,0.08);
    --paper:  2px 4px 12px rgba(0,0,0,0.05);
}

/* ── 리셋 ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: hidden; }
body {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    word-break: keep-all;
    overflow-wrap: break-word;
    text-wrap: pretty;
}
h1, h2, h3, h4 { font-family: var(--serif); color: var(--text); word-break: keep-all; }

/* ── 공통 컨테이너 ── */
.container { max-width: 1440px; margin: 0 auto; padding: 0 5%; }

/* ── 공통 버튼 ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 16px 36px; border-radius: 50px;
    font-family: var(--sans); font-weight: 500; font-size: 1rem;
    text-decoration: none; cursor: pointer; border: none;
    transition: all 0.3s ease;
}
.btn-pink  { background: var(--pink);  color: var(--text); box-shadow: 0 8px 20px rgba(247,203,211,0.4); }
.btn-white { background: var(--white); color: var(--text); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.btn:hover { transform: translateY(-3px); }
.btn-orange {
    background: linear-gradient(135deg, #FF7A28, #FF4500) !important;
    color: #fff !important;
    box-shadow: 0 6px 20px rgba(255,84,15,0.45) !important;
    transition: none !important;
}
.btn-orange:hover {
    background: linear-gradient(135deg, #FF7A28, #FF4500) !important;
    color: #fff !important;
    box-shadow: 0 6px 20px rgba(255,84,15,0.45) !important;
    transform: none !important;
    opacity: 1 !important;
}

/* ── script 텍스트 ── */
.script-txt { font-family: var(--script); color: var(--pink); display: inline-block; transform: rotate(-5deg); }

/* ── 배경 blob ── */
.blob {
    position: fixed; border-radius: 50%;
    filter: blur(70px); opacity: 0.4;
    pointer-events: none; z-index: 0;
    animation: blobFloat 12s ease-in-out infinite;
}
@keyframes blobFloat {
    0%,100% { transform: translate(0,0) scale(1); }
    33%      { transform: translate(30px,-50px) scale(1.08); }
    66%      { transform: translate(-20px,20px) scale(0.94); }
}

/* ── 헤더 ── */
header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
    padding: 18px 0;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 4px 30px rgba(102,88,83,0.06);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 100%; padding: 0 5%;
}

/* ── 로고 ── */
.logo {
    display: inline-flex; align-items: center; gap: 3px;
    font-family: 'Pretendard', sans-serif; font-weight: 700; font-size: 1.5rem;
    color: #FF540F; text-decoration: none; white-space: nowrap;
}
.logo-icon { width: 1.4rem; height: 1.4rem; flex-shrink: 0; }

/* ── 내비 ── */
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
    font-size: 0.9rem; font-weight: 500; color: var(--text);
    text-decoration: none; opacity: 0.8; transition: opacity 0.2s;
}
.nav-links a:hover,
.nav-links a.active { opacity: 1; color: #FF540F; }
.nav-links a.active { font-weight: 700; }

/* ── 햄버거 ── */
.hamburger {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* ── 사이드바 오버레이 ── */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(102,88,83,0.2);
    backdrop-filter: blur(4px);
    z-index: 109;
}
.sidebar-overlay.open { display: block; }

/* ── 사이드바 ── */
.sidebar {
    position: fixed; top: 0; right: -320px; width: 300px; height: 100%;
    background: var(--white);
    z-index: 110;
    display: flex; flex-direction: column;
    transition: right 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
    overflow-y: auto;
    box-shadow: -8px 0 40px rgba(102,88,83,0.12);
}
.sidebar.open { right: 0; }

.sidebar-head {
    background: #ff5912;
    padding: 20px 20px 18px;
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.sidebar-logo {
    display: flex; align-items: center; gap: 6px;
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    font-weight: 700; font-size: 1.2rem;
    color: #fff; text-decoration: none;
}
.sidebar-close {
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(255,255,255,0.12); border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #fff; font-size: 1rem;
    transition: background 0.2s;
}
.sidebar-close:hover { background: rgba(255,255,255,0.25); }

.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-item {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 22px;
    text-decoration: none; color: var(--text);
    font-size: 0.95rem; font-weight: 500;
    transition: background 0.15s;
    position: relative;
}
.sidebar-item:hover { background: rgba(247,203,211,0.15); }
.sidebar-item.active { font-weight: 700; }
.sidebar-item.active::after {
    content: ''; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
    width: 7px; height: 7px; border-radius: 50%; background: var(--pink);
}
.sidebar-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.sidebar-divider { height: 1px; background: rgba(148,133,127,0.1); margin: 8px 20px; }

.sidebar-tags {
    padding: 16px 22px;
    display: flex; flex-wrap: wrap; gap: 8px;
    border-top: 1px solid rgba(148,133,127,0.1);
}
.sidebar-tag {
    padding: 5px 14px; border-radius: 50px;
    background: var(--bg); color: var(--light);
    font-size: 0.8rem; font-weight: 500;
    text-decoration: none; transition: all 0.2s;
}
.sidebar-tag:hover { background: var(--pink); color: var(--text); }

.sidebar-cta {
    margin: 0 16px 20px;
    background: linear-gradient(135deg, #FF7A28, #FF540F);
    color: #fff; border: none; border-radius: 14px; padding: 14px;
    font-family: var(--sans); font-weight: 700; font-size: 0.95rem;
    cursor: pointer; width: calc(100% - 32px);
    text-align: center; text-decoration: none;
    display: block; transition: all 0.2s;
    box-shadow: 0 6px 16px rgba(255,84,15,0.35);
}
.sidebar-cta:hover { transform: translateY(-2px); }

/* ── 푸터 ── */
footer { padding: 36px 0; text-align: center; background: var(--bg); color: var(--light); font-size: 0.88rem; }

/* ── 플로팅 pill 버튼 ── */
.float-wrap {
    position: fixed; right: 28px; bottom: 32px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 50; align-items: flex-end;
}
.float-pill {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 12px 20px; border-radius: 50px;
    width: 168px; line-height: 1;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    border: 1px solid rgba(255,255,255,0.75);
    box-shadow: 0 8px 32px rgba(102,88,83,0.12), inset 0 1px 0 rgba(255,255,255,0.8);
    font-family: var(--sans); font-size: 0.82rem; font-weight: 700;
    color: var(--text); text-decoration: none;
    animation: softGlow 3s ease-in-out infinite;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.float-pill:nth-child(2) { animation-delay: -1.5s; }
.float-pill:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 14px 40px rgba(102,88,83,0.18), inset 0 1px 0 rgba(255,255,255,0.9);
    animation-play-state: paused;
}
@keyframes softGlow {
    0%,100% { box-shadow: 0 8px 32px rgba(102,88,83,0.10), inset 0 1px 0 rgba(255,255,255,0.8); }
    50%      { box-shadow: 0 8px 36px rgba(247,203,211,0.35), inset 0 1px 0 rgba(255,255,255,0.9); }
}
.float-pill-icon {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; line-height: 1;
}
.float-pill-icon svg { width: 13px; height: 13px; display: block; }

/* ── 스크롤 reveal ── */
.reveal { opacity: 1; transform: none; }
.reveal.animate { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.animate.visible { opacity: 1; transform: none; }
.d1 { transition-delay: 0.1s; }
.d2 { transition-delay: 0.2s; }
.d3 { transition-delay: 0.3s; }

/* ── 공통 반응형 ── */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .hamburger  { display: flex; }
    .float-wrap { right: 12px; bottom: 16px; }
    .float-pill { width: 136px; font-size: 0.74rem; padding: 10px 14px; }
}
@media (max-width: 600px) {
    .logo { font-size: 1.15rem; }
    .logo-icon { width: 18px; height: 18px; }
    .float-wrap { right: 16px; bottom: 20px; }
    .float-pill { width: 148px; font-size: 0.76rem; padding: 10px 16px; }
    .float-pill-icon { width: 24px; height: 24px; }
}

/* ══════════════════════════════════════════
   Custom Elements (Shadow DOM 미사용)
   FOUC 예약 + 컴포넌트 내부 스타일
════════════════════════════════════════════ */

/* FOUC 예약 — JS 로드 전 레이아웃 안정화 */
unni-header { display: block; min-height: 64px; }
unni-footer { display: block; min-height: 72px; }
unni-sidebar { display: contents; }
unni-float-buttons { display: contents; }
unni-loading { display: block; }
unni-empty-state { display: block; }

/* ── <unni-loading> ── */
.unni-loading {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px 20px; color: var(--light); font-size: 0.9rem;
}
.unni-loading-spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid rgba(247,203,211,0.3);
  border-top-color: #FF540F;
  animation: unniSpin 0.8s linear infinite;
}
@keyframes unniSpin { to { transform: rotate(360deg); } }
.unni-loading-text { opacity: 0.8; }

/* ── <unni-empty-state> ── */
.unni-empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 20px; gap: 12px; text-align: center; color: var(--light);
}
.unni-empty-icon { font-size: 2.4rem; opacity: 0.7; }
.unni-empty-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.unni-empty-description { font-size: 0.88rem; max-width: 320px; line-height: 1.5; }
.unni-empty-state--error .unni-empty-title { color: #C53030; }

/* 제출 중(disabled + aria-busy) 버튼 공통 시각 상태. withSubmitState 유틸과 짝. */
button[aria-busy="true"] {
  opacity: 0.6;
  cursor: wait;
  pointer-events: none;
}
