/* --- TBC News CSS --- */

:root {
    --primary-blue: #0075c5;
    --secondary-blue: #005a9c;
    --primary-yellow: #ffd900;
    --dark-text: #333;
    --light-text: #ffffff;
    --container-width: 1200px;
    --footer-bg: #003366;
}

/* Base Styles */
body { font-family: 'Poppins', sans-serif; margin: 0; color: var(--dark-text); background-color: #f4f7fb; line-height: 1.6; overflow-x: hidden; }
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 1rem; }
a { color: var(--primary-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =================================================================== */
/* HEADER: MOBILE FIRST (< 992px)                                    */
/* =================================================================== */
.site-header { box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.global-header { display: none; }
.masthead { background-color: var(--primary-blue); color: var(--light-text); padding: 0.75rem 0; }
.masthead .container { display: flex; justify-content: space-between; align-items: center; }
.logo-emblem { height: 50px; }
.logo-institution { height: 45px; }
.site-title { text-align: center; }
.site-title h6 { display: none; }
.site-title h1 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.main-navigation { background-color: var(--light-text); border-bottom: 1px solid #dee2e6; }
.main-navigation .container { display: flex; align-items: center; justify-content: space-between; }
.nav-links { display: none; flex-direction: column; width: 100%; position: absolute; top: 131px; left: 0; background-color: white; box-shadow: 0 4px 6px rgba(0,0,0,0.1); z-index: 1000; }
.nav-links.active { display: flex; }
.nav-links a, .nav-item-dropdown span { padding: 1rem; color: var(--dark-text); font-weight: 600; text-align: center; border-bottom: 1px solid #f0f0f0; }
.menu-toggle { display: block; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--primary-blue); }
.search-bar-desktop { display: none; }
.search-bar-mobile { background-color: #f8f9fa; padding: 0.75rem 0; border-bottom: 1px solid #e9ecef; }
.search-bar-mobile form { display: flex; width: 100%; }
.search-bar-mobile input { flex-grow: 1; border: 1px solid #ccc; padding: 0.5rem; border-radius: 4px 0 0 4px; border-right: none; }
.search-bar-mobile button { border: none; background-color: var(--secondary-blue); color: white; padding: 0.5rem 1rem; border-radius: 0 4px 4px 0; cursor: pointer; }
.nav-item-dropdown { width: 100%; }
.dropdown-content { display: none; }

/* =================================================================== */
/* DESKTOP STYLES (992px and wider)                                  */
/* =================================================================== */
@media (min-width: 992px) {
    .global-header { display: block; padding: 0.5rem 0; font-size: 0.85rem; }
    .global-header .container { display: flex; justify-content: space-between; align-items: center; }
    .global-nav { margin-left: auto; }
    .lang-switch img { height: 12px; margin-right: 4px; }
    .masthead { padding: 1.5rem 0; }
    .logo-emblem { height: 80px; }
    .logo-institution { height: 70px; }
    .site-title h6 { display: block; margin: 0; font-size: 1rem; }
    .site-title h1 { font-size: 2.2rem; }
    .menu-toggle { display: none; }
    .main-navigation .container { justify-content: flex-start; }
    .main-navigation .nav-links {
        display: flex !important;
        flex-direction: row;
        align-items: center; /* Vertically align all items */
        position: static;
        width: auto;
        box-shadow: none;
        border: none;
    }
    .nav-links a, .nav-item-dropdown {
        padding: 1rem 1.25rem;
        border-bottom: 3px solid transparent;
        width: auto;
        border-top: none;
    }
    .nav-links a:hover, .nav-item-dropdown:hover {
        background-color: #f1f1f1;
        border-bottom-color: var(--primary-yellow);
    }
    .nav-item-dropdown {
        position: relative;
        cursor: default;
        padding-top: 1rem; /* Match other items */
        padding-bottom: 1rem; /* Match other items */
    }
    .dropdown-content {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #f9f9f9;
        min-width: 240px;
        box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
        z-index: 1001;
    }
    .dropdown-content a {
        color: black;
        padding: 12px 16px;
        text-decoration: none;
        display: block;
        text-align: left;
        border-bottom: none !important;
        font-weight: normal;
    }
    .dropdown-content a:hover { background-color: #ddd; text-decoration: none; }
    .nav-item-dropdown:hover .dropdown-content { display: block; }
    .search-bar-desktop { display: flex; margin-left: auto; }
    .search-bar-desktop input { border: 1px solid #ccc; padding: 0.5rem; }
    .search-bar-desktop button { border: none; background-color: var(--secondary-blue); color: white; padding: 0.5rem 1rem; }
    .search-bar-mobile { display: none; }
    .nav-links a, .nav-item-dropdown a {
        text-decoration: none;
    }
    .nav-links a:hover,
    .nav-item-dropdown a:hover {
        text-decoration: none; /* disable underline on hover */
    }
    
    .global-nav {
        margin-left: auto;
        display: flex; /* Add flex display */
        align-items: center; /* Vertically align items */
    }
    .global-nav a {
        margin-left: 1.5rem; /* Increase spacing between links */
        display: flex; /* Allow vertical alignment of text and flags */
        align-items: center;
    }
    .lang-switch img {
        height: 12px;
        margin-right: 5px; /* Add space between flag and text */
    }
}

/* =================================================================== */
/* ARTICLE BODY STYLES (NEW - Fixes cropped images)                  */
/* =================================================================== */
.article-body {
    line-height: 1.8;
    font-size: 1.1rem;
}
.article-body p {
    margin-bottom: 1.5rem;
}
/* This is the most important rule: it makes all images responsive */
.article-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto; /* Center the images */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* =================================================================== */
/* HOMEPAGE LAYOUT & RESPONSIVENESS                                  */
/* =================================================================== */
.homepage-layout {
    display: grid;
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 2rem;
    align-items: flex-start;
}
.main-content-area {
    width: 100%;
}
@media (min-width: 992px) {
    .homepage-layout {
        grid-template-columns: 300px 1fr; /* Two columns on desktop */
    }
}


/* =================================================================== */
/* NEWS GRID & RESPONSIVENESS                                        */
/* =================================================================== */
.news-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column on smallest screens */
    gap: 1.5rem;
}
@media (min-width: 576px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr); /* Two columns on small tablets */
    }
}
@media (min-width: 992px) {
    .latest-news-grid {
        /* On homepage, stay at 2 columns even on large screens */
        grid-template-columns: repeat(2, 1fr);
    }
    #news-grid-container.news-grid {
        /* On category pages, expand to 3 columns */
        grid-template-columns: repeat(3, 1fr);
    }
}


/* =================================================================== */
/* FOOTER & RESPONSIVENESS (FINAL CREATIVE VERSION)                  */
/* =================================================================== */
.site-footer {
    /* THE NEW GRADIENT BACKGROUND */
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--primary-blue) 100%);
    color: #adb5bd;
    font-size: 0.9rem;
    padding-top: 3rem; /* A bit more space at the top */
    border-top: 5px solid var(--primary-yellow); /* Strong brand accent */
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
@media (min-width: 576px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }

.footer-column h4 {
    color: var(--primary-yellow); /* VIBRANT YELLOW TITLES */
    margin-top: 0;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase; /* More official look */
    letter-spacing: 0.5px;
}
.footer-column ul { list-style: none; padding: 0; }
.footer-column ul li { margin-bottom: 0.75rem; } /* More spacing */
.footer-column a, .footer-column address {
    color: #e9ecef; /* LIGHTER TEXT for better contrast */
    text-decoration: none;
}
.footer-column a:hover { color: var(--light-text); }
.footer-column address { font-style: normal; line-height: 1.8; }

.visitor-stats i {
    color: var(--primary-yellow);
    margin-right: 8px;
    font-size: 0.8rem;
}

/* --- Social Icons --- */
.social-icons {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
}
.social-icons a {
    color: #e9ecef;
    font-size: 1.4rem;
    transition: color 0.3s ease, transform 0.3s ease;
}
.social-icons a:hover {
    color: var(--primary-yellow);
    transform: scale(1.15);
}
@media (min-width: 992px) { .social-icons { justify-content: flex-start; } }

/* --- Bottom Footer --- */
.footer-bottom {
    padding: 1.5rem 0;
    background-color: rgba(0,0,0,0.2);
}
.footer-bottom .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.85rem;
    text-align: center;
}
@media (min-width: 768px) { .footer-bottom .container { flex-direction: row; justify-content: space-between; } }
.mandatory-links a { color: #ced4da; margin: 0 0.5rem; }
.mandatory-links a:hover { color: var(--light-text); }
.copyright { margin-top: 0.5rem; }
@media (min-width: 768px) { .copyright { margin-top: 0; } }

/* =================================================================== */
/* ALL OTHER STYLES (Cards, Hero, etc.)                              */
/* =================================================================== */
/* Hero Section */
.hero-section { margin-bottom: 2rem; background-color: #000; border-radius: 8px; overflow: hidden; position: relative; }
.hero-link { display: block; text-decoration: none; color: white; }
.hero-image { width: 100%; height: 250px; object-fit: cover; display: block; opacity: 0.7; transition: opacity 0.3s ease; }
@media (min-width: 768px) { .hero-image { height: 450px; } }
.hero-link:hover .hero-image { opacity: 0.5; }
.hero-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 1.5rem; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); }
.hero-title { font-size: 1.5rem; margin: 0 0 0.5rem 0; text-shadow: 1px 1px 3px rgba(0,0,0,0.7); }
@media (min-width: 768px) { .hero-title { font-size: 2.5rem; } }
.hero-excerpt { display: none; } /* Hide on mobile */
@media (min-width: 768px) { .hero-excerpt { display: block; font-size: 1rem; margin: 0; max-width: 80%; } }

/* Sidebar Styles */
.left-sidebar .leader-box { background: #fff; border-radius: 8px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.1); text-align: center; }
.leader-title { font-size: 1.2rem; color: var(--primary-blue); margin-top: 0; margin-bottom: 1rem; }
.left-sidebar .leader-image { width: 100%; height: auto; max-width: 250px; border-radius: 5px; margin-bottom: 1rem; }
.left-sidebar .leader-text strong { display: block; font-size: 1.1rem; color: #333; }
.left-sidebar .leader-text span { font-size: 0.9rem; color: #666; }

/* News Card */
.news-card { background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.news-card:hover { transform: translateY(-5px); box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
.news-card a { text-decoration: none; color: inherit; }
.news-card-image { width: 100%; height: 200px; object-fit: cover; display: block; }
.news-card-content { padding: 1rem; }
.news-card-title { margin: 0; font-size: 1.1rem; line-height: 1.4; }

/* Breadcrumb */
.breadcrumb-nav { margin-bottom: 1rem; font-size: 0.9rem; color: #6c757d; }
.breadcrumb-nav a { color: var(--primary-blue); }

/* Search Term Highlight */
.search-term { color: var(--primary-blue); font-weight: bold; }

/* =================================================================== */
/*  RESPONSIVE FLAGS                                    */
/* =================================================================== */
.global-nav .lang-switch img {
    height: 12px;
    margin-right: 4px;
    vertical-align: middle;
}

/* =================================================================== */
/* HEADER ALIGNMENT                                                    */
/* =================================================================== */
.global-header .global-nav {
    margin-left: auto; /* This pushes the navigation to the far right */
}

/* --- DROPDOWN MENU STYLES --- */
.nav-item-dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}
.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    border-bottom: none !important;
}
.dropdown-content a:hover { background-color: #f1f1f1; }
.nav-item-dropdown:hover .dropdown-content {
    display: block;
}

/* =================================================================== */
/* FINAL LAYOUT POLISHING                                            */
/* =================================================================== */

/* --- Dropdown Menu Fixes --- */
.nav-item-dropdown {
    position: relative;
    display: flex; /* Ensures it stays in line with other nav items */
    align-items: center;
    padding: 1rem 1.25rem; /* Matches padding of other nav links */
    color: var(--dark-text);
    font-weight: 600;
    border-bottom: 3px solid transparent;
    cursor: default; /* It makes it not look like a link */
}
.nav-item-dropdown:hover {
    background-color: #f1f1f1;
    border-bottom-color: var(--primary-yellow);
}
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%; /* Position it right below the parent */
    left: 0;
    background-color: #f9f9f9;
    min-width: 240px; /* Give it more space */
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1001; /* Ensure it's on top of everything */
}
.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    border-bottom: none !important; /* Override other nav styles */
    font-weight: normal; /* It makes dropdown items normal weight */
}
.dropdown-content a:hover { 
    background-color: #ddd; 
}
.nav-item-dropdown:hover .dropdown-content {
    display: block;
}

/* --- Responsive Image for DG on Page Template --- */
.page-content img {
    max-width: 100%; /* It makes all images in static pages responsive */
    height: auto;
    border-radius: 8px;
}

/* =================================================================== */
/* DG PAGE LAYOUT STYLES                                             */
/* =================================================================== */

.dg-layout {
    display: flex;
    flex-direction: column; /* Mobile first: stack vertically */
    gap: 2rem;
}

.dg-image-column {
    flex-shrink: 0;
    text-align: center;
}

/* .dg-image-frame {
    background-color: white;
    border: 1px solid #ddd;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: inline-block;
} */

.dg-image-frame {
    padding: 0;
    border: none;
    background-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
}

.dg-image-frame img {
    border-radius: 12px;
    width: 100%;
    height: auto;
    display: block;
}

.btn-wasifu {
    display: inline-block;
    background-color: var(--secondary-blue);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 1rem;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-wasifu:hover {
    background-color: var(--primary-blue);
    color: white;
    text-decoration: none;
}

.dg-text-column {
    line-height: 1.8;
}

.dg-text-column h3 {
    margin-top: 0;
    font-size: 1.8rem;
    color: var(--primary-blue);
}

.dg-title {
    font-size: 1.1rem;
    color: #666;
    margin-top: -10px;
    margin-bottom: 2rem;
}

/* --- Media Query for Desktop View --- */
@media (min-width: 768px) {
    .dg-layout {
        flex-direction: row; /* Side-by-side on desktop */
    }
    .dg-image-column {
        width: 300px; /* Fixed width for the image column */
    }
    .dg-text-column {
        flex-grow: 1;
    }
}

@media (max-width: 991px) {
    .nav-item-dropdown {
        width: 100%;
        text-align: center;
        padding: 1rem;
        border-bottom: 1px solid #f0f0f0;
        color: var(--dark-text);
        font-weight: 600;
    }

    .nav-item-dropdown span {
        width: 100%;
        display: block;
    }

    .nav-item-dropdown:hover {
        background-color: #f1f1f1;
    }

    .dropdown-content {
        position: static;
        background-color: #f9f9f9;
        box-shadow: none;
        width: 100%;
    }

    .dropdown-content a {
        padding: 1rem;
        text-align: center;
        color: var(--dark-text);
    }

    .dropdown-content a:hover {
        background-color: #eee;
        text-decoration: none;
    }
}

.dropdown-content a:hover {
    text-decoration: none;
}

.top-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
@media (min-width: 992px) {
    .top-grid {
        grid-template-columns: 2fr 1fr; /* 2/3 for hero, 1/3 for top stories */
    }
}

.top-stories {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.top-stories h3 {
    margin-top: 0;
    border-bottom: 3px solid var(--primary-yellow);
    padding-bottom: 0.5rem;
    color: var(--primary-blue);
}
.top-stories ul { list-style: none; padding: 0; margin: 0; }
.top-stories li { padding: 0.75rem 0; border-bottom: 1px solid #f0f0f0; }
.top-stories li:last-child { border-bottom: none; }
.top-stories a { font-weight: 500; }

.category-showcase {
    margin-bottom: 2rem;
}
.category-showcase h2 {
    border-bottom: 3px solid var(--primary-blue);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}
.category-showcase h2 a {
    color: inherit;
    text-decoration: none;
}

/* =================================================================== */
/* CREATIVE HOMEPAGE STYLES                                    */
/* =================================================================== */
.top-stories-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 1rem;
}

.top-story-item {
    background: #fff;
    padding: 0.75rem;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.top-story-item a {
    text-decoration: none;
    font-weight: 500;
    color: var(--dark-text);
}

.top-story-item a:hover {
    color: var(--primary-blue);
}

@media (min-width: 576px) {
    .top-stories-grid {
        grid-template-columns: repeat(2, 1fr); /* Two columns on tablets */
    }
}

.category-showcase {
    margin-top: 2.5rem; /* Add more space between sections */
}

.category-showcase h2 {
    border-bottom: 3px solid var(--primary-blue);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}
.category-showcase h2 a {
    color: inherit;
    text-decoration: none;
}

/* =================================================================== */
/* PROFILE CARD & GRID STYLES (FOR BODI/MENEJIMENTI)                 */
/* =================================================================== */

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.profile-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.profile-card img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    object-position: top; /* Focus on the top of the image */
}

.profile-info {
    padding: 1.5rem;
}

.profile-name {
    margin: 0;
    font-size: 1.2rem;
    color: var(--dark-text);
}

.profile-title {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: var(--primary-blue);
}

/* =================================================================== */
/* HIERARCHICAL LEADERSHIP LAYOUT STYLES                             */
/* =================================================================== */

.leader-card-wrapper {
    display: flex;
    justify-content: center; /* Horizontally center the content */
    margin-bottom: 2rem;
}

.leader-card-wrapper .profile-card {
    width: 100%;
    max-width: 350px; /* Give the leader's card a max width */
}

.section-divider {
    border: 0;
    height: 2px;
    background-color: #e0e0e0;
    margin: 2.5rem auto; /* Center the divider and add space */
    width: 80%;
}

/* =================================================================== */
/* MEDIA PLAYER STYLES                          */
/* =================================================================== */

.player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  backdrop-filter: blur(10px);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.player-container::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(41,128,185,0.4), rgba(241,196,15,0.4));
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.player-container:hover::before {
  opacity: 1;
}

.player-container:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.player-container iframe,
.player-container audio {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 16px;
  object-fit: cover;
}

/* Optional: Style audio player nicely */
.player-container audio {
  padding: 1rem;
  box-sizing: border-box;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255,255,255,0.15);
  height: auto; /* Make audio not forced full height */
}


/* =================================================================== */
/* MEDIA SHOWCASE & CHANNEL CARD STYLES         */
/* =================================================================== */

:root {
  --primary-blue: #2980b9;
  --primary-yellow: #f1c40f;
  --dark-text: #2c3e50;
  --card-bg: rgba(255, 255, 255, 0.75);
  --blur-bg: blur(20px);
}

.media-showcase {
  margin-bottom: 3rem;
}

.showcase-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--primary-blue);
  border-bottom: 4px solid var(--primary-yellow);
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
  text-align: center;
  letter-spacing: 0.5px;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.channel-card {
  background: var(--card-bg);
  backdrop-filter: var(--blur-bg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  position: relative;
}

.channel-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(241,196,15,0.1), rgba(41,128,185,0.1));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.channel-card:hover::before {
  opacity: 1;
}

.channel-card:hover {
  transform: translateY(-8px) scale(1.02) rotate(-0.5deg);
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.channel-logo-container {
  background: linear-gradient(135deg, #f8f9fa, #ecf0f1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  height: 180px;
}

.channel-logo {
  max-width: 75%;
  max-height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.channel-info {
  padding: 1.5rem;
  text-align: center;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.channel-name {
  margin: 0 0 0.5rem;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  color: var(--dark-text);
  font-weight: 600;
}

.channel-description {
  color: #555;
  flex-grow: 1;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.btn-watch,
.btn-listen {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  color: white;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.btn-watch {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}
.btn-watch:hover {
  background: linear-gradient(135deg, #ff6f61, #d64233);
  transform: translateY(-2px);
}

.btn-listen {
  background: linear-gradient(135deg, #3498db, #2980b9);
}
.btn-listen:hover {
  background: linear-gradient(135deg, #5dade2, #2e86c1);
  transform: translateY(-2px);
}

.channel-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.channel-link:focus {
  outline: none;
}

.channel-link:focus .channel-card {
  box-shadow: 0 0 0 4px rgba(41,128,185,0.3); /* focus ring */
}

.channel-link:hover {
  text-decoration: none;  /* ensure still none on hover */
}

/* --- CONTACT PAGE STYLES --- */
.map-container {
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
/* --- DATA TABLES STYLES --- */
.dataTables_wrapper {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
}
/* ==============================
   GRID LAYOUT (Bootstrap-like)
   ============================== */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.col-lg-8, .col-lg-4, .col-md-6 {
  flex: 1 1 100%;
}

@media (min-width: 992px) {
  .col-lg-8 { flex: 0 0 66.66%; }
  .col-lg-4 { flex: 0 0 31%; }
}

@media (min-width: 768px) {
  .col-md-6 { flex: 0 0 48%; }
}

/* ==============================
   MAWASILIANO SECTION - IMPROVED
   ============================== */

.mawasiliano {
  margin-top: 2rem;
  --primary: #0075c5;
  --primary-dark: #005a9c;
  --border: #e2e8f0;
  --bg-light: #f8fafc;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --radius: 1.25rem;
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 20px rgba(0,0,0,0.08);
}

/* Container Layout */
.mawasiliano .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.mawasiliano .row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
}

/* Column Layout */
.col-lg-8 {
  flex: 1;
  min-width: 0; /* Prevents flex item from overflowing */
}

.col-lg-4 {
  flex: 0 0 350px;
  min-width: 300px;
}

/* Form Container */
.contact-form {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
}

.contact-form h4 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 2rem;
  color: var(--text-dark);
  text-align: left;
}

/* Form Row for Side-by-Side Fields */
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

/* Form Controls */
.form-control,
textarea.form-control {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  background: #fff;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.form-control::placeholder,
textarea.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.form-control:focus,
textarea.form-control:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 117, 197, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.form-control:hover:not(:focus) {
  border-color: #cbd5e1;
}

/* Textarea Specific */
textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* Submit Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0.75rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 140px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 117, 197, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Contact Info Card */
.contact-info {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  height: fit-content;
  position: sticky;
  top: 2rem;
}

.contact-info h4 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}

.contact-info address {
  font-style: normal;
  line-height: 1.8;
  color: var(--text-muted);
  margin: 0;
}

.contact-info address strong {
  color: var(--text-dark);
  display: block;
  margin-bottom: 0.5rem;
}

.contact-info i {
  color: var(--primary);
  margin-right: 0.75rem;
  width: 1.2rem;
  text-align: center;
}

/* Map Container */
.map-container {
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 3rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.map-container iframe {
  display: block;
  width: 100%;
  height: 450px;
  border: none;
}

/* Responsive Design */
@media (max-width: 992px) {
  .col-lg-4 {
    flex: 1;
    min-width: 0;
  }
  
  .contact-info {
    position: static;
  }
}

@media (max-width: 768px) {
  .mawasiliano .row {
    gap: 1.5rem;
  }
  
  .col-lg-8,
  .col-lg-4 {
    flex: 1;
    min-width: 0;
  }
  
  .contact-form,
  .contact-info {
    padding: 1.5rem;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .form-row .form-group {
    margin-bottom: 1.5rem;
  }
  
  .contact-form h4 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .mawasiliano {
    margin-top: 1rem;
  }
  
  .contact-form,
  .contact-info {
    padding: 1.25rem;
  }
  
  .form-control,
  textarea.form-control {
    padding: 0.875rem 1rem;
  }
  
  .btn {
    width: 100%;
    padding: 1rem;
  }
  
  .map-container iframe {
    height: 300px;
  }
}

/* Focus Management for Accessibility */
.form-control:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

/* Form Validation States (optional) */
.form-control:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

.form-control:valid:not(:placeholder-shown) {
  border-color: #10b981;
}

/* Wrapper */
.wafanyakazi-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Breadcrumb */
.breadcrumb {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #555;
}

.breadcrumb li::after {
  content: "/";
  margin: 0 0.5rem;
  color: #999;
}

.breadcrumb li:last-child::after {
  content: "";
}

.breadcrumb a {
  color: #0077cc;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Title */
.section-title {
  text-align: center;
  margin: 2rem 0;
  color: #0075c5;
  font-size: 2rem;
  font-weight: 700;
}

/* Table container */
.table-wrapper {
  overflow-x: auto;
}

/* Custom table */
.custom-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e0e0e0;
  font-size: 0.95rem;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

/* Table header */
.custom-table thead {
  background: #0075c5;
  color: #fff;
}

.custom-table th,
.custom-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid #eaeaea;
}

.custom-table tbody tr:hover {
  background: #f7faff;
}

/* Button */
.btn-view {
  background: #0075c5;
  color: #fff;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.btn-view:hover {
  background: #005fa3;
}

/* Responsive */
@media (max-width: 768px) {
  .custom-table th, .custom-table td {
    font-size: 0.85rem;
    padding: 0.6rem;
  }
}

/* =================================================================== */
/* HOMEPAGE SECTION TITLE STYLES                                     */
/* =================================================================== */

.category-showcase {
    margin-top: 2.5rem; /* Adds space between the different news sections */
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0; /* Adds a subtle separator line */
}

.category-showcase h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-blue);
    display: inline-block; /* Ensures the border only spans the text width */
}

.category-showcase h2 a {
    color: inherit; /* The title text will be the default dark color */
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-showcase h2 a:hover {
    color: var(--primary-blue); /* The text turns blue on hover */
    text-decoration: none;
}

/* =================================================================== */
/* ARTICLE ENGAGEMENT STYLES (Phase 11)                              */
/* =================================================================== */
.post-navigation {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}
.post-navigation a {
    font-weight: 500;
    color: var(--dark-text);
}
.post-navigation a:hover {
    color: var(--primary-blue);
}
.prev-post { text-align: left; }
.next-post { text-align: right; }

.related-posts-section {
    margin-top: 3rem;
}
.related-posts-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-blue);
    display: inline-block;
    padding-bottom: 0.5rem;
}

/* =================================================================== */
/* FINAL FOOTER SOCIAL ICON SPACING FIX                              */
/* =================================================================== */
.social-icons {
    margin-top: 1.5rem; /* Adds space above the icons, separating them from the address */
    display: flex;      /* Uses flexbox for clean alignment */
    flex-wrap: wrap;    /* Allows icons to wrap onto the next line on very small screens */
    gap: 1.25rem;       /* Creates consistent spacing BETWEEN each icon */
    justify-content: center; /* Center the icons on mobile when they wrap */
}

.social-icons a {
    color: #ced4da;
    font-size: 1.4rem;  /* Slightly larger icons for better visibility */
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-icons a:hover {
    color: var(--primary-yellow);
    transform: scale(1.15); /* Adds a subtle zoom effect on hover */
}

/* On desktop, align the icons to the left */
@media (min-width: 992px) {
    .social-icons {
        justify-content: flex-start;
    }
}

/* =================================================================== */
/* FINAL POLISHING & ENHANCEMENTS                                      */
/* =================================================================== */

/* --- 1. Animation & Interaction --- */

/* Smooth fade-in for major content blocks */
.hero-section, .news-grid, .page-content, .media-showcase {
    animation: fadeIn 0.8s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Add back the hover effect for news cards that we might have lost */
.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* --- 2. Enhanced Typography --- */

/* Apply the new serif font to the article body */
.article-body {
    font-family: 'Merriweather', serif; /* Use Merriweather for articles */
    font-size: 1.15rem; /* Slightly larger for readability */
    line-height: 1.9;   /* More generous line spacing */
    color: #343a40;     /* A slightly softer black for less eye strain */
}

/* --- 3. Brand Consistency --- */

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
  width: 12px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: var(--secondary-blue);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-blue);
}

/* Custom Text Selection Color */
::selection {
  background: var(--primary-blue);
  color: var(--light-text);
}
::-moz-selection { /* For Firefox */
  background: var(--primary-blue);
  color: var(--light-text);
}

/* =================================================================== */
/* STATION & PROGRAM PAGE STYLES                                     */
/* =================================================================== */
.station-hero {
    padding: 4rem 0;
    color: white;
    text-align: center;
    background-size: cover;
    background-position: center;
    position: relative;
}
/* Adds a dark overlay for text readability */
.station-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
}
.station-hero .container {
    position: relative; /* To appear above the overlay */
}
.station-logo-large {
    max-height: 120px;
    margin-bottom: 1rem;
}
.station-title {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.station-tagline {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}
.btn-watch-live {
    background-color: var(--primary-yellow);
    color: var(--dark-text);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}
.btn-watch-live:hover {
    transform: scale(1.05);
    color: var(--dark-text);
}
/* Unique backgrounds for stations */
.hero-tbc1 { background-image: url('images/hero-bg.jpg'); }
.hero-safari { background-image: url('images/safari-bg.jpg'); }

.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}
.program-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.program-card:hover {
    transform: scale(1.05);
}
.program-card img {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.program-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 1.5rem 1rem 1rem;
    font-weight: bold;
}

/* --- PAGINATION STYLES --- */
.pagination-nav {
    margin-top: 2.5rem;
}
.pagination .page-item .page-link {
    color: var(--primary-blue);
}
.pagination .page-item.active .page-link {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #fff;
}
.pagination .page-item.disabled .page-link {
    color: #6c757d;
}

/* =================================================================== */
/* ARTICLE PAGE SIDEBAR LAYOUT                                       */
/* =================================================================== */
.article-layout {
    display: grid;
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 2.5rem;
}
@media (min-width: 992px) {
    .article-layout {
        grid-template-columns: 2fr 1fr; /* Two columns on desktop */
    }
}

.sidebar-widget {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky; /* Makes the sidebar stick on scroll */
    top: 20px;
}
.sidebar-widget h3 {
    margin-top: 0;
    font-size: 1.2rem;
    color: var(--primary-blue);
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}
.sidebar-story {
    margin-top: 1rem;
}
.sidebar-story a {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--dark-text);
}
.sidebar-story a:hover span {
    color: var(--primary-blue);
}
.sidebar-story img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}
.sidebar-story span {
    font-weight: 500;
    font-size: 0.9rem;
}

/* =================================================================== */
/* SOCIAL SHARE BUTTONS STYLES                                       */
/* =================================================================== */
.share-buttons-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-top: 3px solid var(--primary-yellow);
}
.share-buttons-container h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 600;
    text-align: center;
}
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    color: #fff !important;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.share-btn:hover {
    transform: scale(1.05);
    color: #fff !important;
    text-decoration: none;
}
.share-btn .fab, .share-btn .fas {
    font-size: 1.2rem;
}

/* Brand Colors */
.share-btn.facebook { background-color: #1877F2; }
.share-btn.twitter { background-color: #1DA1F2; }
.share-btn.whatsapp { background-color: #25D366; }
.share-btn.copy-link { background-color: #6c757d; }

.channel-buttons {
    margin-top: auto; /* Pushes buttons to the bottom of the card */
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}
.btn-programs {
    background-color: #6c757d;
    color: white;
    /* Other styles similar to btn-watch/btn-listen */
}

/* --- BREADCRUMB SEPARATOR STYLE --- */
.breadcrumb-separator {
    margin: 0 0.5rem;
}