/* assets/css/grid-desktop.css - FINAL CONSOLIDATED SYMMETRY & LAYOUT */

@media (min-width: 1025px) {
    /* 1. THE MAIN GRID CONTAINER */
    .home-layout-grid {
        display: grid !important;
        /* MATH FIX: We subtract 45px (3 gaps of 15px) from 100% to ensure perfect centering */
        grid-template-columns: 
            calc((100% - 45px) * 0.22) 
            calc((100% - 45px) * 0.28) 
            calc((100% - 45px) * 0.28) 
            calc((100% - 45px) * 0.22) !important; 

        /* FIX: Use min-content to collapse excessive vertical space */
        grid-template-rows: repeat(5, min-content) !important;
        gap: 10px !important; /* Reduced from 25px */
        align-items: start; 
        width: 100% !important;
        max-width: 1800px !important; 
        
        /* Centering Logic */
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 5px 5px !important; /* Reduced: 10px Top/Bottom, 25px Left/Right */
        box-sizing: border-box !important;
        
        /* Ensure the grid doesn't shift */
        justify-content: center !important;
    }

/* ==========================================================================
   1. GLOBAL UI REFINEMENTS & CORE BOX STYLES
   ========================================================================== */

/* Unify Section Backgrounds */
body, 
#primary-content, 
.main-wrapper {
    background-color: #cce9f5 !important;
}

/* Global Box Refinement */
.af-box {
    width: 100% !important;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0 !important; /* Grid gap handles spacing */
}

/* Base wrapper for any sidebar item */
.af-box {
    width: 100% !important;
    height: auto;
    margin: 0 0 20px 0 !important;
    padding: 0;
    box-sizing: border-box !important;
}

.af-box:last-child {
    margin-bottom: 0 !important;
}

/* Button & UI Scaling */
.view-all-btn, 
.btn-view-more,
.stk-nav-btn {
    background-color: #ffffff !important;
    color: #002e86 !important;
    border: 1px solid #002e86 !important;
}

.view-all-btn:hover {
    background-color: var(--brand-orange) !important;
    color: #ffffff !important;
    border-color: var(--brand-orange) !important;
}

/* ==========================================================================
   2. HEADER & BRANDING CONFIGURATION
   ========================================================================== */

/* Force Logo and Header Text to Left */
.header-main-inner, 
.logo-container, 
.site-branding {
    justify-content: flex-start !important;
    text-align: left !important;
    margin-left: 0 !important;
}

.site-branding {
    width: 100% !important;
    background: transparent !important;
    padding: 0 !important;
}

.branding-full-width {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important; 
    padding: 15px 50px !important; /* Space from extreme left/right edges */
    box-sizing: border-box !important;
}

.logo-title-group {
    display: flex;
    align-items: center;
    gap: 25px;
}

/* Social Wrapper & Icons */
.header-social-wrap {
    display: flex !important;
    gap: 20px;
    align-items: center;
    margin-left: auto !important; /* The secret for right alignment */
    flex-shrink: 0;
}

.header-social-link svg {
    width: 28px;
    height: 28px;
    display: block;
    transition: transform 0.2s ease;
}

.header-social-link:hover svg {
    transform: scale(1.1);
}

.icon-facebook { fill: #1877F2 !important; }
.icon-instagram { fill: #E4405F !important; }
.icon-linkedin { fill: #0A66C2 !important; }
.icon-youtube { fill: #FF0000 !important; }

/* ==========================================================================
   3. SIDEBAR LAYOUT CONFIGURATION (DESKTOP/GENERAL)
   ========================================================================== */

/* Left Sidebar */
.grid-sidebar-left {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important; 
    gap: 20px;
    align-self: start;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Right Sidebar */
.grid-sidebar-right {
    grid-column: 4 !important;
    grid-row: 3 / span 4 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    background-color: #f1f5f9 !important; /* Light Gray Background */
}

/* ==========================================================================
   4. COMPONENT: FELICITATION MESSAGES
   ========================================================================== */

.messages-widget-container {
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    height: auto; 
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    box-sizing: border-box;
}

.messages-header {
    padding: 20px 20px 0px 20px;
    position: relative;
}

.messages-header::after {
    content: "";
    display: block;
    width: calc(100% - 40px);
    height: 1px;
    background: #e2e8f0;
    margin-top: 15px;
}

.messages-header h2 {
    color: #002e86;
    font-size: 26px; 
    font-weight: 900;
    line-height: 1.1;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.messages-header h2 span {
    color: var(--brand-orange);
    margin-left: 5px;
}

.messages-honor-bar {
    background: #002e86;
    padding: 12px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-bottom: 3px solid var(--brand-gold);
    margin: 15px 20px 0 20px; 
}

.messages-honor-bar span {
    font-weight: 900;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

.messages-stack-wrapper {
    padding: 45px 15px 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 40px; 
    position: relative;
}

.message-box-logic {
    position: relative;
    min-height: 280px; 
    width: 100%;
}

.box-counter-badge {
    position: absolute;
    top: -35px;
    right: 0;
    background: #002e86;
    color: var(--brand-gold);
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 800;
    z-index: 30;
    border: 1px solid var(--brand-gold);
}

.af-logic-slide { 
    opacity: 0; 
    visibility: hidden; 
    display: none;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    position: absolute;
    width: 100%;
    height: 100%; 
    top: 0;
    left: 0;
    flex-direction: column;
    overflow: visible; 
}

.af-logic-slide.active { 
    opacity: 1; 
    visibility: visible; 
    display: flex;
    z-index: 2;
}

.slide-avatar-frame {
    position: absolute;
    top: -35px; 
    left: 20px;
    width: 75px;
    height: 75px;
    border-radius: 15px;
    overflow: hidden; 
    border: 4px solid #fff;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    background: #002e86;
    z-index: 10;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-body {
    padding: 55px 20px 15px 20px; 
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.slide-body h5 {
    margin: 0 0 5px 0;
    color: #002e86;
    font-weight: 800;
    font-size: 16px;
    line-height: 1.3;
}

.slide-body .designation {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.custom-scrollbar {
    overflow-y: auto;
    padding-right: 5px;
    flex: 1;
}

.custom-scrollbar::-webkit-scrollbar { width: 3px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #002e86; border-radius: 10px; }

.message-text {
    font-size: 13px;
    line-height: 1.4;
    font-style: italic;
    color: #475569;
}

.slide-footer {
    margin-top: auto; 
    padding-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.full-story-link {
    color: #002e86;
    font-size: 11px;
    font-weight: 900;
    text-decoration: none;
    text-transform: uppercase;
}

/* ==========================================================================
   5. DESKTOP GRID PLACEMENT (Nested in original Media Query context)
   ========================================================================== */

/* This block handles the specific grid row/column logic mentioned in the prompt */
@media (min-width: 1025px) {
    .grid-anniversary-strip {
        grid-column: 2 / -1 !important;  
        grid-row: 2 !important;
        margin-bottom: 20px !important;
    }

    .grid-sidebar-left {
        grid-column: 1 !important;
        grid-row: 2 / span 5 !important;
        align-self: start;
    }

    .grid-celebration {
        grid-column: 2 !important;
        grid-row: 3 !important;
    }

    .grid-about-book {
        grid-column: 3 !important;
        grid-row: 3 !important;
    }

    .grid-anniversary-strip .org-name { font-size: 28px !important; }
    .grid-anniversary-strip .milestone-text { font-size: 48px !important; }

    .grid-publication,
    .grid-divider {
        grid-column: 1 / -1 !important;
        grid-row: 6 !important;
        margin-top: 20px !important;
        width: 100% !important;
    }
}

/* ==========================================================================
   6. MOBILE & TABLET LAYOUT ADJUSTMENTS
   ========================================================================== */

/* Header Mobile Cleanup */
@media (max-width: 992px) {
    .branding-full-width {
        flex-direction: column;
        text-align: center;
        padding: 15px 20px !important;
    }
    .logo-title-group {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }
    .header-social-wrap {
        margin-left: 0 !important;
        justify-content: center;
    }
}

/* assets/css/grid-desktop.css - FINAL CONSOLIDATED SYMMETRY & LAYOUT */

@media (min-width: 1025px) {
    /* 1. THE MAIN GRID CONTAINER */
    .home-layout-grid {
        display: grid !important;
        grid-template-columns: 
            calc((100% - 45px) * 0.22) 
            calc((100% - 45px) * 0.28) 
            calc((100% - 45px) * 0.28) 
            calc((100% - 45px) * 0.22) !important; 

        grid-template-rows: repeat(5, min-content) !important;
        gap: 10px !important;
        align-items: start; 
        width: 100% !important;
        max-width: 1800px !important; 
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 5px 5px !important;
        box-sizing: border-box;
    }

    /* Keep all other @media (min-width: 1025px) definitions for your grid items here */
    .grid-hero { grid-column: 2 / span 2; grid-row: 1; }
    ...
}

/* REMOVE EVERYTHING BELOW THIS LINE THAT DEALS WITH (max-width: 1024px) */

 

   




  


/* Dark Mode Support */
[data-theme="dark"] .af-logic-slide { 
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255,255,255,0.1); 
}
[data-theme="dark"] .message-text { color: #cbd5e1; }
[data-theme="dark"] .slide-body h5 { color: var(--brand-gold); }

/* Missing SVG Icon Class */
.title-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 10px;
    flex-shrink: 0;
}

