/*
Theme Name: Affordable Workforce Housing
Theme URI: https://affordableworkforcehousing.com
Author: AWH Team
Author URI: https://affordableworkforcehousing.com
Description: Custom WordPress theme for Affordable Workforce Housing blog, matching the main site's warm community realism design with sage green, amber accents, Playfair Display headings, and Source Sans 3 body text.
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: awh-theme
Tags: blog, custom-logo, custom-menu, featured-images, one-column, two-columns
*/

/* ===== CSS RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --sage: #5B8A72;
  --sage-dark: #4A7260;
  --sage-light: #E8F0EC;
  --amber: #D4A843;
  --amber-dark: #B8922F;
  --charcoal: #2C3E2D;
  --warm-white: #FDFBF7;
  --warm-gray: #F5F2ED;
  --text-primary: #2C3E2D;
  --text-secondary: #5A6B5C;
  --text-muted: #7A8B7C;
  --border-color: #E2DDD6;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--warm-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--sage);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--sage-dark);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--charcoal);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 600; }

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container { padding: 0 1.5rem; }
}

@media (min-width: 1024px) {
  .container { padding: 0 2rem; }
}

/* ===== HEADER / NAVBAR ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.125rem 0;
}

.site-logo img {
  height: 80px;
  width: 80px;
  object-fit: contain;
  margin: -4px 0;
}

.main-navigation {
  display: none;
}

.main-navigation ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.main-navigation a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--charcoal);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
  color: var(--sage);
  background-color: var(--sage-light);
}

.donate-btn {
  display: none;
  padding: 0.625rem 1.25rem;
  background: var(--amber);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  box-shadow: 0 2px 8px rgba(212, 168, 67, 0.3);
  transition: opacity 0.2s ease;
}

.donate-btn:hover {
  opacity: 0.9;
  color: #fff !important;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--charcoal);
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  background: #fff;
  border-top: 1px solid var(--sage-light);
  padding: 1rem;
}

.mobile-menu.active {
  display: block;
}

.mobile-menu ul {
  list-style: none;
}

.mobile-menu a {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--charcoal);
  border-radius: 6px;
}

.mobile-menu a:hover {
  color: var(--sage);
  background-color: var(--sage-light);
}

.mobile-donate-btn {
  display: block;
  text-align: center;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--amber);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 8px;
}

@media (min-width: 1024px) {
  .main-navigation { display: block; }
  .donate-btn { display: inline-flex; }
  .menu-toggle { display: none; }
}

/* ===== MAIN CONTENT ===== */
.site-main {
  margin-top: 72px;
  min-height: calc(100vh - 72px - 300px);
}

/* ===== BLOG ARCHIVE / INDEX ===== */
.blog-header {
  background: linear-gradient(135deg, var(--sage-light) 0%, var(--warm-gray) 100%);
  padding: 4rem 0 3rem;
  text-align: center;
}

.blog-header h1 {
  font-size: 2.5rem;
  color: var(--charcoal);
  margin-bottom: 0.5rem;
}

.blog-header p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 3rem 0;
}

@media (min-width: 640px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== POST CARD ===== */
.post-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.post-card-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  overflow: hidden;
  background: var(--sage-light);
}

.post-card-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-card-thumbnail img {
  transform: scale(1.05);
}

.post-card-content {
  padding: 1.5rem;
}

.post-card-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sage);
  background: var(--sage-light);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.post-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.post-card-title a {
  color: inherit;
}

.post-card-title a:hover {
  color: var(--sage);
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-card-meta svg {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: middle;
}

/* ===== SINGLE POST ===== */
.single-post-header {
  background: linear-gradient(135deg, var(--sage-light) 0%, var(--warm-gray) 100%);
  padding: 4rem 0 3rem;
}

.single-post-header .container {
  max-width: 800px;
}

.single-post-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sage);
  background: rgba(91, 138, 114, 0.15);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.single-post-title {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.single-post-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.single-post-meta svg {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: middle;
}

.single-post-featured-image {
  margin: -2rem auto 0;
  max-width: 800px;
  padding: 0 1rem;
}

.single-post-featured-image img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Post Content */
.post-content {
  max-width: 720px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.post-content p {
  font-size: 1.0625rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.post-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.75rem;
}

.post-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.375rem;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.post-content blockquote {
  border-left: 4px solid var(--sage);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--sage-light);
  border-radius: 0 8px 8px 0;
}

.post-content blockquote p {
  font-style: italic;
  font-size: 1.125rem;
  color: var(--charcoal);
  margin-bottom: 0;
}

.post-content img {
  border-radius: 8px;
  margin: 2rem 0;
}

.post-content a {
  color: var(--sage);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content a:hover {
  color: var(--sage-dark);
}

/* ===== POST NAVIGATION ===== */
.post-navigation {
  max-width: 720px;
  margin: 0 auto 3rem;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.post-navigation a {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===== SIDEBAR ===== */
.content-with-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding: 3rem 0;
}

@media (min-width: 1024px) {
  .content-with-sidebar {
    grid-template-columns: 2fr 1fr;
  }
}

.sidebar .widget {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.sidebar .widget-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--sage-light);
}

.sidebar .widget ul {
  list-style: none;
}

.sidebar .widget li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.sidebar .widget a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.sidebar .widget a:hover {
  color: var(--sage);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--charcoal);
  color: #fff;
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-brand .footer-logo {
  height: 60px;
  width: auto;
  margin-bottom: 1rem;
}

.footer-col h4 {
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--amber);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 0 4rem;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pagination a {
  color: var(--text-secondary);
  background: #fff;
  border: 1px solid var(--border-color);
}

.pagination a:hover {
  background: var(--sage-light);
  color: var(--sage);
  border-color: var(--sage);
}

.pagination .current {
  background: var(--sage);
  color: #fff;
  border: 1px solid var(--sage);
}

/* ===== SEARCH FORM ===== */
.search-form {
  display: flex;
  gap: 0.5rem;
}

.search-form input[type="search"] {
  flex: 1;
  padding: 0.625rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-form input[type="search"]:focus {
  border-color: var(--sage);
}

.search-form button {
  padding: 0.625rem 1rem;
  background: var(--sage);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-form button:hover {
  background: var(--sage-dark);
}

/* ===== COMMENTS ===== */
.comments-area {
  max-width: 720px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

.comments-title {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.comment-list {
  list-style: none;
}

.comment-body {
  padding: 1.5rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.comment-author {
  font-weight: 600;
  color: var(--charcoal);
}

.comment-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* ===== 404 PAGE ===== */
.error-404 {
  text-align: center;
  padding: 6rem 1rem;
}

.error-404 h1 {
  font-size: 6rem;
  color: var(--sage);
  margin-bottom: 1rem;
}

.error-404 p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.error-404 .btn-home {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--sage);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.error-404 .btn-home:hover {
  background: var(--sage-dark);
  color: #fff;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  h1 { font-size: 2rem; }
  .single-post-title { font-size: 1.75rem; }
  .blog-header { padding: 3rem 0 2rem; }
  .blog-header h1 { font-size: 2rem; }
}
