/* ============================================================
   01-base-layout.css
   변수 + 리셋 + 헤더 + 메뉴바 + 메인 3분할 그리드
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

  :root {
    --ios-blue: #007AFF;
    --ios-blue-dark: #0051D5;
    --ios-blue-light: #4DA3FF;
    --ios-red: #E55B5B;            /* 톤다운된 빨강 (구: #FF3B30 너무 진함) */
    --ios-red-soft: #E87878;       /* 배경/배지용 더 부드러운 빨강 */
    --ios-orange: #FF9500;
    --ios-green: #34C759;
    --ios-purple: #AF52DE;
    --ios-bg: #F2F2F7;
    --ios-card: #FFFFFF;
    --ios-text: #000000;
    --ios-text-secondary: #8E8E93;
    --ios-text-tertiary: #C7C7CC;
    --ios-separator: #C6C6C8;
    --ios-separator-thin: rgba(60, 60, 67, 0.12);
    --ios-fill: #E5E5EA;
  }

  :root {
    color-scheme: light;
  }

  html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Apple SD Gothic Neo", sans-serif;
    color: #000000 !important;
    background-color: #F2F2F7 !important;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
  }

  body {
    width: 100%;
    max-width: 100vw;
  }

  /* 모달 열릴 때 body 스크롤 잠금 (화면 흔들림 방지) */
  body.modal-open {
    overflow: hidden;
  }

  a { text-decoration: none; color: inherit; }
  ul { list-style: none; }
  button { font-family: inherit; }

  .container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  /* ============================================
     상단 헤더
  ============================================ */
  .header-top {
    height: 64px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 0.5px solid var(--ios-separator);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .logo { display: flex; align-items: center; }
  .logo img {
    height: 38px;
    width: auto;
    display: block;
    object-fit: contain;
  }
  #headerLogoImg {
    height: 38px;
  }

  .logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 44px;
    background: linear-gradient(135deg, var(--ios-blue-light) 0%, var(--ios-blue) 100%);
    color: white;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1.5px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
  }

  /* 통합검색 — 헤더 정중앙. 로고/우측버튼이 양끝을 잡으므로 가운데가 남는 폭을 전부 먹는다. */
  .header-search {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 0 16px;
  }
  .header-search input {
    width: 100%;
    max-width: 340px;
    height: 34px;
    padding: 0 12px;
    font-size: 14px;
    color: var(--ios-text);
    background: rgba(118, 118, 128, 0.08);
    border: 0.5px solid var(--ios-separator);
    border-radius: 17px;
    outline: none;
    transition: background 0.15s, border-color 0.15s;
  }
  .header-search input::placeholder { color: var(--ios-text-secondary); }
  .header-search input:focus {
    background: #fff;
    border-color: var(--ios-blue);
  }
  /* 검색 input 의 브라우저 기본 × 버튼 — 높이만 늘려 레이아웃을 흔들어서 숨긴다 */
  .header-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

  .header-search-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--ios-text-secondary);
    background: transparent;
    border: none;
    border-radius: 17px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }
  .header-search-btn svg { width: 18px; height: 18px; }
  .header-search-btn:hover { background: rgba(118, 118, 128, 0.12); color: var(--ios-blue); }

  .header-right { display: flex; align-items: center; gap: 4px; }

  .header-btn {
    background: transparent;
    color: var(--ios-text-secondary);
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 56px;
  }

  .header-btn svg {
    width: 18px;
    height: 18px;
  }

  .header-btn:hover {
    background: var(--ios-bg);
    color: var(--ios-blue);
  }

  .header-btn:active { opacity: 0.6; }

  .header-btn-logout {
    color: var(--ios-red);
  }

  .header-btn-logout:hover {
    background: rgba(255, 59, 48, 0.08);
    color: var(--ios-red);
  }

  /* ============================================
     메뉴바
  ============================================ */
  .menu-bar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 64px;
    z-index: 99;
    border-bottom: 0.5px solid var(--ios-separator);
  }

  .menu { display: flex; gap: 4px; height: 100%; align-items: center; }

  .menu > li {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
  }

  .menu > li > a {
    display: block;
    padding: 8px 14px;
    color: var(--ios-blue);
    font-size: 15px;
    border-radius: 8px;
    transition: background 0.15s;
    white-space: nowrap;
    cursor: pointer;
  }

  .menu > li:hover > a { background: rgba(0, 122, 255, 0.1); }
  .has-sub > a::after { content: " ▾"; font-size: 9px; opacity: 0.6; margin-left: 2px; }

  .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    min-width: 220px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.96) translateY(-4px);
    transform-origin: top left;
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 1000;
  }

  .menu > li:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
  }

  .submenu li { border-bottom: 0.5px solid var(--ios-separator); }
  .submenu li:last-child { border-bottom: none; }

  .submenu li a {
    display: block;
    padding: 12px 16px;
    color: var(--ios-text);
    font-size: 15px;
    transition: background 0.1s;
    cursor: pointer;
  }

  .submenu li a:hover { background: rgba(0, 122, 255, 0.08); }

  /* ============================================
     메인 - 좌/중/우 3분할
  ============================================ */
  .main {
    flex: 1;
    display: grid;
    /* 좌측 축소(240) + 달력(우). 달력 셀은 정사각형(aspect-ratio:1)이라 너비가 곧 높이 —
       과도하게 크지 않게 적당한 폭 유지, 넓은 화면에서만 소폭 확대(사용자 지시 2026-07-21). */
    grid-template-columns: 240px 1fr 640px;
    gap: 16px;
    padding: 16px 24px;
    width: 100%;
  }

  /* 넓은 PC 화면 — 달력을 소폭 확대 */
  @media (min-width: 1600px) {
    .main { grid-template-columns: 240px 1fr 740px; }
  }
  @media (min-width: 1920px) {
    .main { grid-template-columns: 240px 1fr 840px; }
  }

  /* 우측 영역 숨김 시 그리드 재구성 (게시판/메뉴 페이지 진입 시).
     .main.right-hidden(클래스 2개)가 위 .main 브레이크포인트(클래스 1개)보다 우선순위가 높아 2열 유지된다. */
  .main.right-hidden {
    grid-template-columns: 240px 1fr;
  }

  /* iOS 카드 공통 스타일 */
  .ios-card {
    background: var(--ios-card);
    border-radius: 14px;
    overflow: hidden;
  }

  .card-header {
    padding: 14px 16px;
    border-bottom: 0.5px solid var(--ios-separator-thin);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ios-text);
    letter-spacing: -0.2px;
  }

