/* Public Documents Page Styles */

.tk-public-shell {
  padding: 1.5rem 0 3rem;
}

/* Hero Section */
.tk-department-hero {
  padding: 1rem 0;
  border-radius: 0;
}

.tk-department-hero.tk-card-surface {
  border-radius: 0;
}

.tk-department-hero > .container {
  max-width: none;
}

.tk-department-hero-grid {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 5rem;
  align-items: center;
  padding-inline: 2.5rem;
}

.tk-department-hero-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.tk-department-hero-logo-image {
  width: 100%;
  max-width: 120px;
  height: auto;
  display: block;
  border-radius: 8px;
}

.tk-department-hero-content {
  min-width: 0;
}

.tk-department-hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: #003d82;
}

.tk-department-hero-description {
  font-size: 1.125rem;
  line-height: 1.6;
  color: #555;
  margin: 0;
}

/* Documents Container */
.tk-documents-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Document Group */
.tk-document-group {
  background: white;
  border-radius: 0.5rem;
  border: 1px solid var(--bs-border-color);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tk-document-group-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f5f7fb 0%, #f0f4fa 100%);
  border-bottom: 1px solid var(--bs-border-color);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.tk-document-group-header:hover {
  background: linear-gradient(135deg, #f0f4fa 0%, #ebf0f8 100%);
}

.tk-document-group-title {
  flex: 1;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--bs-emphasis-color);
}

.tk-document-group-toggle-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  transition: transform 0.2s ease;
}

.tk-document-group-toggle-icon img {
  width: 100%;
  height: 100%;
}

.tk-document-group.is-collapsed .tk-document-group-toggle-icon {
  transform: rotate(-90deg);
}

.tk-count-badge {
  flex-shrink: 0;
}

/* Group Content */
.tk-document-group-content {
  padding: 1.5rem;
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.tk-document-group.is-collapsed .tk-document-group-content {
  max-height: 0;
  padding: 0 1.5rem;
  overflow: hidden;
}

/* Document Grid */
.tk-document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.5rem;
}

/* Document Thumbnail */
.tk-document-thumbnail {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tk-document-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bs-gray-100);
  border-radius: 0.375rem;
  border: 1px solid var(--bs-border-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tk-document-thumbnail:hover .tk-document-preview {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tk-document-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tk-document-preview-icon {
  width: 3rem;
  height: 3rem;
  opacity: 0.5;
}

/* Hover Overlay */
.tk-document-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.tk-document-thumbnail:hover .tk-document-overlay {
  opacity: 1;
  pointer-events: auto;
}

.tk-document-overlay .tk-season-icon-btn {
  background-color: white;
  color: #333;
}

.tk-document-overlay .tk-season-icon-btn:hover {
  background-color: var(--bs-primary);
  color: white;
}

/* Document Name */
.tk-document-name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--bs-body-color);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}

/* Empty State */
.tk-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--bs-secondary-color);
}

/* Responsive */
@media (max-width: 768px) {
  .tk-department-hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-inline: 0;
    text-align: center;
  }

  .tk-department-hero-title {
    font-size: 1.75rem;
  }

  .tk-document-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
  }

  .tk-document-group-header {
    padding: 1rem;
  }

  .tk-document-group-content {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .tk-department-hero {
    padding: 2rem 0;
  }

  .tk-department-hero-title {
    font-size: 1.5rem;
  }

  .tk-document-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
  }

  .tk-document-thumbnail {
    gap: 0.5rem;
  }

  .tk-document-name {
    font-size: 0.75rem;
  }
}
