/* ══════════════════════════════════════════════════════════════
   OPENPALP — SHARED PAGES CSS
   For SEO landing pages and blog articles.
   ══════════════════════════════════════════════════════════════ */

/* ── Fonts ── */
/* Self-hosted fonts — no Google Fonts CDN (GDPR compliance for UK medical site) */
@font-face {
  font-family: 'Libre Baskerville';
  src: url('../fonts/libre-baskerville-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Libre Baskerville';
  src: url('../fonts/libre-baskerville-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Libre Baskerville';
  src: url('../fonts/libre-baskerville-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── Design tokens ── */
:root {
  --font-serif: 'Libre Baskerville', 'Georgia', serif;
  --font-sans: 'Inter', 'Helvetica Neue', sans-serif;

  /* Palette */
  --white: #FFFFFF;
  --warm-white: #FAFAF8;
  --ivory: #F5F4F0;
  --light-grey: #E8E6E1;
  --mid-grey: #9B9690;
  --dark-grey: #5A5650;
  --charcoal: #2C2A27;

  --blue-50: #F0F4F8;
  --blue-100: #D9E4ED;
  --blue-200: #B3C9DB;
  --blue-400: #6A9ABF;
  --blue-500: #4A7FA8;
  --blue-600: #3A6B8F;
  --blue-700: #2D5470;
  --blue-800: #1E3A4F;

  --sage-50: #F2F5F3;
  --sage-100: #DCE5DF;
  --sage-400: #7BA393;
  --sage-600: #4D7A65;

  --red-50: #FDF2F2;
  --red-400: #C45A5A;
  --red-600: #A63D3D;

  --amber-50: #FDF6E3;
  --amber-400: #D4A017;

  /* Layout */
  --max-w: 1120px;
  --max-w-narrow: 760px;
  --radius: 12px;
  --radius-sm: 6px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--charcoal);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); }
a:focus-visible { outline: 2px solid var(--blue-400); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.25;
  color: var(--charcoal);
}

h1 { font-size: clamp(32px, 5vw, 48px); letter-spacing: -0.5px; }
h2 { font-size: clamp(26px, 3.5vw, 36px); letter-spacing: -0.3px; }
h3 { font-size: clamp(20px, 2.5vw, 24px); }
h4 { font-size: 18px; font-weight: 700; }

p, li { max-width: 68ch; }

/* ── Utility ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--max-w-narrow); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--light-grey);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--charcoal);
  font-weight: 700;
  white-space: nowrap;
}

.nav-logo em {
  font-style: italic;
  font-weight: 400;
  color: var(--blue-600);
}

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

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--dark-grey);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active { background: var(--blue-50); color: var(--blue-700); }

.nav-links .nav-cta {
  background: var(--blue-600);
  color: var(--white);
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 999px;
  margin-left: 8px;
}

.nav-links .nav-cta:hover { background: var(--blue-700); }

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-hamburger svg { width: 24px; height: 24px; stroke: var(--charcoal); }

/* ── Mobile nav ── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-hamburger { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--light-grey);
    padding: 16px 24px;
    gap: 4px;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open .nav-cta { margin-left: 0; margin-top: 8px; text-align: center; }
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:focus-visible { outline: 2px solid var(--blue-400); outline-offset: 2px; }

.btn-primary {
  background: var(--blue-600);
  color: var(--white);
}

.btn-primary:hover { background: var(--blue-700); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-secondary {
  background: transparent;
  color: var(--blue-600);
  border: 1.5px solid var(--blue-200);
}

.btn-secondary:hover { background: var(--blue-50); border-color: var(--blue-400); color: var(--blue-700); }

/* ── Footer ── */
.site-footer {
  background: var(--charcoal);
  color: rgba(255,255,255,0.7);
  padding: 56px 24px 32px;
  font-size: 14px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--white);
  margin-bottom: 12px;
}

.footer-brand em { font-style: italic; color: var(--blue-200); }

.site-footer h5 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 14px;
}

.site-footer a { color: rgba(255,255,255,0.7); }
.site-footer a:hover { color: var(--white); }

.footer-links { list-style: none; }
.footer-links li { padding: 4px 0; }

.footer-bottom {
  max-width: var(--max-w);
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ── Reduced motion (global override) ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   ARTICLE & BLOG PAGE STYLES
   ══════════════════════════════════════════════════════════════ */

/* ── Safety banner ── */
.safety-banner {
  background: #FDF2F2;
  border-bottom: 1px solid #F0D0D0;
  padding: 10px 24px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 13px;
  color: #A63D3D;
}

/* ── Article layout ── */
.article-hero {
  background: linear-gradient(175deg, var(--blue-50) 0%, var(--warm-white) 60%, var(--white) 100%);
  padding: 80px 24px 48px;
  text-align: center;
}

.article-hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 12px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.article-meta {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--mid-grey);
  margin-bottom: 32px;
}

.article-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.article-content h2 {
  font-size: clamp(22px, 3vw, 28px);
  margin: 40px 0 16px;
}

.article-content h3 {
  font-size: 20px;
  margin: 32px 0 12px;
}

.article-content p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--dark-grey);
  margin-bottom: 20px;
}

.article-content blockquote {
  border-left: 4px solid var(--blue-400);
  padding: 16px 24px;
  margin: 28px 0;
  background: var(--blue-50);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--dark-grey);
  line-height: 1.7;
}

.article-content ul, .article-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.article-content li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--dark-grey);
  margin-bottom: 8px;
}

.article-cta {
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  margin: 48px 0 0;
}

.article-cta h3 { margin: 0 0 8px; }
.article-cta p { margin: 0 0 16px; font-size: 15px; color: var(--dark-grey); }

/* ── Blog listing ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.blog-card {
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: 12px;
  padding: 28px 24px;
  transition: box-shadow 0.3s, transform 0.3s;
  text-decoration: none;
  display: block;
  color: inherit;
}

.blog-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.blog-card h3 { margin-bottom: 8px; font-size: 20px; }
.blog-card p { font-size: 14px; color: var(--dark-grey); line-height: 1.6; margin-bottom: 12px; }
.blog-card .read-more {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-600);
}

/* ── Related articles ── */
.related-articles {
  border-top: 1px solid var(--light-grey);
  padding-top: 40px;
  margin-top: 48px;
}

.related-articles h3 { margin-bottom: 20px; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.related-card {
  padding: 16px;
  border: 1px solid var(--light-grey);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s;
}

.related-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.related-card h4 { font-size: 16px; margin-bottom: 4px; }
.related-card p { font-size: 13px; color: var(--mid-grey); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .article-hero { padding: 56px 20px 36px; }
  .article-content { padding: 36px 20px 60px; }
  .blog-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
}

/* ── Print ── */
@media print {
  .nav, .nav-hamburger, .safety-banner, .btn, .site-footer { display: none; }
  .article-content { max-width: none; padding: 0; }
}
