/**
 * Blog pages – shared styles for blog index and post pages.
 * Uses site color scheme: #4A1717 (burgundy), #E5D8C4 (cream), #F7EDE0 (light cream),
 * #BB8737 (gold), #3E1F12 / #6E4E3D (dark brown).
 */

:root {
  --blog-primary: #4A1717;
  --blog-cream: #E5D8C4;
  --blog-cream-light: #F7EDE0;
  --blog-gold: #BB8737;
  --blog-brown: #3E1F12;
  --blog-brown-muted: #6E4E3D;
}

/* ---- Page shell ---- */
.blog-page,
body.blog-page-body {
  margin: 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: var(--blog-brown);
  background: var(--blog-cream);
}

/* Content starts below fixed site header (same offset as main site) */
body.blog-page-body #page {
  padding-top: 100px;
}
@media (max-width: 799px) {
  body.blog-page-body #page {
    padding-top: 80px;
  }
}

/* ---- Blog header (matches main site header) ---- */
.blog-header {
  background: var(--blog-primary);
  color: var(--blog-cream-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.blog-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.blog-header-logo a {
  display: block;
}

.blog-header-logo img {
  height: 50px;
  width: auto;
  display: block;
}

.blog-header-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
}

.blog-header-nav a {
  color: var(--blog-cream-light);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.35em 0;
  transition: color 0.2s;
}

.blog-header-nav a:hover {
  color: var(--blog-gold);
}

.blog-header-cta a {
  display: inline-block;
  padding: 0.6em 1.4em;
  background: var(--blog-cream-light);
  color: var(--blog-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.blog-header-cta a:hover {
  background: #fff;
  color: var(--blog-primary);
}

@media (max-width: 900px) {
  .blog-header-inner {
    padding: 1rem;
  }
  .blog-header-nav {
    order: 3;
    width: 100%;
  }
  .blog-header-cta {
    margin-left: auto;
  }
}

/* ---- Blog footer (matches main site footer) ---- */
.blog-footer {
  background: var(--blog-cream-light);
  color: var(--blog-brown);
  margin-top: 0;
}

.blog-footer-curve {
  line-height: 0;
  display: block;
}

.blog-footer-curve img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: bottom;
}

.blog-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 2rem 2rem;
  text-align: center;
}

.blog-footer-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.15em;
  color: var(--blog-primary);
  margin: 0 0 1.5rem 0;
}

.blog-footer-contact {
  margin: 0 auto 1.5rem;
  font-size: 0.95rem;
  color: var(--blog-brown-muted);
}

.blog-footer-contact-table {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  border-collapse: collapse;
}

.blog-footer-contact-table td {
  padding: 0.35rem 0.75rem;
}

.blog-footer-contact-table .footer-contact-left {
  text-align: right;
}

.blog-footer-contact-table .footer-contact-right {
  text-align: left;
}

.blog-footer-legal a {
  color: var(--blog-primary);
  text-decoration: none;
  font-weight: 500;
}

.blog-footer-legal a:hover {
  text-decoration: underline;
  color: var(--blog-gold);
}

/* ---- Blog index: hero ---- */
.blog-hero {
  background: linear-gradient(rgba(74, 23, 23, 0.85), rgba(74, 23, 23, 0.85)), url('../images/penrose-house-hero-pattern.png');
  background-size: cover;
  background-position: center;
  color: var(--blog-cream-light);
  padding: 4rem 2rem;
  text-align: center;
}

.blog-hero .hero-content h1 {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin: 0 0 0.75rem 0;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.blog-hero .hero-content p {
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
  opacity: 0.95;
}

/* ---- Blog index: carousel ---- */
.blog-grid {
  padding: 3rem 2rem;
  background: var(--blog-cream);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.blog-carousel-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.blog-container {
  display: flex;
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  justify-content: center;
  align-items: stretch;
  margin: 0 auto;
}

.blog-carousel-arrow {
  position: relative;
  width: 50px;
  height: 50px;
  background: var(--blog-primary);
  color: var(--blog-cream-light);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(62, 31, 18, 0.2);
}

.blog-carousel-arrow:hover {
  background: var(--blog-gold);
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(62, 31, 18, 0.3);
}

.blog-carousel-arrow:active {
  transform: scale(0.95);
}

.blog-carousel-arrow svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 1024px) {
  .blog-card {
    flex: 0 0 calc(50% - 1rem);
    max-width: 400px;
  }
}

@media (max-width: 768px) {
  .blog-carousel-arrow {
    width: 40px;
    height: 40px;
    position: absolute;
    z-index: 20;
  }
  
  .blog-carousel-arrow-left {
    left: 0;
  }
  
  .blog-carousel-arrow-right {
    right: 0;
  }
  
  .blog-carousel-arrow svg {
    width: 20px;
    height: 20px;
  }
  
  .blog-grid {
    padding: 2rem 1rem;
    gap: 0.5rem;
  }
  
  .blog-card {
    flex: 0 0 calc(100% - 2rem);
    max-width: 100%;
  }
  
  .blog-carousel-wrapper {
    margin: 0 50px;
  }
}

@media (min-width: 769px) {
  .blog-carousel-arrow {
    position: relative;
  }
}

.blog-card {
  background: var(--blog-cream-light);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(62, 31, 18, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  flex: 0 0 calc(33.333% - 1.34rem);
  min-width: 0;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  height: 100%;
}


.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(62, 31, 18, 0.12);
}

.blog-card-image {
  position: relative;
  height: 220px;
  overflow: hidden;
  margin: 0;
  padding: 0;
  line-height: 0;
  display: block;
  flex-shrink: 0;
  width: 100%;
}

.blog-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
  display: block;
  margin: 0;
  padding: 0;
  min-width: 100%;
  min-height: 100%;
}

/* Force full-bleed card images if any global rules override sizing */
.blog-card .blog-card-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.04);
}

.blog-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--blog-primary);
  color: var(--blog-cream-light);
  padding: 0.35em 0.9em;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 0;
  text-align: left;
  justify-content: flex-start;
  align-items: flex-start;
}

.blog-card-content h2 {
  margin: 0 0 0.75rem 0;
  font-family: 'Oswald', sans-serif;
  font-size: 1.2rem;
  line-height: 1.35;
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.35em * 2);
  max-height: calc(1.35em * 2);
  text-transform: none;
  letter-spacing: normal;
}

.blog-card-content h2 a {
  color: var(--blog-primary);
  text-decoration: none;
  transition: color 0.2s;
  text-transform: none;
  letter-spacing: normal;
}

.blog-card-content h2 a:hover {
  color: var(--blog-gold);
}

.blog-card-content p {
  color: var(--blog-brown-muted);
  margin: 0 0 1rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.6em * 3);
  max-height: calc(1.6em * 3);
}

.blog-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--blog-brown-muted);
  margin: 0 0 1rem 0;
  flex-shrink: 0;
}

.read-more {
  display: inline-block;
  color: var(--blog-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s;
  margin-top: auto;
  flex-shrink: 0;
}

.read-more:hover {
  color: var(--blog-gold);
}

/* ---- Blog index: CTA ---- */
.blog-cta {
  background: var(--blog-primary);
  color: var(--blog-cream-light);
  padding: 3.5rem 2rem;
  text-align: center;
}

.blog-cta .cta-content h2 {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin: 0 0 0.75rem 0;
}

.blog-cta .cta-content p {
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 1.5rem;
  opacity: 0.95;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-button {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.cta-button.primary {
  background: var(--blog-cream-light);
  color: var(--blog-primary);
}

.cta-button.primary:hover {
  background: #fff;
  color: var(--blog-primary);
}

.cta-button.secondary {
  background: transparent;
  color: var(--blog-cream-light);
  border: 2px solid var(--blog-cream-light);
}

.cta-button.secondary:hover {
  background: var(--blog-cream-light);
  color: var(--blog-primary);
}

@media (max-width: 600px) {
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  .cta-button {
    min-width: 220px;
    text-align: center;
  }
}

/* ---- Back to Blog ---- */
.blog-back-nav {
  margin: 0 0 1rem 0;
  font-size: 0.95rem;
}

.blog-back-nav a {
  color: var(--blog-primary);
  text-decoration: none;
  font-weight: 500;
}

.blog-back-nav a:hover {
  color: var(--blog-gold);
  text-decoration: underline;
}

/* ---- Blog post: layout ---- */
.blog-post-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

@media (min-width: 900px) {
  .blog-post-main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
  }
  .blog-back-nav {
    grid-column: 1 / -1;
  }
}

/* ---- Blog post: article ---- */
.blog-post {
  min-width: 0;
}

.blog-post-header {
  margin-bottom: 1.75rem;
}

.blog-post-header h1 {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  color: var(--blog-primary);
  margin: 0 0 0.5rem 0;
  line-height: 1.25;
}

.blog-post-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--blog-brown-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.blog-post-meta .category {
  font-weight: 600;
  color: var(--blog-primary);
}

.blog-post-content {
  line-height: 1.8;
  font-size: 1.05rem;
  color: var(--blog-brown);
}

.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4 {
  color: var(--blog-primary);
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  font-family: 'Oswald', sans-serif;
}

.blog-post-content h2 { font-size: 1.35rem; }
.blog-post-content h3 { font-size: 1.15rem; }
.blog-post-content h4 { font-size: 1.05rem; }

.blog-post-content p {
  margin: 0 0 1rem 0;
}

.blog-post-content img {
  max-width: 100%;
  height: auto;
  margin: 1.25rem 0;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(62, 31, 18, 0.1);
}

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

.blog-post-content li {
  margin: 0.4rem 0;
}

.blog-post-content a {
  color: var(--blog-primary);
  text-decoration: none;
}

.blog-post-content a:hover {
  text-decoration: underline;
  color: var(--blog-gold);
}

.blog-post-content strong {
  font-weight: 700;
  color: var(--blog-primary);
}

.blog-post-content em {
  font-style: italic;
}

.blog-post-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(62, 31, 18, 0.15);
}

.share-buttons h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  color: var(--blog-primary);
  margin: 0 0 0.75rem 0;
}

.share-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.share-buttons a {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--blog-primary);
  color: var(--blog-cream-light);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.share-buttons a:hover {
  background: var(--blog-gold);
  color: #fff;
}

/* ---- Blog post: sidebar ---- */
.blog-sidebar {
  min-width: 0;
}

.cta-section {
  background: var(--blog-cream-light);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(62, 31, 18, 0.06);
  border: 1px solid rgba(62, 31, 18, 0.08);
}

.cta-section h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  color: var(--blog-primary);
  margin: 0 0 0.5rem 0;
}

.cta-section p {
  font-size: 0.95rem;
  color: var(--blog-brown-muted);
  margin: 0;
  line-height: 1.5;
}

.cta-section .cta-button {
  margin-top: 1rem;
  background: var(--blog-primary);
  color: var(--blog-cream-light);
  padding: 0.7rem 1.25rem;
  font-size: 0.85rem;
}

.cta-section .cta-button:hover {
  background: var(--blog-gold);
  color: #fff;
  border-color: transparent;
}

@media (max-width: 899px) {
  .blog-sidebar {
    max-width: 400px;
    margin: 0 auto;
  }
}
