/* ═══════════════════════════════════════════════════════════
   HD Estate — Modern Health Blog
   Design System & Main Styles
═══════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────── */
:root {
  --green-900: #0f2118;
  --green-800: #1e3a2f;
  --green-700: #2d5a45;
  --green-600: #3a7a5e;
  --green-500: #4a9a7a;
  --green-100: #e8f5ef;
  --green-50:  #f0faf5;

  --amber-600: #d97706;
  --amber-500: #e8803a;
  --amber-400: #f0a060;
  --amber-100: #fef3c7;

  --bg:        #fafaf8;
  --surface:   #ffffff;
  --border:    #e5e7e0;
  --border-2:  #d1d5cc;

  --text-1:    #111827;
  --text-2:    #374151;
  --text-3:    #6b7280;
  --text-4:    #9ca3af;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.14);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;

  --dur: 0.22s;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --nav-h: 68px;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ── Reading progress bar ───────────────────────────────── */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--green-600), var(--amber-500));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ── Navigation ─────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--green-800);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  box-shadow: 0 2px 16px rgba(0,0,0,.25);
}

.nav-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.nav-logo svg { flex-shrink: 0; }
.nav-logo span { color: var(--amber-400); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  color: rgba(255,255,255,.8);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: background var(--dur) var(--ease), color var(--dur);
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  color: #fff;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--dur), opacity var(--dur);
}

/* Mobile nav */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: var(--green-900);
  padding: 16px 24px 24px;
  z-index: 99;
  box-shadow: var(--shadow-lg);
}
.nav-mobile.open { display: block; }
.nav-mobile a {
  display: block;
  color: rgba(255,255,255,.85);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: background var(--dur);
}
.nav-mobile a:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  background:
    linear-gradient(135deg, rgba(30,58,47,.82) 0%, rgba(45,92,69,.75) 60%, rgba(45,92,69,.70) 100%),
    url('/uploads/hero-bg.jpg') center center / cover no-repeat;
  padding: 80px 24px 90px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 20% 40%, rgba(255,255,255,.04) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 80% 60%, rgba(232,128,58,.1) 0%, transparent 60%);
}
.hero-inner { position: relative; max-width: 700px; margin: 0 auto; }
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 50px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.hero h1 em {
  font-style: normal;
  color: var(--amber-400);
}
.hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,.75);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Layout wrapper ─────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-section {
  padding: 64px 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 36px;
  gap: 16px;
}
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.02em;
}
.section-title::after {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--amber-500);
  border-radius: 2px;
  margin-top: 6px;
}
.section-link {
  font-size: 0.875rem;
  color: var(--green-600);
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--dur);
}
.section-link:hover { color: var(--green-800); }

/* ── Category filter ────────────────────────────────────── */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}
.cat-btn {
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all var(--dur) var(--ease);
}
.cat-btn:hover, .cat-btn.active {
  background: var(--green-800);
  border-color: var(--green-800);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ── Article grid ───────────────────────────────────────── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

/* ── Article card ───────────────────────────────────────── */
.article-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-img-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--green-50);
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.article-card:hover .card-img-wrap img {
  transform: scale(1.04);
}
.card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green-100), var(--green-50));
  color: var(--green-500);
}

.cat-badge {
  position: absolute;
  bottom: 12px; left: 12px;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
}

.card-body {
  padding: 20px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.4;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
  transition: color var(--dur);
}
.article-card:hover .card-title { color: var(--green-700); }

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-3);
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-4);
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: auto;
}
.card-meta svg { flex-shrink: 0; }
.card-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-2); }

.card-read-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-600);
  margin-left: auto;
  transition: gap var(--dur), color var(--dur);
}
.article-card:hover .card-read-link {
  gap: 10px;
  color: var(--green-800);
}

/* ── Single article page ────────────────────────────────── */
.article-page {
  padding-top: 48px;
  padding-bottom: 80px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-3);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--green-600); transition: color var(--dur); }
.breadcrumb a:hover { color: var(--green-800); }
.breadcrumb svg { color: var(--text-4); flex-shrink: 0; }

.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
}

.article-main {}

.article-header {
  margin-bottom: 32px;
}
.article-cat-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}
.article-title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--text-1);
  margin-bottom: 20px;
}
.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-3);
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
}
.article-meta-bar svg { color: var(--text-4); }
.article-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-hero-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 36px;
  aspect-ratio: 16/8;
  background: var(--green-50);
}
.article-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Article body typography ────────────────────────────── */
.article-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-2);
}
.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 40px 0 16px;
  letter-spacing: -0.02em;
  padding-top: 8px;
  border-top: 2px solid var(--green-100);
}
.article-content h2:first-child { margin-top: 0; border-top: none; }
.article-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 28px 0 12px;
}
.article-content p { margin-bottom: 20px; }
.article-content ul, .article-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 8px; }
.article-content strong { color: var(--text-1); font-weight: 600; }
.article-content em { font-style: italic; }
.article-content a {
  color: var(--green-600);
  text-decoration: underline;
  text-decoration-color: var(--green-100);
  text-underline-offset: 3px;
  transition: color var(--dur);
}
.article-content a:hover { color: var(--green-800); }
.article-content blockquote {
  border-left: 4px solid var(--amber-500);
  background: var(--amber-100);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 24px 0;
  font-style: italic;
  color: var(--text-2);
}
.article-content blockquote p { margin-bottom: 0; }

/* ── Editorial pick / partner block ────────────────────── */
.editorial-pick {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #f8fcf9;
  border: 1.5px solid #a7e8c4;
  border-left: 5px solid #2d7a4f;
  border-radius: 10px;
  padding: 18px 20px;
  margin: 32px 0;
}
.editorial-pick-img {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}
.editorial-pick-body { flex: 1; min-width: 0; }
.editorial-pick-label {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #2d7a4f;
  background: #d4f5e5;
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 6px;
}
.editorial-pick-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}
.editorial-pick-desc {
  font-size: .88rem;
  color: #4b5563;
  margin-bottom: 10px;
  line-height: 1.55;
}
.editorial-pick-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  font-weight: 600;
  color: #fff;
  background: #2d7a4f;
  border-radius: 6px;
  padding: 7px 16px;
  text-decoration: none !important;
  transition: background .2s;
}
.editorial-pick-link:hover { background: #1e5c3a; color: #fff; }
.article-content .editorial-pick-link { color: #fff; text-decoration: none; }
.article-content .editorial-pick-link:hover { color: #fff; }
@media (max-width: 480px) {
  .editorial-pick { flex-direction: column; align-items: flex-start; }
}

/* ── Sidebar ────────────────────────────────────────────── */
.article-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}
.sidebar-widget {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 20px;
}
.sidebar-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 16px;
}
.sidebar-article {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.sidebar-article:first-of-type { border-top: none; }
.sidebar-article-img {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--green-50);
}
.sidebar-article-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
  transition: color var(--dur);
}
.sidebar-article:hover .sidebar-article-title { color: var(--green-600); }
.sidebar-article-date {
  font-size: 0.75rem;
  color: var(--text-4);
  margin-top: 4px;
}

/* ── Related articles ───────────────────────────────────── */
.related-section {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 2px solid var(--border);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

/* ── Share buttons ──────────────────────────────────────── */
.share-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 40px 0;
  flex-wrap: wrap;
}
.share-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-3);
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--dur) var(--ease);
  border: none;
}
.share-btn-vk  { background: #4a76a8; color: #fff; }
.share-btn-tg  { background: #2ca5e0; color: #fff; }
.share-btn-copy{ background: var(--surface); color: var(--text-2); border: 1.5px solid var(--border); }
.share-btn:hover { opacity: 0.88; transform: translateY(-2px); }

/* ── Back to top ────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 32px; right: 32px;
  width: 44px; height: 44px;
  background: var(--green-800);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur), transform var(--dur) var(--ease);
  border: none;
  z-index: 50;
}
#back-to-top.show {
  opacity: 1;
  pointer-events: all;
}
#back-to-top:hover { transform: translateY(-3px); }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  background: var(--green-900);
  color: rgba(255,255,255,.7);
  padding: 48px 24px 32px;
  margin-top: 80px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.footer-brand-desc {
  font-size: 0.875rem;
  line-height: 1.7;
}
.footer-col-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,.5);
  margin-bottom: 16px;
}
.footer-links a {
  display: block;
  font-size: 0.875rem;
  color: rgba(255,255,255,.65);
  padding: 4px 0;
  transition: color var(--dur);
}
.footer-links a:hover { color: #fff; }
.footer-bottom {
  max-width: 1280px;
  margin: 24px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-bottom a { color: rgba(255,255,255,.5); transition: color var(--dur); }
.footer-bottom a:hover { color: #fff; }

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-3);
}
.empty-state svg { margin: 0 auto 16px; }
.empty-state h3 { font-size: 1.2rem; color: var(--text-2); margin-bottom: 8px; }

/* ── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}
.page-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-2);
  transition: all var(--dur);
}
.page-btn:hover, .page-btn.active {
  background: var(--green-800);
  border-color: var(--green-800);
  color: #fff;
}

/* ── 404 ────────────────────────────────────────────────── */
.not-found {
  text-align: center;
  padding: 120px 24px;
}
.not-found-code {
  font-size: 6rem;
  font-weight: 900;
  color: var(--green-100);
  line-height: 1;
  margin-bottom: 16px;
}
.not-found h2 { font-size: 1.5rem; margin-bottom: 12px; }
.not-found p  { color: var(--text-3); margin-bottom: 24px; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-800);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background var(--dur), transform var(--dur);
}
.btn-primary:hover { background: var(--green-700); transform: translateY(-2px); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --nav-h: 60px; }
  .nav-links { display: none; }
  .nav-burger { display: flex; }

  .hero { padding: 56px 20px 64px; }
  .page-section { padding: 48px 0; }
  .articles-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  #back-to-top { bottom: 20px; right: 20px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .article-title { font-size: 1.5rem; }
  .section-title { font-size: 1.3rem; }
}

/* ── Print ──────────────────────────────────────────────── */
@media print {
  .site-nav, .site-footer, #back-to-top, .share-section, .related-section { display: none; }
  body { background: #fff; color: #000; }
  .article-layout { grid-template-columns: 1fr; }
}
