/* --- 1. CSS Variables (The Color Palette) --- */
:root {
    --bg-main: #FAFAFA;       
    --text-main: #334155;     
    --primary: #2563EB;       
    --accent-yellow: #FBBF24; 
    --accent-purple: #8B5CF6; 
    --accent-green: #10B981;  
    --alert-red: #EF4444;     
    --radius-soft: 16px;      
    --radius-button: 24px;    
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* --- 2. Base Reset & Typography --- */
body {
    font-family: 'Quicksand', 'Noto Sans HK', 'PingFang HK', 'Microsoft JhengHei', sans-serif;
    font-weight: 500; /* Medium weight, clean and readable */
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .nav-header {
    font-family: 'Quicksand', 'Noto Sans HK', 'PingFang HK', 'Microsoft JhengHei', sans-serif;
    font-weight: 700; /* Bold, but not too fat */
}

.container {
    max-width: 95%; /* 95% content width */
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 3. Layout Structure --- */

/*.header-area {
    background-color: rgba(139, 92, 246, 0.2);
    padding: 8px 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
   border-bottom: 4px solid var(--primary);

    border-top: 4px solid;
    border-bottom: 4px solid;
    border-image: linear-gradient(to right, var(--primary), var(--accent-yellow), var(--accent-purple), var(--accent-green)) 1;
}
*/
/*
.header-area {
    background-color: #FFFFFF;
    padding: 15px 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    
    border-top: 6px solid;
    border-image: linear-gradient(to right, var(--primary) 25%, var(--accent-yellow) 25%, var(--accent-yellow) 50%, var(--accent-purple) 50%, var(--accent-purple) 75%, var(--accent-green) 75%) 1;
}
*/


/*.header-area {
     A very soft, 3% wash of your Royal Blue 

    background-color: rgba(37, 99, 235, 0.03); 
    padding: 15px 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-bottom: 4px solid var(--primary);
}
*/
/*
.header-area {
     A beautiful, soft 15% wash of your Cheerful Yellow 
    background-color: rgba(251, 191, 36, 0.2); 
    padding: 8px 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    
    
    
    border-top: 4px solid;
    border-image: linear-gradient(to right, var(--primary) 25%, var(--accent-yellow) 25%, var(--accent-yellow) 50%, var(--accent-purple) 50%, var(--accent-purple) 75%, var(--accent-green) 75%) 1;
    border-bottom: 4px solid var(--accent-yellow);
}*/

/* --- 3. Layout Structure --- */

.header-area {
   
    background-color: rgba(139, 92, 246, 0.15); 
    
   
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px); 
    
    padding: 8px 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    
   
    border-top: 4px solid;
    border-bottom: 4px solid;
    border-image: linear-gradient(to right, var(--primary), var(--accent-yellow), var(--accent-purple), var(--accent-green)) 1;
}



.main-content-wrapper {
    display: flex;
    gap: 40px; 
    margin: 40px auto;
}

.content-main {
    flex: 3;
    background: #FFFFFF;
    padding: 30px;
    border-radius: var(--radius-soft);
    box-shadow: var(--shadow-soft);
    min-width: 0; /* Prevents flexbox resize bugs */
}

.sidebar {
    flex: 1;
}

/* --- Utility Banner & Breadcrumbs --- */
.breadcrumbs-section {
    min-height: 60px; 
    display: flex;
    align-items: center; 
    border-bottom: 1px solid #E2E8F0;
}

/* Style Joomla Breadcrumbs to look like modern UIkit breadcrumbs */
.breadcrumbs-section ul.breadcrumb {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.breadcrumbs-section ul.breadcrumb li {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Add a slash between the breadcrumb links */
.breadcrumbs-section ul.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin: 0 10px;
    color: #94A3B8; 
    opacity: 0.5;
}

.breadcrumbs-section ul.breadcrumb li a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumbs-section ul.breadcrumb li a:hover {
    color: var(--accent-purple);
}

.breadcrumbs-section ul.breadcrumb li.active {
    color: var(--text-main);
}



/* --- Full-Width Section Module Title --- */
.full-width-section > div {
    width: 100%;
}

/* Target the first H3 directly inside the module wrapper (safely ignoring the grid cards!) */
.full-width-section > div > h3:first-child,
.full-width-section .moduletable > h3:first-child {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 30px;
    margin-top: 20px;
    text-transform: uppercase;
}

/* Add a cute yellow underline below the title */
.full-width-section > div > h3:first-child::after,
.full-width-section .moduletable > h3:first-child::after {
    content: '';
    display: block;
    width: 60px;
    height: 5px;
    background-color: var(--accent-yellow);
    margin: 15px auto 0 auto;
    border-radius: var(--radius-button);
}

/* --- Footer Google Map Responsiveness --- */
.footer-map-wrapper {
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-soft);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); /* Deep shadow to make it pop against the blue footer */
}

/* Force the Google iframe to ignore its hardcoded sizing and fit our layout */
.footer-map-wrapper iframe {
    width: 100% !important;
    height: 280px !important;
    border: none !important;
    display: block;
}


/* --- Card Module Titles (For Quick Links, Sidebar, Bottom area) --- */
/* Targets the first H3 generated by Joomla inside the card */
.card-module .moduletable > h3:first-child {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 25px;
    text-transform: uppercase;
}

/* Adds a subtle accent line under the title, matching the green top-border of the card */
.card-module .moduletable > h3:first-child::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background-color: var(--accent-green);
    margin: 12px auto 0 auto;
    border-radius: var(--radius-button);
}

/* --- Section Background Color Bands --- */
.bg-pale-blue {
    /* A very soft, 5% wash of your Royal Blue */
    background-color: rgba(37, 99, 235, 0.04); 
    border-top: 1px solid rgba(37, 99, 235, 0.1);
    border-bottom: 1px solid rgba(37, 99, 235, 0.1);
}

.bg-pale-yellow {
    /* A cheerful, 10% wash of your Accent Yellow */
    background-color: rgba(251, 191, 36, 0.1);
    border-top: 1px solid rgba(251, 191, 36, 0.2);
    border-bottom: 1px solid rgba(251, 191, 36, 0.2);
}

.bg-pale-gray {
    /* A neutral, slightly deeper gray than your standard background */
    background-color: #F1F5F9;
    border-top: 1px solid #E2E8F0;
    border-bottom: 1px solid #E2E8F0;
}



/* --- 4. Friendly UI Elements --- */
.btn-primary, .readmore-link {
    display: inline-block;
    background-color: var(--primary);
    color: #FFFFFF;
    padding: 10px 24px;
    border-radius: var(--radius-button);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease; 
    border: none;
    cursor: pointer;
}

/* Energetic Hover Effect */
.btn-primary:hover, .readmore-link:hover {
    background-color: var(--accent-purple);
    color: #FFFFFF !important; /* Stops UIkit from turning the text blue! */
    text-decoration: none !important; /* CRITICAL FIX: Kills the hover underline! */
    transform: translateY(-3px); 
    box-shadow: var(--shadow-hover);
}



.highlight-tag {
    background-color: var(--accent-yellow);
    color: #333;
    padding: 4px 12px;
    border-radius: var(--radius-button);
    font-size: 0.85em;
    font-weight: bold;
}

.card-module {
    background: #FFFFFF;
    border-radius: var(--radius-soft);
    padding: 25px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
    border-top: 4px solid var(--accent-green);
    transition: transform 0.3s ease;
}

.card-module:hover {
    transform: translateY(-5px);
}

/* =========================================================
   --- 5. Header Layout (100% Width & 3-Tier Responsive) ---
   ========================================================= */

.header-area .header-container {
    max-width: 100%; 
    padding: 0 20px; 
    display: flex;
    align-items: center;
    justify-content: space-between; 
    flex-wrap: wrap; /* Allows menu to drop to a second row on tablet */
}

.school-logo-link {
    flex-shrink: 0; 
    display: flex;
    align-items: center;
}

.school-logo-svg {
    height: 70px;     
    width: auto;      
    min-width: 200px; 
    display: block;
    transition: transform 0.3s ease;
}

.school-logo-link:hover .school-logo-svg { transform: scale(1.02); }

/* Main Wrapper for Desktop/Tablet Menu */
.header-menu-wrapper {
    margin-left: auto;
    display: flex;
    align-items: center;
}

/* Header Social Icons */
.header-social-icons {
    display: flex;
    align-items: center;
    gap: 15px; 
    margin-left: 20px; 
    padding-left: 20px;
    border-left: 2px solid #E2E8F0; 
}

.social-icon {
    color: var(--text-main); font-size: 1.25rem; 
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    
    /* CRITICAL FIX: Forces Joomla to stop adding dots or underlines on hover! */
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
}

.social-icon:hover { 
    transform: scale(1.2) translateY(-2px); 
    text-decoration: none !important;
    border: none !important;
}

.social-icon.fb:hover { color: #1877F2 !important; } 
.social-icon.ig:hover { color: #E4405F !important; } 
.social-icon.yt:hover { color: #FF0000 !important; } 

/* Hide Mobile Toggle by default */
.mobile-menu-toggle { display: none; }

/* =========================================================
   --- RESPONSIVE BREAKPOINTS ---
   ========================================================= */

/* 1. TABLET (Screens smaller than 1230px) -> Logo Row 1, Menu & Social Row 2 */
@media (max-width: 1230px) {
    .header-area .header-container { 
        justify-content: center; /* Centers items on row 2 */
        column-gap: 15px; 
        row-gap: 0;  
        padding-top: 4px;
        padding-bottom: 4px;
    }
    
    /* Force Logo to take 100% width so it sits alone on Row 1 */
    .school-logo-link { 
        order: 1; 
        width: 100%; 
        justify-content: center; /* Centers the logo image */
        margin-bottom: 0px;
    }
    
    .header-menu-wrapper {
        order: 2; 
        margin-left: 0; /* Stop pushing to the right */
        margin-top: 0;

        
        
    }


    .header-social-icons {
        order: 3; 
        margin-left: 0; 

    }
}

/* 2. MOBILE (Screens smaller than 768px) -> The "Hamburger" */
@media (max-width: 768px) {
    .header-area .header-container {
        justify-content: space-between; 
        flex-wrap: nowrap;
    }
    
        /* CRITICAL FIX: Safe Flexbox boundaries for SVGs */
    .school-logo-link {
        flex: 1; /* Takes up all available space left over by the hamburger */
        min-width: 0; /* Allows the box to safely shrink below the SVG's native width */
        margin-right: 15px; /* Safety gap */
        display: block; /* Removes nested flexbox to prevent SVG collapse bugs */
    }
    
    /* Smart Scale: Tells the SVG to scale down proportionally to fit the wrapper! */
    .school-logo-svg { 
        height: 70px; /* Try to stay 70px tall */
        width: 100%; /* Never break out of the parent wrapper */
        max-width: 100%;
        min-width: 0; /* Kills the 200px desktop lock */
        object-fit: contain; /* Magically scales the SVG proportionally without squishing it! */
        object-position: left center; /* Keeps the logo pinned to the left edge */
    }

    
    .header-menu-wrapper { display: none; }
    .header-social-icons { display: none; }
    
    .mobile-menu-toggle { 
        display: flex; 
        align-items: center;
        order: 2; 
        margin-left: auto; 
        color: var(--primary);
        text-decoration: none;
        flex-shrink: 0; /* Forces the hamburger to NEVER shrink */
    }

    
    /* --- Style the Off-Canvas Mobile Menu --- */
    
    /* 1. Main Mobile Menu Wrapper */
    .mobile-offcanvas-menu ul.mod-menu { 
        display: block; /* Switched from Flex to Block for reliable vertical stacking */
        list-style: none; 
        padding: 0; 
        margin: 0; 
    }
    
    .mobile-offcanvas-menu ul.mod-menu li { 
        display: block; 
        width: 100%; 
        border-bottom: 1px solid rgba(0,0,0,0.05); 
        position: relative; 
    }
    
    /* 2. Style ALL mobile links (With or Without Submenus) */
    .mobile-offcanvas-menu ul.mod-menu li a,
    .mobile-offcanvas-menu ul.mod-menu li span,
    .mobile-offcanvas-menu ul.mod-menu li .nav-header { 
        display: block; 
        font-size: 1.2rem; 
        padding: 15px 0; 
        color: var(--text-main); 
        font-weight: 600;
        text-decoration: none;
        white-space: normal; 
    }

    /* Restore the word "首頁" (Home) on mobile if it was hidden by the desktop icon rule */
    .mobile-offcanvas-menu ul.mod-menu > li:first-child > a { font-size: 1.2rem; }
    .mobile-offcanvas-menu ul.mod-menu > li:first-child > a::before { content: none; }

    /* 3. Add Dropdown Arrows to Mobile Parents so users know to tap them */
    .mobile-offcanvas-menu ul.mod-menu li.parent > a::after,
    .mobile-offcanvas-menu ul.mod-menu li.parent > span::after,
    .mobile-offcanvas-menu ul.mod-menu li.parent > .nav-header::after {
        content: '▾';
        float: right;
        margin-right: 10px;
        color: var(--primary);
    }

    /* 4. Submenus: Hidden by default, open on Tap (Hover/Focus) */
    .mobile-offcanvas-menu ul.mod-menu li ul {
        display: none; /* Hides the messy submenus! */
        list-style: none;
        padding: 0 0 0 15px; 
        margin: 0 0 15px 0; 
        border-left: 2px solid #E2E8F0; /* Soft line showing it's a submenu */
    }
    
    /* Opens the submenu when the parent is tapped */
    .mobile-offcanvas-menu ul.mod-menu li:hover > ul,
    .mobile-offcanvas-menu ul.mod-menu li:focus-within > ul {
        display: block;
    }

    /* 5. Mobile Submenu Links */
    .mobile-offcanvas-menu ul.mod-menu li ul li { border-bottom: none; }
    
    .mobile-offcanvas-menu ul.mod-menu li ul li a,
    .mobile-offcanvas-menu ul.mod-menu li ul li span { 
        font-size: 1.05rem; 
        color: #64748B; 
        padding: 10px 0; 
        font-weight: 500;
    }
    
    .mobile-offcanvas-menu ul.mod-menu li ul li a:hover { color: var(--primary); }
    
    /* Mobile Social Icons */
    .mobile-social-icons { display: flex; justify-content: center; gap: 20px; }
    .mobile-social-icons .social-icon { font-size: 1.5rem; color: var(--text-main); }
} /* End of @media (max-width: 768px) */



/* --- 5b. Joomla Menu & Dropdown Styling (Minimalist & Space Saving) --- */

/* 1. Main Menu Flex Container */
.header-area ul.mod-menu { 
    list-style: none; 
    display: flex; 
    gap: 20px; 
    margin: 0; 
    padding: 0; 
    align-items: center; 
}

.header-area ul.mod-menu li { 
    position: relative; 
    list-style: none; 
}

/* 2. Main Menu Links (Top Level Only) */
.header-area ul.mod-menu > li > a,
.header-area ul.mod-menu > li > span,
.header-area ul.mod-menu > li > .nav-header {
    text-decoration: none; 
    color: var(--text-main); 
    font-weight: 600; 
    padding: 5px 0; 
    white-space: nowrap; 
    transition: all 0.3s ease;
    display: inline-block; 
}

/* Stays blue and lifted when hovering the item AND when inside the submenu */
.header-area ul.mod-menu > li:hover > a,
.header-area ul.mod-menu > li:hover > span,
.header-area ul.mod-menu > li:hover > .nav-header { 
    background-color: transparent !important; 
    color: var(--primary) !important; 
    transform: translateY(-2px); 
}

/* 3. The Home Icon (First Menu Item) */
.header-area ul.mod-menu > li:first-child > a,
.header-area ul.mod-menu > li:first-child > span {
    font-size: 0; 
}

.header-area ul.mod-menu > li:first-child > a::before,
.header-area ul.mod-menu > li:first-child > span::before {
    content: '\f015'; 
    font-family: "Font Awesome 6 Free";
    font-weight: 900; 
    font-size: 1.2rem; 
    display: inline-block;
    color: var(--text-main);
    transition: color 0.3s ease;
}

.header-area ul.mod-menu > li:first-child:hover > a::before,
.header-area ul.mod-menu > li:first-child:hover > span::before {
    color: var(--primary) !important; 
}

/* 4. Dropdowns (Submenus) */
.header-area ul.mod-menu li ul {
    display: none; 
    position: absolute; 
    top: 100%; 
    left: 50%; 
    transform: translateX(-50%); 
    background-color: #FFFFFF; 
    min-width: 220px; 
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.15); 
    border-radius: var(--radius-soft);
    padding: 12px 0; 
    margin-top: 15px; 
    z-index: 1000; 
    flex-direction: column;
    border-top: 4px solid var(--accent-yellow); 
    list-style: none; 
}

.header-area ul.mod-menu li::after { 
    content: ''; position: absolute; top: 100%; left: 0; width: 100%; height: 25px; 
}

.header-area ul.mod-menu li:hover > ul { 
    display: flex; 
    animation: dropMenu 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

/* 5. Submenu Links Styling & Bullet/Underline Fix */
.header-area ul.mod-menu li ul li { 
    width: 100%; 
    list-style: none; 
}

.header-area ul.mod-menu li ul li a, 
.header-area ul.mod-menu li ul li span {
    text-decoration: none; /* Kills underlines */
    border-radius: 0; 
    padding: 10px 24px; 
    width: 100%; 
    box-sizing: border-box; 
    display: block;
    color: var(--text-main);
    font-weight: 500;
    border-bottom: 1px solid #f1f5f9; 
    transition: all 0.2s ease;
    transform: none; /* Prevents lift inside submenu */
}

.header-area ul.mod-menu li ul li:last-child a, 
.header-area ul.mod-menu li ul li:last-child span { 
    border-bottom: none; 
}

.header-area ul.mod-menu li ul li a:hover,
.header-area ul.mod-menu li ul li span:hover {
    background-color: #f8fafc; 
    color: var(--primary); 
    padding-left: 30px; 
    transform: none; /* Forces submenu items NOT to lift */
}

@keyframes dropMenu {
    from { opacity: 0; transform: translate(-50%, -15px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* --- 6. Hero Image Styling (Art Directed / Responsive) --- */
.hero-section { 
    width: 100%; 
    margin-bottom: 40px; 
}

/* Base styles for the image */
.hero-section img {
    width: 100%; 
    object-fit: cover; /* CRITICAL: This ensures the image crops perfectly without stretching */
    object-position: center; /* Keeps the focal point in the middle when cropping */
    display: block; 
    box-shadow: var(--shadow-soft);
}

/* 1. DESKTOP & TABLET (Landscape Shape) */
@media (min-width: 769px) {
    .hero-section img {
        height: 450px; /* Forces a nice, wide landscape banner */
    }
}

/* 2. MOBILE PHONES (Portrait Shape) */
@media (max-width: 768px) {
    .hero-section img {
        /* aspect-ratio forces the image into a tall, vertical portrait shape (4 units wide, 5 units tall) */
        aspect-ratio: 4 / 5; 
        height: auto; 
        max-height: 80vh; /* Safety limit: won't take up more than 80% of the phone screen */
    }
}


/* =========================================================
   --- 7 & 8. Global Blog Layout Cards ---
   ========================================================= */
.blog-items {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 20px;
}
.blog-item {
    background: #FFFFFF; border-radius: var(--radius-soft); padding: 25px; box-shadow: var(--shadow-soft);
    border-top: 5px solid var(--accent-yellow); transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.blog-item:hover {
    transform: translateY(-8px); box-shadow: var(--shadow-hover); border-top-color: var(--accent-purple); 
}
.blog-item h2 { margin-top: 0; font-size: 1.4rem; }
.blog-item h2 a { color: var(--primary); text-decoration: none; }

.blog-item .item-image {
    margin: -25px -25px 20px -25px; overflow: hidden; border-radius: var(--radius-soft) var(--radius-soft) 0 0; 
}
.blog-item .item-image img {
    width: 100%; height: 220px; object-fit: cover; display: block; transition: transform 0.4s ease; 
}
.blog-item:hover .item-image img { transform: scale(1.05); }
.blog-item h2.item-title a { color: var(--text-main); text-decoration: none; transition: color 0.3s ease; }
.blog-item:hover h2.item-title a { color: var(--primary); }

/* =========================================================
   --- 9. Pagination Styling (Horizontal Scroll & Safe Center) ---
   ========================================================= */
div.uk-margin-large-top.uk-flex.uk-flex-center {
    display: block !important; text-align: center; max-width: 100%; overflow: hidden;
}
ul.pagination {
    display: flex; flex-wrap: nowrap; list-style: none; padding: 10px 20px 20px 20px; margin: 40px auto 20px auto; gap: 10px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; -ms-overflow-style: none; scrollbar-width: none; max-width: 100%;
}
ul.pagination::-webkit-scrollbar { display: none; }
ul.pagination::before, ul.pagination::after { content: ''; margin: auto; }
ul.pagination li.page-item { flex-shrink: 0; }

ul.pagination li.page-item a.page-link, ul.pagination li.page-item span.page-link {
    display: flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 15px;
    border-radius: var(--radius-button); background-color: #FFFFFF; color: var(--text-main); text-decoration: none;
    font-weight: bold; border: none; box-shadow: var(--shadow-soft); transition: all 0.3s ease;
}
ul.pagination li.page-item:not(.active):not(.disabled) a.page-link:hover {
    background-color: var(--accent-yellow); color: #333333; transform: translateY(-3px); box-shadow: var(--shadow-hover);
}
ul.pagination li.page-item.active span.page-link, ul.pagination li.page-item.active a.page-link {
    background-color: var(--primary); color: #FFFFFF; box-shadow: var(--shadow-soft); cursor: default;
}
ul.pagination li.page-item.disabled span.page-link, ul.pagination li.page-item.disabled a.page-link {
    background-color: transparent; color: #94A3B8; box-shadow: none; cursor: not-allowed;
}
ul.pagination .visually-hidden { display: none; }

/* --- 11. Custom Timeline Pill Menu --- */
.uk-subnav-pill > * > a {
    border-radius: var(--radius-button) !important; background-color: #FFFFFF !important; color: var(--text-main) !important;
    box-shadow: var(--shadow-soft); font-weight: bold; padding: 8px 20px !important; transition: all 0.3s ease !important; 
}
.uk-subnav-pill > * > a:hover {
    background-color: var(--accent-yellow) !important; color: #333333 !important; transform: translateY(-3px); box-shadow: var(--shadow-hover);
}
.uk-subnav-pill > .uk-active > a {
    background-color: var(--primary) !important; color: #FFFFFF !important; box-shadow: var(--shadow-soft); transform: none; 
}

/* --- Automated Responsive Google Calendar --- */
/* This automatically targets any iframe containing a Google Calendar link */
iframe[src*="calendar.google.com"] {
    width: 100% !important;       /* Forces the calendar to perfectly fit the white container */
    max-width: 100% !important;   /* Prevents it from ever breaking out */
    height: 650px !important;     /* Gives it plenty of vertical room to show the weeks */
    border: none !important;
    border-radius: var(--radius-soft); /* Applies your theme's friendly rounded corners! */
    box-shadow: var(--shadow-soft);    /* Applies your theme's soft drop shadow! */
}

/* On mobile phones, Google Calendar switches to an 'Agenda' view automatically. 
   We make it slightly shorter so it fits nicely on the phone screen. */
@media (max-width: 768px) {
    iframe[src*="calendar.google.com"] {
        height: 450px !important; 
    }
}

/* --- Option 1: Swipeable Tag Filter Ribbon (Mobile & Tablet) --- */
@media (max-width: 1024px) {
    .content-main .uk-subnav-pill {
        flex-wrap: nowrap !important; /* Stops the tags from dropping to a second row */
        overflow-x: auto; /* Allows horizontal swiping */
        -webkit-overflow-scrolling: touch; /* Smooth momentum scrolling on iOS */
        padding-bottom: 15px; /* Leaves room for the drop-shadows so they don't clip */
        margin-bottom: 10px;
        gap: 10px;
        
        /* Hides the ugly scrollbar for a native app look */
        -ms-overflow-style: none;  
        scrollbar-width: none;  
    }
    
    .content-main .uk-subnav-pill::-webkit-scrollbar {
        display: none;
    }

    /* Stops the pills from squishing */
    .content-main .uk-subnav-pill > * {
        flex-shrink: 0;
        padding-left: 0; /* Reset UIkit default */
    }
}

/* =========================================================
   --- Single Article Next/Prev Navigation Override ---
   ========================================================= */

/* The Custom Perfectly Balanced Button */
.pagenav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* THIS is the magic! It perfectly spaces the icon and text */
    padding: 10px 24px;
    background-color: #FFFFFF;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius-button);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

/* Hover Effect */
.pagenav-btn:hover {
    background-color: var(--primary);
    color: #FFFFFF !important;
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* Mobile Fix: Make buttons full width */
@media (max-width: 640px) {
    .uk-pagination.uk-flex-between {
        flex-direction: column;
        gap: 15px;
    }
    .uk-pagination .page-item-prev,
    .uk-pagination .page-item-next {
        width: 100%;
        margin-left: 0 !important;
    }
    .pagenav-btn {
        width: 100%;
        box-sizing: border-box;
    }
}

/* =========================================================
   --- Event Gallery Article Integration ---
   ========================================================= */

/* Themed Title */
.gallery-module-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 25px;
}

/* Purple Retro Camera Icon */
.gallery-module-title i {
    color: var(--accent-purple);
    margin-right: 10px;
}

/* Gallery Pagination Container */
.gallery-pagination {
    list-style: none;
    padding: 0;
    gap: 10px;
}

/* Compact, Soft Gray Gallery Buttons */
.gallery-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 16px;
    background-color: #FFFFFF;
    color: var(--text-main);
    border-radius: var(--radius-button);
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}

/* Playful Yellow Hover Effect (Distinct from Article Nav!) */
.gallery-page-btn:hover {
    background-color: var(--accent-yellow);
    color: #333333 !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

/* Cute Page Indicator Badge */
.gallery-page-info {
    background: #E2E8F0;
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #64748B;
    letter-spacing: 1px;
}


