/*
 Theme Name:   GeneratePress Child - ForgR
 Theme URI:    https://forgr.io
 Description:  ForgR managed WordPress theme based on GeneratePress
 Author:       ForgR
 Author URI:   https://forgr.io
 Template:     generatepress
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  forgr-child
*/

/**
 * Base styles loaded for all ForgR sites
 * Theme-specific and layout-specific styles are loaded dynamically
 */

/* ========================================
   CSS Reset & Base
   ======================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ========================================
   Typography Base
   ======================================== */

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Links
   ======================================== */

a {
    color: var(--forgr-primary, #2029d9);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--forgr-secondary, #3b82f6);
}

/* ========================================
   Buttons Base
   ======================================== */

.wp-block-button__link,
button,
input[type="submit"] {
    transition: all 0.2s ease;
}

/* ========================================
   Images
   ======================================== */

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   Post Grid Container
   ======================================== */

.posts-grid {
    width: 100%;
}

/* ========================================
   Entry (article) Base Styles
   ======================================== */

article.post {
    position: relative;
}

.entry-title a {
    color: inherit;
}

.entry-meta {
    margin-bottom: 1rem;
}

.entry-summary {
    color: #666;
}

/* ========================================
   Post Thumbnail
   ======================================== */

.post-thumbnail-wrapper {
    position: relative;
    overflow: hidden;
}

.post-thumbnail {
    transition: transform 0.3s ease;
}

/* ========================================
   Navigation
   ======================================== */

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.5rem;
}

.main-navigation a {
    text-decoration: none;
    display: block;
}

/* ========================================
   Widgets
   ======================================== */

.widget {
    margin-bottom: 2rem;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.widget li:last-child {
    border-bottom: none;
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    background: #f8f9fa;
}

/* ========================================
   Utility Classes
   ======================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ========================================
   Category Colors (from ForgR settings)
   ======================================== */

.category-link {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
}

/* ========================================
   Responsive Helpers
   ======================================== */

@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ========================================
   MOSAIC GRID - Critical Styles (always loaded)
   ======================================== */

/* Force mosaic grid layout with high specificity */
ul.home-mosaic.wp-block-latest-posts.is-grid,
.home-mosaic.wp-block-latest-posts.is-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 1.5rem !important;
    grid-auto-flow: dense !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    max-width: 1400px !important;
}

/* Override WordPress default column styles */
ul.home-mosaic.wp-block-latest-posts.is-grid > li,
.home-mosaic.wp-block-latest-posts.is-grid li,
.home-mosaic.wp-block-latest-posts[class*="columns-"] li {
    width: auto !important;
    flex: initial !important;
    margin: 0 !important;
    list-style: none !important;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,.06);
    transition: transform .2s ease, box-shadow .2s ease;
}

ul.home-mosaic.wp-block-latest-posts.is-grid > li:hover,
.home-mosaic.wp-block-latest-posts.is-grid li:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0,0,0,.1);
}

/* Hide page title on homepage */
body.home .entry-title,
body.blog .entry-title,
body.home .page-header,
body.blog .page-header,
body.home h1.entry-title,
body.blog h1.entry-title {
    display: none !important;
}

/* Responsive mosaic */
@media (max-width: 1024px) {
    ul.home-mosaic.wp-block-latest-posts.is-grid,
    .home-mosaic.wp-block-latest-posts.is-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 767px) {
    ul.home-mosaic.wp-block-latest-posts.is-grid,
    .home-mosaic.wp-block-latest-posts.is-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .no-print,
    .main-navigation,
    .sidebar,
    .site-footer {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}
