/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* Base Styles */
:root {
  --color-text: #333;
  --color-text-light: #666;
  --color-primary: #6e8efb;
  --color-secondary: #a777e3;
  --space-unit: 1rem;
  --space-sm: calc(0.5 * var(--space-unit));
  --space-md: var(--space-unit);
  --space-lg: calc(2 * var(--space-unit));
  --font-sans: 'Inter', system-ui, sans-serif;
  --border-radius: 8px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: #f8f9fa;
  color: var(--color-text);
  line-height: 1.6;
}

/* Main Content */
.main-content {
  padding-top: 80px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

#blog-title {
  text-align: center;
  margin-bottom: 2rem;
}

/* Magazine Grid Styles */
.magazine-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.main-featured {
  background: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  grid-column: 1 / 2;
  grid-row: 1 / 3;
}

.main-featured-image {
  width: 100%;
  height: 300px;
  background-color: #ccc;
}

.main-featured-content { 
  padding: 2rem; 
}

.main-featured-title { 
  font-size: 1.8rem; 
  margin-top: 0; 
  margin-bottom: 0.5rem;
}

.main-featured-title a {
  color: var(--color-text);
  text-decoration: none;
}

.main-featured-title a:hover {
  color: var(--color-primary);
}

.side-featured {
  background: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.side-featured-image {
  width: 100%;
  height: 150px;
  background-color: #ddd;
}

.side-featured-content { 
  padding: 1.5rem; 
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.side-featured-title { 
  margin-top: 0; 
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.side-featured-title a {
  color: var(--color-text);
  text-decoration: none;
}

.side-featured-title a:hover {
  color: var(--color-primary);
}

.post-date {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin: 0 0 1rem 0;
}

.read-more {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  margin-top: auto;
  align-self: flex-start;
}

.read-more:hover {
  text-decoration: underline;
}

/* More Articles Section */
.more-articles-section {
  margin-top: 3rem;
}

.section-title {
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5rem;
  margin-top: 3rem;
  font-size: 1.5rem;
}

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

.post-list-item {
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
}

.post-list-item:last-child { 
  border-bottom: none; 
}

.post-list-link { 
  color: var(--color-text); 
  text-decoration: none; 
  font-weight: 500;
}

.post-list-link:hover { 
  color: var(--color-primary); 
}

.post-list-date { 
  color: var(--color-text-light); 
  font-size: 0.85em; 
  display: block;
  margin-top: 0.25rem;
}

/* Fallback single post styling */
.post {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  width: 100%;
}

.post h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  color: var(--color-text);
}

.post-link {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-link:hover {
  color: var(--color-primary);
}

.post-excerpt {
  color: var(--color-text);
  line-height: 1.6;
}

/* States */
.loading, .empty-state, .error-state {
  background: white;
  padding: var(--space-lg);
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: var(--shadow);
  margin: var(--space-lg) 0;
}

.loading p, .empty-state p, .error-state p {
  margin: 0 0 var(--space-md) 0;
  color: var(--color-text-light);
  font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .magazine-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .main-featured {
    grid-column: 1;
    grid-row: 1;
  }
  
  .main-featured-image {
    height: 200px;
  }
  
  .main-featured-content {
    padding: 1.5rem;
  }
  
  .main-featured-title {
    font-size: 1.5rem;
  }
  
  .side-featured {
    flex-direction: row;
  }
  
  .side-featured-image {
    width: 120px;
    height: auto;
    flex-shrink: 0;
  }
  
  .side-featured-content {
    padding: 1rem;
  }
  
  .post {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .post h2 {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .side-featured {
    flex-direction: column;
  }
  
  .side-featured-image {
    width: 100%;
    height: 120px;
  }
}

/* Container and Title Styles */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

#blog-title {
  text-align: center;
  margin-bottom: 2rem;
  width: 100%;
  grid-column: 1 / -1; /* This ensures title spans all columns */
}

/* Magazine Layout Container */
.magazine-layout {
  width: 100%;
}

/* Magazine Grid Styles */
.magazine-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
  width: 100%;
}

.main-featured {
  background: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  grid-column: 1 / 2;
  grid-row: 1 / 3;
}

.side-featured {
  background: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

/* Fix for magazine layout structure */
.magazine-layout {
  width: 100%;
  display: block; /* Ensure this is not a grid/flex container */
}

.magazine-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto auto;
  gap: 2rem;
  margin-bottom: 3rem;
  width: 100%;
}

/* Ensure the main featured article spans the correct columns */
.main-featured {
  background: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  grid-column: 1 / 2;
  grid-row: 1 / 3;
}

.side-featured {
  background: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

/* Make sure the title is completely separate from the grid */
#blog-title {
  text-align: center;
  margin-bottom: 2rem;
  width: 100%;
  display: block;
  grid-column: 1 / -1; /* This ensures it spans all columns if it somehow gets in the grid */
}

/* Clear any grid properties from parent containers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: block; /* Ensure container is not a grid */
}

.main-content {
  padding-top: 80px;
  display: block; /* Ensure main-content is not a grid */
}

/* Image styles */
.main-featured-image,
.side-featured-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.image-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Image styles */
.main-featured-image,
.side-featured-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.image-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}