/* ============================================================================
   marathon-calendar.css — 마라톤 월간 캘린더 + 상세 페이지 스타일
   ============================================================================ */

/* ── 월 네비 ── */
.ro-cal-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin: 16px 0 20px;
    padding: 12px 14px;
    background: var(--ro-surface);
    border: 1px solid var(--ro-border);
    border-radius: var(--ro-radius-md);
}
.ro-cal-nav__title {
    font-size: var(--ro-text-lg);
    font-weight: 800;
    color: var(--ro-text);
    margin: 0 12px;
    letter-spacing: -0.02em;
}

/* ── 캘린더 그리드 ── */
.ro-cal {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--ro-border);
    border: 1px solid var(--ro-border);
    border-radius: var(--ro-radius-md);
    overflow: hidden;
}
.ro-cal__head {
    background: var(--ro-bg);
    padding: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--ro-text);
}
.ro-cal__head.sun { color: var(--ro-danger-600); }
.ro-cal__head.sat { color: var(--ro-primary-600); }

.ro-cal__cell {
    background: var(--ro-surface);
    min-height: 110px;
    padding: 6px 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ro-cal__cell.muted { background: var(--ro-bg); opacity: 0.55; }
.ro-cal__cell.today { box-shadow: inset 0 0 0 2px var(--ro-primary-500); }
.ro-cal__cell.sun .ro-cal__day { color: var(--ro-danger-600); }
.ro-cal__cell.sat .ro-cal__day { color: var(--ro-primary-600); }

.ro-cal__day {
    font-weight: 700;
    font-size: 13px;
    color: var(--ro-text);
}

.ro-cal__events {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 0;
}
.ro-cal__events a {
    display: block;
    padding: 3px 6px;
    background: var(--ro-primary-50);
    border-radius: 4px;
    color: var(--ro-primary-700);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ro-cal__events a:hover { background: var(--ro-primary-100); }
.ro-cal__events .region {
    display: inline-block;
    padding: 0 4px;
    background: var(--ro-primary-500);
    color: white;
    border-radius: 3px;
    margin-right: 3px;
    font-size: 10px;
    font-weight: 700;
}
.ro-cal__events .name { color: var(--ro-primary-700); }
.ro-cal__events .cnt {
    margin-left: 4px;
    color: var(--ro-accent-600);
    font-weight: 700;
}

/* 모바일 — 캘린더 글자 크기 축소 + 셀 높이 조절 */
@media (max-width: 640px) {
    .ro-cal__cell { min-height: 70px; padding: 4px 5px; }
    .ro-cal__day { font-size: 11px; }
    .ro-cal__events a { font-size: 10px; padding: 2px 4px; }
    .ro-cal__events .region { display: none; }   /* 모바일은 지역 칩 숨김, 이름만 */
}

/* ── 월별 보조 리스트 ── */
.ro-cal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ro-cal-list__item {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 12px 16px;
    background: var(--ro-surface);
    border: 1px solid var(--ro-border);
    border-radius: var(--ro-radius-md);
    text-decoration: none;
    color: inherit;
    transition: border-color 160ms;
}
.ro-cal-list__item:hover { border-color: var(--ro-primary-300); }
.ro-cal-list__date {
    text-align: center;
    min-width: 50px;
    padding: 6px 4px;
    background: var(--ro-primary-50);
    border-radius: 6px;
    color: var(--ro-primary-700);
}
.ro-cal-list__date strong {
    display: block;
    font-size: 20px;
    font-weight: 800;
}
.ro-cal-list__date span { font-size: 11px; }
.ro-cal-list__main { flex: 1; min-width: 0; }
.ro-cal-list__main h4 {
    margin: 0 0 4px;
    font-size: var(--ro-text-md);
    font-weight: 700;
    color: var(--ro-text);
}
.ro-cal-list__meta {
    color: var(--ro-text-sub);
    font-size: var(--ro-text-sm);
    display: flex; gap: 8px; flex-wrap: wrap;
}

/* ── 상세 + 입상자 페이지 ── */
.ro-marathon-hero {
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--ro-primary-50), var(--ro-accent-50));
    border: 1px solid var(--ro-primary-200);
    border-radius: var(--ro-radius-lg);
    margin-bottom: 20px;
}
.ro-marathon-hero__date {
    display: inline-block;
    padding: 4px 12px;
    background: var(--ro-primary-500);
    color: white;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
}
.ro-marathon-hero h1 {
    margin: 0 0 8px;
    font-size: var(--ro-text-2xl);
    color: var(--ro-text);
    font-weight: 800;
}
.ro-marathon-hero__meta {
    color: var(--ro-text-sub);
    font-size: var(--ro-text-md);
    display: flex; gap: 14px; flex-wrap: wrap;
}

/* 입상자 카드 그리드 (부문별 그룹핑) */
.ro-winner-group {
    background: var(--ro-surface);
    border: 1px solid var(--ro-border);
    border-radius: var(--ro-radius-md);
    padding: 16px 20px;
    margin-bottom: 16px;
}
.ro-winner-group h3 {
    margin: 0 0 12px;
    font-size: var(--ro-text-md);
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ro-border);
}
.ro-winner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 10px;
}
.ro-winner-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--ro-bg);
    border: 1px solid var(--ro-border);
    border-radius: var(--ro-radius-sm);
    text-decoration: none;
    color: inherit;
    transition: transform 160ms, border-color 160ms;
}
.ro-winner-card:hover {
    transform: translateY(-2px);
    border-color: var(--ro-primary-300);
}
.ro-winner-card__rank {
    font-size: 24px;
    line-height: 1;
}
.ro-winner-card__rank.top1 { color: #FFD700; }
.ro-winner-card__rank.top2 { color: #C0C0C0; }
.ro-winner-card__rank.top3 { color: #CD7F32; }
.ro-winner-card__info { flex: 1; min-width: 0; }
.ro-winner-card__info strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--ro-text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ro-winner-card__info span {
    font-size: 12px;
    color: var(--ro-text-sub);
}
.ro-winner-card__photo {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--ro-gray-200);
}

/* ── 한국 공휴일 표시 (2026-05-28) ── */
.ro-cal__cell.holiday .ro-cal__day { color: #e11d48; }   /* 토스 핫레드 */
.ro-cal__cell.holiday.sun .ro-cal__day,
.ro-cal__cell.holiday.sat .ro-cal__day { color: #e11d48; }
.ro-cal__cell.sun .ro-cal__day { color: #e11d48; }
.ro-cal__cell.sat .ro-cal__day { color: #2563eb; }
[data-theme="dark"] .ro-cal__cell.holiday .ro-cal__day,
[data-theme="dark"] .ro-cal__cell.sun .ro-cal__day {
    color: #fb7185;
}
[data-theme="dark"] .ro-cal__cell.sat .ro-cal__day {
    color: #60a5fa;
}
.ro-cal__holiday-tag {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #e11d48;
    margin-top: 2px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}
[data-theme="dark"] .ro-cal__holiday-tag { color: #fb7185; }

/* 대체공휴일 — 본 공휴일과 톤을 살짝 구분 (점선 underline) */
.ro-cal__holiday-tag:where([title*="대체"]),
.ro-cal__cell.holiday .ro-cal__holiday-tag[title*="대체"] {
    border-bottom: 1px dotted currentColor;
    opacity: 0.9;
}
