/* Editorial Q&A: load after community-showcase.css and site-polish.css.
   Presentation only: all original questions, answers, sources and tables remain in flow. */
.faq.education-section {
  background: #F6F7F1 !important; /* Overrides the earlier section background !important. */
}
.faq.education-section.education-food { background: #F0F5EE !important; }
.faq#diabetes-guide { background: #F6F7F1 !important; }
.faq#faq { background: #FAF8F3 !important; }

.faq .faq-inner.education-grid,
.faq .faq-inner.faq-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 24px;
  width: 100%;
  max-width: 1120px;
  min-width: 0;
  margin: 0 auto;
}

.faq .faq-inner > .section-header {
  grid-column: 1 / -1;
  max-width: 780px;
  margin: 0 0 8px !important; /* Existing guide and FAQ headers have inline margins. */
  padding: 20px 0 0;
  border-top: 2px solid #D8E5D9;
  text-align: left;
  opacity: 1;
  transform: none;
}
.faq .faq-inner > .section-header .section-label {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 12px;
  border: 1px solid #D8E5D9;
  border-radius: 999px;
  background: #EDF4EA;
  color: #1F6958;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: 0.035em;
}
.faq .faq-inner > .section-header .section-title {
  margin: 0 0 14px;
  color: #243D35;
  font-size: clamp(30px, 3.5vw, 38px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.035em;
  text-align: left;
}
.faq .faq-inner > .section-header .section-desc {
  max-width: 700px;
  margin: 0;
  color: #4B6055;
  font-size: 16px;
  line-height: 1.7;
}

.faq .faq-inner .faq-item,
.faq#faq .faq-inner .faq-item {
  box-sizing: border-box;
  min-width: 0;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 24px;
  border: 1px solid #D8E5D9;
  border-radius: 22px;
  background: #FFFFFF;
  box-shadow: 0 6px 20px rgba(36, 61, 53, 0.045);
  overflow: visible;
  visibility: visible;
  opacity: 1;
  cursor: default;
  transform: none;
  transition: none;
}
.faq .faq-inner .faq-item:hover,
.faq#faq .faq-inner .faq-item:hover {
  box-shadow: 0 6px 20px rgba(36, 61, 53, 0.045);
  transform: none;
}

/* The rounded header is its own pane, not a flat label above a divider.
   Negative margins meet the card's border without clipping any content. */
.faq .faq-inner .faq-item .faq-question {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-sizing: border-box;
  min-width: 0;
  height: auto;
  max-height: none;
  margin: -24px -24px 0;
  padding: 20px 22px;
  border: 0;
  border-bottom: 1px solid #D8E5D9;
  border-radius: 21px 21px 0 0;
  background: #EDF4EA;
  color: #243D35;
  font-family: inherit;
  font-size: 20px;
  font-weight: 650;
  font-style: normal;
  line-height: 1.45;
  letter-spacing: -0.015em;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: default;
}
.faq .faq-inner .faq-item .faq-question::before {
  content: "Q";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin: 1px 0 0;
  border-radius: 9px;
  background: #1F6958;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}
/* Answers are always open; remove the legacy plus/accordion affordance. */
.faq .faq-inner .faq-item .faq-question::after { content: none; }

.faq .faq-inner .faq-item .faq-answer {
  display: block;
  min-width: 0;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 20px 0 0;
  border: 0;
  background: #FFFFFF;
  color: #4B6055;
  font-size: 16px;
  line-height: 1.7;
  overflow: visible;
  visibility: visible;
  opacity: 1;
  white-space: normal;
  overflow-wrap: anywhere;
}
.faq .faq-inner .faq-item .faq-answer::before {
  content: "Answer";
  display: block;
  margin: 0 0 10px;
  color: #1F6958;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}
.faq .faq-inner .faq-item .faq-answer p {
  margin: 0 0 12px;
  color: #4B6055;
  font-size: 16px;
  line-height: 1.7;
}
.faq .faq-inner .faq-item .faq-answer p:last-child { margin-bottom: 0; }
.faq .faq-inner .faq-item .faq-answer .education-source {
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid #E3EBE2;
  color: #4B6055;
  font-size: 14px !important; /* Earlier medical source typography is important. */
  line-height: 1.7 !important;
}
.faq .faq-inner .faq-item .faq-answer a {
  color: #1F6958 !important; /* Retains the earlier link override and inline privacy color. */
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.faq .faq-inner .faq-item .faq-answer .education-source a { font-size: 14px; }
.faq .faq-inner a:focus-visible {
  outline: 3px solid #1F6958;
  outline-offset: 3px;
  border-radius: 3px;
}

.faq .faq-inner .education-note {
  grid-column: 1 / -1;
  min-width: 0;
  max-height: none;
  overflow: visible;
}
.faq .faq-inner .faq-answer .glucose-reference {
  max-width: 100%;
  width: 100%;
  table-layout: fixed;
  overflow-wrap: anywhere;
}
/* Only a dedicated table wrapper may scroll horizontally; never the answer. */
.faq .faq-inner .faq-answer .glucose-level-table {
  max-width: 100%;
  overflow-x: auto;
}

@media (max-width: 700px) {
  .faq .faq-inner.education-grid,
  .faq .faq-inner.faq-card-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .faq .faq-inner .faq-item,
  .faq#faq .faq-inner .faq-item { padding: 18px; }
  .faq .faq-inner .faq-item .faq-question {
    margin: -18px -18px 0;
    padding: 20px 18px;
    font-size: 19px;
  }
  .faq .faq-inner > .section-header .section-label {
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
  }
}
