/* Blog specific styling aligned with SpaceCatWeb primary palette */
:root {
  --uwf-primary: #E67E22;
  --uwf-accent: #D35400;
  --uwf-sand: #f8fbff;
  --uwf-slate: #2a2a2a;
  --uwf-muted: rgba(42, 42, 42, 0.64);
  --uwf-border: rgba(230, 126, 34, 0.12);
}

body {
  background: var(--uwf-sand);
  color: var(--uwf-slate);
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  min-height: 100vh;
}

.blog-header {
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(230, 126, 34, 0.08);
  box-shadow: 0 8px 24px rgba(230, 126, 34, 0.08);
}

.blog-header .main-nav .nav li a {
  color: var(--uwf-muted) !important;
}

.blog-header .main-nav .nav li a:hover,
.blog-header .main-nav .nav li a:focus,
.blog-header .main-nav .nav li a.active {
  color: var(--uwf-primary) !important;
}

.blog-header .language-switcher a.active {
  border-bottom: 2px solid var(--uwf-accent);
}

.blog-hero {
  padding: 140px 0 80px;
  background: linear-gradient(135deg, rgba(230, 126, 34, 0.12) 0%, rgba(211, 84, 0, 0.08) 100%);
  border-bottom: 1px solid var(--uwf-border);
}

.blog-hero h1 {
  font-size: clamp(2.4rem, 4vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--uwf-slate);
}

.blog-hero .lead {
  font-size: 1.1rem;
  color: var(--uwf-muted);
  max-width: 680px;
}

.blog-grid {
  padding: 50px 0 100px;
}

.blog-card {
  margin-bottom: 40px;
}

.blog-card .card-inner {
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--uwf-border);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 60px rgba(15, 42, 80, 0.12);
  transition: transform .35s ease, box-shadow .35s ease;
}

.blog-card .card-inner:hover {
  transform: translateY(-8px);
  box-shadow: 0 36px 70px rgba(15, 42, 80, 0.18);
}

.blog-card .card-image img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16/9;
  /* Unify image aspect ratio */
  object-fit: cover;
  /* Cover area without distortion */
}

.blog-card .card-content {
  padding: 26px 28px 32px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-card .card-date {
  font-size: 0.85rem;
  color: rgba(42, 42, 42, 0.56);
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.blog-card h2 {
  font-size: 1.35rem;
  line-height: 1.45;
  margin-bottom: 16px;
  color: var(--uwf-slate);
}

.blog-card h2 a {
  color: inherit;
  text-decoration: none;
}

.blog-card h2 a:hover {
  color: var(--uwf-primary);
}

.blog-card p {
  color: var(--uwf-muted);
  flex-grow: 1;
}

.blog-card .card-tags {
  margin: 18px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-card .card-tags span {
  font-size: 0.8rem;
  background: rgba(230, 126, 34, 0.12);
  color: var(--uwf-primary);
  padding: 6px 12px;
  border-radius: 999px;
}

.blog-card .read-more {
  color: var(--uwf-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
  margin-top: auto;
}

.blog-footer {
  padding: 60px 0;
  text-align: center;
  background: #ffffff;
  border-top: 1px solid var(--uwf-border);
}

.blog-footer p {
  margin-bottom: 12px;
  color: var(--uwf-muted);
}

.blog-footer .cta-link {
  color: var(--uwf-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.post-hero {
  padding-top: 140px;
  padding-bottom: 0;
}

.post-meta {
  text-transform: uppercase;
  color: rgba(42, 42, 42, 0.56);
  letter-spacing: 1px;
  font-size: 0.85rem;
}

.post-hero h1 {
  font-size: clamp(2.6rem, 4vw, 3.6rem);
  margin-top: 18px;
  margin-bottom: 20px;
  line-height: 1.2;
  color: var(--uwf-slate);
}

.post-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.post-tags span {
  background: rgba(230, 126, 34, 0.1);
  color: var(--uwf-primary);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.post-hero .hero-image img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 24px;
  margin: 40px auto 0;
  display: block;
  border: 1px solid var(--uwf-border);
  box-shadow: 0 24px 60px rgba(15, 42, 80, 0.12);
}

.post-content {
  padding: 60px 0 100px;
}

.post-content p {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--uwf-slate);
  margin-bottom: 28px;
  font-weight: 400;
}

.post-content h2 {
  font-size: 2.2rem;
  margin-top: 56px;
  margin-bottom: 24px;
  color: var(--uwf-slate);
  font-weight: 700;
  line-height: 1.3;
  position: relative;
  padding-bottom: 16px;
}

.post-content h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--uwf-primary), var(--uwf-accent));
  border-radius: 2px;
}

.post-content h3 {
  font-size: 1.6rem;
  margin-top: 40px;
  margin-bottom: 18px;
  color: var(--uwf-slate);
  font-weight: 600;
  line-height: 1.4;
}

.post-content h4 {
  font-size: 1.3rem;
  margin-top: 32px;
  margin-bottom: 16px;
  color: var(--uwf-slate);
  font-weight: 600;
}

.post-content ul,
.post-content ol {
  margin-bottom: 28px;
  padding-left: 0;
  list-style: none;
}

.post-content ul li,
.post-content ol li {
  margin-bottom: 16px;
  color: var(--uwf-slate);
  font-size: 1.05rem;
  line-height: 1.7;
  padding-left: 32px;
  position: relative;
}

.post-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  background: var(--uwf-primary);
  border-radius: 50%;
}

.post-content ol {
  counter-reset: list-counter;
}

.post-content ol li {
  counter-increment: list-counter;
}

.post-content ol li::before {
  content: counter(list-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--uwf-primary), var(--uwf-accent));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.post-content ul strong,
.post-content ol strong {
  color: var(--uwf-slate);
  font-weight: 700;
}

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

.post-content em {
  font-style: italic;
  color: var(--uwf-primary);
}

.post-content a {
  color: var(--uwf-primary);
  text-decoration: underline;
  text-decoration-color: rgba(230, 126, 34, 0.3);
  text-underline-offset: 3px;
  transition: all 0.2s ease;
}

.post-content a:hover {
  color: var(--uwf-accent);
  text-decoration-color: var(--uwf-accent);
}

.post-content blockquote {
  margin: 40px 0;
  padding: 24px 32px;
  border-left: 4px solid var(--uwf-primary);
  background: rgba(230, 126, 34, 0.05);
  border-radius: 0 12px 12px 0;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--uwf-slate);
}

.post-content code {
  background: rgba(42, 42, 42, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--uwf-accent);
}

.post-content pre {
  background: var(--uwf-slate);
  color: #f8f8f2;
  padding: 24px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 32px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Image container with blurred background effect */
.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 32px auto;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--uwf-border);
  position: relative;
  z-index: 2;
}

/* Wrapper for image with blurred background */
.post-content p:has(img) {
  position: relative;
  padding: 40px 0;
  margin: 32px -20px;
  overflow: hidden;
}

.post-content p:has(img)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: inherit;
  background-size: cover;
  background-position: center;
  filter: blur(20px);
  opacity: 0.3;
  z-index: 1;
}

/* Alternative: wrap images in a figure element for better control */
.post-content figure {
  position: relative;
  margin: 32px 0;
  padding: 40px 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 16px;
}

.post-content figure::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background-size: cover;
  background-position: center;
  filter: blur(30px) brightness(0.8);
  opacity: 0.4;
  z-index: 1;
}

.post-content figure img {
  position: relative;
  z-index: 2;
  max-height: 600px;
  width: auto;
  max-width: 90%;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

.post-content hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--uwf-border), transparent);
  margin: 48px 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.post-content table th {
  background: linear-gradient(135deg, var(--uwf-primary), var(--uwf-accent));
  color: white;
  padding: 16px;
  text-align: left;
  font-weight: 600;
}

.post-content table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--uwf-border);
  color: var(--uwf-slate);
}

.post-content table tr:last-child td {
  border-bottom: none;
}

.post-content table tr:hover {
  background: rgba(230, 126, 34, 0.03);
}

.blog-cta {
  margin: 40px 0 0;
  padding: 26px 32px;
  border-left: 4px solid var(--uwf-primary);
  background: rgba(230, 126, 34, 0.08);
  border-radius: 16px;
  color: var(--uwf-slate);
  font-weight: 500;
}

.post-cta {
  background: #ffffff;
  border: 1px solid var(--uwf-border);
  border-radius: 24px;
  padding: 40px;
  margin-top: 60px;
  text-align: center;
  box-shadow: 0 32px 70px rgba(15, 42, 80, 0.16);
}

.post-cta h2 {
  margin-top: 0;
  font-size: 2rem;
  color: var(--uwf-slate);
}

.post-cta p {
  margin-bottom: 24px;
  color: var(--uwf-muted);
}

.post-cta .btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--uwf-primary), var(--uwf-accent));
  color: #ffffff !important;
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

@media (max-width: 767px) {
  .blog-hero {
    padding-top: 110px;
  }

  .post-hero {
    padding-top: 110px;
  }

  .blog-card .card-content {
    padding: 24px 24px 28px;
  }

  .post-content {
    padding: 40px 0 80px;
  }

  .post-cta {
    padding: 32px;
  }
}