/**
 * Modern Page & Sidebar Layout Enhancements
 * Solves PC widescreen margin/whitespace issues & compressed sidebar
 * Provides responsive, touch-friendly mobile experience
 */

/* ==========================================================================
   1. Modern Container Breakpoints (Expands usable area on PC screens)
   ========================================================================== */
@media (min-width: 1200px) {
    .container {
        width: 1220px;
        max-width: 96%;
    }
}

@media (min-width: 1400px) {
    .container {
        width: 1340px;
        max-width: 95%;
    }
}

@media (min-width: 1600px) {
    .container {
        width: 1440px;
        max-width: 93%;
    }
}

/* ==========================================================================
   2. Subheader Banner Responsive Polish
   ========================================================================== */
.subheader {
    position: relative;
    padding: 70px 0 60px;
    background-size: cover;
    background-position: center;
}

.subheader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

.subheader .container {
    position: relative;
    z-index: 2;
}

.subheader h2 {
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 14px;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.subheader ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.subheader ul li {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    display: inline-flex;
    align-items: center;
}

.subheader ul li a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.subheader ul li a:hover {
    color: #ffd166;
}

.subheader ul li:after {
    content: "/";
    padding: 0 10px;
    color: rgba(255, 255, 255, 0.6);
}

.subheader ul li:last-child:after {
    display: none;
}

/* ==========================================================================
   3. Main Content Spacing & Layout
   ========================================================================== */
.main-content.p80 {
    padding: 50px 0 70px;
    background: #f8fafc;
}

.news-details .container>.row {
    margin-left: -15px;
    margin-right: -15px;
}

/* ==========================================================================
   4. Main Content Card (.single-news, .news-box)
   ========================================================================== */
.news-details .news-box.single-news,
.news-details .news-box {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    margin-bottom: 30px;
}

.news-details .new-txt {
    padding: 34px 38px;
    background: #ffffff;
}

.news-details .new-txt h4 {
    font-size: 27px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.45;
    margin-top: 0;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
    position: relative;
}

/* Direction-aware accent underline under title */
.news-details .new-txt h4::after {
    content: '';
    position: absolute;
    bottom: -2px;
    width: 65px;
    height: 3px;
    background: #d94148;
    border-radius: 3px;
}

[dir="rtl"] .news-details .new-txt h4::after {
    right: 0;
    left: auto;
}

[dir="ltr"] .news-details .new-txt h4::after {
    left: 0;
    right: auto;
}

.page-content-body {
    font-size: 16px;
    line-height: 1.85;
    color: #334155;
    min-height: 140px;
}

.page-content-body p {
    font-size: 16px;
    line-height: 1.85;
    color: #334155;
    margin-bottom: 18px;
}

/* Share post bar */
.share-post-single {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.share-post-single strong {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-inline-end: 10px;
}

.share-post-single a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.share-post-single a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.share-post-single a.fb {
    background-color: #1877f2;
}

.share-post-single a.tw {
    background-color: #1da1f2;
}

.share-post-single a.insta {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.share-post-single a.linked {
    background-color: #0a66c2;
}

.share-post-single a.yt {
    background-color: #ff0000;
}

/* ==========================================================================
   5. Enhanced Sidebar Widgets (.sidebar .widget)
   ========================================================================== */
.sidebar {
    width: 100%;
}

.sidebar .widget {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    margin-bottom: 28px;
    overflow: hidden;
    transition: box-shadow 0.25s ease;
    float: none;
    width: 100%;
}

.sidebar .widget:last-child {
    margin-bottom: 0;
}

.sidebar .widget h4 {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    background: #f8fafc;
    margin: 0;
    padding: 16px 20px;
    border-bottom: 1px solid #edf2f7;
    position: relative;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: 0;
}

[dir="rtl"] .sidebar .widget h4 {
    border-right: 4px solid #d94148;
}

[dir="ltr"] .sidebar .widget h4 {
    border-left: 4px solid #d94148;
}

.sidebar .widget .inner {
    padding: 20px;
    float: none;
    width: 100%;
}

/* ==========================================================================
   6. Sidebar Recent Posts / Latest News (Modern Flex Layout)
   ========================================================================== */
.widget .recent-posts ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.widget .recent-posts li {
    position: static !important;
    padding: 0 !important;
    float: none !important;
    width: 100% !important;
    min-height: unset !important;
    margin-bottom: 16px !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid #f1f5f9;
    display: flex !important;
    align-items: flex-start;
    gap: 14px;
    transition: transform 0.2s ease;
}

.widget .recent-posts li:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none;
}

.widget .recent-posts li:hover {
    transform: translateY(-1px);
}

.widget .recent-posts .recent-post-thumb,
.widget .recent-posts li>a:first-child {
    flex-shrink: 0;
}

.widget .recent-posts li img,
.widget .recent-posts .recent-post-thumb img {
    position: static !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    width: 82px !important;
    height: 72px !important;
    min-width: 82px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: block;
    transition: transform 0.3s ease;
}

.widget .recent-posts li:hover img,
.widget .recent-posts li:hover .recent-post-thumb img {
    transform: scale(1.04);
}

.widget .recent-posts .recent-post-info,
.widget .recent-posts li>div:not(.recent-post-thumb) {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.widget .recent-posts strong,
.widget .recent-posts .post-date {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #d94148;
    margin-bottom: 4px;
    line-height: 1.3;
}

.widget .recent-posts h6 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
    word-break: break-word;
}

.widget .recent-posts h6 a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.widget .recent-posts h6 a:hover {
    color: #d94148;
}

/* ==========================================================================
   7. Sidebar Upcoming Events (Modern Flex Layout)
   ========================================================================== */
.widget .upcoming-events ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.widget .upcoming-events li {
    position: static !important;
    padding: 0 !important;
    float: none !important;
    width: 100% !important;
    min-height: unset !important;
    margin-bottom: 16px !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid #f1f5f9;
    display: flex !important;
    align-items: flex-start;
    gap: 14px;
    transition: transform 0.2s ease;
}

.widget .upcoming-events li:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none;
}

.widget .upcoming-events .edate {
    position: static !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    width: 64px !important;
    min-width: 64px;
    background: linear-gradient(135deg, #d94148 0%, #c02d34 100%) !important;
    border-radius: 8px;
    padding: 8px 4px 6px;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(217, 65, 72, 0.25);
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.widget .upcoming-events li:hover .edate {
    background: linear-gradient(135deg, #40407e 0%, #2f2f63 100%) !important;
}

.widget .upcoming-events .edate strong {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    display: block;
    color: #ffffff;
}

.widget .upcoming-events .edate span {
    font-size: 12px;
    font-weight: 600;
    display: block;
    color: #ffffff;
}

.widget .upcoming-events .edate span.year {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin-top: 4px;
    padding: 2px 0;
    color: #ffffff;
}

.widget .upcoming-events .event-info,
.widget .upcoming-events li>div:not(.edate) {
    flex: 1;
    min-width: 0;
}

.widget .upcoming-events h6 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    margin: 0 0 4px;
}

.widget .upcoming-events h6 a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.widget .upcoming-events h6 a:hover {
    color: #d94148;
}

.widget .upcoming-events span.loc {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.4;
    display: block;
}

/* ==========================================================================
   8. Sidebar Municipality Sections & Categories
   ========================================================================== */
.widget .categories ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.widget .categories ul li {
    margin-bottom: 8px;
}

.widget .categories ul li:last-child {
    margin-bottom: 0;
}

.widget .categories ul li a {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: all 0.2s ease;
}

.widget .categories ul li a:hover {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #d94148;
    box-shadow: 0 2px 8px rgba(217, 65, 72, 0.12);
}

[dir="rtl"] .widget .categories ul li a:hover {
    transform: translateX(-4px);
}

[dir="ltr"] .widget .categories ul li a:hover {
    transform: translateX(4px);
}

[dir="rtl"] .widget .categories a:before {
    margin-left: 10px;
    margin-right: 0;
    font-family: 'Font Awesome 5 Free', 'FontAwesome';
    content: "\f0d9";
    color: #d94148;
}

[dir="ltr"] .widget .categories a:before {
    margin-right: 10px;
    margin-left: 0;
    font-family: 'Font Awesome 5 Free', 'FontAwesome';
    content: "\f0da";
    color: #d94148;
}

/* ==========================================================================
   9. Mobile & Tablet Responsiveness
   ========================================================================== */
@media (max-width: 991px) {
    .main-content.p80 {
        padding: 35px 0 50px !important;
    }

    .news-details .new-txt {
        padding: 24px 22px;
    }

    .news-details .new-txt h4 {
        font-size: 22px;
        margin-bottom: 18px;
        padding-bottom: 12px;
    }

    .sidebar {
        margin-top: 35px;
    }

    .widget .recent-posts li img,
    .widget .recent-posts .recent-post-thumb img {
        width: 78px !important;
        height: 70px !important;
        min-width: 78px;
    }
}

@media (max-width: 767px) {
    .subheader {
        padding: 40px 0 35px !important;
    }

    .subheader h2 {
        font-size: 23px;
        margin-bottom: 10px;
    }

    .subheader ul li {
        font-size: 13px;
    }

    .main-content.p80 {
        padding: 20px 0 40px !important;
    }

    .news-details .new-txt {
        padding: 20px 16px;
    }

    .news-details .new-txt h4 {
        font-size: 20px;
    }

    .page-content-body {
        font-size: 15px;
        line-height: 1.75;
    }

    .page-content-body p {
        font-size: 15px;
        line-height: 1.75;
    }

    .widget .recent-posts li img,
    .widget .recent-posts .recent-post-thumb img {
        width: 70px !important;
        height: 64px !important;
        min-width: 70px;
    }

    .widget .recent-posts h6 {
        font-size: 13.5px;
    }

    .share-post-single {
        margin-top: 24px;
        padding-top: 16px;
    }
}

/* ==========================================================================
   10. Council Official Members Grid & Person Glyph Support
   ========================================================================== */
#council_data {
    display: flex;
    flex-wrap: wrap;
}

.official-members .team-box {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    height: calc(100% - 30px);
}

.official-members .team-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.12);
}

.official-members .team-box .team-thumb {
    width: 100% !important;
    height: 250px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid #edf2f7;
}

.official-members .team-box .team-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.3s ease;
}

.official-members .team-box:hover .team-thumb img {
    transform: scale(1.03);
}

.official-members .team-box .team-txt {
    width: 100% !important;
    padding: 18px 16px !important;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.official-members .team-box .team-txt h5 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px;
    line-height: 1.4;
}

.official-members .team-box .team-txt strong.dep {
    font-size: 13.5px;
    color: #d94148;
    font-weight: 600;
    font-style: normal;
    line-height: 1.35;
    margin: 0;
}