@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
  --accent: #bf6275;
  --accent-dark: #a3485c;
  --purple: #9e2e7f;
  --accordion-hover: #eb4c4c;
  --accordion-active: #e66666;
  --text: #2b2b2b;
  --bg-alt: #faf6f7;
  --border: #e8d9dc;
  --max-width: 1100px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Roboto', Arial, sans-serif;
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header-top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
}
.logo img { height: 56px; width: auto; }
.site-tagline {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--accent-dark);
  flex: 1;
  min-width: 0;
}

.main-nav {
  background: var(--accent);
}
.main-nav .container {
  display: flex;
}
.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  list-style: none;
  margin: 0;
  padding: 14px 0;
}
.main-nav a.nav-highlight { white-space: nowrap; }
.main-nav a {
  color: #fff;
  font-weight: 500;
}
.main-nav a.active,
.main-nav a:hover {
  text-decoration: underline;
}
.main-nav a.nav-highlight {
  background: #fff;
  color: var(--accordion-hover);
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 4px;
}
.main-nav a.nav-highlight:hover {
  background: var(--bg-alt);
  text-decoration: none;
}

/* Hero: фото (вирізка без фону) зліва + симптоми справа */
.hero { overflow: hidden; }
.hero-inner {
  display: grid;
  grid-template-columns: 5fr 7fr;
  align-items: end;
  gap: 0 36px;
}
.hero-photo { align-self: end; }
.hero-photo img {
  width: 100%;
  height: auto; /* перекриває height-атрибут, який стоїть проти layout shift */
  max-width: 400px;
  margin: 30px auto 0;
}
.hero-right { padding-bottom: 10px; }
.hero-title {
  color: var(--purple);
  font-size: 1.45rem;
  margin: 24px 0 0;
  text-align: center;
}
.symptoms.hero-symptoms {
  grid-template-columns: repeat(3, 1fr);
  gap: 26px 16px;
  padding: 24px 0 34px;
}
.hero-symptoms .symptom {
  animation-name: symptomPop;
  animation-duration: 0.55s;
  animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes symptomPop {
  from { opacity: 0; transform: scale(0.4) translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* Symptom strip */
.symptoms {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  padding: 40px 0;
}
.symptom {
  text-align: center;
}
.symptom-icon {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.symptom-icon img { max-height: 90px; max-width: 100%; width: auto; margin: 0; }
.symptom h5 {
  margin: 0;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
}

@keyframes symptomFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.symptom {
  opacity: 0;
  animation: symptomFadeIn 0.8s ease forwards;
}
.symptoms .symptom:nth-child(1) { animation-delay: 0s; }
.symptoms .symptom:nth-child(2) { animation-delay: 0.5s; }
.symptoms .symptom:nth-child(3) { animation-delay: 1s; }
.symptoms .symptom:nth-child(4) { animation-delay: 1.5s; }
.symptoms .symptom:nth-child(5) { animation-delay: 2s; }
.symptoms .symptom:nth-child(6) { animation-delay: 2.5s; }

/* Section headings */
.section-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  padding: 22px 0;
  color: var(--purple);
}
.section-title.on-bg {
  background: var(--bg-alt);
}
.section-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.section-title-link:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Accordion */
.accordion-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 40px;
  padding: 30px 0 50px;
}
.accordion-group.single-column { grid-template-columns: 1fr; }

details.accordion-item {
  border-bottom: 1px solid var(--border);
}
details.accordion-item summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 4px;
  font-weight: 500;
  list-style: none;
  transition: color 0.15s ease;
}
details.accordion-item summary::-webkit-details-marker { display: none; }
.accordion-title {
  flex: 1;
  color: inherit;
  text-decoration: none;
}
.accordion-title:hover {
  text-decoration: none;
}
details.accordion-item summary::after {
  content: '\203A';
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
details.accordion-item summary:hover {
  color: var(--accordion-hover);
}
details.accordion-item[open] summary,
details.accordion-item.is-open summary {
  color: var(--accordion-active);
}
details.accordion-item[open] summary::after,
details.accordion-item.is-open summary::after {
  transform: rotate(90deg);
}
.accordion-placeholder {
  color: #999;
  font-style: italic;
}
.source-note {
  font-size: 0.8rem;
  color: #999;
  margin-top: 16px;
}
.accordion-content h3 {
  font-size: 1.05rem;
  color: var(--accent-dark);
  margin: 18px 0 6px;
}
.accordion-content .lab-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 18px 16px;
  margin: 16px 0;
  background: var(--bg-alt);
}
.accordion-content .lab-card h3 { margin-top: 14px; }
.accordion-content .lab-card h3 a { color: inherit; text-decoration: none; }
.accordion-content .lab-card h3 a:hover { text-decoration: underline; }
.accordion-content .lab-card .lab-address {
  color: #666;
  font-size: 0.9rem;
  margin-top: 12px;
}
.accordion-content {
  padding: 0 4px 18px;
}
.accordion-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  font-size: 0.92rem;
}
.accordion-content table td,
.accordion-content table th {
  border: 1px solid var(--border);
  padding: 8px 10px;
  vertical-align: top;
}
.accordion-content img { margin: 12px 0; }
.accordion-content .img-pair {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.accordion-content .img-pair figure { margin: 0; flex: 1; min-width: 200px; }
.accordion-content .img-pair figcaption { text-align: center; margin-top: 6px; font-size: 0.9rem; }
.accordion-content .cta-button {
  display: inline-block;
  margin-top: 14px;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 4px;
  font-weight: 500;
}
.accordion-content .cta-button:hover {
  background: var(--accent-dark);
  text-decoration: none;
}

/* Video section */
.videos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 30px 0 50px;
}
.video-card { text-align: center; }
.video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}
.video-frame iframe,
.video-frame .video-placeholder {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  border: 0;
}
.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 0.85rem;
  padding: 10px;
  text-align: center;
}
.video-card p { font-weight: 700; margin-top: 10px; }

/* Links list */
.links-list {
  list-style: none;
  margin: 0;
  padding: 30px 0 50px;
  text-align: center;
}
.links-list li { margin: 8px 0; }

/* Resource list (drug safety etc.) */
.resource-list {
  list-style: none;
  margin: 20px auto 0;
  padding: 0 0 40px;
  max-width: 700px;
}
.resource-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.resource-list li:last-child { border-bottom: none; }
.resource-list a {
  font-weight: 700;
  font-size: 1.05rem;
}
.resource-list .desc {
  display: block;
  color: var(--text);
  font-size: 0.88rem;
  margin-top: 4px;
}

/* Diagnostics / Contacts pages */
.page-content {
  padding-top: 30px;
  padding-bottom: 60px;
}
.page-content h2 { color: var(--accent-dark); }

.contact-box {
  text-align: center;
  padding: 60px 0;
}
.contact-box a {
  font-size: 1.3rem;
  font-weight: 500;
}

/* Emergency page */
.emergency-toc {
  margin: 0 0 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
}
.emergency-toc a {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.emergency-toc a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}
.emergency-block {
  margin: 0 0 34px;
}
.emergency-block h2 {
  color: var(--purple);
  font-size: 1.3rem;
  margin-bottom: 10px;
}
.emergency-block h3 {
  color: var(--accent-dark);
  font-size: 1.08rem;
  margin: 22px 0 6px;
}
.emergency-block ul { padding-left: 20px; }
.emergency-block li { margin: 6px 0; }
.emergency-alert {
  background: var(--bg-alt);
  border-left: 4px solid var(--accordion-hover);
  border-radius: 4px;
  padding: 20px 24px;
}
.emergency-alert h2 { color: var(--accordion-hover); margin-top: 0; }
.text-warn { color: var(--accordion-hover); font-weight: 700; }
.emergency-block h2 a.heading-link { color: inherit; text-decoration: none; transition: color 0.15s ease; }
.emergency-block h2 a.heading-link:hover { color: var(--accent); text-decoration: none; }
.rep-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px 22px;
  margin-top: 16px;
  max-width: 600px;
  background: var(--bg-alt);
}
.rep-card p { margin: 2px 0; }
.rep-name { font-weight: 700; font-size: 1.1rem; color: var(--accent-dark); }
.rep-position { font-weight: 500; }
.rep-address { color: #666; font-size: 0.92rem; }
.rep-contacts {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.rep-contacts li { margin: 4px 0; overflow-wrap: break-word; }

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
  font-size: 0.85rem;
  color: #777;
}
footer.site-footer p { margin: 4px 0; }
.footer-contact a { font-weight: 500; }

/* Responsive */
@media (max-width: 900px) {
  .symptoms { grid-template-columns: repeat(3, 1fr); }
  /* Hero на мобільному: фото — фон-шапка, обличчя чисте, низ розчиняється в білий,
     симптоми "вспливають" поверх */
  .hero-inner { display: block; position: relative; }
  .hero-photo {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 430px;
  }
  .hero-photo img {
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    object-fit: cover;
    object-position: 50% 18%;
  }
  .hero-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0) 42%,
      rgba(255, 255, 255, 0.72) 68%,
      #fff 97%);
  }
  .hero-right {
    position: relative;
    z-index: 1;
    padding-top: 285px;
    padding-bottom: 0;
  }
  .hero-title {
    margin-top: 0;
    text-shadow: 0 1px 10px #fff, 0 0 4px #fff;
  }
  .accordion-group { grid-template-columns: 1fr; }
  .videos { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .symptoms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Hero-сітка лишається 3 колонки і на вузьких екранах (як у затвердженому макеті) */
  .symptoms.hero-symptoms { grid-template-columns: repeat(3, 1fr); }
  .main-nav ul { width: 100%; justify-content: center; gap: 10px 16px; }
  .header-top { gap: 12px; padding: 12px 16px; }
  .logo img { height: 44px; }
  .site-tagline { font-size: 1rem; }
  /* Банер, зміст і картки — на всю ширину екрана */
  .emergency-alert { margin-left: -20px; margin-right: -20px; border-radius: 0; }
  .rep-card { margin-left: -20px; margin-right: -20px; border-radius: 0; }
  .emergency-toc { margin-left: -20px; margin-right: -20px; }
}
