body {
    background: url("../../assets/img/city-hall.webp") center / cover no-repeat;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

body > div {
    display: flex;
    flex-direction: column;
    flex: 1;
}

#full-info-con {
    margin-top: 1.25rem;
    width: 100%;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

#full-info-con .row {
    width: auto;
    max-width: 90vw;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

#full-info-con .col-auto {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

#full-info-con .col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: auto;
    flex-shrink: 1;
}

#logo {
    height: 8.125rem;
    width: auto;
    margin-right: 1rem;
}

.page-info {
    font-size: var(--body);
    color: var(--default-text);
    margin-bottom: 0.3125rem;
    white-space: nowrap;
}

#page-title {
    color: var(--default-text);
    font-weight: bold;
    font-size: var(--page-title);
    margin-bottom: 0.3125rem;
    white-space: nowrap;
}

.search-container.search-field {
    font-size: var(--body);
    border-style: none;
    height: 2.5rem;
    border-radius: 50px !important;
    margin: 0rem auto;
    flex-shrink: 0;
    width: 90%;
    max-width: 50rem;
}

.search-result-name {
    font-size: var(--body);
    font-weight: bold;
    color: var(--primary-blue);
}

.search-result-type {
    font-size: var(--smaller);
    color: gray;
    margin-top: 2px;
}

.search-result-type.department {
    color: var(--primary-green);
}

.search-result-type.announcement {
    color: #ffc107;
}

.search-result-type.option {
    color: #153a78;
}

.homepage-options-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0 5%;
    margin-top: 1rem;
    margin-bottom: 0;
    flex-shrink: 0;
}

.options-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    width: 100%;
    max-width: 75rem;
    margin: 0 auto;
}

.homepage-options {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 1.25rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: calc(25% - 1.5rem);
    min-width: 12.5rem;
    max-width: 15.625rem;
    aspect-ratio: 250 / 215;
    transition: transform 0.2s ease;
}

.homepage-options:hover {
    transform: scale(1.05);
    background: var(--default-text);
}

.homepage-option-icon {
    height: 65%;
    width: auto;
    object-fit: contain;
    margin-top: 0.3125rem;
}

.homepage-subtitle {
    color: var(--primary-blue);
    margin: 0.5rem 0 0 0;
    font-weight: bold;
    text-align: center;
    font-size: var(--body);
    line-height: 1.2;
}

#ann-con, #event-con {
    background: linear-gradient(transparent 0%, rgba(21, 58, 120, 0.5) 39%, rgba(21, 58, 120, 0.5) 100%);
    padding: 1.25rem 1.25rem 0 1.25rem;
    width: 100%;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

#ann-header, #event-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.25rem;
    width: 100%;
    flex-shrink: 0;
    position: relative;
}

#ann-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

#ann-title {
    color: var(--default-text);
    font-size: var(--title);
    font-weight: bold;
    margin: 0;
    text-align: center;
}

#ann-sortby-wrapper, #event-sortby-wrapper{
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
}

#ann-sortby, #event-sortby {
    color: var(--default-text);
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    margin: 0;
    font-size: var(--body);
    cursor: pointer;
    white-space: nowrap;
    position: relative;
}

.custom-dropdown-menu {
    width: auto;
    right: 0;
    margin-top: 8px;
    display: none;
    background: var(--default-text);
    border: 1px solid var(--primary-blue);
}

.custom-dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
}

.dropdown-item:last-child::after {
    display: none;
}

.dropdown-item.has-submenu {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.submenu-arrow {
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.dropdown-item.has-submenu:hover .submenu-arrow {
    transform: rotate(90deg);
}

.submenu-content {
    display: none;
    background: var(--default-text);
    border-top: 1px solid rgba(21,58,120,0.30);
    padding: 12px;
}

.submenu-content.show {
    display: block;
}

.submenu-content .month-year-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.submenu-content .month-year-row .selects-wrapper {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.submenu-content select {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--primary-blue);
    font-size: var(--body);
    background: var(--default-text);
    cursor: pointer;
}

.submenu-content .btn, .btn:hover {
    padding: 8px 12px;
    font-size: var(--body);
    color: var(--default-text) !important;
    font-weight: normal !important;
    width: 100%;
}

.announcements-grid, .events-grid {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scroll-behavior: smooth;
    cursor: grab;
    scrollbar-width: thin;
    scrollbar-color: var(--default-text) transparent;
}

.announcements-grid.dragging {
    cursor: grabbing;
    user-select: none;
}

.announcement-card, .event-card {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    height: 18.75rem;
    width: 0;                  
    border-radius: 1.25rem;
    overflow: hidden;
    cursor: pointer;
    transition: width 0.3s ease;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.5);
}

.announcement-card .ann-image,
.event-card .event-image {
    width: auto;             
    height: 100%;
    object-fit: cover;
    display: block;
}

.announcement-card .ann-image[src*="placeholder"],
.event-card .event-image[src*="placeholder"] {
    width: auto;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

.ann-preview, .event-preview {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.8) 50%,
        transparent 100%
    );
    z-index: 2;
    transition: opacity 0.3s ease;
}

.ann-prev-event-date, .event-preview-time {
    font-size: var(--smaller);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin: 4px 0;
}

.ann-event-date, .event-time {
    font-size: var(--smaller);
    color: var(--primary-green);
    font-weight: 600;
    margin: 0 0 15px 0;
}

.ann-preview-content, .event-preview-content {
    display: flex;
    align-items: center;
    width: 100%;
    padding-bottom: 10px !important;
}

.ann-preview-icon svg,
.event-preview-icon svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.ann-preview-text, .event-preview-text {
    flex: 1;
}

.ann-preview-date, .event-preview-date {
    color: var(--default-text);
    font-size: var(--small);
    margin: 0 0 0.25rem 0;
    font-weight: bold;
}

.ann-preview-title, .event-preview-title {
    color: var(--primary-green);
    font-size: var(--body);
    font-weight: bold;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .homepage-options {
        width: calc(50% - 1rem);
    }
}

@media (max-width: 991px) {
    #full-info-con {
        margin-top: 0 !important;
    }

    #logo {
        height: 6rem;
    }
    
    .page-info { 
        white-space: normal; 
    }

    #page-title { 
        white-space: normal; 
    }
}

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

    #ann-sortby-wrapper {
        position: relative;
        display: flex;
        justify-content: center;
        width: 100%;
        margin-top: 0.5rem;
        transform: none;
        top: auto;
    }
    
    #ann-sortby {
        margin-top: 0.2rem;
    }
    
    .custom-dropdown-menu {
        right: auto;
    }
}

@media (max-width: 550px) {
    .homepage-options {
        width: calc(50% - 1rem);
    }
}

@media (max-width: 480px) {
    #logo {
        height: 5rem;
    }

    .options-grid {
        gap: 1rem;
    }
    
    .homepage-options {
        width: calc(50% - 0.5rem);
        padding: 0.5rem;
        min-width: 10rem;
        max-width: 10rem;
    }
    
    .homepage-option-icon {
        height: 50% !important;
    }

    .announcement-card {
        width: 15rem;
    }
}

.item-details-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000001;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
}

.item-details-modal {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 50vw;
    height: auto;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 20px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    scrollbar-color: #999 transparent;
}

.item-details-modal::-webkit-scrollbar,
.item-details-modal::-webkit-scrollbar-track {
    background: transparent;
}

.item-details-close {
    position: sticky;
    top: 0;
    align-self: flex-end;
    z-index: 1;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    margin: 0 -12px -32px 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #333;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.item-details-image {
    display: block;
    width: auto;
    height: auto;
    flex: 0 0 auto;
    max-width: 100%;
    margin: 0 auto;
    max-height: 40vh;
    border-radius: 20px;
    object-fit: contain;
}

.item-details-title {
    margin: 16px 0 12px;
    color: var(--primary-blue);
    font-size: var(--subtitle);
    font-weight: bold;
    line-height: 1.3;
    text-align: center;
    overflow-wrap: anywhere;
}

.item-details-description {
    margin: 0;
    color: #000;
    font-size: var(--body);
    line-height: 1.5;
    text-align: left;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}