/*
Theme Name:   SNP Telemedicine
Theme URI:    https://searlneuropsychology.com
Author:       SNP
Description:  Minimalistlik meditsiiniteemaline WordPress-teema affiliate-saidile: ravimikataloog, konsultatsioonibänner, E-E-A-T plokid.
Version:      1.0.0
Requires at least: 6.3
Requires PHP: 7.4
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  snp
*/

/* =========================================================
   1. Custom properties / design tokens
   ========================================================= */
:root {
  --snp-bg: #fafcfd;
  --snp-surface: #ffffff;
  --snp-ink: #16323c;
  --snp-ink-soft: #51707c;
  --snp-line: #dfe9ed;
  --snp-accent: #0e7f8c;        /* calm teal – single CTA accent */
  --snp-accent-dark: #0a6470;
  --snp-accent-soft: #e3f2f4;
  --snp-radius: 14px;
  --snp-shadow: 0 6px 24px rgba(22, 50, 60, 0.08);
  --snp-max: 1120px;
  --snp-narrow: 720px;
}

/* =========================================================
   2. Base / reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--snp-bg);
  color: var(--snp-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--snp-accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--snp-accent-dark); }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--snp-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  word-wrap: normal !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--snp-accent);
  color: #fff;
  padding: 10px 18px;
  z-index: 10000;
}
.skip-link:focus { left: 12px; top: 12px; color: #fff; }

/* =========================================================
   3. Layout containers
   ========================================================= */
.snp-container { max-width: var(--snp-max); margin: 0 auto; padding: 0 20px; }
.snp-narrow    { max-width: var(--snp-narrow); margin: 0 auto; padding: 0 20px; }

/* =========================================================
   4. Header
   ========================================================= */
.site-header {
  background: var(--snp-surface);
  border-bottom: 1px solid var(--snp-line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
  max-width: var(--snp-max);
  margin: 0 auto;
  flex-wrap: wrap;
}
.site-branding a {
  text-decoration: none;
  color: var(--snp-ink);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.site-branding .site-tagline {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--snp-ink-soft);
}
.primary-nav ul {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.primary-nav a {
  text-decoration: none;
  color: var(--snp-ink);
  font-weight: 500;
  font-size: 0.95rem;
}
.primary-nav a:hover { color: var(--snp-accent); }

/* =========================================================
   5. Hero (front page)
   ========================================================= */
.snp-hero {
  padding: clamp(48px, 8vw, 96px) 20px;
  text-align: center;
  background: linear-gradient(180deg, var(--snp-accent-soft) 0%, var(--snp-bg) 100%);
}
.snp-hero__inner { max-width: 760px; margin: 0 auto; }
.snp-hero p {
  color: var(--snp-ink-soft);
  font-size: 1.1rem;
  margin: 0 auto 1.5em;
  max-width: 560px;
}

/* Buttons */
.snp-btn {
  display: inline-block;
  background: var(--snp-accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 13px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.snp-btn:hover { background: var(--snp-accent-dark); color: #fff; transform: translateY(-1px); }

/* =========================================================
   6. Sections & grids
   ========================================================= */
.snp-section { padding: clamp(40px, 6vw, 72px) 0; }
.snp-section__title { text-align: center; margin-bottom: 1.4em; }

.snp-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Category cards */
.snp-cat-card {
  background: var(--snp-surface);
  border: 1px solid var(--snp-line);
  border-radius: var(--snp-radius);
  padding: 26px 24px;
  text-decoration: none;
  color: var(--snp-ink);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: block;
}
.snp-cat-card:hover { box-shadow: var(--snp-shadow); transform: translateY(-2px); color: var(--snp-ink); }
.snp-cat-card h3 { color: var(--snp-accent); margin-bottom: 6px; }
.snp-cat-card p { margin: 0; color: var(--snp-ink-soft); font-size: 0.92rem; }
.snp-cat-card .snp-cat-card__count {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--snp-ink-soft);
}

/* Post cards */
.snp-card {
  background: var(--snp-surface);
  border: 1px solid var(--snp-line);
  border-radius: var(--snp-radius);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}
.snp-card:hover { box-shadow: var(--snp-shadow); transform: translateY(-2px); }
.snp-card__thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.snp-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.snp-card__body h3 { margin: 0; font-size: 1.08rem; }
.snp-card__body h3 a { text-decoration: none; color: var(--snp-ink); }
.snp-card__body h3 a:hover { color: var(--snp-accent); }
.snp-card__excerpt { color: var(--snp-ink-soft); font-size: 0.92rem; margin: 0; }
.snp-card__meta { margin-top: auto; padding-top: 8px; font-size: 0.8rem; color: var(--snp-ink-soft); }

/* Archive header */
.snp-archive-header { padding: clamp(36px, 6vw, 64px) 20px 0; text-align: center; }
.snp-archive-header .archive-description {
  color: var(--snp-ink-soft);
  max-width: 640px;
  margin: 0 auto;
}

/* Pagination */
.snp-pagination { margin: 40px 0; text-align: center; }
.snp-pagination .page-numbers {
  display: inline-block;
  padding: 8px 14px;
  margin: 0 3px;
  border: 1px solid var(--snp-line);
  border-radius: 8px;
  text-decoration: none;
  background: var(--snp-surface);
}
.snp-pagination .page-numbers.current { background: var(--snp-accent); color: #fff; border-color: var(--snp-accent); }

/* =========================================================
   7. Single ravim
   ========================================================= */
.single-ravim-article { padding: clamp(32px, 5vw, 56px) 0 24px; }

.single-ravim-article .entry-thumb {
  border-radius: var(--snp-radius);
  overflow: hidden;
  margin-bottom: 28px;
}
.single-ravim-article .entry-thumb img { width: 100%; }

.article-byline {
  font-size: 0.9rem;
  color: var(--snp-ink-soft);
  border-left: 3px solid var(--snp-accent);
  background: var(--snp-accent-soft);
  padding: 12px 16px;
  border-radius: 0 10px 10px 0;
  margin: 0 0 26px;
}
.article-byline p { margin: 0; }
.article-byline p + p { margin-top: 4px; }

.entry-content { font-size: 1.05rem; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content h3 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 0.95rem;
}
.entry-content th, .entry-content td {
  border: 1px solid var(--snp-line);
  padding: 10px 12px;
  text-align: left;
}
.entry-content th { background: var(--snp-accent-soft); }

/* Sources */
.article-sources {
  margin: 48px 0 24px;
  padding: 26px 28px;
  background: var(--snp-surface);
  border: 1px solid var(--snp-line);
  border-radius: var(--snp-radius);
}
.article-sources h2 { font-size: 1.2rem; margin-bottom: 0.8em; }
.article-sources ol { margin: 0; padding-left: 1.3em; }
.article-sources li { margin-bottom: 6px; font-size: 0.93rem; }
.article-sources .source-domain { color: var(--snp-ink-soft); }

/* =========================================================
   8. Legal page template
   ========================================================= */
.page-template-page-legal .legal-content {
  padding: clamp(36px, 6vw, 64px) 0 64px;
}
.legal-content h1 { margin-bottom: 1em; }
.legal-content h2 { margin-top: 1.8em; font-size: 1.3rem; }
.legal-content { font-size: 1rem; }

/* =========================================================
   9. Footer
   ========================================================= */
.site-footer {
  margin-top: 64px;
  background: var(--snp-surface);
  border-top: 1px solid var(--snp-line);
  padding: 40px 0 32px;
}
.site-footer__inner { max-width: var(--snp-max); margin: 0 auto; padding: 0 20px; }

.footer-menu ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0 0 24px;
  padding: 0;
}
.footer-menu a {
  color: var(--snp-ink-soft);
  text-decoration: none;
  font-size: 0.88rem;
}
.footer-menu a:hover { color: var(--snp-accent); }

/* Disclaimer: small and muted but WCAG-contrast readable */
.site-disclaimer {
  font-size: 0.82rem;
  line-height: 1.6;
  color: #5b6f77; /* ~5.2:1 on white – readable but visually secondary */
  border-top: 1px dashed var(--snp-line);
  padding-top: 20px;
  margin-bottom: 20px;
  max-width: 880px;
}

.site-copyright { font-size: 0.82rem; color: var(--snp-ink-soft); }

/* =========================================================
   10. Responsive fine-tuning (360px–1920px)
   ========================================================= */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .site-header__inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .snp-grid { grid-template-columns: 1fr; }
}
@media (min-width: 601px) and (max-width: 900px) {
  .snp-grid { grid-template-columns: repeat(2, 1fr); }
}
