/* =========================================================
   Home: Notice + 세미나 미니 캘린더 (index.html)
   - 데스크톱(≥1024px): Notice | 세미나 2단
   - 태블릿/모바일: 세미나가 Notice 아래로 (태블릿은 캘린더 | 다가오는 세미나 2단)
   - 브랜드 색: var(--brand) = #26549c (styles.css)
========================================================= */

.home-board__main,
.home-cal {
  min-width: 0;
}

/* ---------- 세미나 컬럼 ---------- */
.home-cal {
  margin-top: 3rem;
  display: grid;
  gap: 1.25rem;
}

.home-cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.home-cal__heading {
  margin: 0;
  font-size: 2.75rem; /* .notice__title 과 동일 */
  font-weight: 800;
  line-height: 1.2;
}

.home-cal__all {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
}

.home-cal__all:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-cal__body {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

/* ---------- 달력 카드 ---------- */
.home-cal__card {
  border: 1px solid var(--muted); /* .notice-card 와 같은 테두리 */
  background: #fff;
  padding: 1rem 1rem 1.125rem;
  min-width: 0;
}

.home-cal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}

.home-cal__month {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
}

.home-cal__nav {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: #efefef; /* .icon-btn 톤 */
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.home-cal__nav:hover {
  background: var(--brand);
  color: #fff;
}

.home-cal__weekdays,
.home-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.home-cal__weekdays {
  padding-bottom: 0.375rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid #e9e9e9;
}

.home-cal__weekdays span {
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  color: #666;
}

.home-cal__weekdays .is-sun,
.home-cal__day.is-sun .home-cal__num {
  color: #d64545;
}

.home-cal__weekdays .is-sat,
.home-cal__day.is-sat .home-cal__num {
  color: #2f6fd6;
}

/* 공휴일: 일요일과 같은 빨강 (토요일 파랑보다 우선, 오늘/선택 스타일보다는 뒤) */
.home-cal__day.is-holiday .home-cal__num {
  color: #d64545;
}

.home-cal__grid {
  row-gap: 0.125rem;
}

.home-cal__day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.125rem;
  min-width: 0;
  height: 2.5rem;
  padding: 0.25rem 0 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
}

button.home-cal__day {
  cursor: pointer;
}

.home-cal__num {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  transition: background 0.15s ease, color 0.15s ease;
}

.home-cal__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
}

button.home-cal__day:hover .home-cal__num {
  background: #f0f0f0;
}

.home-cal__day.has-events .home-cal__num {
  font-weight: 700;
}

/* 오늘: 브랜드 테두리 */
.home-cal__day.is-today .home-cal__num {
  box-shadow: inset 0 0 0 2px var(--brand);
  color: var(--brand);
}

/* 선택: 브랜드 채움 */
.home-cal__day.is-selected .home-cal__num,
button.home-cal__day.is-selected:hover .home-cal__num {
  background: var(--brand);
  color: #fff;
  box-shadow: none;
}

/* 키보드 포커스: 날짜 칸 전체에 브랜드색 테두리 (칸 안쪽으로 그려 옆 칸과 겹치지 않게) */
.home-cal__day:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  border-radius: 0.375rem;
}

.home-cal__nav:focus-visible,
.home-cal__all:focus-visible,
.home-cal__link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- 선택한 날 목록 ---------- */
.home-cal__daylist {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f0f0f0;
}

.home-cal__daylist-title {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}

.home-cal__holiday {
  margin: 0 0 0.375rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #d64545;
  word-break: break-word;
}

.home-cal__none {
  margin: 0;
  font-size: 0.8125rem;
  color: #767676;
}

.home-cal__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.home-cal__link {
  display: block;
  padding: 0.5rem 0.5rem;
  margin: 0 -0.5rem;
  color: inherit;
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.45;
  word-break: break-word;
  transition: background 0.15s ease;
}

.home-cal__link:hover {
  background: #fafafa;
}

.home-cal__time {
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.home-cal__title {
  font-weight: 700;
  color: var(--text);
}

.home-cal__link:hover .home-cal__title {
  color: var(--brand);
}

.home-cal__loc {
  color: #888;
}

.home-cal__sep {
  margin: 0 0.25rem;
  color: #aaa;
}

/* ---------- 다가오는 세미나 ---------- */
.home-cal__upcoming {
  min-width: 0;
}

.home-cal__sub {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

.home-cal__next {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--text);
}

.home-cal__next li {
  border-bottom: 1px solid #f0f0f0;
}

.home-cal__next-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.25rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.home-cal__next-link:hover .home-cal__next-title {
  color: var(--brand);
}

.home-cal__next-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* 날짜: 목록(notice.html 다가오는 세미나)과 같은 평범한 월/일 + 구분선 */
.home-cal__badge {
  flex: 0 0 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.125rem 0;
  color: var(--text);
  border-right: 1px solid #e9e9e9;
  line-height: 1.1;
}

.home-cal__badge-m {
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
}

.home-cal__badge-d {
  font-size: 1.25rem;
  font-weight: 700;
}

.home-cal__next-body {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.home-cal__next-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-cal__next-meta {
  font-size: 0.8125rem;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-cal__empty {
  padding: 0.875rem 0.25rem;
  font-size: 0.875rem;
  color: #888;
}

.home-cal__empty.is-error {
  color: #d93030;
}

/* ---------- 반응형 ---------- */
/* 태블릿: 캘린더 | 다가오는 세미나 */
@media (min-width: 640px) and (max-width: 1023px) {
  .home-cal__body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 1.5rem;
  }
}

/* 데스크톱: Notice | 세미나 */
@media (min-width: 1024px) {
  .home-board__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(300px, 26vw, 360px);
    column-gap: 2.5rem;
    align-items: start;
  }

  .home-cal {
    margin-top: 0;
  }

  /* 우측 컬럼만큼 좁아진 공지 카드 */
  .home-board .notice-card {
    padding: 2rem;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .home-board .notice__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .home-cal__heading {
    font-size: 2rem;
  }

  /* 좌우 여백 축소 → 360px 에서도 날짜 칸 44px 폭 */
  .home-cal__card {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* 터치 기기: 44px 터치 영역 (이전/다음 달, 전체 보기, 날짜 칸) */
@media (pointer: coarse) {
  .home-cal__nav {
    width: 2.75rem;
    height: 2.75rem;
  }

  .home-cal__all {
    min-height: 2.75rem;
  }

  .home-cal__day {
    height: 2.75rem;
    padding-top: 0.375rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-cal__num,
  .home-cal__nav {
    transition: none;
  }
}
