/**
 * Layout CSS for Broadplace Theme
 */

/* ==========================================================================
   Base Layout
   ========================================================================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family-primary, 'Inter', sans-serif);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color, #2c3e50);
    background-color: var(--background-color, #ffffff);
}

/* ==========================================================================
   Site Structure
   ========================================================================== */
#page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#content {
    flex: 1;
    width: 100%;
}

/* ==========================================================================
   Container
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-max-width, 1600px);
    margin: 0 auto;
    padding: 0 var(--spacing-md, 1.5rem);
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm, 1rem);
    }
}

/* ==========================================================================
   Header Layout
   ========================================================================== */
.site-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    max-width: 100% !important;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    max-width: var(--container-max-width, 1600px);
    margin: 0 auto;
    padding-left: var(--spacing-md, 1.5rem);
    padding-right: var(--spacing-md, 1.5rem);
}

.site-branding {
    flex-shrink: 0;
}

.site-logo img {
    max-height: 50px;
    width: auto;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.site-title a {
    color: var(--text-color, #2c3e50);
    text-decoration: none;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.main-navigation {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.primary-menu li {
    position: relative;
}

.primary-menu a {
    color: var(--text-color, #2c3e50);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.primary-menu a:hover {
    color: var(--primary-color, #e91e63);
}

/* Sub Menu */
.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.primary-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-menu a {
    display: block;
    padding: 0.5rem 1.5rem;
}

/* Header CTA */
.header-cta {
    flex-shrink: 0;
    margin-left: 2rem;
}

/* Mobile Menu */
.mobile-menu-toggle {
    /* display: none; */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle-icon span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-color, #2c3e50);
    transition: all 0.3s ease;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 90%;
    height: 100%;
    background: white;
    padding: 2rem;
    /* transform: translateX(100%); */
    transition: transform 0.3s ease;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

/* ==========================================================================
   Main Content Areas
   ========================================================================== */
.site-main {
    /* padding: var(--spacing-xl, 3rem) 0; */
    padding: none !important;
}

.page-header {
    margin-bottom: var(--spacing-xl, 3rem);
}

.page-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin: 0 0 1rem;
    font-weight: 700;
    width: 60%;
    color: #ffffff;
}

/* ==========================================================================
   Footer Layout
   ========================================================================== */
.site-footer {
    background: linear-gradient(135deg, #1a4f5c 0%, #0b1c2c 100%);
    color: white;
    padding: var(--spacing-xxl, 4rem) 0 0;
    /* margin-top: var(--spacing-xxl, 4rem); */
    max-width: 100%!important;
}

.footer-main {
    padding-bottom: var(--spacing-xl, 3rem);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: var(--spacing-xl, 3rem);
}

.footer-section h4 {
    margin: 0 0 1.5rem;
    font-size: 1.125rem;
    color: var(--accent-color, #4cb494);
}

.footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-menu li {
    margin-bottom: 0.75rem;
}

.footer-menu a {
    color: rgba(255, 255, 255);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-menu a:hover {
    color: white;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.copyright p {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   Post/Page Layouts
   ========================================================================== */
.posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg, 2rem);
}

.post-card {
    background: white;
    border-radius: var(--border-radius, 8px);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 1.5rem;
}

.post-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light, #7f8c8d);
}

.post-title {
    margin: 0 0 1rem;
    font-size: 1.5rem;
}

.post-title a {
    color: var(--text-color, #2c3e50);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: var(--primary-color, #e91e63);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0.75rem var(--spacing-sm, 1rem);
    }
    
    .main-navigation,
    .header-cta {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg, 2rem);
    }
    
    .posts-container {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    padding: 0 !important;
    border: 0 !important;
    height: 1px !important;
    width: 1px !important;
    overflow: hidden;
}

.alignfull {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
}

.alignwide {
    max-width: var(--wp--style--global--wide-size, 1600px);
    margin-left: auto;
    margin-right: auto;
}