/* =============================================================
   Performacentric – Blog Page Styles
   Covers: shared layout tokens, header, footer, blog-specific
   sections, newsletter form, post cards, sidebar.
   ============================================================= */

/* ─── RESET & CUSTOM PROPERTIES ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand palette */
  --primary:           #076476;
  --primary-dark:      #054e5c;
  --primary-deep:      #004b59;

  /* Text */
  --text-dark:         #1a1c1c;
  --text-heading:      #004b59;
  --text-body:         #555f6f;
  --text-card:         #3f484b;
  --text-muted:        #6f797c;
  --text-light:        #94a3b8;

  /* Surfaces */
  --white:             #ffffff;
  --bg-page:           #ffffff;
  --bg-card:           #f3f3f4;
  --bg-badge:          #e8e8e8;
  --bg-newsletter:     #eef7f8;
  --border-color:      rgba(191, 200, 204, 0.2);
  --border-nav:        #f3f4f6;

  /* Sidebar accent */
  --sidebar-dark:      #004b59;
  --sidebar-accent:    #97def3;

  /* Typography */
  --font-display:      'Manrope', sans-serif;
  --font-body:         'Inter', 'Manrope', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-display);
  color: var(--text-card);
  background: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── ACCESSIBILITY ───────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* ─── SHARED LAYOUT ───────────────────────────────────────────── */
.container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px;
}

/* ─── BUTTONS ─────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  padding: 16px 40px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--primary-dark);
  box-shadow: 0 12px 20px -3px rgba(0,0,0,0.15);
}

/* ─── HEADER ──────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 80px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--border-nav);
  display: flex;
  align-items: center;
}

.nav {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img {
  height: 40px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
}

.nav-links li + li { margin-left: 32px; }

.nav-links a {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links .nav-link--active { color: var(--primary); }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: all 0.25s;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  display: none;
  position: absolute;
  top: 80px;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border-nav);
  padding: 16px 32px 24px;
  flex-direction: column;
  list-style: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.nav-mobile.open { display: flex; }
.nav-mobile li + li { border-top: 1px solid var(--border-nav); }

.nav-mobile a {
  display: block;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
}

/* ─── BLOG INTRO ──────────────────────────────────────────────── */
.blog-intro {
  padding: 56px 0 48px;
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
}

.blog-page-title {
  font-size: 40px;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.blog-page-desc {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-body);
  line-height: 1.6;
  max-width: 680px;
}

/* ─── NEWSLETTER BANNER ───────────────────────────────────────── */
.newsletter-banner {
  background: var(--bg-newsletter);
  border-top: 1px solid rgba(7, 100, 118, 0.1);
  border-bottom: 1px solid rgba(7, 100, 118, 0.1);
  padding: 48px 0;
}

.newsletter-inner {
  display: flex;
  align-items: flex-start;
  gap: 48px;
  justify-content: space-between;
}

.newsletter-copy {
  flex: 1;
  min-width: 0;
  max-width: 560px;
}

.newsletter-heading {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-deep);
  line-height: 1.25;
  margin-bottom: 10px;
}

.newsletter-subtext {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-body);
  line-height: 1.6;
}

.newsletter-form-wrap {
  flex-shrink: 0;
  width: 100%;
  max-width: 448px;
}

.newsletter-form-row {
  display: flex;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #6f797c;
  background: var(--white);
}

.newsletter-input {
  flex: 1;
  min-width: 0;
  padding: 0 17px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  color: var(--text-dark);
  background: transparent;
  border: none;
  outline: none;
}

.newsletter-input::placeholder { color: #6b7280; }

/* Focus ring on the row when input is focused */
.newsletter-form-row:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.newsletter-btn {
  flex-shrink: 0;
  padding: 0 28px;
  background: var(--primary);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.newsletter-btn:hover { background: var(--primary-dark); }

.newsletter-btn:disabled {
  background: #8ab7be;
  cursor: not-allowed;
}

/* Status messages */
.form-status {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: 4px;
  padding: 8px 12px;
}

.form-status[hidden] { display: none; }

.form-status--success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.form-status--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.form-status--info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.newsletter-legal {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.4;
}

.newsletter-legal a {
  color: var(--text-muted);
  text-decoration: underline;
}

.newsletter-legal a:hover { color: var(--primary); }

/* ─── FEATURED POST ───────────────────────────────────────────── */
.featured-post-section {
  padding: 48px 0;
  background: var(--white);
}

.featured-post-card {
  display: grid;
  grid-template-columns: 7fr 5fr;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  min-height: 500px;
}

.featured-post-image {
  position: relative;
  overflow: hidden;
}

.featured-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-post-body {
  padding: 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: center;
}

.post-tag {
  display: inline-flex;
  align-items: center;
  background: var(--primary);
  color: var(--sidebar-accent);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 12px 4px;
  border-radius: 12px;
  align-self: flex-start;
}

.featured-post-title {
  font-size: 40px;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.featured-post-excerpt {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-body);
  line-height: 1.65;
}

.featured-post-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 4px;
}

.featured-read-more {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: none;
}

.post-read-time {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

/* ─── BLOG LAYOUT (main + sidebar) ───────────────────────────── */
.blog-layout {
  padding: 64px 0 80px;
  background: var(--bg-page);
}

.blog-layout-inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  align-items: start;
}

/* ─── LATEST INSIGHTS ─────────────────────────────────────────── */
.latest-insights-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 32px;
}

.latest-insights-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1;
}

.view-all-link {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s;
}

.view-all-link:hover { color: var(--primary-dark); text-decoration: underline; }

/* ─── POST GRID ───────────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.post-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}

.post-card:hover {
  box-shadow: 0 4px 20px -4px rgba(0, 75, 89, 0.12);
}

.post-card-image-link {
  display: block;
  overflow: hidden;
}

.post-card-image {
  height: 200px;
  overflow: hidden;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.post-card:hover .post-card-image img { transform: scale(1.03); }

.post-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-category {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--primary-deep);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.post-card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 10px;
}

.post-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

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

.post-card-excerpt {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-card);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 20px;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.post-date {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.post-arrow-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: transform 0.15s;
}

.post-arrow-link:hover { transform: translateX(3px); }

/* ─── SIDEBAR ─────────────────────────────────────────────────── */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: sticky;
  top: 96px;
}

.sidebar-widget {
  border-radius: 4px;
  overflow: hidden;
}

/* Trending Topics */
.sidebar-widget--topics {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 32px;
}

.sidebar-widget-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.3;
  margin-bottom: 20px;
}

.sidebar-widget-title--dark { color: var(--text-dark); }

.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-tag {
  display: inline-flex;
  align-items: center;
  background: var(--white);
  border: 1px solid rgba(191, 200, 204, 0.3);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.topic-tag:hover {
  background: var(--primary-deep);
  border-color: var(--primary-deep);
  color: var(--white);
}

/* Featured Whitepaper */
.sidebar-widget--whitepaper {
  background: var(--primary-deep);
  padding: 48px;
  position: relative;
}

.whitepaper-glow {
  position: absolute;
  bottom: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: rgba(45, 212, 191, 0.2);
  border-radius: 12px;
  filter: blur(32px);
  pointer-events: none;
}

.whitepaper-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.whitepaper-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--sidebar-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.whitepaper-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
  margin-bottom: 4px;
}

.whitepaper-desc {
  font-size: 15px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  margin-bottom: 24px;
  padding-top: 12px;
}

.btn-whitepaper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  color: var(--primary-deep);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 24px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  align-self: flex-start;
}

.btn-whitepaper:hover {
  background: #e8f5f7;
}

/* Categories */
.sidebar-widget--categories {
  border: 1px solid var(--border-color);
  padding: 32px;
}

.categories-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid rgba(191, 200, 204, 0.08);
}

.category-item:first-child { border-top: none; }

.category-link {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-body);
  text-decoration: none;
  transition: color 0.15s;
}

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

.category-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-badge);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px 2px;
  border-radius: 2px;
  min-width: 28px;
}

/* ─── FOOTER ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--border-nav);
  padding: 80px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

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

.footer-brand .btn-primary {
  padding: 12px 32px;
  font-size: 15px;
  align-self: flex-start;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.footer-col-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 20px;
  margin-bottom: 20px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-col a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-body);
  text-decoration: none;
  line-height: 20px;
  transition: color 0.15s;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-nav);
  padding-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  line-height: 16px;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-legal a {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-legal a:hover { color: var(--primary); }

/* ─── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .featured-post-title { font-size: 32px; }
  .blog-layout-inner { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; }
  .sidebar-widget--whitepaper { padding: 32px; }
  .footer-top { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Nav */
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  /* Intro */
  .blog-intro { padding: 40px 0 32px; }
  .blog-page-title { font-size: 28px; }
  .blog-page-desc { font-size: 16px; }

  /* Newsletter */
  .newsletter-inner {
    flex-direction: column;
    gap: 28px;
  }
  .newsletter-copy { max-width: 100%; }
  .newsletter-form-wrap { max-width: 100%; }
  .newsletter-heading { font-size: 22px; }

  /* Featured post */
  .featured-post-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .featured-post-image { height: 240px; }
  .featured-post-body { padding: 28px 24px; }
  .featured-post-title { font-size: 26px; }
  .featured-post-excerpt { font-size: 15px; }

  /* Blog layout */
  .blog-layout { padding: 40px 0 56px; }
  .post-grid { grid-template-columns: 1fr; }

  /* Footer */
  .footer-links { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .container { padding: 0 20px; }
  .nav { padding: 0 20px; }
  .nav-mobile { padding: 16px 20px 24px; }

  .newsletter-form-row { flex-direction: column; height: auto; border-radius: 4px; overflow: visible; border: none; gap: 10px; }
  .newsletter-input { height: 50px; border: 1px solid #6f797c; border-radius: 4px; padding: 0 17px; }
  .newsletter-input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
  .newsletter-form-row:focus-within { outline: none; }
  .newsletter-btn { height: 50px; border-radius: 4px; }

  .footer-links { grid-template-columns: 1fr; }

  .featured-post-body { padding: 24px 20px; }
  .featured-post-title { font-size: 22px; }
}
