/* assets/css/layout.css */

/* =========================================================
   GENERAL LAYOUT
========================================================= */

/* Main Layout Wrapper */
.page-wrapper { flex: 1; min-height: 60vh; }

.container { clear: both; }

/* Sub-page Container Widths - Normalized */
@media (min-width: 768px)  { .container { max-width: 1050px; } } 
@media (min-width: 992px)  { .container { max-width: 1200px; } } 
@media (min-width: 1200px) { .container { max-width: 1350px; } } 
@media (min-width: 1400px) { .container { max-width: 1500px; } } 

/* =========================================================
   HOME LAYOUT ARCHITECTURE
========================================================= */

/* The Wrapper for the whole page content */
.home-layout-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Target all components on the home page */
.home-layout-wrapper > * {
    max-width: 5000px !important;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2.5rem;   /* Increased safe gutter */
    padding-right: 2.5rem;
    margin-bottom: 0 !important; /* Consistent gap between all sections */
    margin-top: 0 !important;
}

/* The Hero Exception (Full Bleed) */
.home-layout-wrapper > .hero-component {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 0 !important; /* Smaller gap below the main photo */
}

/* The Grid Exception (Counteract Bootstrap Row Gutters) */
.home-layout-wrapper > .kgs-smart-grid-row {
    padding-left: 1rem; 
    padding-right: 1rem;
    margin-left: auto !important;
    margin-right: auto !important;
}

.kgs-smart-grid-row {
    clear: both;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Force Smart Grid to 1-Column Collapse at 1000px */
@media (max-width: 1000px) {
    .kgs-smart-grid-row .row > [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 1rem;
        padding-right: 1rem;
    } 
}

@media (max-width: 768px) {
    .home-layout-wrapper > * {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
        padding-bottom: 0 !important;
    }
}

/* ==========================================================================
   HOMEPAGE SPACING & TITLE ALIGNMENT CORRECTIONS
   ========================================================================== */

#calendar-widget-module {
    padding-top: 0 !important;
}

.kgs-live-feed-widget .container {
    padding-top: 0 !important;
}

/* Tighten the vertical gap between stacked row containers */
.home-layout-wrapper > .container {
    padding-top: 0.5rem !important;
    padding-bottom: 0.75rem !important;
}

.kgs-widget-container {
    margin-bottom: 0 !important;
}

/* =========================================================
   FOOTER LAYOUT
========================================================= */

 footer .container {
    padding-left: 0px !important;
    padding-right: 0px !important;
 }
 
 @media (max-width: 576px) {
    footer .container {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
 }
   
/* Optical Sizing for Footer Columns */
footer .row.g-4 {
    display: flex;
    justify-content: center;
}

footer .col-md-4 {
    max-width: 320px; 
    width: 100%;
}

@media (max-width: 768px) {
    footer .col-md-4 {
        max-width: 100%; /* Stacks naturally on mobile */
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    footer .nav {
        align-items: center;
    }
}

/* =========================================================
   FOOTER UTILITIES
========================================================= */

/* Toast Notification */
.kgs-toast {
    position: fixed; bottom: 20px; right: 20px; padding: 12px 20px;
    background: #333; color: #fff; border-radius: 8px; font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); opacity: 0;
    transform: translateY(20px); transition: all 0.3s ease; z-index: 9999;
    pointer-events: none;
}
.kgs-toast.show { opacity: 1; transform: translateY(0); }
.kgs-toast--success { background: #28a745 !important; }
.kgs-toast--error { background: #dc3545 !important; }

/* Back to Top */
#back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    width: 45px; height: 45px; border-radius: 50%;
    z-index: 1000; transition: transform 0.2s, opacity 0.2s;
    display: none; align-items: center; justify-content: center;
}
#back-to-top i { font-size: 1.4rem; line-height: 0; }
#back-to-top:hover { transform: scale(1.1); }

@media (max-width: 768px) {
    #back-to-top { bottom: 20px; right: 20px; }
}

/* =========================================================
   OTHER LAYOUT TEMPLATE SPECIFICS
========================================================= */

.academics-layout { background-color: #f8f9fa; }
.sports-layout { background-color: #f8f9fa; }
.clubs-layout { background-color: #f8f9fa; }
.school-board-layout .rich-text-title { color: var(--primary); }

.feather-bg {
    border-radius: 10px;
    background-color: var(--primary); /* FIXED: Neon blue fallback resolved */
    padding: 10px 0;
    background-image: url('../img/nav_bg_img_ID.png');
    background-position: left top;
    background-repeat: repeat;
    position: relative;
}

.rounded-15 {
    border-radius: 15px !important;
}

/* =========================================================
   WIDGET FIXES
   ========================================================= */

	.kgs-widget-container {
		width: 100% !important;
		max-width: 100% !important;
		overflow: hidden;
	}