/* [경제 캘린더] /market/calendar 주간·월간 뷰 + 홈 주간 캘린더(hp3-cal-) 공용 스타일 */

/* ---------- 공통 조각 ---------- */
.mc-dots{ display:inline-flex; gap:2px; vertical-align:middle; }
.mc-dots i{ width:5px; height:5px; border-radius:50%; background:#f59e0b; display:block; }
.mc-dots i:nth-child(n+2){ opacity:.9; }
.mc-dots[data-importance="1"] i{ background:#64748b; }
.mc-dots[data-importance="2"] i{ background:#38bdf8; }
.mc-dots[data-importance="3"] i{ background:#f43f5e; }

.mc-badge{ font-size:10.5px; font-weight:800; letter-spacing:.04em; padding:1px 6px; border-radius:999px; border:1px solid transparent; white-space:nowrap; }
.mc-badge[data-market="US"]{ color:#93c5fd; border-color:rgba(147,197,253,.35); background:rgba(147,197,253,.1); }
.mc-badge[data-market="KR"]{ color:#86efac; border-color:rgba(134,239,172,.35); background:rgba(134,239,172,.1); }
.mc-badge[data-market="CRYPTO"]{ color:#fbbf24; border-color:rgba(251,191,36,.35); background:rgba(251,191,36,.1); }

/* ---------- 홈 상단 주간 캘린더 ---------- */
.hp3-cal{ margin:0 0 14px; padding:10px 12px 12px; background:var(--panel,#15151a);
  border:1px solid rgba(255,255,255,.07); border-radius:12px; }
.hp3-cal-top{ display:flex; align-items:center; gap:10px; margin-bottom:9px; }
.hp3-cal-label{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:800; color:var(--muted,#9aa0aa); white-space:nowrap; }
.hp3-cal-label i{ font-style:normal; opacity:.8; }
.hp3-cal-range{ font-size:12.5px; font-weight:700; }
.hp3-cal-tz{ font-size:11px; color:rgba(154,160,170,.75); white-space:nowrap; }
.hp3-cal-all{ margin-left:auto; font-size:12px; font-weight:700; color:var(--muted,#9aa0aa); text-decoration:none; white-space:nowrap; }
.hp3-cal-all:hover{ color:inherit; }

.hp3-cal-week{ display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; }
.hp3-cal-day{ position:relative; min-height:112px; padding:7px 7px 8px; border-radius:10px;
  border:1px solid rgba(255,255,255,.06); background:rgba(255,255,255,.02); }
.hp3-cal-day.is-weekend .hp3-cal-date b{ color:#94a3b8; }
.hp3-cal-day.is-today{ background:rgba(244,63,94,.07); border-color:rgba(244,63,94,.45); }

.hp3-cal-date{ display:flex; align-items:baseline; gap:5px; margin-bottom:6px; text-decoration:none; color:inherit; }
.hp3-cal-date b{ font-size:11.5px; font-weight:700; color:var(--muted,#9aa0aa); }
.hp3-cal-date span{ font-size:14px; font-weight:800; }
.hp3-cal-date em{ margin-left:auto; font-style:normal; font-size:9px; font-weight:800; letter-spacing:.04em; color:#f43f5e; }
.hp3-cal-date:hover span{ text-decoration:underline; }

.hp3-cal-items{ display:flex; flex-direction:column; gap:4px; }
.hp3-cal-item{ display:block; padding:4px 6px; border-radius:6px; text-decoration:none; color:inherit;
  background:rgba(255,255,255,.04); border-left:2px solid #64748b; }
.hp3-cal-item:hover{ background:rgba(255,255,255,.09); }
.hp3-cal-item[data-importance="2"]{ border-left-color:#38bdf8; }
.hp3-cal-item[data-importance="3"]{ border-left-color:#f43f5e; background:rgba(244,63,94,.1); }
.hp3-cal-item-when{ display:flex; align-items:center; gap:4px; font-size:10.5px; font-weight:700; color:var(--muted,#9aa0aa); }
.hp3-cal-dday{ font-size:9.5px; font-weight:800; color:#0b0b0d; background:#f43f5e; padding:0 4px; border-radius:999px; }
.hp3-cal-item-name{ display:block; font-size:11px; line-height:1.3; margin-top:1px; word-break:keep-all;
  overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.hp3-cal-item[data-importance="3"] .hp3-cal-item-name{ font-weight:700; }
.hp3-cal-none{ font-size:10.5px; color:rgba(154,160,170,.45); }

/* '+N' 은 details 로 접는다. 칸 높이가 흔들리지 않도록 펼침 패널은 띄워서 얹는다. */
.hp3-cal-more{ margin-top:4px; }
.hp3-cal-more summary{ display:inline-block; cursor:pointer; list-style:none; font-size:10.5px; font-weight:800;
  color:var(--muted,#9aa0aa); padding:1px 6px; border-radius:999px; border:1px solid rgba(255,255,255,.12); }
.hp3-cal-more summary::-webkit-details-marker{ display:none; }
.hp3-cal-more summary:hover{ color:inherit; border-color:rgba(255,255,255,.3); }
.hp3-cal-more-panel{ position:absolute; z-index:5; left:6px; right:6px; margin-top:5px; padding:6px;
  display:flex; flex-direction:column; gap:4px; border-radius:8px;
  background:var(--panel,#1b1b21); border:1px solid rgba(255,255,255,.16); box-shadow:0 10px 24px rgba(0,0,0,.45); }

@media (max-width:720px){
  .hp3-cal-top{ flex-wrap:wrap; }
  .hp3-cal-tz{ order:3; flex-basis:100%; }
  .hp3-cal-week{ grid-template-columns:1fr; gap:4px; }
  .hp3-cal-day{ min-height:0; display:grid; grid-template-columns:64px minmax(0,1fr); gap:8px; align-items:start; }
  .hp3-cal-date{ margin-bottom:0; flex-direction:column; gap:0; }
  .hp3-cal-date em{ margin-left:0; }
  .hp3-cal-more{ grid-column:2; }
  .hp3-cal-more-panel{ position:static; box-shadow:none; }
}

/* ---------- 페이지 공통 ---------- */
.mc-toolbar{ display:flex; align-items:center; gap:10px 14px; flex-wrap:wrap; margin:6px 0 12px; }
.mc-tabs{ display:inline-flex; padding:2px; border-radius:10px; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.08); }
.mc-tab{ padding:6px 16px; border-radius:8px; font-size:13px; font-weight:700; text-decoration:none; color:var(--muted,#9aa0aa); }
.mc-tab:hover{ color:inherit; }
.mc-tab.is-on{ color:#0b0b0d; background:#e2e8f0; }
.mc-nav{ display:inline-flex; align-items:center; gap:6px; }
.mc-step, .mc-today{ display:inline-flex; align-items:center; justify-content:center; border-radius:8px;
  border:1px solid rgba(255,255,255,.09); background:rgba(255,255,255,.02); color:inherit;
  font-size:13px; font-weight:700; text-decoration:none; }
.mc-step{ width:30px; height:30px; font-size:16px; line-height:1; }
.mc-today{ height:30px; padding:0 12px; }
.mc-step:hover, .mc-today:hover{ border-color:rgba(255,255,255,.24); }
.mc-today.is-off{ opacity:.4; }
.mc-range{ font-size:16px; font-weight:800; padding-left:6px; }
.mc-tz{ margin-left:auto; font-size:11.5px; color:var(--muted,#9aa0aa); white-space:nowrap; }
.mc-filters{ display:flex; flex-wrap:wrap; gap:14px; margin:0 0 16px; }
.mc-filter-group{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.mc-filter-group > b{ font-size:11.5px; color:var(--muted,#9aa0aa); font-weight:700; margin-right:2px; }
.mc-filter{ font-size:12.5px; padding:4px 11px; border-radius:999px; text-decoration:none; color:var(--muted,#9aa0aa);
  border:1px solid rgba(255,255,255,.09); background:transparent; }
.mc-filter.is-on{ color:#0b0b0d; background:#e2e8f0; border-color:#e2e8f0; font-weight:700; }
.mc-filter-reset{ font-size:12px; color:var(--muted,#9aa0aa); text-decoration:underline; align-self:center; }

/* ---------- 주간 그리드 ---------- */
.mc-week{ display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; }
.mc-day{ background:var(--panel,#15151a); border:1px solid rgba(255,255,255,.07); border-radius:12px; padding:10px 9px; min-height:150px; }
.mc-day.is-today{ border-color:rgba(244,63,94,.5); box-shadow:0 0 0 1px rgba(244,63,94,.18) inset; }
.mc-day.is-weekend .mc-day-head b{ color:#94a3b8; }
.mc-day-head{ display:flex; align-items:baseline; gap:6px; margin-bottom:8px; }
.mc-day-head b{ font-size:14px; }
.mc-day-head small{ font-size:11px; color:var(--muted,#9aa0aa); }
.mc-day-head .mc-today-tag{ margin-left:auto; font-size:10px; font-weight:800; color:#f43f5e; }
/* 이벤트는 details 라서 JS 없이 그 자리에서 상세가 펼쳐진다. */
.mc-event{ display:block; padding:0; border-radius:9px; margin-bottom:6px;
  background:rgba(255,255,255,.035); border:1px solid rgba(255,255,255,.06); border-left:2px solid #64748b; }
.mc-event[data-importance="2"]{ border-left-color:#38bdf8; }
.mc-event[data-importance="3"]{ border-left-color:#f43f5e; background:rgba(244,63,94,.08); }
.mc-event:hover{ border-color:rgba(255,255,255,.2); }
.mc-event > summary{ display:block; cursor:pointer; list-style:none; padding:7px 8px; }
.mc-event > summary::-webkit-details-marker{ display:none; }
.mc-event-top{ display:flex; align-items:center; flex-wrap:wrap; gap:4px 6px; margin-bottom:3px; }
.mc-event-time{ font-size:11.5px; font-weight:700; color:#e2e8f0; }
.mc-dday{ font-size:9.5px; font-weight:800; color:#0b0b0d; background:#f43f5e; padding:1px 5px; border-radius:999px; }
.mc-event-title{ font-size:12px; line-height:1.4; display:block; word-break:keep-all; }
.mc-event[data-importance="3"] .mc-event-title{ font-weight:800; }
/* KST 로 날짜가 넘어간 미국 일정에 원래 현지 날짜를 적어 둔다. */
.mc-local{ display:inline-block; margin-top:3px; font-size:10px; font-weight:700; color:#fbbf24;
  border:1px solid rgba(251,191,36,.3); border-radius:999px; padding:0 5px; }
.mc-event-detail{ padding:0 8px 8px; border-top:1px dashed rgba(255,255,255,.1); margin-top:2px; }
.mc-event-tz{ margin:7px 0 6px; font-size:11px; font-weight:700; color:#e2e8f0; }
.mc-event-detail dl{ margin:0; display:grid; grid-template-columns:auto minmax(0,1fr); gap:2px 8px; }
.mc-event-detail dt{ font-size:10.5px; color:var(--muted,#9aa0aa); white-space:nowrap; }
.mc-event-detail dd{ margin:0; font-size:11px; line-height:1.45; word-break:keep-all; }
.mc-event-link{ display:inline-block; margin-top:7px; font-size:11.5px; font-weight:700; color:#93c5fd; text-decoration:none; }
.mc-event-link:hover{ text-decoration:underline; }
.mc-day-empty{ font-size:11.5px; color:rgba(154,160,170,.5); }
/* 홈·월간에서 #d-YYYY-MM-DD 로 넘어온 날짜를 잠깐 눈에 띄게 한다. */
.mc-day:target{ border-color:rgba(226,232,240,.55); box-shadow:0 0 0 2px rgba(226,232,240,.18); }
.mc-day{ scroll-margin-top:80px; }

/* ---------- 월간 그리드 ---------- */
.mc-month{ width:100%; border-collapse:separate; border-spacing:6px; table-layout:fixed; }
.mc-month th{ font-size:11.5px; color:var(--muted,#9aa0aa); font-weight:700; padding-bottom:2px; }
.mc-month td{ vertical-align:top; background:var(--panel,#15151a); border:1px solid rgba(255,255,255,.07); border-radius:10px; padding:7px 7px 8px; height:96px; }
.mc-month td.is-out{ background:transparent; border-color:rgba(255,255,255,.03); opacity:.4; }
.mc-month td.is-today{ border-color:rgba(244,63,94,.5); }
.mc-month .mc-num{ display:block; font-size:12.5px; font-weight:700; margin-bottom:5px; color:inherit; text-decoration:none; }
a.mc-num:hover{ text-decoration:underline; }
.mc-month td.is-weekend .mc-num{ color:#94a3b8; }
.mc-mini{ display:block; text-decoration:none; color:inherit; font-size:11px; line-height:1.35; margin-bottom:3px; word-break:keep-all; }
.mc-mini:hover{ text-decoration:underline; }
.mc-mini b{ font-weight:800; }
.mc-empty-note{ margin:18px 0; padding:16px; border:1px dashed rgba(255,255,255,.14); border-radius:12px; color:var(--muted,#9aa0aa); font-size:13.5px; }

/* ---------- 주요 이벤트 표 ---------- */
.mc-table-wrap{ overflow-x:auto; }
.mc-table{ width:100%; border-collapse:collapse; font-size:13.5px; }
.mc-table th, .mc-table td{ text-align:left; padding:9px 10px; border-bottom:1px solid rgba(255,255,255,.06); }
.mc-table th{ font-size:11.5px; color:var(--muted,#9aa0aa); font-weight:700; }
.mc-table td a{ color:inherit; }
.mc-table tr[data-importance="3"] td:nth-child(3){ font-weight:800; }

/* ---------- 모바일: 주간은 세로 리스트, 월간은 가로 스크롤 ---------- */
@media (max-width:860px){
  .mc-week{ grid-template-columns:1fr; gap:6px; }
  .mc-day{ min-height:0; }
  /* 일정 없는 날도 '일정 없음' 을 그대로 보여줘 한 주 전체가 빠짐없이 읽히게 한다. */
  .mc-day:not(.has-events){ padding:7px 9px; opacity:.6; }
  .mc-toolbar{ gap:8px 10px; }
  .mc-tz{ margin-left:0; flex-basis:100%; }
  .mc-range{ font-size:15px; }
  .mc-month-scroll{ overflow-x:auto; }
  .mc-month{ min-width:640px; }
}

/* 이 페이지에서만 쓰는 스크린리더 전용 텍스트 (plaza.css 에만 정의돼 있어 여기 다시 둔다) */
.mc-month .sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* Investment calendar v2: category is textual as well as color-coded. */
.ec-page .mc-category,.hp3-cal .mc-category{display:inline-flex;align-items:center;min-height:16px;padding:0 5px;border:1px solid rgba(100,116,139,.25);border-radius:5px;background:rgba(100,116,139,.1);color:#aab6c5;font-size:9px;font-weight:750;line-height:1;white-space:nowrap}
.ec-page .mc-category[data-category="macro"],.hp3-cal .mc-category[data-category="macro"]{border-color:rgba(56,189,248,.25);background:rgba(56,189,248,.09);color:#7dd3fc}
.ec-page .mc-category[data-category="earnings"],.hp3-cal .mc-category[data-category="earnings"]{border-color:rgba(45,212,191,.25);background:rgba(45,212,191,.09);color:#79e3d1}
.ec-page .mc-category[data-category="expiry"],.hp3-cal .mc-category[data-category="expiry"]{border-color:rgba(244,63,94,.24);background:rgba(244,63,94,.08);color:#fda4af}
.ec-page .mc-category[data-category="crypto"],.hp3-cal .mc-category[data-category="crypto"]{border-color:rgba(167,139,250,.28);background:rgba(139,92,246,.1);color:#c4b5fd}
.ec-page .mc-category[data-category="holiday"],.hp3-cal .mc-category[data-category="holiday"]{border-color:rgba(148,163,184,.22);background:rgba(100,116,139,.08);color:#b4c0cf}
.ec-page .mc-filter-important{border-style:dashed}
.ec-page .mc-filter-important.is-on{border-style:solid;background:#fee2e2;border-color:#fee2e2;color:#881337}
.ec-page .mc-event-ticker,.ec-page .mc-table-ticker{display:inline-block;margin-left:7px;color:#8494a8;font-size:10px;font-weight:700;letter-spacing:.035em}
.ec-page .mc-status{display:inline-block;margin-left:6px;padding:1px 5px;border:1px solid rgba(251,191,36,.25);border-radius:999px;color:#f3c96b;font-size:9px;font-style:normal;font-weight:750;vertical-align:middle}
.ec-page .mc-mini{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ec-page .mc-mini .mc-category{margin-right:2px;vertical-align:1px}
.ec-page .mc-mini-more{display:inline-block;margin-top:1px;color:#93c5fd;font-size:10px;font-weight:800;text-decoration:none}
.ec-page .mc-table td:nth-child(3){min-width:210px}
@media(max-width:620px){
  .ec-page .mc-filters{gap:8px 10px}
  .ec-page .mc-filter{padding:4px 9px;font-size:11px}
  .ec-page .mc-table-ticker{display:block;margin:2px 0 0}
}
