/*
 Theme Name:   Quwa Theme
 Theme URI:    https://quwa.org
 Description:  Custom theme for Quwa Pakistan Defence Journal
 Author:       Bilal Khan
 Author URI:   https://quwa.org
 Template:     generatepress
 Version:      1.0.68.15
 License:      GNU General Public License v2 or later
 License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  quwa-theme
 Tags:         news, magazine, defence, journal
*/

/* ==========================================================================
   Child theme styles go here
   ========================================================================== */

/* Visually hidden H1 for homepage SEO (Janes-style) */
.home-h1 {
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    height: 0.0625rem !important;
    margin: -0.0625rem !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    width: 0.0625rem !important;
}

/* ==========================================================================
   GENERATEPRESS OVERRIDES

   These styles neutralize GeneratePress's default layout to allow
   our custom layout.css to work correctly.
   ========================================================================== */

/* Reset GP site wrapper */
.site {
    margin: 0 !important;
    padding: 0 !important;
}

/* Reset GP content area */
#content,
.site-content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* Ensure our containers work correctly */
.site-content > .container,
.site-content .container {
    max-width: var(--container-max, 1200px);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-4, 1rem);
    padding-right: var(--space-4, 1rem);
}

/* Reset any GP grid/flexbox interference */
#primary,
#secondary,
.content-area,
.widget-area,
.site-main {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Remove GP container defaults */
.generate-columns,
.generate-columns-container {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure our header takes full width */
.site-header {
    width: 100%;
    background: var(--color-white, #fff);
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}

/* Ensure our footer takes full width */
.site-footer {
    width: 100%;
}

/* Reset GP's inside-article container */
.inside-article {
    padding: 0 !important;
    margin: 0 !important;
}

/* Make sure GP's post-image works with our layout */
.post-image {
    margin: 0 !important;
}

/* Reset entry-content padding from GP */
.entry-content {
    margin: 0 !important;
}

/* Ensure sidebar doesn't break layout */
.sidebar .widget {
    margin-bottom: var(--space-6, 1.5rem);
}

/* Fix any GP nav interference */
#site-navigation,
.main-navigation {
    float: none !important;
    clear: none !important;
}

/* ==========================================================================
   HOMEPAGE LAYOUT (v68.13) - Breaking Defense Style

   Hero: Overlay style - text over image with gradient
   Featured: Centered with whitespace (max-width ~1000-1100px)
   Latest News: Centered with sidebar RIGHT for ads
   Ads: Fixed ad-unit parameters across all templates
   ========================================================================== */

/* Main content wrapper - narrower for more whitespace */
.home .site-content,
.home .content-area {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 1024px) {
    .home .site-content,
    .home .content-area {
        padding-left: 40px;
        padding-right: 40px;
    }
}

/* Remove any left floats on homepage */
.home .site-main {
    float: none !important;
}

/* Hero main article - constrained width */
.home .card-hero {
    max-width: none;
    width: 100%;
}

/* Featured cards - 3-column grid */
.home .featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: none;
    width: 100%;
}

/* Latest news section - content expands properly */
.home .section-latest .main-content {
    width: 100%;
}

.home .section-latest .latest-list {
    width: 100%;
}

/* Latest cards fill their container */
.home .section-latest .latest-card {
    width: 100%;
    display: flex;
    gap: 24px;
}

.home .section-latest .latest-card-content {
    flex: 1;
    min-width: 0;
}

/* Responsive: 2 columns at 769-1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    .home .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive: 1 column below 768px */
@media (max-width: 768px) {
    .home .featured-grid {
        grid-template-columns: 1fr;
    }

    .home .card-hero,
    .home .section-latest .main-content,
    .home .latest-list {
        max-width: 100%;
    }
}
