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

*, *::before, *::after { box-sizing: border-box; }

:root {
  --blog-max-width: 87.5rem; /* 1400px — matches main site container */
  --blog-gutter: clamp(0.75rem, 4vw, 1.5rem);
  --mental-50: #e6f6ff;
  --mental-100: #cceeff;
  --mental-300: #66ccff;
  --mental-600: #0a85ff;
  --mental-700: #0066dd;
  --gray-50: #f9fafb;
  --gray-200: #e5e7eb;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.blog-page {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--gray-800);
  background: #fff;
  line-height: 1.65;
  overflow-x: hidden;
  min-width: 320px;
}

/* Shared 1400px shell (header, main, footer) */
.blog-shell {
  width: 100%;
  max-width: var(--blog-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--blog-gutter);
  padding-right: var(--blog-gutter);
}

.blog-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--gray-200);
  backdrop-filter: blur(8px);
}

.blog-header__inner {
  max-width: var(--blog-max-width);
  margin: 0 auto;
  padding: 0.625rem var(--blog-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.blog-logo {
  flex-shrink: 0;
}

.blog-logo img {
  height: 3rem;
  width: auto;
  max-width: none;
  display: block;
  object-fit: contain;
}

.blog-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.blog-header__lang {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.blog-lang {
  font-weight: 600;
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.25rem 0.35rem;
  line-height: 1;
}

.blog-lang:hover {
  color: var(--mental-600);
}

.blog-lang--active {
  color: var(--mental-600);
}

.blog-lang-divider {
  color: var(--gray-200);
  font-size: 0.875rem;
  user-select: none;
}

.blog-main {
  padding-top: clamp(4.5rem, 12vw, 6rem);
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
  width: 100%;
}

.blog-container {
  width: 100%;
  max-width: var(--blog-max-width);
  margin: 0 auto;
  padding-left: var(--blog-gutter);
  padding-right: var(--blog-gutter);
}

.blog-breadcrumb {
  margin-bottom: 1.25rem;
}

.blog-breadcrumb a {
  color: var(--gray-600);
  text-decoration: none;
  font-size: clamp(0.875rem, 2.5vw, 0.95rem);
}

.blog-breadcrumb a:hover {
  color: var(--mental-600);
}

.blog-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--mental-100);
  color: var(--mental-700);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.blog-article h1 {
  font-size: clamp(1.5rem, 5vw, 2.75rem);
  line-height: 1.2;
  margin: 0 0 1rem;
  overflow-wrap: break-word;
}

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  color: var(--gray-500);
  font-size: 0.8125rem;
  margin-bottom: 1.5rem;
}

.blog-hero {
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 0 0 1.5rem;
  max-height: min(500px, 55vw);
}

.blog-hero img,
.blog-card__img img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  display: block;
}

.blog-prose {
  overflow-wrap: break-word;
  word-break: break-word;
}

.blog-prose h2 {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  margin: 1.75rem 0 0.75rem;
  line-height: 1.3;
}

.blog-prose h3 {
  font-size: clamp(1.1rem, 3.5vw, 1.25rem);
  margin: 1.25rem 0 0.5rem;
  line-height: 1.35;
}

.blog-prose p {
  margin: 0 0 1.25rem;
}

.blog-prose ul,
.blog-prose ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}

@media (min-width: 375px) {
  .blog-prose ul,
  .blog-prose ol {
    padding-left: 1.5rem;
  }
}

.blog-prose li {
  margin-bottom: 0.5rem;
}

.blog-prose a {
  color: var(--mental-600);
}

.blog-prose strong {
  font-weight: 600;
}

.blog-prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.blog-related {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.blog-related h2 {
  font-size: clamp(1.1rem, 3vw, 1.25rem);
  margin-bottom: 1rem;
}

.blog-related ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-related li {
  margin-bottom: 0.5rem;
}

.blog-related a {
  color: var(--mental-600);
  font-weight: 500;
  text-decoration: none;
}

.blog-related a:hover {
  text-decoration: underline;
}

.blog-cta {
  margin-top: 2.5rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--mental-50);
  border-radius: 0.75rem;
  border: 1px solid var(--mental-100);
}

.blog-cta__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.15rem, 4vw, 1.35rem);
  line-height: 1.3;
}

.blog-cta__text {
  margin: 0 0 1.25rem;
  color: var(--gray-600);
  font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.blog-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.blog-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: clamp(0.8125rem, 2.5vw, 0.9rem);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
}

.blog-btn--primary {
  background: var(--mental-600);
  color: #fff;
}

.blog-btn--primary:hover {
  background: var(--mental-700);
}

.blog-btn--secondary {
  background: #fff;
  color: var(--mental-600);
  border-color: var(--mental-600);
}

.blog-btn--ghost {
  background: transparent;
  color: var(--gray-600);
  border-color: var(--gray-200);
}

.blog-btn--sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
}

.blog-hub-title {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.blog-hub-sub {
  color: var(--gray-600);
  margin: 0 0 1.5rem;
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
}

.blog-page--hub-redirect .blog-main {
  padding-top: clamp(4.5rem, 12vw, 6rem);
  text-align: center;
}

.blog-hub-redirect .blog-hub-sub {
  color: var(--gray-600);
  margin: 0;
}

.blog-lang-picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.blog-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

.blog-card {
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
  background: #fff;
  min-width: 0;
}

.blog-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.blog-card__img {
  height: clamp(140px, 40vw, 180px);
  overflow: hidden;
}

.blog-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card__body {
  padding: clamp(1rem, 3vw, 1.25rem);
}

.blog-card__cat {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mental-700);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.blog-card__title {
  font-size: clamp(1rem, 3vw, 1.1rem);
  margin: 0.5rem 0;
  font-weight: 700;
  line-height: 1.35;
}

.blog-card__excerpt {
  font-size: clamp(0.85rem, 2.5vw, 0.9rem);
  color: var(--gray-600);
  margin: 0;
  line-height: 1.5;
}

/* Footer — aligned with src/components/Footer.tsx */
.blog-footer {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

.blog-footer__container {
  max-width: var(--blog-max-width);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 3rem) var(--blog-gutter);
}

.blog-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.blog-footer__logo-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.blog-footer__logo {
  height: 3rem;
  width: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
}

.blog-footer__description {
  color: var(--gray-600);
  margin: 0 0 1.5rem;
  max-width: 28rem;
  line-height: 1.65;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
}

.blog-footer__social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.blog-footer__social-link {
  color: var(--gray-500);
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.blog-footer__social-link:hover {
  color: var(--mental-600);
}

.blog-footer__heading {
  font-size: clamp(1rem, 3vw, 1.125rem);
  font-weight: 600;
  color: var(--gray-800);
  margin: 0 0 1rem;
}

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

.blog-footer__list li {
  margin-bottom: 0.75rem;
}

.blog-footer__list li:last-child {
  margin-bottom: 0;
}

.blog-footer__list a {
  color: var(--gray-600);
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
}

.blog-footer__list a:hover {
  color: var(--mental-600);
}

.blog-footer__bottom {
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: clamp(1.5rem, 4vw, 2rem);
  border-top: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

.blog-footer__copyright {
  color: var(--gray-600);
  font-size: 0.8125rem;
  margin: 0;
  text-align: center;
}

.blog-lang-switch {
  margin-top: 0;
  display: flex;
  justify-content: center;
}

.blog-lang-switch__details {
  position: relative;
}

.blog-lang-switch__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-800);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 0.375rem;
  cursor: pointer;
  list-style: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.blog-lang-switch__trigger::-webkit-details-marker {
  display: none;
}

.blog-lang-switch__trigger:hover {
  border-color: var(--mental-300);
  color: var(--mental-600);
}

.blog-lang-switch__chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.blog-lang-switch__details[open] .blog-lang-switch__chevron {
  transform: rotate(180deg);
}

.blog-lang-switch__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.5rem);
  min-width: 11rem;
  max-width: calc(100vw - 2rem);
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 0.375rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 20;
}

.blog-lang-switch__menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--gray-800);
  text-decoration: none;
  border-radius: 0.25rem;
}

.blog-lang-switch__menu a:hover,
.blog-lang-switch__menu a[aria-current="page"] {
  background: var(--mental-50);
  color: var(--mental-700);
}

/* ——— Responsive breakpoints ——— */

/* iPhone SE and small phones: stack CTAs, full-width lang buttons on hub */
@media (max-width: 479px) {
  .blog-cta__actions {
    flex-direction: column;
  }

  .blog-cta__actions .blog-btn {
    width: 100%;
  }

  .blog-lang-picker .blog-btn {
    width: 100%;
  }
}

/* Large phones: 2-column card grid when width allows */
@media (min-width: 480px) {
  .blog-lang-picker {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .blog-footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .blog-footer__copyright {
    text-align: left;
  }

  .blog-lang-switch {
    justify-content: flex-end;
  }
}

/* Desktop: 3-column cards within 1400px */
@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .blog-footer__grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .blog-footer__brand {
    grid-column: span 2;
  }
}
