/* 
 * Layout-specific Fixes CSS - Improved Version
 * This file fixes specific layout issues without excessive !important usage
 */

/* Mobile optimizations for headers */
.mobile-optimized-header {
    padding: 5px 0 !important;
}

.mobile-optimized-nav {
    padding: 0 !important;
}

.mobile-hidden {
    display: none !important;
}

@media (min-width: 768px) {
    .mobile-hidden {
        display: inherit !important;
    }
}

/* Improve footer mobile layout */
@media (max-width: 768px) {
    /* Make footer more compact on mobile */
    footer {
        padding: 15px 0 10px !important;
    }
    
    /* Display footer content as a vertical stack with minimal spacing */
    .footer-content {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        margin-bottom: 10px !important;
    }
    
    /* Make sections smaller */
    .footer-info, .footer-nav, .footer-categories, .footer-social {
        margin-bottom: 10px !important;
    }
    
    /* Hide footer description on mobile to save space */
    .footer-description {
        display: none !important;
    }
    
    /* Make footer headings smaller */
    .footer-content h4 {
        margin-bottom: 5px !important;
        font-size: 0.9rem !important;
    }
    
    /* Condense the navigation links into a horizontal row */
    .footer-nav ul, .footer-categories ul {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    
    .footer-nav li, .footer-categories li {
        margin-bottom: 0 !important;
    }
    
    /* Legal links in the footer bottom */
    .legal-links {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 5px !important;
        font-size: 0.75rem !important;
        line-height: 1.4 !important;
    }
    
    .legal-links a {
        border: none !important;
        padding: 2px 5px !important;
        margin: 0 !important;
    }
    
    /* Remove the pipe separators in the legal links */
    .footer-bottom .legal-links a + a:before {
        content: "" !important;
    }
    
    /* Make the copyright text smaller */
    .copyright {
        font-size: 0.75rem !important;
        margin-top: 8px !important;
    }
}

/* RSOC ad style improvements */
.rsoc-container {
    margin: 12px 0 !important;
    padding: 0 !important;
    background-color: transparent !important;
}

.rsoc-ad-unit {
    margin-bottom: 10px;
}

/* ===== LAYOUT UTILITIES ===== */

body > header,
body > main,
body > footer {
  width: 100%;
  display: block;
}

header .container,
main .container,
footer .container {
  margin: 0 auto;
  max-width: var(--container-max-width, 1200px);
  padding: 0 var(--container-padding, 15px);
  width: 100%;
}

/* ===== GRID LAYOUT FIXES ===== */
.grid-layout {
  display: block;
  width: 100%;
}

.grid-layout header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== PORTFOLIO LAYOUT FIXES ===== */
.portfolio-layout {
  display: block;
  width: 100%;
}

.portfolio-layout header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.portfolio-layout header nav {
  display: flex;
  align-items: center;
}

.portfolio-layout header nav ul {
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ===== SHOWCASE LAYOUT FIXES ===== */
.layout-showcase {
  width: 100%;
}

.layout-showcase .showcase-section {
  margin-bottom: 2rem;
}

.layout-showcase .showcase-header {
  text-align: center;
  margin-bottom: 2rem;
}

.layout-showcase .layout-grid,
.layout-showcase .color-grid,
.layout-showcase .typography-grid,
.layout-showcase .density-grid,
.layout-showcase .combinations-grid,
.layout-showcase .mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.layout-showcase .layout-card, 
.layout-showcase .typography-card,
.layout-showcase .density-card,
.layout-showcase .combination-card, 
.layout-showcase .mode-card {
  background-color: var(--color-surface, #f7fafc);
  border-radius: var(--border-radius-lg, 0.5rem);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
  transition: transform 0.2s, box-shadow 0.2s;
}

.layout-showcase .color-card {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-lg, 0.5rem);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.layout-showcase .btn-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.layout-showcase .btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-md, 0.25rem);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s;
}

/* Layout templates cards in showcase */
.layout-showcase h3 {
  margin-bottom: 0.5rem;
}

.layout-showcase p {
  margin-bottom: 1rem;
}

/* View demo/sample buttons */
a.view-demo-btn,
a.view-sample-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin: 0.25rem;
  border-radius: var(--border-radius-md, 0.25rem);
  text-decoration: none;
  font-weight: 500;
}

a.view-demo-btn {
  background-color: var(--color-primary, #3490dc);
  color: white;
}

a.view-sample-btn {
  background-color: var(--color-surface-variant, #f1f5f8);
  border: 1px solid var(--color-border, #dae1e7);
  color: var(--color-text-secondary, #606f7b);
}

/* Add proper section styling */
.showcase-section {
  margin: 3rem 0;
}

.showcase-section h2 {
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border, #dae1e7);
}