/* css for section elements: title/text/footnote/tooltip */
.section-container {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  border: 1px solid silver;
  border-radius: 5px;

  /* Do not use side margins which will override parent padding */
  padding: .5em 1em 1em 1em;
  box-shadow: 3px 3px 8px silver;
  z-index: 0;
  width: fit-content;
  height: fit-content;
  background-color: var(--section_background_color);

  /* TESTING: */
  /*background-color: red;*/
}


.section-body-container {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  flex: 0 0 auto;
  row-gap: 1em;
  column-gap: 2em;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;

  /* TESTING: */
  /*background-color: hotpink;*/
}

.section-content-container {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border: 1px solid silver;
  border-radius: 5px;
    padding: .5em 1em 1em 1em;
  background-color: var(--section_background_color);
  box-shadow: 3px 3px 8px silver;
  z-index: 0;
  flex-shrink: 1;
  word-wrap: break-word;
  white-space: normal;
  width: fit-content;
  height: fit-content;
  overflow: clip;
  min-width: 0; /* possible fix for Firefox */
  min-height: 0;


  /* TESTING: */
  /*color: darkgreen;*/
  /*background-color: aqua;*/
}

.section-content-container.single {
  border: none;
  box-shadow: none;
  background-color: white;
  margin: 0;
  padding: 0;
  /* TESTING: */
  /*background-color: blue;*/
}

/* Apply styling to section-content-container divs that have a child
   with ID starting with 'content-toggle-container' and class 'display-none' */
.section-content-container:has([id^='content-toggle-container'].display-none) {
  padding-bottom: 0;
  border-bottom: 1px solid #ccc;
}

.section-header {
  /*padding: .25em 0;*/
  width: 100%;
}

/*.section-header:empty {*/
/*  padding: 0;*/
/*}*/

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3em;
  cursor: pointer;
  width: 100%;
  padding: .25em 0 .5em 0;
}

.section-title {
  font-size: 1em;
  font-weight: 600;
}

.section-description {
  display: inline-block;
  font-size: .9em;
  padding: .5em 0;
  width: 100%;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
  text-indent: 0;
}

.section-description:empty {
  padding: 0;
}

.section-tab-row {
  /* used for section-level tabs in page_header.html */
  display: flex;
  border-top: 1px solid silver;
  margin: 0;
  padding: 0 2em 1em 2em;
  width: fit-content;
  pointer-events: auto;
  z-index: 10;
  align-items: stretch;
}

.content-tab-row {
  /* used for content-level tabs in section_body.html */
  display: flex;
  border-top: 1px solid silver;
  margin: 0 -1em 1em -1em;
  padding: 0 1em;
}

.section-tab, .content-tab {
  cursor: pointer;
  vertical-align: center;
  /*justify-content: center;*/
  text-align: center;
  line-height: 1.2em;
  font-size: .95em;
  width: fit-content;
  white-space: normal;
  padding: 5px .5em 5px .5em;
  border-width: 1px 1px 1px 1px;
  border-color: silver;
  border-style: solid;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 3px 3px silver;
  background-color: #e6e6e6;
  transition: background-color 0.3s ease;
}

.section-tab.active, .content-tab.active {
  /* Styling for active tab */
  padding: 6px .5em 5px .5em;
  background-color: white;
  font-weight: 600;
  border-top: 1px solid white;
  margin-top: -1px;
  position: relative;
}

.section-body {
  min-width: 0; /* possible fix for Firefox */
  min-height: 0; /* possible fix for Firefox */
}

.section-footnote {
  font-size: .8em;
  font-style: italic;
  max-width: 100%;
  padding: 0 1em;
}


.filters-row {
  display: flex;
  justify-content: space-between;
  /*margin: .25em 0;*/
}

.filters-row-left {
  display: flex;
  justify-content: flex-start;
  gap: 1em;
  align-items: center;
  font-weight: 500;
  padding: .25em 0;
}

.filters-row-right {
  display: flex;
  justify-content: flex-end;
  gap: 2em;
  align-items: center;
  padding: .25em 0;
}

/* Hide empty flex children completely */
.filters-row-left:not(:has(*)),
.filters-row-right:not(:has(*)) {
  display: none;
}

/* Special case for when both are empty */
.filters-row:has(.filters-row-left:not(:has(*))):has(.filters-row-right:not(:has(*))) {
  display: none;
}

/* ------------ Modifier classes --------------- */


.gap-2em {
  margin-top: 2em;
  /*gap: 2em;*/
}

.no-fit-width {
  width: 100% !important;
  max-width: 100% !important;
  align-self: stretch !important;  /* ensures full width in flex columns */
  box-sizing: border-box;
}

.no-fit-height {
  height: auto !important;
  max-height: none !important;
  flex-grow: 1;              /* optional: lets it expand vertically in a flex column */
  min-height: 0;             /* prevents flex overflow issues */
}

.invisible-container {
  border: none;
  box-shadow: none;
  background-color: transparent;
  margin: 0;
  padding: 0;
}

.add-border-top {
  border-top: 1px solid silver;
  border-radius: 0;
}
