/* Public Portal Styles */
/* Uses CSS variables from themes.css for dark mode support */

/* ============================================
   Layout
   ============================================ */
.public-portal {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.public-header {
  background: var(--card-bg, #fff);
  border-bottom: 1px solid var(--border-color, #dee2e6);
}

.public-nav {
  background: var(--bg-secondary, #f8f9fa);
  border-bottom: 1px solid var(--border-color, #dee2e6);
  padding: 0.5rem 0;
}

.public-content {
  flex: 1;
  background: var(--bg-primary, #fff);
}

.public-footer {
  background: var(--bg-secondary, #f8f9fa);
  border-top: 1px solid var(--border-color, #dee2e6);
  padding: 1.5rem 0;
}

.public-footer-text {
  color: var(--text-secondary, #6c757d);
  font-size: 0.875rem;
  margin: 0;
}

/* ============================================
   Organization Branding
   ============================================ */
.org-logo {
  max-height: 50px;
  width: auto;
}

.org-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary, #212529);
  margin: 0;
}

.org-tagline {
  font-size: 0.875rem;
  color: var(--text-secondary, #6c757d);
  margin: 0;
}

/* ============================================
   Navigation
   ============================================ */
/* inline-flex is stated here, on the SHARED class, on purpose. Most items in this
   bar are <a> (inline, so padding does not grow the line box) but the "Other NCs"
   disclosure is a <button> (inline-block, and a button computes its baseline from
   its own content box). Those two baselines do not agree, which left the button
   sitting a couple of pixels off its neighbours. Normalising both to inline-flex
   here makes them share one box model instead of patching the button alone. */
.public-nav .nav-link {
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary, #6c757d);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.public-nav .nav-link:hover {
  background: var(--bg-tertiary, #e9ecef);
  color: var(--text-primary, #212529);
}

/* WCAG 1.4.3. The RENDERED pill passes: --primary-color is style.css's #2563eb
   in both themes and `white` on it is 5.1686:1. Only the FALLBACK failed --
   white on #667eea is 3.6602:1 -- so just that literal is raised, to the same
   #1e5aa8 the portal uses elsewhere (white on it: 6.8113:1).

   Deliberately NOT switched to var(--accent) like the inline link fallbacks in
   views/public/ were. Those are accent-as-TEXT on a themed surface, where
   --accent's dark value is the correct one; here the accent is the SURFACE and
   the text is a hardcoded `white`, so --accent's dark #6ea8f0 would render
   white-on-light-blue at 2.4641:1. Changing this to --accent requires making
   the text colour --accent-contrast in the same edit. */
.public-nav .nav-link.active {
  background: var(--primary-color, #1e5aa8);
  color: white;
}

.public-nav .nav-link i {
  margin-right: 0.5rem;
}

/* ============================================
   Page Headers
   ============================================ */
.page-header {
  background: var(--bg-secondary, #f8f9fa);
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary, #212529);
  margin: 0 0 0.5rem 0;
}

.page-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary, #6c757d);
  margin: 0;
}

/* ============================================
   Meeting Cards
   ============================================ */
.meeting-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Surface change per portal.css:184. On a portal page portal.css redeclares
 * these tokens, so --border resolves to #e3e6ea light / #2a2f37 dark against a
 * --card-bg of #f7f8fa / #1c2027. Delta 1.1782:1 light / 1.2139:1 dark, and
 * the --shadow-card step below carries the rest of the affordance. */
.meeting-card:hover {
  background-color: var(--border, #e3e6ea);
  box-shadow: var(--shadow-card);
}

.meeting-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.meeting-card-title {
  color: var(--text-primary, #212529);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.meeting-card-title a {
  color: inherit;
  text-decoration: none;
}

.meeting-card-title a:hover {
  color: var(--primary-color, #667eea);
}

.meeting-card-meta {
  color: var(--text-secondary, #6c757d);
  font-size: 0.875rem;
}

.meeting-card-meta i {
  margin-right: 0.25rem;
  width: 1rem;
  text-align: center;
}

.meeting-card-committee {
  display: inline-flex;
  align-items: center;
  background: var(--bg-secondary, #f8f9fa);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  color: var(--text-secondary, #6c757d);
}

.meeting-card-status {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.meeting-card-status.status-upcoming {
  background: var(--info-bg, #cfe2ff);
  color: var(--info-color, #0a58ca);
}

.meeting-card-status.status-live {
  background: var(--success-bg, #d1e7dd);
  color: var(--success-color, #146c43);
}

.meeting-card-status.status-past {
  background: var(--bg-secondary, #f8f9fa);
  color: var(--text-secondary, #6c757d);
}

.meeting-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #dee2e6);
}

/* ============================================
   Document Lists
   ============================================ */
.document-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.document-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color, #dee2e6);
  transition: background-color 0.15s ease;
}

.document-item:hover {
  background: var(--bg-secondary, #f8f9fa);
}

.document-item:last-child {
  border-bottom: none;
}

.document-item-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: var(--radius-md);
  margin-right: 1rem;
  color: var(--primary-color, #667eea);
  flex-shrink: 0;
}

.document-item-icon.icon-pdf {
  color: #dc3545;
}

.document-item-icon.icon-doc {
  color: #0d6efd;
}

.document-item-icon.icon-video {
  color: #6f42c1;
}

.document-item-info {
  flex: 1;
  min-width: 0;
}

.document-item-title {
  font-weight: 500;
  color: var(--text-primary, #212529);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-item-title a {
  color: inherit;
  text-decoration: none;
}

.document-item-title a:hover {
  color: var(--primary-color, #667eea);
}

.document-item-meta {
  font-size: 0.875rem;
  color: var(--text-secondary, #6c757d);
}

.document-item-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: 1rem;
}

/* ============================================
   Agenda Items Display
   ============================================ */
.agenda-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.agenda-item {
  padding: 1rem;
  border-left: 3px solid var(--accent);
  background: var(--card-bg, #fff);
  margin-bottom: 0.5rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: background-color 0.15s ease;
}

.agenda-item:hover {
  background: var(--bg-secondary, #f8f9fa);
}

.agenda-item-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.agenda-item-number {
  font-weight: 700;
  color: var(--primary-color, #667eea);
  min-width: 2rem;
}

.agenda-item-content {
  flex: 1;
}

.agenda-item-title {
  font-weight: 500;
  color: var(--text-primary, #212529);
  margin: 0;
}

.agenda-item-description {
  color: var(--text-secondary, #6c757d);
  margin-top: 0.5rem;
  font-size: 0.9375rem;
}

.agenda-item-attachments {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color, #dee2e6);
}

.agenda-item-attachment {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--primary-color, #667eea);
  text-decoration: none;
  margin-right: 1rem;
}

.agenda-item-attachment:hover {
  text-decoration: underline;
}

/* Consent and Action Item styling */
.agenda-item.consent-item {
  border-left-color: var(--success-color, #198754);
}

.agenda-item.action-item {
  border-left-color: var(--warning-color, #ffc107);
}

.agenda-item.public-comment {
  border-left-color: var(--info-color, #0dcaf0);
}

/* ============================================
   Section Headers
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color, #dee2e6);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary, #212529);
  margin: 0;
}

.section-title i {
  margin-right: 0.5rem;
  color: var(--primary-color, #667eea);
}

.section-action {
  font-size: 0.875rem;
}

/* ============================================
   Filter Bar
   ============================================ */
.filter-bar {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.filter-bar .form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary, #6c757d);
}

.filter-bar .form-select,
.filter-bar .form-control {
  background-color: var(--input-bg, #fff);
  border-color: var(--border-color, #dee2e6);
  color: var(--text-primary, #212529);
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
  text-align: center;
  padding: 3rem;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: var(--radius-md);
}

.empty-state-icon {
  font-size: 3rem;
  color: var(--text-muted, #adb5bd);
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary, #212529);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  color: var(--text-secondary, #6c757d);
  margin-bottom: 1rem;
}

/* ============================================
   Meeting Detail View
   ============================================ */
.meeting-detail-header {
  background: var(--bg-secondary, #f8f9fa);
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.meeting-detail-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary, #212529);
  margin: 0 0 0.5rem 0;
}

.meeting-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: var(--text-secondary, #6c757d);
}

.meeting-detail-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meeting-detail-meta-item i {
  color: var(--primary-color, #667eea);
}

/* ============================================
   Video Player
   ============================================ */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #000;
  border-radius: var(--radius-md);
}

.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #6c757d;
}

.video-placeholder i {
  font-size: 4rem;
  margin-bottom: 1rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-view {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.sidebar-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #212529);
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color, #dee2e6);
}

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

.sidebar-list-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color, #dee2e6);
}

.sidebar-list-item:last-child {
  border-bottom: none;
}

.sidebar-list-item a {
  color: var(--text-primary, #212529);
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-list-item a:hover {
  color: var(--primary-color, #667eea);
}

/* ============================================
   Pagination
   ============================================ */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* ============================================
   Custom Button Utilities (for shared partials)
   ============================================ */
.btn-primary-custom {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  background: var(--primary-color, #667eea);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.btn-primary-custom:hover { background: #5a6fd6; color: #fff; }

.btn-secondary-custom {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary, #f8f9fa);
  color: var(--text-primary, #212529);
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.btn-secondary-custom:hover { background: var(--bg-tertiary, #e9ecef); color: var(--text-primary, #212529); }

.pagination-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  background: var(--card-bg, #fff);
  color: var(--text-primary, #212529);
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.pagination-link:hover { background: var(--bg-secondary, #f8f9fa); }

/* Bootstrap-compatible utilities for shared partials (agenda/minutes preview) */
.btn { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.375rem 0.75rem; border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 500; cursor: pointer; text-decoration: none; border: 1px solid transparent; transition: background-color 0.15s ease, color 0.15s ease; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.8125rem; }
.btn-success { background: #198754; color: #fff; border-color: #198754; }
.btn-success:hover { background: #157347; color: #fff; }
.btn-outline-primary { background: transparent; color: var(--primary-color, #667eea); border-color: var(--primary-color, #667eea); }
.btn-outline-primary:hover { background: var(--primary-color, #667eea); color: #fff; }
.btn-outline-secondary { background: transparent; color: var(--text-secondary, #6c757d); border-color: var(--border-color, #dee2e6); }
.btn-outline-secondary:hover { background: var(--bg-secondary, #f8f9fa); color: var(--text-primary, #212529); }

/* Card utilities for shared partials */
.card { background: var(--card-bg, #fff); border: 1px solid var(--border-color, #dee2e6); border-radius: var(--radius-md); }
.card-header { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color, #dee2e6); background: var(--bg-secondary, #f8f9fa); }
.card-header:first-child { border-radius: calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px) 0 0; }
.card-body { padding: 1rem; }

/* Breadcrumb for detail views */
.breadcrumb { display: flex; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; gap: 0.25rem; }
.breadcrumb-item + .breadcrumb-item::before { content: "/"; color: var(--text-muted, #adb5bd); padding-right: 0.5rem; }
.breadcrumb-item a { color: var(--primary-color, #667eea); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: var(--text-secondary, #6c757d); }

/* Flex/layout utilities for shared partials */
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

/* Table utility */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.75rem; border-bottom: 1px solid var(--border-color, #dee2e6); }

/* Badge utilities */
.badge { display: inline-flex; align-items: center; padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600; }
.bg-primary { background: var(--primary-color, #667eea); color: #fff; }
.bg-secondary { background: var(--text-secondary, #6c757d); color: #fff; }
.bg-success { background: #198754; color: #fff; }
.bg-warning { background: #ffc107; color: #000; }
.bg-danger { background: #dc3545; color: #fff; }

/* Meeting date badge component */
.meeting-date-badge { display: flex; flex-direction: column; align-items: center; padding: 0.25rem 0.5rem; border-radius: var(--radius-md); background: var(--bg-secondary, #f8f9fa); border: 1px solid var(--border-color, #dee2e6); line-height: 1.2; }
.meeting-date-badge .month { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; color: var(--primary-color, #667eea); letter-spacing: 0.05em; }
.meeting-date-badge .day { font-size: 1.25rem; font-weight: 700; color: var(--text-primary, #212529); }
.meeting-date-badge .year { font-size: 0.625rem; color: var(--text-secondary, #6c757d); }

/* ============================================
   Search
   ============================================ */
.search-box {
  position: relative;
}

.search-box .form-control {
  padding-left: 2.5rem;
  background-color: var(--input-bg, #fff);
  border-color: var(--border-color, #dee2e6);
  color: var(--text-primary, #212529);
}

.search-box .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #adb5bd);
}

/* ============================================
   Badges
   ============================================ */
.badge-committee {
  background: var(--bg-tertiary, #e9ecef);
  color: var(--text-secondary, #6c757d);
  font-weight: 500;
}

.badge-document-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* ============================================
   Accessibility
   ============================================ */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color, #667eea);
  color: white;
  padding: 0.5rem 1rem;
  z-index: 1000;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* Focus styles for accessibility */
.public-nav .nav-link:focus,
.document-item a:focus,
.meeting-card-title a:focus,
.btn:focus {
  outline: 2px solid var(--primary-color, #667eea);
  outline-offset: 2px;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .public-nav,
  .public-footer,
  .btn-download,
  .filter-bar,
  .pagination-wrapper {
    display: none !important;
  }

  .public-portal {
    min-height: auto;
  }

  .meeting-card,
  .document-item,
  .agenda-item {
    break-inside: avoid;
  }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 992px) {
  .meeting-detail-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .public-header h1 {
    font-size: 1.25rem;
  }

  .org-logo {
    max-height: 35px;
  }

  .org-name {
    font-size: 1.25rem;
  }

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

  .page-subtitle {
    font-size: 1rem;
  }

  .meeting-card {
    padding: 1rem;
  }

  .meeting-card-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .meeting-card-actions {
    flex-direction: column;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .document-item {
    flex-wrap: wrap;
  }

  .document-item-actions {
    width: 100%;
    margin-left: 0;
    margin-top: 0.75rem;
    justify-content: flex-end;
  }

  .filter-bar .row > div {
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 576px) {
  .public-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .public-nav .nav {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .agenda-item-header {
    flex-direction: column;
    gap: 0.25rem;
  }

  .agenda-item-number {
    min-width: auto;
  }
}

/* ============================================
   Dark Mode Overrides
   ============================================ */
[data-theme="dark"] .meeting-card:hover {
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .agenda-item {
  background: var(--bg-secondary, #1a1f2e);
}

[data-theme="dark"] .agenda-item:hover {
  background: var(--bg-tertiary, #252b3b);
}

[data-theme="dark"] .document-item:hover {
  background: var(--bg-tertiary, #252b3b);
}

[data-theme="dark"] .document-item-icon {
  background: var(--bg-tertiary, #252b3b);
}

[data-theme="dark"] .empty-state {
  background: var(--bg-secondary, #1a1f2e);
}

[data-theme="dark"] .filter-bar {
  background: var(--bg-secondary, #1a1f2e);
}

[data-theme="dark"] .meeting-card-status.status-upcoming {
  background: rgba(13, 110, 253, 0.2);
  color: #6ea8fe;
}

[data-theme="dark"] .meeting-card-status.status-live {
  background: rgba(25, 135, 84, 0.2);
  color: #75b798;
}

[data-theme="dark"] .meeting-card-status.status-past {
  background: var(--bg-tertiary, #252b3b);
}

[data-theme="dark"] .sidebar-card {
  background: var(--bg-secondary, #1a1f2e);
}

[data-theme="dark"] .page-header {
  background: var(--bg-secondary, #1a1f2e);
}

[data-theme="dark"] .meeting-detail-header {
  background: var(--bg-secondary, #1a1f2e);
}

/* ==========================================
   "OTHER NCS" NAV DROPDOWN
   ========================================== */

/*
 * The dropdown markup and hover behaviour come from style.css (.nav-dropdown).
 * Two adjustments are needed inside the public portal nav.
 */

/* The toggle is a <button>, so give it the surrounding .nav-link's typography
   rather than the browser's default button styling. */
.public-nav .nav-dropdown-toggle {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* `.public-nav .nav-link i` sets margin-right on EVERY icon, and at (0,2,1) it
   outranks the .me-1 the <a> siblings carry, so 0.5rem is what all of them get.
   That is right for a LEADING icon and wrong for the toggle's TRAILING chevron,
   where it becomes 8px of dead space between the glyph and the pill's edge --
   which reads as the label sitting off-centre against its neighbours. Only the
   trailing icon needs correcting; do not touch the leading one or this toggle
   stops matching the rest of the bar. */
.public-nav .nav-dropdown-toggle i:last-child {
  margin-right: 0;
  margin-left: 0.25rem;
}

/* Keyboard: open the dropdown when focus is anywhere inside it (the compiled
   style.css only opens it on :hover). Desktop only — below 576px the items
   render inline (see the media query below). */
.public-nav .nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
}

/*
 * Below 576px .public-nav becomes a horizontal scroll container
 * (overflow-x: auto, further up this file). A scroll container CLIPS
 * absolutely-positioned descendants, so the dropdown panel would be cut off
 * with no way to reach it. At that width drop the disclosure entirely and show
 * both destinations inline as ordinary nav items — the nav already scrolls
 * horizontally, so two more items cost nothing.
 */
@media (max-width: 576px) {
  /* On phones the nav becomes a single scrolling row rather than wrapping.
     The scroll container is .public-nav (styled further up this file), NOT the
     <ul> — putting overflow on the list clips absolutely-positioned children,
     which is exactly what broke the dropdown. */
  .public-nav ul {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .public-nav .nav-dropdown-toggle {
    display: none;
  }

  .public-nav .nav-dropdown .nav-dropdown-menu {
    display: flex;
    gap: 4px;
    position: static;
    opacity: 1;
    transform: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    min-width: 0;
    overflow: visible;
    transition: none;
  }
}

/* ==========================================
   MEMBER LOGIN (header, not nav)
   ========================================== */

/*
 * Sits in the header beside the theme toggle rather than among the section
 * tabs, so it does not read as another public section.
 *
 * :visited is listed explicitly: a:visited has specificity 0,1,1 and would
 * otherwise beat this single class, leaving the link a stale purple after a
 * staff member has signed in once.
 */
.member-login-link,
.member-login-link:visited {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--text-secondary, #6c757d);
  background: transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.member-login-link:hover,
.member-login-link:focus {
  background: var(--bg-tertiary, #e9ecef);
  color: var(--text-primary, #212529);
  border-color: var(--text-secondary, #6c757d);
}

.member-login-link:focus-visible {
  outline: 2px solid var(--primary-color, #667eea);
  outline-offset: 2px;
}

/* On phones the label is redundant next to the icon; keep the tap target. */
@media (max-width: 480px) {
  .member-login-link .login-label {
    display: none;
  }
}
