/* ============================================
   INDEX PAGE - NEW LAYOUT STYLES
   ============================================ */

/* Large Screen Layout - Index Page Only */
.homePg {
    display: flex;
    width: 100%;
    height: calc(100vh - 55px); /* Full viewport minus header */
    padding-top: 55px !important; /* Top padding for header */
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden; /* Prevent page scroll, allow sidebar scroll */
}

/* Left Sidebar (75%) - Index Page Only */
.homePg .left-sidebar {
    width: 75% !important;
    padding: 20px;
    padding-bottom: 180px; /* Space for footer */
    box-sizing: border-box;
    background-color: #f5f5f5;
    height: 100%; /* Full height of parent container */
    overflow-y: auto !important; /* Enable vertical scrolling */
    overflow-x: hidden; /* Prevent horizontal scrolling */
    /* Ensure scrollbar is visible */
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* Webkit scrollbar styling for left sidebar */
.homePg .left-sidebar::-webkit-scrollbar {
    width: 10px;
}

.homePg .left-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.homePg .left-sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.homePg .left-sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Right Sidebar (25%) - Index Page Only */
.homePg .right-sidebar {
    width: 25% !important;
    padding: 20px;
    padding-bottom: 180px; /* Space for footer */
    background-color: #f5f5f5;
    box-sizing: border-box;
    border-left: 1px solid #ddd;
    height: 100%; /* Full height of parent container */
    overflow-y: auto !important;
    overflow-x: hidden;
}

/* Section Container - Index Page Only */
.homePg .section-container {
    display: none;
    overflow: hidden; /* Contain floats */
}

.homePg .section-container.active {
    display: block;
    background-color: transparent !important;
    overflow: visible; /* Allow content to wrap around floats */
}

/* Title Styling */
.title-detail, .title-details {
    margin-bottom: 20px;
}

.title-detail h1, .title-details h1 {
    margin: 0;
    padding: 0;
}

/* Mobile: Reduce title size and add top padding */
@media (max-width: 768px) {
    .homePg .title-detail h1,
    .homePg .title-details h1 {
        font-size: 1.2em !important; /* Smaller font size on mobile */
        padding-top: 10px; /* Reduced top padding */
        margin-top: 0;
        margin-bottom: 15px; /* Reduced bottom margin */
    }
    
    /* Match individual post font size on mobile - same as desktop */
    .homePg .section-content p {
        font-size: 130% !important; /* Match individual posts */
        line-height: 1.6 !important; /* Increased line spacing */
    }
    
    .homePg .section-content .bibleQuote,
    .homePg .section-content .repSpeech {
        font-size: 110% !important; /* Slightly smaller than regular paragraphs */
        line-height: 1.6 !important; /* Increased line spacing */
    }
}

/* Image and Content Layout - Float image left for text wrapping */
.homePg .section-image-wrapper {
    margin-bottom: 20px;
    /* Don't use overflow:hidden - let content wrap around */
}

/* Clear float at end of section to prevent layout issues */
.homePg .section-container.active::after {
    content: "";
    display: table;
    clear: both;
}

.homePg .section-img {
    float: left;
    width: 40%;
    max-width: 40%;
    padding-right: 20px;
    padding-bottom: 20px;
    box-sizing: border-box;
}

.homePg .section-img img {
    width: 100%;
    height: auto;
    display: block;
}

/* Content that wraps around the image - on the right side */
.homePg .section-content-top {
    /* Text will wrap around the floated image naturally */
    padding-left: 0;
    overflow: visible;
}

/* Content continues wrapping around the image, only goes below when space is filled */
.homePg .section-content-bottom {
    /* Don't clear the float - let it continue wrapping around the image */
    padding-left: 0;
    width: auto; /* Let it wrap naturally */
    clear: none; /* Don't clear float - allow wrapping */
    float: none; /* Don't float, just wrap around */
}

/* Ensure section-content doesn't create columns - override old flex styles */
.homePg .section-content {
    width: 100% !important;
    display: block !important;
    flex: none !important;
    align-items: unset !important;
}

/* Match individual post font size and line spacing for Ahabanza and Igitabo pages */
.homePg .section-content p {
    font-size: 130% !important; /* Match individual posts (.post-content font-size: 130%) */
    line-height: 1.6 !important; /* Increased line spacing */
}

/* Override any section-content img rules for home page */
.homePg .section-content img {
    width: auto !important;
    order: unset !important;
    margin: 0 !important;
}

/* Override old section-content flex styles for home page */
.homePg .section-content-top .section-content,
.homePg .section-content-bottom .section-content {
    display: block !important;
    flex: none !important;
    align-items: unset !important;
}

/* Right Sidebar Preview Blocks - Index Page Only */
.homePg .right-sidebar h1 {
    margin-bottom: 20px;
    font-size: 1.5em;
}

.homePg .preview-block {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    background: white;
    border-radius: 5px;
}

.homePg .preview-block h2 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
}

.homePg .preview-block h2 a {
    color: #007bff;
    text-decoration: none;
}

.homePg .preview-block h2 a:hover {
    text-decoration: underline;
}

.homePg .preview-content {
    margin-bottom: 10px;
}

.homePg .preview-more {
    text-align: right;
}

.homePg .preview-more a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.homePg .preview-more a:hover {
    text-decoration: underline;
}

/* Mobile Layout */
@media (max-width: 768px) {
    .homePg {
        flex-direction: column;
        height: auto !important;
        min-height: calc(100vh - 55px);
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding-top: 0 !important;
    }
    
    .mobile-menu {
        position: fixed;
        top: 55px; /* Below header */
        left: 0;
        right: 0;
        background: white;
        padding: 3px 5px; /* Reduced padding: 3px top/bottom, 5px left/right */
        border-bottom: 2px solid #ddd;
        z-index: 999;
        display: flex;
        flex-wrap: nowrap; /* Prevent wrapping - keep all items on one line */
        gap: 3px; /* Reduced gap between items */
        overflow-x: auto; /* Allow horizontal scrolling if needed */
    }
    
    .mobile-menu a {
        color: #007bff;
        text-decoration: none;
        padding: 4px 8px; /* Adequate padding */
        margin: 0; /* Remove any margins */
        border: 1px solid #007bff;
        border-radius: 3px;
        font-size: 0.65em !important; /* Smaller font size */
        white-space: nowrap; /* Prevent text wrapping */
        flex-shrink: 0; /* Prevent items from shrinking */
        background: white; /* Ensure background */
    }
    
    .mobile-menu a.active {
        background: #007bff !important;
        color: white !important;
    }
    
    .mobile-menu a.active {
        background: #007bff;
        color: white;
    }
    
    /* CRITICAL: Home page left sidebar must be visible on mobile - override general left-sidebar hiding */
    .homePg .left-sidebar {
        width: 100% !important;
        padding-top: 75px !important; /* Reduced space for header + compact menu */
        padding-bottom: 120px !important; /* Extra padding at bottom for compact footer */
        display: block !important; /* Override general left-sidebar display: none */
        overflow-y: auto !important; /* Enable vertical scrolling on mobile */
        overflow-x: hidden !important;
        height: calc(100vh - 130px) !important; /* Full height minus header and menu */
        /* Ensure scrollbar is visible on mobile */
        scrollbar-width: thin;
        scrollbar-color: #888 #f1f1f1;
    }
    
    /* Webkit scrollbar styling for mobile left sidebar */
    .homePg .left-sidebar::-webkit-scrollbar {
        width: 8px;
    }
    
    .homePg .left-sidebar::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .homePg .left-sidebar::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }
    
    .homePg .left-sidebar::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
    
    .homePg .right-sidebar {
        width: 100% !important;
        padding-top: 120px !important; /* Space for header + menu */
        display: none !important; /* Hide on mobile */
    }

    /* Mobile: Section containers must be visible when active */
    .homePg .section-container {
        display: none !important;
    }
    
    .homePg .section-container.active {
        display: block !important;
    }

    /* Mobile: Use float layout like big screens - image on left, text wraps on right */
    .homePg .section-image-wrapper {
        display: block !important; /* Remove flex to allow float */
        flex-direction: unset !important;
    }
    
    /* Mobile: Float image left at 40% width - same as big screens */
    .homePg .section-img {
        width: 40% !important;
        max-width: 40% !important;
        float: left !important;
        padding-right: 15px !important; /* Reduced padding for mobile */
        padding-bottom: 15px !important;
        margin-bottom: 0 !important;
        order: unset !important;
    }
    
    .homePg .section-img img {
        width: 100% !important;
        display: block;
    }
    
    /* Mobile: Content wraps on the right side of image first, then below when space fills */
    .homePg .section-content-top {
        width: auto !important; /* Let it wrap naturally on the right side */
        padding-left: 0 !important;
        order: unset !important;
        display: block !important;
        overflow: visible !important;
    }
    
    /* Mobile: Content continues wrapping around image */
    .homePg .section-content-bottom {
        width: auto !important; /* Let it wrap around image */
        padding-left: 0 !important;
        clear: none !important; /* Don't clear float - let content wrap */
        margin-top: 0 !important;
        float: none !important; /* Don't float, just wrap */
    }
    
    /* Ensure section-container allows wrapping */
    .homePg .section-container.active {
        overflow: visible !important; /* Allow wrapping around floats */
    }
    
    /* Only clear float at the very end of section */
    .homePg .section-container.active::after {
        content: "";
        display: table;
        clear: both;
    }
}

/* Removed redundant media query - float layout now applies to all mobile screens */

/* Hide mobile menu on large screens */
@media (min-width: 769px) {
    .mobile-menu {
        display: none;
    }
}

/* ============================================
   END INDEX PAGE - NEW LAYOUT STYLES
   ============================================ */


.social-media{
	text-align: center;
}

.social-media img {
	width: 37.5px;
	height: 37.5px; /* Make height equal to width for perfect square */
	object-fit: contain; /* Maintain aspect ratio while fitting within dimensions */
	text-align: center;
}

.text-content {
    flex: 1;
}

.text-content h2 {
    margin-bottom: 15px;
    color: #444;
}

.text-content p {
    margin-bottom: 20px;
}


.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}
.btn {
    flex: 1;
    margin: 0 10px; 
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: #555;
}

.active {
    background-color: green;
    color: white;
}

/* Override green background for home page content - no green backgrounds in left sidebar */
.homePg .left-sidebar .active,
.homePg .left-sidebar * .active,
.homePg .section-content .active,
.homePg .section-content * .active,
.homePg .section-container .active {
    background-color: transparent !important;
    color: inherit !important;
}

/* Form Styling */
form {
    display: flex;
    flex-direction: column;
}

form input, form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    font-family: Arial, sans-serif;
}

/* Contact form specific spacing */
#contactForm input,
#contactForm textarea,
#contactForm select,
#contactForm label {
    margin-bottom: 18px;
    display: block;
}

/* Ensure contact form section has enough bottom padding */
#section-twandikire {
    padding-bottom: 50px !important; /* Extra padding at bottom for form buttons */
}

#contactForm label {
    margin-top: 10px;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Add right padding to contact message textarea to space it from scrollbar */
#contactForm #contactMessage,
form#contactForm textarea#contactMessage {
    padding: 10px 30px 10px 10px !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

#contactForm .form-buttons {
    margin-top: 20px;
}

form input:focus, form textarea:focus {
    border-color: #333;
}

.form-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.form-buttons .btn {
    flex: 1;
    margin: 0 10px; 
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.form-buttons .btn:hover {
    background-color: #555;
}

#ahabanza .section-content img,
#dukurikire .section-content img {
    order: 0; /* Image on the left */
    margin-right: 20px;
    margin-left: 0;
}

#ku-gitabo .section-content img,
#twandikire .section-content img {
    order: 1; /* Image on the right */
    margin-left: 20px;
    margin-right: 0;
}

.section-content img {
    width: 40%;
    height: auto;
    border-radius: 8px;
}

.contact-input {
    width: 75% !important;
    padding: 5px;
    box-sizing: border-box;
}
.contact-input#buyer-email, .contact-input#donor-email {
	width: 67% !important;
}

@media (max-width: 768px) {
    .contact-input {
        width: 80% !important;
    }
	.contact-input#buyer-email, .contact-input#donor-email {
		width: 60% !important;
	}
}

.social-icons a {
    display: inline-block;
    margin-right: 10px;
    text-decoration: none;
    color: #333;
}

.read-more {
    color: #007bff;
    cursor: pointer;
    font-size: 0.9em;
}

.read-more:hover {
    text-decoration: underline;
}



/* Mobile fixes merged from index_mobile_fixes.css */

/* Fixes for index.html on small screens (max-width: 768px) */
@media (max-width: 768px) {
	
  .home-container,
  .home-container > div{
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  .title-details h1 {
    margin-top: 0;
    font-size: 1.8em;
    font-weight: bold;
  }

  #ku-gitabo .title-details {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
}

/* Small screens view (max-width: 768px) */
@media (max-width: 768px) {
	
	.homePg h1{
	  margin: 0;
	  padding: 0;
	}

}
