/* Gallery */

/* Wrapper */

.media-gallery {
  margin: 1.5rem 0;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Hash navigation highlight effect */
@keyframes slideHighlight {
  0% { box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.5); }
  100% { box-shadow: none; }
}

.gallery-slide.hash-target {
  animation: slideHighlight 1.5s ease-out;
}

/* TopBar */

.gallery-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  border-left: 3px solid #e0e0e0;
  border-right: 3px solid #e0e0e0;
  border-top: 3px solid #e0e0e0;
}

/* Header */

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--colorSundK-primary-blue);
  color: white;
  border-left: 3px solid #465571;
  border-right: 3px solid #465571;
  height: 100px;
}

.gallery-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.gallery-title {
}

.gallery-description {
  font-weight: 700;
  font-size: 0.85rem;
  opacity: 0.9;
}

.gallery-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gallery-nav.single-item {
  display: none;
}

.gallery-nav-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.gallery-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
}

.gallery-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gallery-counter {
  font-size: 0.85rem;
  min-width: 50px;
  text-align: center;
}

/* Slides */

.gallery-slides {
  position: relative;
  min-height: 300px;
  background: #fafafa;
  overflow: auto;
  border-left: 3px solid #e0e0e0;
  border-right: 3px solid #e0e0e0;
}

.gallery-slide {
  display: none;
  text-align: center;
  min-height: 400px;
}

.gallery-slide.active {
  display: block;
}

.gallery-slide img {
  max-width: 100%;
  max-height: 85vh;
  height: auto;
  margin: 0 auto;
  display: block;
}

.slide-caption {
    margin: 1rem;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    border-top: 1px solid black;
    border-bottom: 1px solid black;
    padding: 0.8rem 0rem;
}

/* Gallery Toolbar */

.gallery-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}

.gallery-toolbar-btn {
  padding: 0.3rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  color: var(--colorSundK-primary-blue);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.gallery-toolbar-btn:hover {
  background: var(--colorSundK-light-blue-60);
}

.gallery-search {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}

.gallery-search label {
  font-size: 0.75rem;
  color: #666;
}

.gallery-search input {
  padding: 0.3rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.75rem;
  width: 120px;
}

.gallery-search input:focus {
  outline: none;
  border-color: var(--colorSundK-primary-blue);
}

/* Overview - Index */

.gallery-overview {
  background: #fafafa;
  border-left: 3px solid #e0e0e0;
  border-right: 3px solid #e0e0e0;
  border-bottom: 3px solid #e0e0e0;
}

.gallery-overview-header {
  display: flex;
  justify-content: center;
  padding: 0.5rem;
}

.gallery-overview-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: white;
  color: var(--colorSundK-primary-blue);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 153px;
  justify-content: center;
}

.gallery-overview-toggle:hover {
  background: var(--colorSundK-light-blue-60);
}

.gallery-overview-toggle i {
  transition: transform 0.2s;
}

.gallery-overview-toggle.expanded i {
  transform: rotate(45deg);
}

.gallery-overview-content {
  display: none;
  border-top: 1px solid #e0e0e0;
}

.gallery-overview-content.visible {
  display: block;
}

.gallery-overview-title {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1rem 0.5rem;
  color: var(--colorSundK-primary-blue);
  border-bottom: 1px solid #e0e0e0;
  background: white;
}

.gallery-overview-list {
  list-style: none;
  margin: 0px !important;
  padding: 0px !important;
}

.gallery-overview-list li {
  display: flex;
  align-items: stretch; /* Changed from center */
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.15s;
}

.gallery-overview-list li:last-child {
  border-bottom: none;
}

.gallery-overview-list li:hover {
  background: var(--colorSundK-light-blue-60);
}

.gallery-overview-list li.active {
  background: var(--colorSundK-light-blue-60);
}

.overview-item-number {
  width: 100px;
  padding: 0.6rem 0.75rem;
  text-align: center;
  color: #666;
  background: #f0f0f0;
  border-right: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overview-item-type {
  min-width: 50px;
  padding: 0.6rem 0.5rem;
  font-size: 0.75rem;
  color: white;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overview-item-type.type-tabel {
  background: var(--colorSundK-primary-blue);
}

.overview-item-type.type-graf {
  background: var(--colorSundK-primary-blue);
}

.overview-item-type.type-billede {
  background: var(--colorSundK-primary-blue);
}

.overview-item-type.type-download {
  background: var(--colorSundK-primary-blue);
}

.overview-item-title {
  flex: 1;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  color: var(--colorSundK-primary-blue);
}

/* Gallery Buttons */

.gallery-topbar-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #ddd;
  border-radius: var(--btn-roundness);
  background: white;
  color: black;
  font-size: var(--font-size-7);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gallery-topbar-btn:hover {
  background: var(--colorSundK-light-blue-60);
  border-color: var(--colorSundK-primary-blue);
}

/* Download View */

.gallery-slide-download {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.gallery-download-icon {
  font-size: 3rem;
  color: var(--colorSundK-primary-blue);
  margin-bottom: 1.5rem;
}

.gallery-download-message {
  font-size: 1rem;
  color: #666;
  margin-bottom: 1rem;
}

.gallery-download-filename {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--colorSundK-primary-blue);
  margin-bottom: 1.5rem;
  word-break: break-word;
  max-width: 90%;
}

.gallery-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  background: var(--colorSundK-primary-blue);
  color: white;
  border: none;
  border-radius: var(--btn-roundness);
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.gallery-download-btn:hover {
  background: var(--colorSundK-secondary-dark-purple);
  color: white;
  transform: translateY(-1px);
}

/* Gallery table */

.gallery-table {
  max-width: 100%;
  margin: auto;
}

.gallery-table th, .gallery-table td {
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  min-width: 100px !important;
  max-width: 250px !important;
}

.gallery-table th {
  cursor: pointer;
}

.gallery-table tbody tr:hover td {
  background-color: #f0f5fa !important;
}

/* Optional: Skip hover on empty/spacer rows */
.gallery-table tbody tr:hover td:empty {
  background-color: transparent !important;
}

.gallery-table-container {
  overflow: auto;
  max-height: 60vh;
  padding: 0rem 1.5rem;
}

.gallery-img-container {
  overflow: auto;
  padding: 1.5rem 1.5rem;
}

.gallery-download-container {
  overflow: auto;
  max-height: 30vh;
  padding: 1.5rem 1.5rem;
}

/* Tables Gallery - Remove height restrictions for tables */

.tables-gallery .gallery-slides {
  min-height: 300px;
  max-height: none; /* Remove height limit */
  height: auto; /* Allow natural height */
  overflow-y: visible; /* No vertical scrollbar */
  overflow-x: auto; /* Keep horizontal scrollbar for wide tables */
}

.tables-gallery .gallery-slide {
  min-height: 400px;
  max-height: none; /* Remove height limit */
  height: auto; /* Allow natural height */
}

.tables-gallery .gallery-table-container {
  max-height: none; /* Allow table to expand fully */
  overflow-x: auto; /* Horizontal scroll for wide tables */
  overflow-y: visible; /* No vertical scrollbar */
}
