/* Article layout — sidebar + main */
.article-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

/* Sidebar */
.article-sidebar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: 'Poppins', system-ui, sans-serif;
}
.article-sidebar__card {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 14px;
  padding: 20px 22px;
}
.article-sidebar__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #163E40;
  margin: 0 0 14px;
  letter-spacing: -.1px;
}
.article-sidebar__title i { color: #226468; font-size: 18px; }

.article-toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 460px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.article-toc__empty { font-size: 13px; color: #8090a3; margin: 0; }
.article-toc__item {
  display: block;
  padding: 7px 10px 7px 12px;
  font-size: 13px;
  color: #4a5a70;
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  line-height: 1.4;
  transition: color .15s, background .15s, border-color .15s;
  cursor: pointer;
}
.article-toc__item:hover { color: #163E40; background: #f3f6fa; }
.article-toc__item.is-active {
  color: #226468;
  font-weight: 600;
  border-left-color: #226468;
  background: rgba(34,100,104,.06);
}
.article-toc__item--lvl-1 { padding-left: 24px; font-size: 12.5px; }
.article-toc__item--lvl-2 { padding-left: 34px; font-size: 12px; color: #6b7a8c; }

.article-share { display: flex; gap: 8px; flex-wrap: wrap; }
.article-share__btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 18px;
  background: #f3f6fa;
  color: #4a5a70;
  border: 0;
  cursor: pointer;
  transition: background .2s, color .2s, transform .12s;
}
.article-share__btn:hover { transform: translateY(-2px); }
.article-share__btn--fb:hover { background: #1877F2; color: #fff; }
.article-share__btn--tg:hover { background: #229ED9; color: #fff; }
.article-share__btn--vb:hover { background: #7360F2; color: #fff; }
.article-share__btn--copy:hover { background: #226468; color: #fff; }
.article-share__btn.is-copied { background: #226468; color: #fff; }
.article-share__btn.is-copied i::before { content: '\\eb37'; }

.article-sidebar__card--cta { background: #163E40; border-color: #163E40; color: #fff; }
.article-sidebar__title-cta {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #fff;
  line-height: 1.3;
}
.article-sidebar__cta-text { font-size: 13px; color: rgba(255,255,255,.7); margin: 0 0 14px; line-height: 1.5; }
.article-sidebar__cta-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #226468;
  color: #fff;
  border: 0;
  padding: 12px 16px;
  border-radius: 999px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .12s;
  margin-bottom: 8px;
}
.article-sidebar__cta-btn:hover { background: #6B237A; transform: translateY(-1px); }
.article-sidebar__cta-btn i { font-size: 17px; }
.article-sidebar__phone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  padding: 8px;
  border-radius: 6px;
  font-weight: 500;
  transition: color .2s;
}
.article-sidebar__phone:hover { color: #fff; }
.article-sidebar__phone i { color: #226468; font-size: 16px; }

/* Article detail */
.article-detail {
  background: #fff;
  border-radius: 16px;
  padding: 36px 40px 40px;
  border: 1px solid #e8edf3;
  font-family: 'Poppins', system-ui, sans-serif;
  min-width: 0;
}
.article-detail__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.article-detail__date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6b7a8c;
  background: #f3f6fa;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 500;
}
.article-detail__date i { color: #226468; font-size: 16px; }
.article-detail__back a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #226468;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: color .2s;
}
.article-detail__back a:hover { color: #6B237A; }
.article-detail__back i { font-size: 16px; }

.article-detail__hero {
  background-color: #f3f6fa;
  background-size: cover;
  background-position: center;
  aspect-ratio: 16/8;
  border-radius: 12px;
  margin-bottom: 22px;
}

.article-detail__title {
  font-family: 'Poppins', sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.25;
  color: #163E40;
  margin: 0 0 24px;
  letter-spacing: -.5px;
}

.article-detail__content {
  font-size: 16px;
  line-height: 1.75;
  color: #324158;
}
.article-detail__content p {
  margin: 0 0 16px;
  color: #324158;
}
.article-detail__content p:last-child { margin-bottom: 0; }
.article-detail__content h2,
.article-detail__content h3 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: #163E40;
  margin: 28px 0 12px;
}
.article-detail__content h2 { font-size: 22px; }
.article-detail__content h3 { font-size: 18px; }
.article-detail__content h4 { font-size: 16px; color: #163E40; margin: 22px 0 10px; font-weight: 700; }
.article-detail__content ul,
.article-detail__content ol {
  padding-left: 26px;
  margin: 12px 0 16px;
}
.article-detail__content li { margin-bottom: 6px; color: #324158; }
.article-detail__content a {
  color: #226468;
  text-decoration: underline;
}
.article-detail__content a:hover { color: #6B237A; }
.article-detail__content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 16px 0;
  display: block;
}
.article-detail__content blockquote {
  border-left: 3px solid #226468;
  padding: 4px 0 4px 18px;
  margin: 18px 0;
  color: #4a5a70;
  font-style: italic;
}
.article-detail__content strong { color: #163E40; font-weight: 700; }
.article-detail__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14.5px;
}
.article-detail__content th,
.article-detail__content td {
  border: 1px solid #e8edf3;
  padding: 10px 12px;
  text-align: left;
}
.article-detail__content th {
  background: #f3f6fa;
  font-weight: 700;
  color: #163E40;
}

.article-detail__cta {
  margin-top: 32px;
  padding: 22px 24px;
  background: #f3f6fa;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}
.article-detail__cta h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: #163E40;
}
.article-detail__cta p {
  margin: 0;
  font-size: 13.5px;
  color: #5a6a80;
  line-height: 1.5;
}
.article-detail__cta-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.article-detail__cta-actions button:hover { background: #6B237A !important; }
.article-detail__cta-actions a:hover { background: rgba(34,100,104,.08); }

/* Related articles grid */
.article-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.article-related-card {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .2s, border-color .2s;
}
.article-related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(22,62,64,.08);
  border-color: #226468;
}
.article-related-card__img {
  aspect-ratio: 16/9;
  background-color: #f3f6fa;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c8d0db;
  font-size: 36px;
}
.article-related-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.article-related-card__title {
  font-size: 14px;
  font-weight: 600;
  color: #163E40;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-related-card__date {
  font-size: 12px;
  color: #8090a3;
  font-weight: 500;
}

/* Articles index grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.article-card {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .2s, border-color .2s;
}
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(22,62,64,.1);
  border-color: #226468;
}
.article-card__img {
  display: block;
  aspect-ratio: 16/9;
  background-color: #f3f6fa;
  background-size: cover;
  background-position: center;
}
.article-card__body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.article-card__date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #6b7a8c;
  font-weight: 500;
  width: fit-content;
}
.article-card__date i { color: #226468; font-size: 14px; }
.article-card__title {
  font-family: 'Poppins', sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
  margin: 2px 0 4px;
  color: #163E40;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card__title a { color: inherit; text-decoration: none; transition: color .2s; }
.article-card__title a:hover { color: #226468; }
.article-card__excerpt {
  font-size: 13.5px;
  color: #5a6a80;
  line-height: 1.55;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card__more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #226468;
  font-weight: 600;
  text-decoration: none;
  margin-top: 6px;
  transition: color .2s, gap .15s;
  width: fit-content;
}
.article-card__more:hover { color: #6B237A; gap: 8px; }
.article-card__more i { font-size: 16px; }

@media (max-width: 991px) {
  .article-layout { grid-template-columns: 1fr; gap: 20px; }
  .article-sidebar { position: static; flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .article-sidebar__card { flex: 1; min-width: 260px; }
  .article-sidebar__card--cta { width: 100%; flex: 1 1 100%; }
  .article-toc { max-height: 280px; }
  .article-detail { padding: 28px 28px 32px; }
  .article-detail__title { font-size: 24px; }
  .article-detail__cta { grid-template-columns: 1fr; }
  .article-related-grid { grid-template-columns: repeat(2, 1fr); }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
  .article-detail { padding: 22px 20px 26px; border-radius: 14px; }
  .article-detail__title { font-size: 20px; }
  .article-detail__hero { aspect-ratio: 16/10; }
  .article-detail__content { font-size: 14.5px; }
  .article-related-grid { grid-template-columns: 1fr; }
  .article-detail__cta-actions { width: 100%; }
  .article-detail__cta-actions button,
  .article-detail__cta-actions a { width: 100%; justify-content: center; }
}

/* === legacy class aliases (cont-wrapper > ac-2/ac-3) === */
.article-detail__body .cont-wrapper {
  font-family: "Poppins", sans-serif;
}
.article-detail__body .ac-2 {
  margin: 0 0 22px;
}
.article-detail__body .ac-2 img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
}
.article-detail__body .ac-2 .doctor-photo {
  margin: 0;
}
.article-detail__body .ac-3 {
  color: #324158;
  font-size: 16px;
  line-height: 1.75;
}
.article-detail__body .ac-3 p {
  margin: 0 0 14px;
  color: #324158;
}
.article-detail__body .ac-3 p:last-child { margin-bottom: 0; }
.article-detail__body .ac-3 p:empty { display: none; }
.article-detail__body .ac-3 h2,
.article-detail__body .ac-3 h3,
.article-detail__body .ac-3 h4 {
  color: #163E40;
  font-weight: 700;
  margin: 28px 0 12px;
  line-height: 1.3;
}
.article-detail__body .ac-3 h2 { font-size: 24px; }
.article-detail__body .ac-3 h3 { font-size: 20px; }
.article-detail__body .ac-3 h4 { font-size: 17px; }
.article-detail__body .ac-3 ul,
.article-detail__body .ac-3 ol {
  margin: 0 0 16px 22px;
  padding: 0;
}
.article-detail__body .ac-3 li {
  margin-bottom: 6px;
  color: #324158;
  line-height: 1.6;
}
.article-detail__body .ac-3 a {
  color: #226468;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.article-detail__body .ac-3 a:hover { color: #6B237A; }
.article-detail__body .ac-3 strong { color: #163E40; font-weight: 700; }
.article-detail__body .ac-3 img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 18px 0;
  display: block;
}
.article-detail__body .ac-3 blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 3px solid #226468;
  background: rgba(34,100,104,.06);
  color: #163E40;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}
.article-detail__body .ac-3 table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
.article-detail__body .ac-3 th,
.article-detail__body .ac-3 td {
  padding: 10px 12px;
  border: 1px solid #e0e6ee;
  text-align: left;
}
.article-detail__body .ac-3 th {
  background: rgba(34,100,104,.08);
  color: #163E40;
  font-weight: 600;
}

/* strip legacy inline span colors so they inherit theme */
.article-detail__body .ac-3 span[style*="color:#000000"],
.article-detail__body .ac-3 span[style*="color: #000000"] {
  color: inherit !important;
}

/* === Override legacy inline styles (text-indent, line-height, margin via style="...") === */
/* Legacy exported Google Docs HTML with inline style="line-height:1.2;text-indent:42.5197pt;margin-top:0pt;margin-bottom:0pt;padding:0pt 0pt 10pt" on every <p> */
/* These !important rules restore proper typography despite inline styles */
.article-detail__body .ac-3 p {
  margin-bottom: 14px !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 1.7 !important;
  text-indent: 0 !important;
}
.article-detail__body .ac-3 p:empty {
  display: none !important;
  margin: 0 !important;
}
/* Restore <span> font-size that was set to 12pt inline */
.article-detail__body .ac-3 span {
  font-size: inherit !important;
  background-color: transparent !important;
  font-variant: inherit !important;
  vertical-align: baseline !important;
}
/* Fix bold <span> — legacy content used <span style="font-weight:700"> instead of <strong> */
.article-detail__body .ac-3 span[style*="font-weight:700"],
.article-detail__body .ac-3 span[style*="font-weight: 700"] {
  color: #163E40 !important;
  font-weight: 700 !important;
}

/* === ARTICLE DETAIL LAYOUT 2-COL === */
/* container default = 1500px (як на всіх інших сторінках сайту — header/footer/services/articles) */
.article-detail__layout {
  display: grid;
  grid-template-columns: minmax(0, 920px) 340px;
  gap: 56px;
  align-items: start;
  justify-content: center;
}
.article-detail__body {
  min-width: 0;
}
.article-detail__sidebar {
  position: sticky;
  top: 100px;
}
@media (max-width: 991px) {
  .article-detail__layout { grid-template-columns: 1fr; gap: 32px; justify-content: stretch; }
  .article-detail__sidebar { position: static; }
}

/* === META (date) === */
.article-detail__meta {
  margin: 28px 0 24px;
  padding-top: 18px;
  border-top: 1px solid #E5E7E7;
  font-size: 13px;
  color: #6A6C72;
}
.article-detail__meta .ac-1 {
  font-weight: 600;
  color: #226468;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* === SHARE BUTTONS === */
.article-detail__share {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  background: #F8FAFB;
  border-radius: 14px;
  margin: 24px 0 0;
}
.article-detail__share-label {
  font-weight: 600;
  font-size: 14px;
  color: #163E40;
  margin-right: 4px;
}
.share-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #226468;
  border: 1px solid #E5E7E7;
  text-decoration: none;
  font-size: 18px;
  transition: all .15s ease;
  cursor: pointer;
}
.share-btn:hover {
  background: #226468;
  color: #fff;
  border-color: #226468;
  transform: translateY(-2px);
}
.share-btn--fb:hover { background: #1877F2; border-color: #1877F2; }
.share-btn--tg:hover { background: #0088CC; border-color: #0088CC; }
.share-btn--vb:hover { background: #7360F2; border-color: #7360F2; }
.share-btn--copied { background: #226468; color: #fff; border-color: #226468; }

/* === SIDEBAR === */
.sidebar-block {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 14px rgba(22, 62, 64, 0.06), 0 1px 2px rgba(22, 62, 64, 0.04);
}
.sidebar-block__title {
  font-size: 16px;
  font-weight: 700;
  color: #163E40;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #E5E7E7;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sidebar-articles { list-style: none; margin: 0; padding: 0; }
.sidebar-article { margin-bottom: 16px; }
.sidebar-article:last-child { margin-bottom: 0; }
.sidebar-article a {
  display: flex;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  align-items: flex-start;
}
.sidebar-article__img {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: #f5f7f7;
}
.sidebar-article__img img {
  width: 100%; height: 100%; object-fit: cover;
}
.sidebar-article__body { flex: 1; min-width: 0; }
.sidebar-article__title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  color: #163E40;
  margin: 0 0 4px;
}
.sidebar-article__date {
  font-size: 11px;
  color: #6A6C72;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sidebar-article a:hover .sidebar-article__title {
  color: #226468;
}

/* === RELATED ARTICLES === */
.related-articles {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid #E5E7E7;
}
.related-articles__title {
  font-size: 24px;
  font-weight: 700;
  color: #163E40;
  margin: 0 0 28px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.related-articles__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
@media (max-width: 991px) {
  .related-articles__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .related-articles__grid { grid-template-columns: 1fr; }
}
