:root {
  color-scheme: light;
  --bg: #eef2f7;
  --surface: #fff;
  --text: #1b2638;
  --muted: #617086;
  --line: #dfe6ef;
  --accent: #2458ad;
  --accent-light: #eaf2ff;
  --shadow: 0 7px 26px rgba(28, 45, 72, .09);
  --sport-icon-size: 24px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif; }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #efae22; outline-offset: 3px; }
.site-header { background: linear-gradient(120deg,#dde7f6,#fff 55%,#e5edf8); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1240px; padding: 10px 24px; min-height: 130px; margin: auto; display: grid; grid-template-columns: 150px minmax(0,470px) 150px; align-items: center; justify-content: center; column-gap: 24px; }
.header-symbols { display: flex; align-items: center; justify-content: center; gap: 10px; }
.header-facebook { display: grid; place-items: center; flex: 0 0 45px; }
.header-facebook img { display: block; width: 50px; height: 50px; object-fit: contain; }
.header-emblem { display: grid; place-items: center; }
.header-emblem img { width: 96px; height: 96px; object-fit: contain; }
.header-logo { display: block; width: 100%; max-height: 108px; object-fit: contain; }
.page-layout { max-width: 1180px; margin: 16px auto 42px; padding: 0 24px; display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 14px; align-items: start; }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 14px; }
.card-head { margin-bottom: 10px; }
.card-head h1, .card-head h2 { font: 750 clamp(1.2rem, 2vw, 1.5rem)/1.25 system-ui, sans-serif; margin: 0; letter-spacing: -.02em; }
.card-head p { margin: 5px 0 0; color: var(--muted); font-size: .9rem; }
.sports-card, .partners-card { grid-column: 1 / -1; }
.news-card { grid-column: 1; }
.calendar-card { grid-column: 2; }
/* Původní charakteristický vzhled tlačítek oddílů zůstává zachován. */
#sporty { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); justify-items: center; gap: 8px 12px; }
#sporty a.oddil { display: block; position: relative; width: min(300px,100%); height: 68px; border-radius: 20px; text-decoration: none; transition: transform .2s; }
#sporty a.oddil:hover { transform: translateY(-2px); }
#sporty a.oddil .znak { position: absolute; height: 66px; width: 66px; object-fit: contain; left: 0; top: 0; z-index: 2; }
#sporty a.oddil .nazev { display: block; position: relative; top: 13px; left: 10px; width: calc(100% - 20px); height: 46px; border-radius: 500px 0 0 0 / 200px 0; box-shadow: 3px 3px 5px rgba(0,0,0,.3); }
#sporty a.oddil .nazev span { position: absolute; color: #000; right: 10px; bottom: 6px; font: 700 clamp(20px,2.2vw,27px)/1 'Work Sans',sans-serif; text-transform: uppercase; text-align: right; white-space: nowrap; text-shadow: 1px 0 rgba(255,255,255,.8),-1px 0 rgba(255,255,255,.8),0 1px rgba(255,255,255,.8),0 -1px rgba(255,255,255,.8),1px 2px 3px rgba(0,0,0,.35); }
#sporty a.oddil:hover .nazev span { color: #ffe800; -webkit-text-stroke: .2px #171717; text-shadow: 0 1px 2px rgba(0,0,0,.55); }
.partners-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.partners-grid a { display: grid; min-height: 60px; place-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 5px; background: #f9faff; transition: box-shadow .2s, transform .2s; }
.partners-grid a:hover { box-shadow: 0 4px 13px rgba(40,55,80,.13); transform: translateY(-2px); }
.partners-grid img { max-height: 58px; width: auto; object-fit: contain; }
.calendar-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.kalendar { width: 100%; border-spacing: 2px; table-layout: fixed; text-align: center; }
.kalendar caption { font-weight: 750; text-transform: capitalize; text-align: left; padding-bottom: 5px; }
.kalendar th { font-size: .78rem; font-weight: 650; color: var(--muted); }
.kalendar td { position: relative; height: 32px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.kalendar td:not(.empty) { background: #f5f7fb; }
.kalendar td.today { box-shadow: inset 0 0 0 2px var(--accent); }
.calendar-day, .calendar-events summary { display: grid; place-items: center; min-height: 30px; }
.calendar-events summary { cursor: pointer; list-style: none; border-radius: 8px; color: var(--accent); background: var(--accent-light); font-weight: 750; }
.calendar-events summary::-webkit-details-marker { display: none; }
.calendar-events summary:hover, .calendar-events[open] summary { background: #d7e7ff; }
.calendar-popover { position: absolute; top: calc(100% + 7px); left: 50%; transform: translateX(calc(-50% + var(--calendar-offset, 0px))); z-index: 10; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 12px 40px rgba(20,34,58,.23); text-align: left; font-size: .9rem; }
.calendar-popover > strong { display: block; padding-right: 25px; }
@media (hover: hover) and (pointer: fine) and (min-width: 641px) {
  .calendar-popover::before { content: ''; position: absolute; top: -8px; left: 0; width: 100%; height: 8px; }
}
.calendar-popover ul { margin: 8px 0 0; padding: 0; list-style: none; }
.calendar-popover li + li { border-top: 1px solid var(--line); }
.calendar-popover .event-link { display: flex; align-items: center; gap: 7px; padding: 8px 4px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: .84rem; line-height: 1.35; }
.calendar-popover .event-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-popover .event-link:hover { background: var(--accent-light); }
.calendar-popover img { width: var(--sport-icon-size); height: var(--sport-icon-size); flex: none; object-fit: contain; }
.calendar-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.calendar-nav a { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 8px; border-radius: 9px; background: var(--accent-light); text-decoration: none; font-size: .83rem; font-weight: 650; }
.calendar-nav a:hover { background: #d7e7ff; }
.news-list { display: grid; gap: 4px; }
.news-item { display: flex; align-items: stretch; min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: #fafcff; overflow: hidden; }
.news-item.is-soon { border-left: 4px solid #3885cc; background: #eff7ff; }
.news-item.is-today { border-left: 4px solid #d6a000; background: #fff5ba; }
.news-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; min-height: 38px; border: 0; padding: 2px 9px; background: transparent; color: var(--text); font: inherit; text-align: left; text-decoration: none; }
a.news-main, button.news-main { cursor: pointer; }
a.news-main:hover, button.news-main:hover { background: rgba(36,88,173,.08); }
.news-icon { width: var(--sport-icon-size); height: var(--sport-icon-size); flex: none; object-fit: contain; }
.news-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .89rem; font-weight: 650; }
.news-date { flex: none; white-space: nowrap; font-size: .76rem; color: #516078; font-variant-numeric: tabular-nums; }
.poster-symbol { width: 20px; height: 20px; flex: none; color: var(--accent); }
.poster-button { display: grid; place-items: center; flex: 0 0 36px; min-height: 38px; border: 0; border-left: 1px solid var(--line); background: rgba(255,255,255,.55); color: var(--accent); padding: 3px; cursor: pointer; }
.poster-button:hover { background: var(--accent-light); }
.poster-button .poster-symbol { width: 20px; height: 20px; }
.news-note { color: var(--muted); font-size: .83rem; margin: 10px 0 0; }
.empty-news { margin: 8px 0; color: var(--muted); }
.poster-dialog { width: min(920px,calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: none; border-radius: 15px; padding: 34px 14px 14px; box-shadow: 0 24px 65px rgba(0,0,0,.4); color: var(--text); }
.poster-dialog::backdrop { background: rgba(14,23,39,.78); }
.poster-dialog figure { margin: 0; text-align: center; }
.poster-dialog figure img { display: block; max-width: 100%; max-height: calc(100dvh - 125px); width: auto; height: auto; margin: 0 auto; object-fit: contain; }
.poster-dialog figcaption { margin-top: 8px; font-size: .9rem; overflow-wrap: anywhere; }
.dialog-close { position: absolute; top: 4px; right: 7px; border: none; background: transparent; color: var(--text); font-size: 30px; line-height: 1; cursor: pointer; padding: 1px 9px; }
@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
  .sports-card, .partners-card, .calendar-card, .news-card { grid-column: 1; }
  #sporty { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .partners-grid { grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); }
}
@media (max-width: 640px) {
  .header-inner { display: flex; justify-content: center; min-height: 0; padding: 8px 16px; }
  .header-symbols, .header-emblem { display: none; }
  .header-logo { width: min(100%,340px); max-height: 80px; }
  .page-layout { padding: 0 12px; margin: 14px auto 35px; gap: 14px; }
  .card { padding: 16px; border-radius: 14px; }
  #sporty { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 6px; --mobile-mark-size: clamp(34px,9.5vw,44px); }
  #sporty a.oddil { width: 100%; height: 50px; border-radius: 8px; }
  #sporty a.oddil .znak { left: 6px; top: 50%; width: var(--mobile-mark-size); height: var(--mobile-mark-size); transform: translateY(-50%); }
  #sporty a.oddil .nazev { display: flex; align-items: center; justify-content: center; top: 0; left: 0; width: 100%; height: 100%; padding: 4px 6px 4px calc(var(--mobile-mark-size) + 10px); border-radius: 8px; }
  #sporty a.oddil .nazev span { position: static; width: 100%; font-size: clamp(13px,3.8vw,18px); line-height: 1.1; letter-spacing: -.02em; text-align: center; white-space: normal; overflow-wrap: anywhere; }
  .calendar-grid { grid-template-columns: 1fr; gap: 17px; }
  .kalendar { border-spacing: 2px; }
  .kalendar td { height: 42px; }
  .calendar-popover { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); max-height: calc(100dvh - 40px); overflow-y: auto; }
  .news-main { gap: 6px; padding: 5px 7px; }
  .news-title { font-size: .75rem; }
}
@media (max-width: 380px) {
  .partners-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) { #sporty a.oddil, .partners-grid a { transition: none; } }
