/* ==========================================
   HOMEPAGE STYLES - Sausio 13 Progimnazija
   ========================================== */

/* --- Color Variables --- */
:root {
    --hp-navy: #2e4a7a;
    --hp-navy-dark: #223358;
    --hp-orange: #e8832a;
    --hp-orange-hover: #d0721f;
    --hp-white: #ffffff;
    --hp-light-gray: #f0f0f0;
    --hp-text-gray: #666666;
    --hp-card-bg: #ffffff;
    --hp-border-radius: 8px;
}

/* --- White background for homepage --- */
body.home,
body.home .wrapper,
body.home .content,
body.home .content .content_inner,
body.home .content .container,
body.home .full_width,
.homepage-container {
    background-color: var(--hp-white);
}

.homepage-landing-image {
    width: 100%;
    aspect-ratio: 1240 / 272;
    overflow: hidden;
    background-color: var(--hp-white);
    position: relative;
}

.homepage-landing-image .landing-slide {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    animation: landing-crossfade 48s ease-in-out infinite;
}

.homepage-landing-image .landing-slide:nth-child(1) { animation-delay: 0s; }
.homepage-landing-image .landing-slide:nth-child(2) { animation-delay: 6s; }
.homepage-landing-image .landing-slide:nth-child(3) { animation-delay: 12s; }
.homepage-landing-image .landing-slide:nth-child(4) { animation-delay: 18s; }
.homepage-landing-image .landing-slide:nth-child(5) { animation-delay: 24s; }
.homepage-landing-image .landing-slide:nth-child(6) { animation-delay: 30s; }
.homepage-landing-image .landing-slide:nth-child(7) { animation-delay: 36s; }
.homepage-landing-image .landing-slide:nth-child(8) { animation-delay: 42s; }

@keyframes landing-crossfade {
    0%      { opacity: 0; }
    1.88%   { opacity: 1; }
    12.5%   { opacity: 1; }
    14.38%  { opacity: 0; }
    100%    { opacity: 0; }
}

/* --- NAUJIENOS Header (full width) --- */
.homepage-naujienos-header {
    background-color: var(--hp-navy);
    padding: 12px 0;
    margin: 0;
}

.homepage-naujienos-header .container {
    background-color: transparent;
}

.homepage-naujienos-header h2 {
    color: var(--hp-white);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0;
    padding: 0;
    text-transform: uppercase;
}

/* --- Homepage Layout (Main + Sidebar) --- */
.homepage-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    padding-top: 25px;
    width: 100%;
    box-sizing: border-box;
}

.homepage-main {
    flex: 1;
    min-width: 0;
}

.homepage-sidebar {
    width: 260px;
    flex-shrink: 0;
}

/* --- News Grid --- */
.homepage-news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

/* --- News Card --- */
.homepage-news-card {
    background: var(--hp-card-bg);
    border-radius: var(--hp-border-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.homepage-news-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.news-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card-thumb {
    display: block;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 16/10;
    background: var(--hp-light-gray);
}

.news-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.homepage-news-card:hover .news-card-thumb img {
    transform: scale(1.05);
}

.news-card-content {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-card-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px 0;
}

.news-card-title a {
    color: var(--hp-orange);
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-card-title a:hover {
    color: var(--hp-orange-hover);
}

.news-card-excerpt {
    font-size: 12px;
    line-height: 1.5;
    color: var(--hp-text-gray);
    margin: 0 0 10px 0;
    flex: 1;
}

.news-card-date {
    font-size: 11px;
    color: #999;
    display: block;
    margin-bottom: 10px;
}

.news-card-btn-wrap {
    margin-top: auto;
}

.news-card-btn {
    display: inline-block;
    background-color: var(--hp-orange);
    color: var(--hp-white);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.news-card-btn:hover {
    background-color: var(--hp-orange-hover);
    color: var(--hp-white);
}

/* --- Pagination Arrows --- */
.homepage-news-pagination {
    display: flex;
    justify-content: center;
    margin-top: 25px;
    margin-bottom: 30px;
}

.news-pagination-arrows {
    display: flex;
    gap: 4px;
}

.news-page-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: var(--hp-navy);
    color: var(--hp-white);
    border-radius: 50%;
    text-decoration: none;
    font-size: 22px;
    font-weight: 300;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.news-page-arrow:hover {
    background-color: var(--hp-orange);
    color: var(--hp-white);
}

.news-page-arrow.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

/* --- Sidebar --- */

/* Pamokų laikas schedule (collapsible) */
.sidebar-schedule {
    background-color: var(--hp-white);
    border: 2px solid var(--hp-navy);
    border-radius: var(--hp-border-radius);
    margin-bottom: 15px;
    overflow: hidden;
}

.sidebar-schedule-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background-color: var(--hp-navy);
    color: var(--hp-white);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    padding: 12px 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sidebar-schedule-toggle:hover {
    background-color: var(--hp-orange);
}

.sidebar-schedule-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.sidebar-schedule-toggle[aria-expanded="true"] .sidebar-schedule-arrow {
    transform: rotate(180deg);
}

.sidebar-schedule-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.sidebar-schedule-body.open {
    max-height: 400px;
}

.sidebar-schedule-table {
    width: 100%;
    border-collapse: collapse;
}

.sidebar-schedule-table tr {
    border-bottom: 1px solid rgba(30, 45, 77, 0.1);
}

.sidebar-schedule-table tr:last-child {
    border-bottom: none;
}

.sidebar-schedule-table tr:hover {
    background-color: rgba(30, 45, 77, 0.04);
}

.sidebar-schedule-table td {
    padding: 9px 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--hp-navy);
    text-align: center;
    font-style: normal;
    letter-spacing: 0.3px;
}

.sidebar-schedule-table td:first-child {
    width: 24px;
    text-align: right;
    padding-right: 4px;
    font-weight: 600;
    color: var(--hp-text-gray);
    font-size: 13px;
}

.homepage-sidebar-links,
.homepage-sidebar .homepage-sidebar-widget {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Pertrauka dropdown style */
.homepage-sidebar .widget_nav_menu,
.homepage-sidebar .widget_custom_html {
    margin-bottom: 0;
}

.sidebar-link-btn,
.homepage-sidebar .homepage-sidebar-widget a,
.homepage-sidebar-links a {
    display: block;
    background-color: var(--hp-navy);
    color: var(--hp-white);
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.sidebar-link-btn:hover,
.homepage-sidebar .homepage-sidebar-widget a:hover,
.homepage-sidebar-links a:hover {
    background-color: var(--hp-orange);
    color: var(--hp-white);
}

.sidebar-link-btn:first-child,
.homepage-sidebar .homepage-sidebar-widget:first-child a {
    border-radius: var(--hp-border-radius) var(--hp-border-radius) 0 0;
}

.sidebar-link-btn:last-child,
.homepage-sidebar .homepage-sidebar-widget:last-child a {
    border-radius: 0 0 var(--hp-border-radius) var(--hp-border-radius);
    border-bottom: none;
}

/* Audience buttons (MOKINIAMS / TĖVAMS) */
.sidebar-audience-btns {
    display: flex;
    gap: 6px;
    margin-top: 15px;
    position: relative;
}

.sidebar-audience-wrap {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
}

.sidebar-audience-wrap .sidebar-audience-btn {
    width: 100%;
}

.sidebar-audience-btns > .sidebar-audience-btn {
    flex: 1 1 0;
}

.sidebar-audience-btn {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 12px 6px;
    box-sizing: border-box;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hp-white);
    text-decoration: none;
    border-radius: var(--hp-border-radius);
    transition: opacity 0.2s ease, transform 0.2s ease;
    flex-wrap: wrap;
    text-align: center;
}

.sidebar-audience-btn i.fa {
    font-size: 20px;
}

.sidebar-audience-btn:hover {
    opacity: 0.88;
    transform: translateY(-2px);
    color: var(--hp-white);
}

.sidebar-audience-students {
    background-color: #42a5f5;
}

.sidebar-audience-parents {
    background-color: #4caf50;
}

.sidebar-audience-tamo {
    background-color: #d3d3d3;
}

.tamo-logo-icon {
    height: 20px;
    width: auto;
    vertical-align: middle;
}

/* Audience dropdown menus */
.sidebar-audience-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 999;
    background-color: #4265a0;
    border-radius: var(--hp-border-radius);
    padding: 6px 0;
    margin-top: 5px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.sidebar-audience-dropdown::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 5px;
}

.sidebar-audience-dropdown > a:first-child {
    border-radius: var(--hp-border-radius) var(--hp-border-radius) 0 0;
}

.sidebar-audience-dropdown > a:last-child {
    border-radius: 0 0 var(--hp-border-radius) var(--hp-border-radius);
}

.sidebar-audience-wrap:hover .sidebar-audience-dropdown {
    display: block;
}

.sidebar-audience-wrap:hover .sidebar-audience-btn {
    opacity: 0.88;
    transform: translateY(-2px);
}

.sidebar-audience-dropdown a {
    display: block;
    padding: 8px 16px;
    color: var(--hp-white);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.sidebar-audience-dropdown a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--hp-white);
}

/* VEIKLŲ KALENDORIUS section */
.sidebar-calendar-section {
    margin-top: 15px;
}

.sidebar-calendar-heading {
    background-color: var(--hp-orange);
    color: var(--hp-white);
    text-align: center;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--hp-border-radius) var(--hp-border-radius) 0 0;
    margin: 0;
}

.sidebar-calendar-heading i {
    margin-right: 6px;
}

.sidebar-calendar-img {
    display: block;
    width: 100%;
    border-radius: 0 0 var(--hp-border-radius) var(--hp-border-radius);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.sidebar-calendar-img:hover {
    opacity: 0.85;
}

/* Pilietiškumo mokykla logo */
.sidebar-pilietiskumas-section {
    margin-top: 12px;
    text-align: center;
    padding: 0 65px;
    box-sizing: border-box;
}

.sidebar-pilietiskumas-logo {
    display: block;
    width: 100%;
    transition: opacity 0.2s ease;
}

.sidebar-pilietiskumas-logo:hover {
    opacity: 0.85;
}



/* Kalendorius modal */
.kalendorius-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.kalendorius-modal.is-open {
    display: flex;
}

.kalendorius-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
}

.kalendorius-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
}

.kalendorius-modal-content img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--hp-border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.kalendorius-modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--hp-white);
    color: #333;
    font-size: 24px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 2;
    padding: 0;
}

/* --- Back to top button --- */
#back_to_top > span {
    width: 44px;
    height: 44px;
    line-height: 44px;
    border-radius: var(--hp-border-radius);
    border: none;
    background-color: var(--hp-navy);
}

#back_to_top span i,
#back_to_top span span {
    color: var(--hp-white);
    font-size: 18px;
    line-height: 44px;
}

#back_to_top:hover > span {
    background-color: var(--hp-orange);
    border-color: var(--hp-orange);
}

#back_to_top:hover span i,
#back_to_top:hover span span {
    color: var(--hp-white);
}

/* --- Override page background pattern on homepage --- */
body.page-id-14869.transparent_content,
body.page-id-14869.transparent_content.overlapping_content .content .content_inner > .container,
body.page-id-14869.transparent_content.overlapping_content .content .content_inner > .full_width {
    background-image: none !important;
    background-color: var(--hp-white) !important;
}

/* --- Remove gap above footer on homepage --- */
body.home .content,
body.home .content_inner,
body.home .content .container,
body.home .content .container .container_inner,
body.home .content_bottom,
body.home .full_width,
body.home .wrapper_inner,
body.home .content .container .container_inner.page_container_inner,
body.home .full_page_container_inner,
body.page-id-14869 .content,
body.page-id-14869 .content_inner,
body.page-id-14869 .content .container,
body.page-id-14869 .content .container .container_inner {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

body.home footer,
body.page-id-14869 footer {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Footer text color override */
footer .footer_top a,
footer .footer_top p,
footer .footer_top span,
footer .footer_top li,
footer .footer_top .textwidget,
footer .footer_top h1,
footer .footer_top h2,
footer .footer_top h3,
footer .footer_top h4,
footer .footer_top h5,
footer .footer_top h6,
footer .footer_bottom_holder,
footer .footer_bottom_holder a,
footer .footer_bottom_holder p,
footer .footer_bottom_holder span {
    color: var(--hp-navy) !important;
}

/* --- No posts message --- */
.homepage-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--hp-text-gray);
    font-size: 16px;
    padding: 40px 0;
    margin: 0;
}

/* ==========================================
   ARCHIVE SECTION ON HOMEPAGE
   ========================================== */

.homepage-archive-section {
    background-color: #f0f0f0;
    border-radius: var(--hp-border-radius);
    padding: 28px 30px 30px;
    margin-top: 30px;
    margin-bottom: 0;
    overflow: hidden;
}

.archive-section-title {
    color: var(--hp-orange);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 20px 0;
    padding: 0;
}

.archive-year-block {
    margin-bottom: 20px;
}

.archive-year-block:last-child {
    margin-bottom: 0;
}

.archive-year-label {
    color: var(--hp-orange);
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.archive-months-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
}

.archive-month-btn {
    display: inline-block;
    background-color: var(--hp-navy);
    color: var(--hp-white);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s ease;
    min-width: 90px;
    text-align: center;
}

.archive-month-btn:hover {
    background-color: var(--hp-orange);
    color: var(--hp-white);
}

/* ==========================================
   ARCHIVE PAGE TEMPLATE
   ========================================== */

.archive-page-container {
    padding-top: 20px;
    padding-bottom: 40px;
}

.archive-back-link-wrap {
    margin-bottom: 20px;
    padding: 0 10px;
}

.archive-back-link {
    color: var(--hp-navy);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.archive-back-link:hover {
    color: var(--hp-orange);
}

.archive-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--hp-text-gray);
    font-size: 16px;
    padding: 40px 0;
}

/* --- Responsive --- */
@media only screen and (max-width: 1100px) {
    .homepage-news-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .homepage-sidebar {
        width: 220px;
    }

    .archive-month-btn {
        padding: 7px 14px;
        font-size: 12px;
        min-width: 80px;
    }
}

@media only screen and (max-width: 880px) {
    .homepage-layout {
        flex-direction: column;
    }

    .homepage-sidebar {
        width: 100%;
        order: -1;
        margin-bottom: 20px;
    }

    .sidebar-schedule {
        margin-bottom: 12px;
    }

    .sidebar-schedule-table td {
        padding: 5px 10px;
        font-size: 12px;
    }

    .homepage-sidebar-links,
    .homepage-sidebar .homepage-sidebar-widget {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .sidebar-link-btn,
    .homepage-sidebar .homepage-sidebar-widget a {
        border-radius: var(--hp-border-radius) !important;
        border-bottom: none;
        flex: 1 1 auto;
        text-align: center;
        padding: 10px 12px;
        font-size: 11px;
    }

    .homepage-news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sidebar-calendar-heading {
        font-size: 13px;
        padding: 12px 14px;
    }
}

@media only screen and (max-width: 550px) {
    .homepage-landing-image {
        aspect-ratio: 16 / 10;
    }

    .homepage-news-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .homepage-naujienos-header {
        padding: 10px 15px;
    }

    .homepage-naujienos-header h2 {
        font-size: 18px;
    }

    .archive-months-row {
        gap: 6px;
    }

    .archive-month-btn {
        padding: 6px 10px;
        font-size: 11px;
        min-width: 70px;
    }

    .archive-section-title {
        font-size: 18px;
    }

    .archive-year-label {
        font-size: 15px;
    }
}
