/**
 * @file
 * Styles for group page display.
 */

/* Group Container */
.group {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

@media (min-width: 768px) {
  .group {
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto 1fr;
    gap: 2rem;
    padding: 2rem;
  }
}

/* Group Header */
.group-header {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e5e5;
}

.group-image {
  flex-shrink: 0;
}

.group-image img {
  max-width: 200px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.group-info {
  flex: 1;
  min-width: 250px;
}

.group-title {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
}

.group-official-name {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

/* Group Type Info Link */
.group-type-link {
  margin-bottom: 0.75rem;
}

.group-type-link a {
  font-size: 0.875rem;
  color: #1F5A96;
  text-decoration: none;
}

.group-type-link a:hover {
  text-decoration: underline;
}

/* Group Labels */
.group-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.group-label-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #1F5A96;
  background: #E8F0F7;
  border-radius: 9999px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.group-label-tag:hover {
  background: #1F5A96;
  color: #fff;
  text-decoration: none;
}

.group-description {
  color: #333;
  line-height: 1.6;
}

/* Group Meta (Sidebar) */
.group-meta {
  grid-column: 2;
  grid-row: 2;
}

@media (max-width: 767px) {
  .group-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
  }

  .group-meta > * {
    flex: 1;
    min-width: 150px;
  }
}

.group-meta-heading {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
}

/* Managers */
.group-managers {
  margin-bottom: 1.5rem;
}

.manager-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.manager-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.manager-picture {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.manager-name {
  color: #1F5A96;
  text-decoration: none;
}

.manager-name:hover {
  text-decoration: underline;
}

/* Member Count */
.group-member-count {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: center;
}

.count-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #333;
}

.count-label {
  display: block;
  font-size: 0.85rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Distribution Rules */
.group-rules {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.rules-list {
  margin: 0;
}

.rules-list dt {
  font-weight: 600;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.rules-list dd {
  margin: 0 0 0.75rem;
  color: #333;
}

.rules-list dd:last-child {
  margin-bottom: 0;
}

/* Landing Page Link */
.group-landing-page {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e5e5;
}

.landing-page-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #1F5A96 0%, #1B4B8A 100%);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.2s ease, transform 0.1s ease;
}

.landing-page-link:hover {
  background: linear-gradient(135deg, #1B4B8A 0%, #163563 100%);
  color: white;
  text-decoration: none;
}

.landing-page-link:active {
  transform: scale(0.98);
}

.external-link-icon {
  font-size: 1.1em;
}

/* Visibility Info */
.group-visibility-info {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.group-visibility-scope {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: #333;
  line-height: 1.4;
}

.group-visibility-join {
  margin: 0;
  font-size: 0.8125rem;
  color: #666;
  line-height: 1.4;
}

/* Main Content */
.group-content {
  grid-column: 1;
  grid-row: 2;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .group-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .group-image img {
    max-width: 150px;
  }

  .group-title {
    font-size: 1.5rem;
  }
}
