/*-------------------------------------------
  0) Utilities & Overrides
-------------------------------------------*/
/* Hide the PhotoSwipe “Share”, zoom, and frame-expand buttons */
.e-eicon-share-arrow,
.e-eicon-zoom-in-bold,
.e-eicon-frame-expand {
  display: none !important;
}

/*-------------------------------------------
  1) Glossary Table Base
-------------------------------------------*/
.sg-glossary-table {
  width: 100% !important;
  table-layout: fixed;
  border-collapse: collapse;
  margin-bottom: 2em;
  font-family: Arial, sans-serif;
}

/*-------------------------------------------
  2) Column Widths
-------------------------------------------*/
/* Force 4 equal columns */
.sg-glossary-table thead th:nth-child(1),
.sg-glossary-table tbody td:nth-child(1),
.sg-glossary-table thead th:nth-child(2),
.sg-glossary-table tbody td:nth-child(2),
.sg-glossary-table thead th:nth-child(3),
.sg-glossary-table tbody td:nth-child(3),
.sg-glossary-table thead th:nth-child(4),
.sg-glossary-table tbody td:nth-child(4) {
  width: 25%;
}

/*-------------------------------------------
  3) Header Styling
-------------------------------------------*/
.sg-glossary-table thead tr th {
  background-color: #0073aa;
  color: #fff;
  padding: 10px;
  border: 1px solid #444;
  text-align: left;
}

/*-------------------------------------------
  4) Cell Wrapping & Typography
-------------------------------------------*/
.sg-glossary-table th,
.sg-glossary-table td {
  padding: 10px;
  white-space: normal;        /* wrap at spaces */
  word-break: keep-all;       /* don’t split words */
  overflow-wrap: break-word;  /* fallback for very long strings */
  hyphens: none;              /* no hyphens */
  font-size: clamp(12px, 2.5vw, 16px);
  line-height: 1.2;
}

/*-------------------------------------------
  5) Term Rows (clickable)
-------------------------------------------*/
.sg-glossary-table tbody tr.sg-term-header {
  border: 1px solid #ddd;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}
.sg-glossary-table tbody tr.sg-term-header.sg-odd { background: #f9f9f9; }
.sg-glossary-table tbody tr.sg-term-header.sg-even { background: #e9e9e9; }
.sg-glossary-table tbody tr.sg-term-header:hover       { background: #ddd; }

/* Caret arrows */
.sg-glossary-table tbody tr.sg-term-header td:first-child {
  position: relative;
  padding-left: 24px;
}
.sg-glossary-table tbody tr.sg-term-header td:first-child::before {
  content: "▶";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 0.9em;
}
.sg-glossary-table tbody tr.sg-term-header.expanded td:first-child::before {
  content: "▼";
  color: #333;
}

/* Per-cell styling in term rows */
.sg-glossary-table tbody tr.sg-term-header td:nth-child(2) { /* Definition */ }
.sg-glossary-table tbody tr.sg-term-header td:nth-child(3) { /* Example */ font-style: italic; }
.sg-glossary-table tbody tr.sg-term-header td:nth-child(4) { /* Translation */ }

/*-------------------------------------------
  6) Media Rows (hidden by default)
-------------------------------------------*/
.sg-glossary-table tbody tr.sg-media-labels,
.sg-glossary-table tbody tr.sg-media-values {
  display: none;
}
.sg-glossary-table tbody tr.sg-media-labels td {
  background: #eef1f5;
  border: 1px solid #ddd;
  font-weight: bold;
  text-align: center;
  padding: 8px;
}
.sg-glossary-table tbody tr.sg-media-values td {
  background: #fff;
  border: 1px solid #ddd;
  text-align: center;
  vertical-align: top;
  padding: 8px;
}

/* Make media responsive */
.sg-glossary-table td img,
.sg-glossary-table td iframe,
.sg-glossary-table td audio {
  max-width: 100%;
  height: auto;
}

/*-------------------------------------------
  7) “Expand All” Button
-------------------------------------------*/
.sg-toggle-all {
  display: inline-block;
  margin-bottom: 6px;
  padding: 4px 10px;
  background: #0073aa;
  color: #fff;
  border: 1px solid #005f8d;
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.85em;
  transition: background 0.2s;
}
.sg-toggle-all:hover {
  background: #005f8d;
}

/*-------------------------------------------
  8) Lightbox Modal
-------------------------------------------*/
.sg-image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  padding-top: 40px;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: auto;
  background: rgba(0,0,0,0.8);
}
.sg-image-modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  border: 3px solid #fff;
  border-radius: 4px;
}
.sg-image-modal-caption {
  margin: 10px auto;
  max-width: 700px;
  text-align: center;
  color: #f1f1f1;
  font-size: 14px;
}
.sg-image-modal-close {
  position: absolute;
  top: 20px; right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}
.sg-image-modal-close:hover {
  color: #bbb;
}

/* Responsive modal image */
@media screen and (max-width: 700px) {
  .sg-image-modal-content {
    width: 100%;
  }
}
