/*
Theme Name: FSE Block Theme
Theme URI: https://example.com/fse-block-theme
Author: Your Name
Author URI: https://example.com
Description: A WordPress theme with custom Global Patterns using Full Site Editing (FSE) features
Version: 1.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fse-block-theme
Tags: full-site-editing, block-patterns, block-styles, custom-logo, editor-style, featured-images, wide-blocks

This theme is designed for Full Site Editing in WordPress.
*/

/* --------------------------------
   Header Global Pattern Styles
-------------------------------- */
.sticky-header {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Ensure the header stays sticky across browsers */
header.sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-flex-container {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.wp-block-site-title {
  margin: 0;
}

.wp-block-site-logo {
  margin-right: 10px;
}

.wp-block-navigation {
  justify-content: center;
}

/* --------------------------------
   3-Column Layout Styles
-------------------------------- */
.three-column-layout {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.three-column-container {
  margin-top: 0 !important;
}

.left-sidebar, .right-sidebar {
  margin-top: 1rem;
}

.widget {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: #f7f7f7;
  border-radius: 4px;
}

.widget h4 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.post-template {
  gap: 2rem;
}

.wp-block-post {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #ddd;
}

.wp-block-post:last-child {
  border-bottom: none;
}

.wp-block-post-featured-image {
  margin-bottom: 1rem;
}

.wp-block-post-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.wp-block-post-excerpt__more-link {
  display: inline-block;
  margin-top: 0.5rem;
  text-decoration: none;
}

.wp-block-query-pagination {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
}

/* --------------------------------
   Footer Global Pattern Styles
-------------------------------- */
.site-footer {
  background-color: #222;
  color: #fff;
  padding: 3rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-flex-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-left-section p {
  margin: 0;
}

.footer-navigation {
  margin: 0;
}

.footer-social-icons {
  margin: 0;
}

.site-footer .wp-block-site-title {
  margin: 0;
  font-size: 1.25rem;
}

.site-footer .wp-block-navigation {
  font-size: 0.875rem;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* --------------------------------
   Responsive Styles
-------------------------------- */
@media (max-width: 768px) {
  /* Header responsive */
  .header-flex-container {
    flex-direction: column !important;
  }
  
  .header-flex-container > .wp-block-column {
    flex-basis: 100% !important;
    margin-left: 0 !important;
    text-align: center;
    margin-bottom: 1rem;
  }
  
  .wp-block-social-links {
    justify-content: center !important;
  }
  
  /* 3-Column layout responsive */
  .three-column-container {
    flex-wrap: wrap !important;
  }
  
  .three-column-container > .wp-block-column {
    flex-basis: 100% !important;
    margin-left: 0 !important;
  }
  
  .three-column-container > .wp-block-column.left-sidebar {
    order: 3 !important;
  }
  
  .three-column-container > .wp-block-column.main-content {
    order: 1 !important;
  }
  
  .three-column-container > .wp-block-column.right-sidebar {
    order: 2 !important;
  }
  
  /* Footer responsive */
  .footer-flex-container {
    flex-direction: column !important;
    gap: 25px;
    text-align: center;
  }
  
  .footer-left-section {
    align-items: center;
  }
  
  .site-footer .wp-block-navigation {
    justify-content: center;
  }
  
  .site-footer .wp-block-social-links {
    justify-content: center !important;
  }
}

/* Fix for WordPress core styles that might interfere */
.wp-site-blocks .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
  flex-basis: 0;
  flex-grow: 1;
}

@media (max-width: 781px) {
  .wp-site-blocks .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column:not(:only-child) {
    flex-basis: 100% !important;
  }
  
  .three-column-container > .wp-block-column.left-sidebar {
    order: 3 !important;
  }
  
  .three-column-container > .wp-block-column.main-content {
    order: 1 !important;
  }
  
  .three-column-container > .wp-block-column.right-sidebar {
    order: 2 !important;
  }
}
