/* Colors and Typography*/
:root {
    --primary-color: #4a90e2;
    --primary-dark: #2a6ebb;
    --primary-light: #e8f0fb;
    --secondary-color: #1e4d82;
    --border-light: #e0e4eb;
    --border-medium: #d6d9e0;
    --text-dark: #1e4d82;
    --text-medium: #666;
    --text-light: #999;
    --bg-light: #f9fbfe;
}

/* Global */
* {
    box-sizing: border-box;
}

main {
    display: flex;
    min-height: 100vh;
}

body {
    margin: 0;
    padding: 0;
    background: white;
    font-family: sans-serif;
}

/* Headings */
h1 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: #1e4d82;
    font-weight: 700;
}

h2 {
    margin: 0;
    color: #1e4d82;
    font-weight: 700;
}

h3 {
    margin: 0;
    color: #1e4d82;
    font-weight: 600;
}

/* Text */
p {
    line-height: 1.5;
    color: #666;
}


/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

a:hover {
    text-decoration: underline;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-medium);
}

.breadcrumb a {
    color: var(--primary-color);
}

.breadcrumb.show {
    display: block;
}


/* Buttons*/
.view-more-btn {
    display: inline-block;
    padding: 8px 16px !important;
    font-size: 12px !important;
    width: 100%;
    text-align: center;
    margin-top: 8px;
    background: var(--primary-color);
    color: white;
    border: 0;
    border-radius: 8px;
    text-decoration: none;
}

.view-more-btn:hover {
    background: var(--primary-dark);
    color: white;
    text-decoration: none;
}

.primary {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.secondary{
    padding: 12px 24px;
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* ===== SVG MAP ===== */
svg {
    width: 100%;
    max-width: 800px;
    display: block;
    margin: 0 auto;
    transition: all 0.3s ease;
}

svg path {
    fill: var(--primary-light);
    stroke: var(--primary-dark);
    stroke-width: 0.5;
    transition: all 0.2s;
    cursor: pointer;
}

svg path:hover {
    fill: #c8e0f5;
    stroke-width: 1;
}

svg path.active {
    fill: var(--primary-color);
    stroke: var(--secondary-color);
    stroke-width: 1;
}

/* Map */
#map {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    margin: 20px 0;
}


/* Sidebar */
#sidebar {
    width: 320px;
    background: var(--bg-light);
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid var(--border-light);
}

#content {
    flex: 1;
    min-width: 0;
    padding: 20px;
    overflow-y: auto;
}

/* ===== SIDEBAR ===== */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
}

.sidebar-title {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 700;
}

.communities-count {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-medium);
}

.count-label {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.count-number {
    font-size: 16px;
    color: var(--primary-color);
    font-weight: 600;
}

#sidebar-content {
    max-height: 650px;
    overflow-y: auto;
}

.sidebar-section-title {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-dark);
}

.sidebar-section-title.is-compact {
    margin: 15px 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    border-top: 1px solid var(--border-medium);
    padding-top: 10px;
}

.sidebar-empty {
    margin: 0;
    font-size: 12px;
    color: var(--text-light);
}

/* Community */
.community-item {
    background: white;
    border: 1.5px solid var(--border-medium);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.community-item:hover {
    background: #f5f9ff;
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.2);
}

.community-item.active {
    background: var(--primary-color);
    border-color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
}

.community-item.active h3 {
    color: white;
}

.community-item.active p {
    color: white;
    opacity: 0.9;
}

.community-item h3 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: var(--primary-dark);
    font-weight: 600;
}

.community-item p {
    margin: 0;
    font-size: 12px;
    color: var(--text-medium);
}

.cta-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

/* Responsivness */
@media (max-width: 1024px) {
    #sidebar {
        width: 300px;
        padding: 16px;
    }

    #content {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    main {
        flex-direction: column;
    }

    #content {
        order: 2;
        padding: 14px;
    }

    #sidebar {
        order: 1;
        width: 100%;
        padding: 14px;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        max-height: none;
    }

    h1 {
        font-size: 20px;
    }

    svg {
        max-width: 100%;
    }

    #map {
        height: clamp(340px, 62vh, 520px);
        margin: 14px 0 18px;
    }

    #sidebar-content {
        max-height: none;
    }

    .community-item {
        padding: 10px;
    }

    .cta-section {
        margin-top: 24px;
        gap: 10px;
    }

    .cta-section .secondary,
    .cta-section .primary {
        width: 100%;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .breadcrumb {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .community-item h3 {
        font-size: 13px;
    }

    .community-item p {
        font-size: 11px;
    }

    .view-more-btn {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .cta-section {
        flex-direction: column;
    }

    button, .btn, .primary {
        width: 100%;
    }

    h1 {
        font-size: 18px;
    }

    #sidebar {
        padding: 15px;
    }

    #sidebar-content {
        max-height: calc(100vh - 250px);
    }
}

/* Events page */
.events-page {
    margin: 0;
    padding: 0;
    background: white;
}

.events-main {
    display: flex;
    min-height: 100vh;
}

.events-sidebar {
    width: 360px;
    background: var(--bg-light);
    border-right: 1px solid var(--border-light);
    padding: 20px;
    max-height: 750px;
    overflow-y: auto;
}

.events-sidebar-subtitle {
    margin: 10px 0 18px;
    font-size: 14px;
    color: var(--text-medium);
}

.events-content {
    flex: 1;
    padding: 24px;
}

.events-header h1 {
    margin: 0 0 8px;
    font-size: 30px;
}

.events-header p {
    margin: 0 0 20px;
}

.calendar-panel {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 12px;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.calendar-toolbar h2 {
    font-size: 22px;
    margin: 0;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.calendar-weekdays {
    margin-bottom: 6px;
}

.calendar-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-medium);
    padding: 5px 0;
}

.calendar-day {
    min-height: 84px;
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    background: white;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding: 7px;
    transition: all 0.2s;
}

.calendar-day:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
    transform: translateY(0);
}

.calendar-day.active {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.calendar-day.muted {
    visibility: hidden;
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 700;
}

.calendar-day-badge {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-card {
    background: white;
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    padding: 12px;
}

.event-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.event-card p {
    margin: 0 0 6px;
    font-size: 13px;
}

.event-card p:last-child {
    margin-bottom: 0;
}

.events-empty {
    margin: 0;
    color: var(--text-medium);
}

@media (max-width: 980px) {
    .events-main {
        flex-direction: column;
    }

    .events-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }

    .events-content {
        padding: 16px;
    }
}

@media (max-width: 640px) {
    .calendar-day {
        min-height: 66px;
        padding: 6px;
    }

    .calendar-toolbar h2 {
        font-size: 18px;
    }
}
