/* ==========================================================================
   The Iteration Lab — Shared Directory Styles (/assets/css/directory.css)
   Matches the editorial white/charcoal/orange theme from /css/style.css.
   Mobile-first, zero horizontal overflow at 360px, WCAG AA #C2410C small orange.
   ========================================================================== */

:root {
  --dir-orange-aa: #C2410C;
  --dir-orange-aa-hover: #9A3412;
}

.dir-main {
  flex: 1;
  padding: 48px 0 72px;
}

@media (min-width: 768px) {
  .dir-main {
    padding: 64px 0 88px;
  }
}

.dir-home-bar {
  display: flex;
  align-items: center;
}

.dir-home-bar-top {
  justify-content: flex-start;
  margin-bottom: 20px;
}

.dir-home-bar-bottom {
  justify-content: center;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border-light);
}

.dir-home-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background-color: #FFFFFF;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dir-home-link-arrow {
  color: var(--dir-orange-aa);
  font-weight: 700;
}

.dir-home-link:hover {
  background-color: var(--brand-orange-light);
  border-color: var(--brand-orange);
  color: var(--dir-orange-aa-hover);
}

.dir-home-link:focus-visible {
  outline: 2px solid var(--brand-orange);
  outline-offset: 3px;
}

.dir-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.dir-header[hidden] {
  display: none !important;
}

.dir-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dir-orange-aa);
  margin-bottom: 10px;
}

.dir-eyebrow-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--brand-orange);
  flex-shrink: 0;
}

.dir-title {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3.6vw, 2.65rem);
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.015em;
  line-height: 1.18;
  text-wrap: balance;
}

.dir-subtitle {
  font-size: 15.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 8px;
  max-width: 68ch;
}

.dir-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dir-search-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  padding: 14px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.dir-search-bar[hidden] {
  display: none !important;
}

@media (min-width: 680px) {
  .dir-search-bar {
    flex-direction: row;
    align-items: center;
    padding: 12px 14px;
    gap: 10px;
  }
}

.dir-search-select-wrap {
  position: relative;
  flex-shrink: 0;
}

@media (min-width: 680px) {
  .dir-search-select-wrap {
    min-width: 170px;
  }
}

.dir-search-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: #FFFFFF;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234B5563' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dir-search-select:hover {
  border-color: #CBD5E1;
}

.dir-search-select:focus-visible,
.dir-search-select:focus {
  outline: none;
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
}

.dir-search-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.dir-search-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-main);
  line-height: 1.3;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

@media (min-width: 680px) {
  .dir-search-input {
    font-size: 14.5px;
  }
}

.dir-search-input::placeholder {
  color: var(--text-muted);
}

.dir-search-input:hover {
  border-color: #CBD5E1;
}

.dir-search-input:focus-visible,
.dir-search-input:focus {
  outline: none;
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
}

.dir-search-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dir-search-actions .dir-btn {
  flex: 1 1 auto;
}

@media (min-width: 680px) {
  .dir-search-actions .dir-btn {
    flex: 0 0 auto;
  }
}

.dir-search-btn {
  padding-left: 18px;
  padding-right: 18px;
}

.dir-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.dir-summary-bar[hidden] {
  display: none !important;
}

/* ==========================================================================
   Shared Chips, SAMPLE Badge & Avatars
   ========================================================================== */
.dir-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  padding: 3px 8px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.dir-chip-code {
  color: var(--text-main);
  font-weight: 600;
}

.dir-chip-status {
  color: var(--accent-blue);
  background-color: var(--accent-blue-tint);
  border-color: #C7D9FA;
  font-weight: 600;
}

.dir-sample-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.dir-category-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dir-orange-aa);
}

/* Circular Avatar (Photo or 2-letter Initials) */
.dir-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #0A0A0C;
  border: 1.5px solid var(--border-light);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  user-select: none;
}

.dir-avatar-sm {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.dir-avatar-lg {
  width: 84px;
  height: 84px;
  font-size: 26px;
}

.dir-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dir-avatar img[hidden],
.dir-avatar-initials[hidden] {
  display: none !important;
}

/* Action Buttons (>= 44px touch target, visible focus) */
.dir-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.dir-btn[hidden] {
  display: none !important;
}

.dir-btn-primary {
  background-color: var(--brand-orange);
  color: #FFFFFF;
  border: 1px solid var(--brand-orange);
}

.dir-btn-primary:hover {
  background-color: var(--brand-orange-hover);
  border-color: var(--brand-orange-hover);
  color: #FFFFFF;
}

.dir-btn-outline {
  background-color: #FFFFFF;
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.dir-btn-outline:hover {
  background-color: var(--bg-subtle);
  border-color: #CBD5E1;
  color: var(--text-main);
}

.dir-btn:focus-visible {
  outline: 2px solid var(--brand-orange);
  outline-offset: 3px;
}

/* ==========================================================================
   Pagination (Above & Below List, >= 44px buttons, hidden if <= 1 page)
   ========================================================================== */
.dir-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 24px 0;
  font-variant-numeric: tabular-nums;
}

.dir-pagination-top {
  margin-top: 0;
  margin-bottom: 24px;
}

.dir-pagination-bottom {
  margin-top: 32px;
  margin-bottom: 0;
}

.dir-pagination[hidden] {
  display: none !important;
}

.dir-page-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: #FFFFFF;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dir-page-btn:hover:not(:disabled):not([aria-current="page"]) {
  background-color: var(--bg-subtle);
  border-color: #CBD5E1;
}

.dir-page-btn[aria-current="page"] {
  background-color: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #FFFFFF;
  cursor: default;
}

.dir-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dir-page-btn:focus-visible {
  outline: 2px solid var(--brand-orange);
  outline-offset: 3px;
}

.dir-page-gap {
  min-width: 32px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  user-select: none;
}

/* ==========================================================================
   States: Loading Skeleton, Empty State, Error State
   ========================================================================== */
@keyframes dirPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.dir-skeleton-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

@media (min-width: 768px) {
  .dir-skeleton-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .dir-skeleton-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dir-skeleton-grid.cols-compact {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

.dir-skeleton-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: dirPulse 1.4s ease-in-out infinite;
}

.dir-skel-block {
  background-color: #E5E7EB;
  border-radius: var(--radius-sm);
}

.dir-state-box {
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 48px 24px;
  text-align: center;
  max-width: 560px;
  margin: 16px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dir-state-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-main);
}

.dir-state-desc {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 44ch;
}

/* ==========================================================================
   1. LEADERS LAYOUT
   - <1024px: 1 per row, horizontal card (photo left, text right)
   - >=1024px: 3 per row, vertical card (photo on top), identical card sizes
   ========================================================================== */
.dir-leaders-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

@media (min-width: 1024px) {
  .dir-leaders-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 24px;
  }
}

.dir-leader-card {
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  min-width: 0;
  height: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

@media (min-width: 520px) and (max-width: 1023px) {
  .dir-leader-card {
    grid-template-columns: 156px minmax(0, 1fr);
  }
}

@media (min-width: 1024px) {
  .dir-leader-card {
    display: flex;
    flex-direction: column;
    height: 540px;
  }
}

.dir-leader-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.dir-leader-media {
  position: relative;
  background-color: var(--bg-subtle);
  border-right: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 140px;
}

@media (min-width: 1024px) {
  .dir-leader-media {
    width: 100%;
    height: 230px;
    min-height: 230px;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
}

.dir-leader-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  display: block;
}

.dir-leader-media > img[hidden] {
  display: none !important;
}

.dir-leader-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

@media (min-width: 1024px) {
  .dir-leader-body {
    padding: 20px;
  }
}

.dir-leader-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dir-leader-role {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dir-orange-aa);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dir-leader-quote {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.dir-leader-resp-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin-top: 2px;
}

.dir-leader-resp-list li {
  font-size: 12.5px;
  color: var(--text-main);
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dir-leader-resp-list li::before {
  content: "— ";
  color: var(--dir-orange-aa);
  font-weight: 700;
}

.dir-leader-actions {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dir-leader-actions .dir-btn {
  flex: 1 1 auto;
  padding: 8px 12px;
  font-size: 13px;
}

/* ==========================================================================
   2. COMPACT CARDS (Teachers, Students, Institutes — ~220px auto-fill)
   ========================================================================== */
.dir-compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}

.dir-compact-card {
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  height: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dir-compact-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.dir-compact-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dir-compact-info {
  min-width: 0;
  flex: 1;
}

.dir-compact-name {
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.dir-compact-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.dir-compact-eiin {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   3. RESEARCHES LAYOUT (2 per row desktop, 1 on smaller screens)
   ========================================================================== */
.dir-research-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

@media (min-width: 960px) {
  .dir-research-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dir-research-card {
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.dir-research-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dir-research-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dir-research-cover img[hidden] {
  display: none !important;
}

.dir-typographic-cover {
  width: 100%;
  height: 100%;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, #FCFCFD 0%, #F4F5F7 100%);
  text-align: left;
}

.dir-typographic-cover[hidden] {
  display: none !important;
}

.dir-typo-code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--dir-orange-aa);
  letter-spacing: 0.06em;
}

.dir-typo-title {
  font-family: var(--font-serif);
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.dir-research-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.dir-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dir-card-serif-title {
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.dir-full-prose {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.dir-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dir-meta-stats {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.dir-stat-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.dir-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}

/* ==========================================================================
   4. SOFTWARES LAYOUT (Full-width sections, alternating image left/right)
   ========================================================================== */
.dir-stack-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.dir-software-section {
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 860px) {
  .dir-software-section {
    grid-template-columns: minmax(280px, 42%) minmax(0, 58%);
    align-items: stretch;
  }

  .dir-software-section.is-alt {
    grid-template-columns: minmax(0, 58%) minmax(280px, 42%);
  }

  .dir-software-section.is-alt .dir-software-media {
    order: 2;
    border-right: none;
    border-left: 1px solid var(--border-light);
  }

  .dir-software-section.is-alt .dir-software-content {
    order: 1;
  }
}

.dir-software-media {
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

@media (min-width: 860px) {
  .dir-software-media {
    aspect-ratio: auto;
    min-height: 280px;
    border-bottom: none;
    border-right: 1px solid var(--border-light);
  }
}

.dir-software-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dir-software-media img[hidden] {
  display: none !important;
}

.dir-neutral-placeholder {
  width: 100%;
  height: 100%;
  min-height: 200px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background-color: #F4F5F7;
  color: var(--text-muted);
}

.dir-neutral-placeholder[hidden] {
  display: none !important;
}

.dir-software-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

@media (min-width: 860px) {
  .dir-software-content {
    padding: 32px;
  }
}

.dir-software-tagline {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.45;
}

/* ==========================================================================
   5. COMMUNITIES LAYOUT (Full-width sections)
   ========================================================================== */
.dir-community-section {
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

@media (min-width: 768px) {
  .dir-community-section {
    padding: 32px;
  }
}

.dir-community-banner {
  width: 100%;
  max-height: 240px;
  aspect-ratio: 21 / 9;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
  background-color: var(--bg-subtle);
}

.dir-community-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dir-mission-statement {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.2vw, 22px);
  font-style: italic;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.5;
  padding: 16px 20px;
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}

.dir-governance-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.dir-gov-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dir-gov-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.dir-members-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.dir-avatar-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dir-avatar-more {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 999px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   6. DETAIL VIEW (?id=<id>)
   ========================================================================== */
.dir-detail-wrap[hidden] {
  display: none !important;
}

.dir-back-row {
  margin-bottom: 24px;
}

.dir-detail-card {
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

@media (min-width: 768px) {
  .dir-detail-card {
    padding: 36px;
  }
}

.dir-detail-hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 720px) {
  .dir-detail-hero.has-side-portrait {
    flex-direction: row;
    align-items: flex-start;
    gap: 28px;
  }
}

.dir-detail-portrait {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: #0A0A0C;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dir-detail-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dir-detail-portrait img[hidden] {
  display: none !important;
}

.dir-detail-cover {
  width: 100%;
  max-height: 400px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background-color: var(--bg-subtle);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dir-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dir-detail-section {
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dir-detail-heading {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.dir-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: 12px;
}

.dir-stat-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dir-stat-val {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.dir-stat-lbl {
  font-size: 12px;
  color: var(--text-secondary);
}

.dir-people-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dir-person-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
}

.dir-public-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dir-public-list li {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.dir-public-list li::before {
  content: "— ";
  color: var(--dir-orange-aa);
  font-weight: 700;
}

.dir-ext-link {
  color: var(--dir-orange-aa);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dir-ext-link:hover {
  color: var(--dir-orange-aa-hover);
}
