/* ==========================================================================
   eObce Sidebar Widgets
   ========================================================================== */

/* ---------- Shared ---------- */

.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;
}

.sw-empty {
    color: #767676;
    font-size: 0.85rem;
    font-style: italic;
    margin: 0;
}

/* ==========================================================================
   Nadcházející akce
   ========================================================================== */

.sw-akce-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sw-akce-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    align-items: flex-start;
}

.sw-akce-item:last-child {
    border-bottom: none;
}

.sw-akce-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 6px 8px;
    background: var(--color-primary, #2563eb);
    color: #fff;
    border-radius: 8px;
    line-height: 1;
    flex-shrink: 0;
}

.sw-akce-day {
    font-size: 1.25rem;
    font-weight: 700;
}

.sw-akce-month {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.sw-akce-info {
    min-width: 0;
}

.sw-akce-title {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    color: inherit;
    text-decoration: none;
}

.sw-akce-title:hover {
    color: var(--color-primary, #2563eb);
}

.sw-akce-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 4px;
    font-size: 0.78rem;
    color: #767676;
}

/* ==========================================================================
   Rychlé kontakty
   ========================================================================== */

.sw-kontakty-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sw-kontakty-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.88rem;
    line-height: 1.4;
}

.sw-kontakty-item:last-child {
    border-bottom: none;
}

.sw-kontakty-item svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--color-primary, #2563eb);
}

.sw-kontakty-item a {
    color: inherit;
    text-decoration: none;
    word-break: break-all;
}

.sw-kontakty-item a:hover {
    color: var(--color-primary, #2563eb);
}

.sw-kontakty-adresa span {
    white-space: pre-line;
}

/* ==========================================================================
   Úřední hodiny
   ========================================================================== */

.sw-hodiny-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.sw-hodiny-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
}

.sw-hodiny-table tr:last-child td {
    border-bottom: none;
}

.sw-hodiny-den {
    font-weight: 600;
    white-space: nowrap;
}

.sw-hodiny-cas {
    text-align: right;
    color: #555;
    font-size: 0.8rem;
}

.sw-hodiny-closed {
    color: #767676;
    font-style: italic;
}

.sw-hodiny-today {
    background: var(--color-primary-light, #eff6ff);
    border-radius: 6px;
}

.sw-hodiny-today .sw-hodiny-den {
    color: var(--color-primary, #2563eb);
}

/* ==========================================================================
   Mini kalendář akcí
   ========================================================================== */

.sw-kalendar {
    user-select: none;
}

/* Header with nav */
.sw-kalendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.sw-kalendar-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.sw-kalendar-nav {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    color: #555;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.sw-kalendar-nav:hover {
    background: var(--color-primary, #2563eb);
    border-color: var(--color-primary, #2563eb);
    color: #fff;
}

/* Calendar grid */
.sw-kalendar-grid {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 0.8rem;
    table-layout: fixed;
}

.sw-kalendar-grid th {
    padding: 4px 0;
    font-weight: 600;
    color: #767676;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.sw-kalendar-grid td {
    padding: 0;
    position: relative;
}

.sw-kalendar-grid td > span:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 1px auto;
    border-radius: 50%;
    font-size: 0.78rem;
    transition: background 0.15s, color 0.15s;
}

.sw-kalendar-empty {
    background: none;
}

.sw-weekend {
    color: #767676;
}

/* Today */
.sw-today > span:first-child {
    background: var(--color-primary, #2563eb);
    color: #fff;
    font-weight: 700;
}

/* Has event */
.sw-has-event > span:first-child {
    font-weight: 700;
    cursor: default;
}

.sw-has-event:not(.sw-today) > span:first-child {
    background: var(--color-primary-light, #eff6ff);
    color: var(--color-primary, #2563eb);
}

/* Events list below calendar */
.sw-kalendar-events {
    list-style: none;
    margin: 10px 0 0;
    padding: 8px 0 0;
    border-top: 1px solid #eee;
    font-size: 0.82rem;
}

.sw-kalendar-events li {
    padding: 3px 0;
}

.sw-kalendar-event-day {
    font-weight: 700;
    color: var(--color-primary, #2563eb);
    min-width: 22px;
    display: inline-block;
}

.sw-kalendar-events a {
    color: inherit;
    text-decoration: none;
}

.sw-kalendar-events a:hover {
    color: var(--color-primary, #2563eb);
}

/* Category dots inside day cells */
.sw-event-dots {
    display: flex;
    gap: 2px;
    justify-content: center;
    margin-top: 1px;
}

.sw-event-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: inline-block;
}

/* Category tag in event list */
.sw-event-category-tag {
    display: inline-block;
    font-size: 0.65rem;
    color: #767676;
    background: #f5f5f5;
    padding: 0 4px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 2px;
}

/* Loading state */
.sw-kalendar.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ---- A11Y: Focus-visible ---- */

.sw-akce-title:focus-visible,
.sw-kontakty-item a:focus-visible,
.sw-kalendar-nav:focus-visible,
.sw-kalendar-events a:focus-visible {
    outline: 2px solid var(--color-primary, #1a5f7a);
    outline-offset: 2px;
}

/* ---- A11Y: Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
    .sw-akce-title,
    .sw-kontakty-item a,
    .sw-kalendar-nav {
        transition: none !important;
    }
}
