/* FarmaClar: shared styles for the blog and legal pages.
   Tokens and type match the inline styles in index.html. */

:root {
  --ink: #12304A;
  --ink-2: #3B5266;
  --ink-3: #5A6E80;
  --night: #0E263B;
  --teal: #13798A;
  --teal-deep: #0D5D6A;
  --teal-light: #8AD6E0;
  --teal-wash: #E1F0F2;
  --amber: #E38B2C;
  --amber-wash: #FCEEDC;
  --mist: #EEF4F6;
  --paper: #FFFFFF;
  --line: #D6E2E7;
  --line-strong: #B8CAD2;
  --shadow-card: 0 1px 2px rgba(18,48,74,0.06), 0 18px 40px -18px rgba(18,48,74,0.28);
  --radius-lg: 20px;
  --radius: 14px;
  --wrap: 1180px;
  --gutter: 32px;
  --measure: 720px;
  /* left edge of content inside a full-width bar, aligned to the site wrap */
  --edge: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter)));
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

/* ─── Shared controls ─── */
.lang-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--mist);
  border-radius: 999px;
}
.lang-btn, .lang-switch a {
  background: none;
  border: none;
  color: var(--ink-3);
  padding: 5px 10px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}
.lang-btn:hover, .lang-switch a:hover { color: var(--ink); }
.lang-btn.active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(18,48,74,0.18); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s;
}
.nav-cta:visited { color: #fff; }
.nav-cta:hover { background: var(--teal-deep); }
.nav-cta svg { width: 16px; height: 16px; }

/* ─── Blog nav (blog index and articles) ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 72px;
  padding: 0 var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand, .nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand img, .nav-brand img { width: 36px; height: 36px; }
.brand span, .nav-brand span { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links > a:not(.nav-cta) {
  text-decoration: none;
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
}
.nav-links > a:not(.nav-cta):hover { color: var(--ink); background: var(--mist); }

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--teal);
  z-index: 100;
}

/* ─── Site navbar (legal pages, same as index.html) ─── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.94);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.navbar.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 72px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-inner .nav-brand { margin-right: auto; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--ink);
}
.hamburger:hover { background: var(--mist); }
.hamburger svg { width: 26px; height: 26px; display: block; }
.mobile-menu {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: var(--paper);
  padding: 12px 16px 20px;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  z-index: 999;
}
.mobile-menu.open { display: flex; flex-direction: column; gap: 2px; }
.mobile-menu a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
  padding: 12px 14px;
  border-radius: 10px;
}
.mobile-menu a:hover { background: var(--mist); }
.mobile-lang {
  display: flex;
  align-self: flex-start;
  gap: 2px;
  padding: 3px;
  margin: 12px 14px 0;
  background: var(--mist);
  border-radius: 999px;
}

/* ─── Page headers ─── */
.article-header,
.page-header,
.legal-hero,
.hero {
  background: var(--mist);
  border-bottom: 1px solid var(--line);
  padding: 56px var(--edge) 64px;
}
.article-header h1,
.hero h1,
.page-header h1,
.legal-hero h1 {
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
/* Articles and legal pages read in one centred column */
.article-header-inner,
.page-header > *,
.legal-hero > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
/* small label above legal titles; "Legal" reads the same in es, en and ca */
.page-header::before,
.legal-hero::before {
  content: 'Legal';
  display: block;
  max-width: var(--measure);
  margin: 0 auto 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--teal-deep);
}
.page-header > p,
.legal-hero > p { margin-top: 14px; font-size: 18px; color: var(--ink-2); }
.page-header .effective-date,
.legal-hero .legal-date { margin-top: 12px; font-size: 15px; color: var(--ink-3); }

/* ─── Article (blog post) ─── */
.article-header { padding-bottom: 0; border-bottom: 0; }
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--ink-3);
}
.breadcrumb a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { color: var(--teal-deep); text-decoration: underline; }
.article-tag { display: block; margin-bottom: 10px; font-size: 15px; font-weight: 700; color: var(--teal-deep); }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 18px 0 40px;
  font-size: 15px;
  color: var(--ink-3);
}
.article-meta .separator { display: none; }
.article-meta .lang-switch { background: var(--paper); border: 1px solid var(--line); }
/* the cover image straddles the header band and the page */
.hero-image {
  padding: 0 var(--edge);
  background: linear-gradient(var(--mist) 50%, var(--paper) 50%);
}
.hero-image img {
  width: 100%;
  max-width: var(--measure);
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.article-container { padding: 0 var(--edge) 96px; }
.article,
.related-posts { max-width: var(--measure); margin: 0 auto; }
.article { padding-top: 48px; }
.article p { margin-top: 20px; font-size: 18px; line-height: 1.75; color: var(--ink-2); }
.article p.lead { margin-top: 0; font-size: 21px; line-height: 1.6; color: var(--ink); }
.article h2 { margin-top: 52px; font-size: 26px; line-height: 1.25; letter-spacing: -0.02em; }
.article strong { color: var(--ink); }
.article a { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article a:hover { text-decoration-thickness: 2px; }
.pull-quote {
  margin: 36px 0;
  padding: 4px 0 4px 24px;
  border-left: 4px solid var(--teal);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 36px 0;
  border-top: 2px solid var(--ink);
}
.stat-card { padding: 20px 20px 4px; border-left: 1px solid var(--line-strong); }
.stat-card:first-child { padding-left: 0; border-left: 0; }
.stat-card .stat-number {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--teal-deep);
  font-variant-numeric: tabular-nums;
}
.stat-card .stat-label { margin-top: 10px; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.references { margin-top: 52px; padding-top: 20px; border-top: 1px solid var(--line-strong); }
.article .references h2 { margin-top: 0; margin-bottom: 8px; font-size: 17px; letter-spacing: 0; }
.article .references a { display: block; margin-top: 8px; font-size: 15px; line-height: 1.5; }
.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line-strong);
}
.share-label { margin-right: 4px; font-size: 15px; font-weight: 600; color: var(--ink-3); }
.article .share-btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.article .share-btn:hover { border-color: var(--ink); }
.article-cta {
  display: flex;
  align-items: center;
  gap: 16px 24px;
  margin-top: 40px;
  padding: 28px;
  background: var(--teal-deep);
  border-radius: var(--radius-lg);
}
.article .article-cta p { flex: 1; margin: 0; font-size: 17px; line-height: 1.5; color: #fff; }
.article .article-cta a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  background: #fff;
  color: var(--teal-deep);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.article .article-cta a:hover { background: var(--mist); }
.related-posts { margin-top: 80px; }
.related-posts h2 { padding-top: 20px; margin-bottom: 8px; border-top: 2px solid var(--ink); font-size: 22px; letter-spacing: -0.02em; }
.related-grid { display: grid; grid-template-columns: 1fr; }
.related-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  column-gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line-strong);
  text-decoration: none;
  color: inherit;
}
.related-card .related-tag { grid-row: 1 / span 2; padding-top: 2px; font-size: 14px; font-weight: 700; color: var(--teal-deep); }
.related-card h3 { font-size: 18px; line-height: 1.3; margin-bottom: 4px; }
.related-card p { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.related-card:hover h3 { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 3px; }

/* ─── Simple footer (blog pages) ─── */
footer.footer-simple {
  padding: 32px var(--edge) 40px;
  background: var(--night);
  color: rgba(255,255,255,0.6);
  font-size: 15px;
}
footer.footer-simple a { color: rgba(255,255,255,0.85); text-decoration: none; }
footer.footer-simple a:hover { color: var(--teal-light); }

/* ─── Blog index ─── */
.hero { padding-bottom: 72px; }
.hero h1 { max-width: 20ch; }
.hero-kicker { margin-bottom: 10px; font-size: 15px; font-weight: 700; color: var(--teal-deep); }
.hero-inner > p { margin-top: 16px; font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 36em; }
.container { padding: 72px var(--edge) 96px; }
.container > section + section { margin-top: 72px; }
.section-header { margin-bottom: 24px; }
.section-header h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.featured {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.featured-image { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; background: var(--mist); }
.featured-image img { width: 100%; height: 100%; object-fit: cover; }
.tag {
  display: inline-block;
  width: fit-content;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--teal-wash);
  color: var(--teal-deep);
  font-size: 14px;
  font-weight: 700;
}
.featured-content .tag { margin-bottom: 16px; }
.featured-content h2 { font-size: clamp(26px, 2.8vw, 34px); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 14px; }
.featured-content h2 a, .post-card-body h3 a { color: inherit; text-decoration: none; }
.featured-content h2 a:hover, .post-card-body h3 a:hover { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.excerpt { color: var(--ink-2); line-height: 1.6; }
.featured-content .excerpt { font-size: 18px; margin-bottom: 20px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 14px; color: var(--ink-3); }
.lang-links { display: inline-flex; gap: 2px; padding: 2px; background: var(--mist); border-radius: 999px; }
.lang-links a { padding: 2px 9px; border-radius: 999px; color: var(--ink-3); font-size: 13px; font-weight: 700; text-decoration: none; }
.lang-links a:hover { color: var(--ink); background: var(--paper); }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 32px; }
.post-card { display: flex; flex-direction: column; }
.post-card-image { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--mist); margin-bottom: 16px; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; }
.post-card-image .tag { position: absolute; left: 12px; bottom: 12px; background: var(--paper); }
.post-card-body { display: flex; flex-direction: column; flex: 1; }
.post-card-body h3 { font-size: 20px; line-height: 1.25; margin-bottom: 8px; }
.post-card-body .excerpt { flex: 1; font-size: 16px; margin-bottom: 14px; }
.post-card-body .meta { justify-content: space-between; }
.newsletter-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 48px;
  padding: 48px;
  background: var(--teal-deep);
  border-radius: var(--radius-lg);
  color: #fff;
}
.container > section.newsletter-cta { margin-top: 88px; }
.newsletter-cta h2 { flex: 1 1 100%; font-size: clamp(24px, 2.8vw, 34px); font-weight: 800; letter-spacing: -0.02em; max-width: 24ch; }
.newsletter-cta p { flex: 1 1 360px; font-size: 18px; color: rgba(255,255,255,0.82); max-width: 40em; }
.newsletter-cta .cta-btn {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 26px;
  background: #fff;
  color: var(--teal-deep);
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
}
.newsletter-cta .cta-btn:hover { background: var(--mist); }

/* ─── Legal pages ─── */
.page-header, .legal-hero { padding-bottom: 56px; }
.privacy-content, .legal-content {
  box-sizing: content-box;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 56px var(--gutter) 96px;
}
.privacy-content h2, .legal-content h2 {
  margin-top: 48px;
  margin-bottom: 4px;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.privacy-content h2:first-child, .legal-content h2:first-child { margin-top: 0; }
.privacy-content h3 { margin-top: 28px; font-size: 19px; }
.privacy-content p, .legal-content p { margin-top: 14px; font-size: 17px; line-height: 1.7; color: var(--ink-2); }
.privacy-content strong, .legal-content strong { color: var(--ink); }
.privacy-content ul, .legal-content ul { list-style: none; margin-top: 14px; }
.privacy-content li, .legal-content li {
  position: relative;
  padding-left: 22px;
  margin-top: 8px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
}
.privacy-content li::before, .legal-content li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.7em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
}
.privacy-content a, .legal-content a { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 3px; }
.legal-content .highlight-box {
  margin-top: 16px;
  padding: 18px 20px;
  background: var(--amber-wash);
  border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.legal-content .highlight-box p { margin: 0; color: var(--ink); font-weight: 600; }
.data-table-wrapper { margin-top: 20px; overflow-x: auto; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table thead th {
  padding: 12px 16px;
  background: var(--mist);
  border-bottom: 1px solid var(--line-strong);
  text-align: left;
  font-weight: 700;
  color: var(--ink);
}
.data-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }

/* ─── Site footer (legal pages, same as index.html) ─── */
footer.footer-site { background: var(--night); color: rgba(255,255,255,0.7); }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 64px var(--gutter) 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand img { width: 32px; height: 32px; }
.footer-brand span { font-size: 20px; font-weight: 800; color: #fff; }
.footer-desc { font-size: 15px; line-height: 1.6; color: rgba(255,255,255,0.6); max-width: 30ch; }
.footer-col h2 { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.footer-col a { display: block; padding: 5px 0; font-size: 15px; color: rgba(255,255,255,0.7); text-decoration: none; }
.footer-col a[href]:hover { color: var(--teal-light); }
.footer-incubator { padding: 24px 0; border-top: 1px solid rgba(255,255,255,0.1); }
.footer-incubator a { display: inline-flex; align-items: center; gap: 16px; text-decoration: none; }
.footer-incubator img { height: 44px; width: auto; padding: 6px 10px; background: #fff; border-radius: 8px; }
.footer-incubator span { font-size: 14px; color: rgba(255,255,255,0.6); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); }
.footer-copy { font-size: 14px; color: rgba(255,255,255,0.5); }
.footer-socials { display: flex; gap: 8px; }
.footer-socials a { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.75); display: grid; place-items: center; }
.footer-socials a:hover { background: var(--teal); color: #fff; }
.footer-socials svg { width: 18px; height: 18px; }

/* ─── Responsive ─── */
@media (max-width: 1080px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .featured { grid-template-columns: 1fr; gap: 24px; }
  .navbar .nav-right .nav-cta { display: none; }
  .hamburger { display: block; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .nav .nav-cta, .navbar .nav-right .lang-switch { display: none; }
  .nav-links { gap: 8px; }
  .brand span, .nav-brand span { font-size: 19px; }
  .article-header, .page-header, .legal-hero, .hero { padding-top: 32px; }
  .article p { font-size: 17px; }
  .article p.lead { font-size: 19px; }
  .article h2 { font-size: 22px; margin-top: 40px; }
  .article { padding-top: 32px; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card, .stat-card:first-child { padding: 16px 0; border-left: 0; border-bottom: 1px solid var(--line-strong); }
  .article-cta { flex-direction: column; align-items: stretch; padding: 22px; }
  .article .article-cta a { justify-content: center; }
  .related-card { grid-template-columns: 1fr; }
  .related-card .related-tag { grid-row: auto; margin-bottom: 4px; }
  .post-grid { grid-template-columns: 1fr; }
  .container { padding-top: 48px; }
  .newsletter-cta { padding: 28px 22px; }
  .newsletter-cta .cta-btn { width: 100%; justify-content: center; }
  .privacy-content, .legal-content { padding-top: 40px; }
  .data-table { font-size: 14px; }
  .data-table thead th, .data-table tbody td { padding: 10px 12px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
