/* ===================================
   Canyon River Advisors — Custom Styles
   =================================== */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Lexend', system-ui, -apple-system, sans-serif;
  --color-bg: #ffffff;
  --color-fg: #030213;
  --color-muted: #ececf0;
  --color-muted-fg: #717182;
  --color-border: rgba(0, 0, 0, 0.1);
  --color-primary: #030213;
  --color-canvas: #F8F9FA;
  --color-card: #ffffff;
  --input-bg: #f3f3f5;
  --radius: 0.625rem;
}

[data-bs-theme="dark"] {
  --color-bg: #060606;
  --color-fg: #f8f8f8;
  --color-muted: #1b1b1b;
  --color-muted-fg: #9e9e9e;
  --color-border: #2e2e2e;
  --color-primary: #f8f8f8;
  --color-canvas: #0b0b0b;
  --color-card: #121212;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-fg);
  font-size: 16px;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 500; }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }

/* Global Menu */
.global-menu {
  background-color: var(--color-canvas);
  padding: 4px 0;
}
.global-menu-links { display: flex; flex-wrap: wrap; }
.global-menu-link {
  font-size: 12px; font-weight: 400; line-height: 20px; letter-spacing: -0.14px;
  color: var(--color-muted-fg); text-decoration: none; padding: 6px 16px;
  transition: color 0.2s ease; white-space: nowrap;
}
.global-menu-link:hover { color: var(--color-fg); }
.global-menu-link.active { color: var(--color-fg); font-weight: 900; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky; top: 0; z-index: 1040;
}
.header-logo { height: 80px; width: auto; }

/* All text in the portal nav — links, buttons, and dropdowns — at 17px */
#portalNav,
#portalNav .btn,
#portalNav .btn-sm,
#portalNav .dropdown-toggle {
    font-size: 17px;
}

/* Navigation */
.nav-link-custom {
  color: var(--color-fg); text-decoration: none;
  transition: color 0.2s;
  font-size: 17px;
}
.nav-link-custom:hover { opacity: 0.7; }
.btn-ghost {
  background: transparent; border: none; color: var(--color-fg);
}
.btn-ghost:hover  { background: var(--color-muted); }
.btn-ghost:active { background: var(--color-muted); color: var(--color-fg); }

/* Suppress Bootstrap's blue :active flash on dropdown items (light theme) */
.dropdown-menu .dropdown-item:active,
.dropdown-menu .dropdown-item.active {
  background-color: var(--color-muted);
  color: var(--color-fg);
}

/* Nav buttons – dark mode */
[data-bs-theme="dark"] #desktopNav .btn-outline-dark {
  background: rgba(27,27,27,0.3);
  border-color: #1b1b1b;
  color: #f8f8f8;
}
[data-bs-theme="dark"] #desktopNav .btn-outline-dark:hover {
  background: rgba(27,27,27,0.6);
  border-color: #2e2e2e;
  color: #f8f8f8;
}
/* Dropdown menu – dark mode */
[data-bs-theme="dark"] .dropdown-menu {
  background-color: #121212;
  border: 1px solid #2e2e2e;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}
[data-bs-theme="dark"] .dropdown-menu .dropdown-item {
  color: #f8f8f8;
  border-radius: 6px;
}
[data-bs-theme="dark"] .dropdown-menu .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-menu .dropdown-item:focus {
  color: #f8f8f8;
  background-color: rgba(255,255,255,0.05);
}
[data-bs-theme="dark"] .dropdown-menu .dropdown-item:active,
[data-bs-theme="dark"] .dropdown-menu .dropdown-item.active {
  color: #f8f8f8;
  background-color: rgba(255,255,255,0.1);
}

.portal-user-info { font-size: 13px; color: var(--color-muted-fg); text-align: center; }
.portal-user-info .d-flex { justify-content: center; }

/* Portal header: 3-column grid so user-info sits exactly between logo and nav.
   The logo and nav each take auto width; the centre column flexes to fill the
   remaining space and centres its content. */
.portal-header-row {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    align-items: center;
}
.portal-user-info--center {
    grid-column: 2;
    text-align: center;
    justify-self: center;
}

/* Hero */
.hero-section {
  position: relative; padding: 5rem 0;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -1; overflow: hidden;
}
.hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
[data-bs-theme="dark"] .hero-bg img { opacity: 1; }
.hero-card {
  background: rgba(255,255,255,0.95); backdrop-filter: blur(8px);
  border-radius: var(--radius); padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  border: 1px solid rgba(0,0,0,0.05);
}
[data-bs-theme="dark"] .hero-card {
  background: rgba(18,18,18,0.95);
  border-color: rgba(46,46,46,0.5);
}
[data-bs-theme="dark"] .hero-card .btn-dark {
  background-color: #f8f8f8;
  color: #060606;
  border-color: #f8f8f8;
}
[data-bs-theme="dark"] .hero-card .btn-dark:hover {
  background-color: #e0e0e0;
  color: #060606;
  border-color: #e0e0e0;
}
[data-bs-theme="dark"] .hero-card .btn-outline-dark {
  background: rgba(27,27,27,0.3);
  color: #f8f8f8;
  border-color: #1b1b1b;
}
[data-bs-theme="dark"] .hero-card .btn-outline-dark:hover {
  background: rgba(27,27,27,0.6);
  color: #f8f8f8;
  border-color: #2e2e2e;
}

/* Cards */
.card-custom {
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}
.card-custom:hover {
}
.card-custom .card-body { padding: 1.5rem; }
[data-bs-theme="dark"] .card-custom .btn-outline-dark {
  color: #f8f8f8;
  border-color: #f8f8f8;
}
[data-bs-theme="dark"] .card-custom .btn-outline-dark:hover {
  background: #f8f8f8;
  color: #060606;
}
[data-bs-theme="dark"] .card-custom .table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: transparent;
  color: inherit;
}

/* Feature icon circles */
.icon-circle {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(3,2,19,0.1); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
[data-bs-theme="dark"] .icon-circle { background: rgba(250,250,250,0.15); }

/* Badges */
.badge-custom {
  font-size: 0.75rem; font-weight: 500; padding: 0.25em 0.6em;
  border-radius: 9999px;
}
.badge-conviction-high { background: rgba(34,197,94,0.1); color: #15803d; border: 1px solid rgba(34,197,94,0.2); }
.badge-conviction-medium { background: rgba(234,179,8,0.1); color: #a16207; border: 1px solid rgba(234,179,8,0.2); }
.badge-conviction-low { background: rgba(59,130,246,0.1); color: #1d4ed8; border: 1px solid rgba(59,130,246,0.2); }
.badge-rating-buy { background: rgba(34,197,94,0.1); color: #15803d; }
.badge-rating-hold { background: rgba(234,179,8,0.1); color: #a16207; }
.badge-rating-sell { background: rgba(239,68,68,0.1); color: #dc2626; }
.badge-rating-n\/a { background: rgba(156,163,175,0.1); color: #6b7280; }

/* Event type category badges */
.badge-event-active {
  background: var(--color-fg); color: var(--color-bg);
  border: 1px solid var(--color-fg);
}
.badge-event-inactive {
  background: transparent; color: var(--color-muted-fg);
  border: 1px solid var(--color-border);
}

/* Section backgrounds */
.section-muted { background: var(--color-muted); }
[data-bs-theme="dark"] .section-muted { background: rgba(27,27,27,0.5); }
[data-bs-theme="dark"] .section-muted .btn-dark {
  background-color: #f8f8f8;
  color: #060606;
  border-color: #f8f8f8;
  box-shadow: 0 10px 7.5px rgba(0,0,0,0.1), 0 4px 3px rgba(0,0,0,0.1);
}
[data-bs-theme="dark"] .section-muted .btn-dark:hover {
  background-color: #e0e0e0;
  color: #060606;
  border-color: #e0e0e0;
}
[data-bs-theme="dark"] .section-muted .btn-outline-dark {
  color: #f8f8f8;
  border-color: #f8f8f8;
}
[data-bs-theme="dark"] .section-muted .btn-outline-dark:hover {
  background: #f8f8f8;
  color: #060606;
}

/* CTA */
.cta-section {
  background: rgba(3,2,19,0.03); border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,0.03);
}
[data-bs-theme="dark"] .cta-section { background: rgba(18,18,18,0.8); border-color: rgba(46,46,46,0.3); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-muted);
  margin-top: auto;
}
[data-bs-theme="dark"] .site-footer { background: rgba(27,27,27,0.5); border-top: 1px solid #2e2e2e; }
.footer-logo { height: 48px; width: auto; }
.footer-desc { font-size: 0.75rem; color: var(--color-muted-fg); line-height: 1.6; }
.footer-links { font-size: 0.875rem; }
.footer-links a { color: var(--color-muted-fg); text-decoration: none; display: block; padding: 0.25rem 0; }
.footer-links a:hover { color: var(--color-fg); }
.footer-contact { font-size: 0.875rem; color: var(--color-muted-fg); line-height: 1.6; }
.footer-divider { border-color: var(--color-border); margin: 2rem 0; }
.footer-copy { font-size: 0.875rem; color: var(--color-muted-fg); }

/* Table */
.table-custom { background: var(--color-bg); table-layout: fixed; border-radius: 0.5rem; overflow: hidden; border: 1px solid var(--color-border); }
[data-bs-theme="dark"] .table-custom { 
  --bs-table-bg: #060606;
  background: #060606 !important;
}
.table-custom col.col-date { width: 170px; }
.table-custom col.col-title { width: 26%; }
.table-custom col.col-situation { width: 10%; }
.table-custom col.col-summary { width: auto; }
.table-custom col.col-download { width: 140px; }
.table-custom th {
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  vertical-align: middle;
  padding: 8px 16px;
}
/* Light-grey, compact header row on the coverage & archive tables (bg-muted/50). */
.table-custom thead th,
.research-archive-table thead th {
  background-color: color-mix(in srgb, var(--color-muted) 50%, transparent);
  white-space: nowrap;
}
/* Region pill in the coverage table — outline badge to match the design. */
.badge-region {
  background: transparent;
  color: var(--color-fg);
  border: 1px solid var(--color-border);
  white-space: nowrap;
}
/* Header "You have access to" region pills — soft filled secondary badge. */
.badge-access {
  background: var(--color-muted);
  color: var(--color-fg);
  font-weight: 500;
}
/* Checked checkboxes use the primary colour (matches the design) in light mode. */
[data-bs-theme="light"] .form-check-input:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}
.table-custom th:first-child {
  text-align: left;
}
.table-custom th:last-child {
  white-space: nowrap;
}
.table-custom th .th-content {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.table-custom th .bi {
  font-size: 0.75em;
  flex-shrink: 0;
  padding-left: 5px;
}
.table-custom th:hover { color: var(--color-primary); }
.table-custom td {
  vertical-align: middle;
  padding: 12px 16px;
  height: 60px;
}
.table-custom td:first-child { text-align: left; }
.table-custom .td-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.table-custom tbody tr {
    border-bottom: 1px solid var(--color-border);
    height: 74px;
}
/* Body cells at 14px to match the summary field; headers keep their default. */
.table-custom tbody td {
    font-size: 14px;
}
.table-custom tbody tr:hover { background: rgba(0,0,0,0.02); }
[data-bs-theme="dark"] .table-custom tbody tr:hover { background: rgba(255,255,255,0.03); }
[data-bs-theme="dark"] .table-custom .btn-outline-dark {
  color: #f8f8f8;
  border-color: #2e2e2e;
}
[data-bs-theme="dark"] .table-custom .btn-outline-dark:hover {
  background: #f8f8f8;
  color: #060606;
}

/* Form controls — slightly grey fill in light mode (matches the design's
   --input-background). Inputs, textareas, the search box, and the custom
   filter dropdown triggers. */
[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-control:focus,
[data-bs-theme="light"] .form-select,
[data-bs-theme="light"] .crt-select__trigger,
[data-bs-theme="light"] .wpcf7 .wpcf7-form input.wpcf7-form-control,
[data-bs-theme="light"] .wpcf7 .wpcf7-form textarea.wpcf7-form-control {
  background-color: var(--input-bg);
}

/* Form controls dark mode */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: rgba(27,27,27,0.3);
  border-color: #1b1b1b;
  color: #f8f8f8;
}
[data-bs-theme="dark"] .form-control::placeholder {
  color: #6b6b6b;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: rgba(27,27,27,0.5);
  border-color: #2e2e2e;
  color: #f8f8f8;
  box-shadow: 0 0 0 0.25rem rgba(248,248,248,0.1);
}
[data-bs-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23f8f8f8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
[data-bs-theme="dark"] .form-select option {
  background-color: #121212;
  color: #f8f8f8;
  padding: 8px 12px;
}
[data-bs-theme="dark"] .form-select option:checked {
  background-color: #2e2e2e;
}
[data-bs-theme="dark"] .form-select option:hover {
  background-color: #1b1b1b;
}

/* Custom Select Dropdown */
.crt-select {
  position: relative;
  display: inline-block;
}
.crt-select__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-fg);
  font-size: 0.875rem;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s;
}
.crt-select__trigger:hover {
  border-color: var(--color-muted-fg);
}
.crt-select.is-open .crt-select__trigger {
  border-color: var(--color-primary);
}
.crt-select__chevron {
  flex-shrink: 0;
  transition: transform 0.2s;
}
.crt-select.is-open .crt-select__chevron {
  transform: rotate(180deg);
}
.crt-select__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-height: 280px;
  overflow-y: auto;
  z-index: 1050;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 4px 0;
}
.crt-select.is-open .crt-select__dropdown {
  display: block;
}
.crt-select__option {
  padding: 8px 14px;
  font-size: 0.875rem;
  color: var(--color-fg);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.crt-select__option:hover {
  background: var(--color-muted);
}
.crt-select__option.is-selected {
  font-weight: 600;
}
.crt-select__option.is-selected::after {
  content: ' ✓';
  opacity: 0.6;
}
[data-bs-theme="dark"] .crt-select__trigger {
  background: rgba(27,27,27,0.3);
  border-color: #1b1b1b;
  color: #f8f8f8;
}
[data-bs-theme="dark"] .crt-select__trigger:hover {
  border-color: #2e2e2e;
}
[data-bs-theme="dark"] .crt-select.is-open .crt-select__trigger {
  border-color: #f8f8f8;
}
[data-bs-theme="dark"] .crt-select__dropdown {
  background: #121212;
  border-color: #2e2e2e;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
[data-bs-theme="dark"] .crt-select__option {
  color: #f8f8f8;
}
[data-bs-theme="dark"] .crt-select__option:hover {
  background: #1b1b1b;
}
[data-bs-theme="dark"] .crt-select__option.is-selected {
  background: #2e2e2e;
}

/* Research table expand */
.research-expand-row,
.research-expand-row > td { background: transparent !important; }
[data-bs-theme="dark"] .research-expand-row,
[data-bs-theme="dark"] .research-expand-row > td { background: transparent !important; }

/* Research Archive table styling */
.research-archive-table {
  border-collapse: separate;
  border-spacing: 0;
}
.research-archive-table thead th:first-child {
  border-top-left-radius: 0.5rem;
}
.research-archive-table thead th:last-child {
  border-top-right-radius: 0.5rem;
}
.research-archive-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 0.5rem;
}
.research-archive-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 0.5rem;
}
.research-archive-table tr {
    height: 50px !important;
    vertical-align: middle;
}
.research-archive-table td {
  height: 50px;
  vertical-align: middle;
}
.research-archive-table th,
.research-archive-table td {
  padding: 8px 10px;
}
.research-archive-table th,
.research-archive-table td {
  white-space: nowrap;
}
.research-archive-table th:first-child,
.research-archive-table td:first-child {
  width: 110px;
}
.research-archive-main td:nth-child(2),
.research-archive-main td:nth-child(3) {
  white-space: normal;
}
.research-expand-row .table {
  --bs-table-bg: transparent;
  background: transparent !important;
}
.research-expand-row .table th,
.research-expand-row .table td {
  background: transparent !important;
}

/* Publication summary 3-line clamp */
.pub-summary-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* Contact Form 7 Styling */
.wpcf7 .wpcf7-form {
  margin: 0;
}

/* Fix CF7 autop inserting p and br tags that break Bootstrap grid */
.wpcf7 .wpcf7-form .row > p {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.wpcf7 .wpcf7-form .row > br {
  display: none !important;
}

.wpcf7 .wpcf7-form .col-sm-6 > p {
  margin: 0;
}

.wpcf7 .wpcf7-form .col-sm-6 > br,
.wpcf7 .wpcf7-form .mb-3 > br {
  display: none !important;
}

.wpcf7 .wpcf7-form span.wpcf7-form-control-wrap {
  display: block !important;
  width: 100% !important;
}

.wpcf7 .wpcf7-form input.wpcf7-form-control[type="text"],
.wpcf7 .wpcf7-form input.wpcf7-form-control[type="email"],
.wpcf7 .wpcf7-form input.wpcf7-form-control[type="tel"],
.wpcf7 .wpcf7-form textarea.wpcf7-form-control {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background-color: var(--input-bg);
  color: var(--color-fg);
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wpcf7 .wpcf7-form input.wpcf7-form-control:focus,
.wpcf7 .wpcf7-form textarea.wpcf7-form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(3, 2, 19, 0.1);
}

.wpcf7 .wpcf7-form textarea.wpcf7-form-control {
  min-height: 120px;
  resize: vertical;
}

.wpcf7 .wpcf7-form .form-label {
  display: block !important;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
  color: var(--color-fg);
}

.wpcf7 .wpcf7-form .mb-3 {
  display: block !important;
}

/* Ask Our Analysts form: Send button and Turnstile side by side, centered */
.wpcf7 .wpcf7-form:has(.wpcf7-submit) {
  text-align: center;
}

.wpcf7 .wpcf7-form:has(.wpcf7-submit) .wpcf7-form-control-wrap,
.wpcf7 .wpcf7-form:has(.wpcf7-submit) .form-label {
  text-align: left;
}

.wpcf7 .wpcf7-form .mb-3:has(.wpcf7-submit) {
  align-items: center;
  gap: 12px;
  vertical-align: middle;
  margin-right: 12px;
}

.wpcf7 .wpcf7-form .mb-3:has(.wpcf7-submit) + div:has(.wpcf7-turnstile),
.wpcf7 .wpcf7-form .mb-3:has(.wpcf7-submit) + div:has(.cf-turnstile) {
  display: inline-flex !important;
  align-items: center;
  vertical-align: middle;
}

#joinModal .wpcf7-form .text-center {
  text-align: center;
}

#joinModal .wpcf7-form .text-center .wpcf7-form-control-wrap {
  display: inline-block !important;
  width: auto !important;
}

.wpcf7-submit {
  background-color: var(--color-primary) !important;
  color: var(--color-bg) !important;
  border: none !important;
  padding: 12px 32px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
  box-shadow: none !important;
}

.wpcf7-submit:hover {
  opacity: 0.85;
}

.wpcf7-submit:active {
}

/* Ask Our Analysts submit: white outline button matching the home-page
   "Contact Us" button (shadow grows on hover). */
#ask-analysts .wpcf7-form .mb-3 {
  text-align: center;
}
#ask-analysts .wpcf7-submit {
  background-color: var(--color-bg) !important;
  color: var(--color-fg) !important;
  border: 1px solid var(--color-border) !important;
  width: 50%;
  display: block !important;
  margin: 0 auto !important;
  position: relative;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1) !important;
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}
#ask-analysts .wpcf7-submit:hover {
  background-color: var(--color-muted) !important;
  opacity: 1;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1) !important;
}

.wpcf7-spinner {
  margin-left: 10px;
}

.wpcf7-response-output {
  margin: 20px 0 0 0;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid;
}

.wpcf7-mail-sent-ok {
  border-color: #28a745;
  background-color: #d4edda;
  color: #155724;
}

.wpcf7-mail-sent-ng,
.wpcf7-validation-errors {
  border-color: #dc3545;
  background-color: #f8d7da;
  color: #721c24;
}

.wpcf7 .wpcf7-not-valid-tip {
  color: #dc3545;
  font-size: 12px;
  margin-top: 4px;
  display: block;
}

/* Blurred content */
.blurred { filter: blur(4px); user-select: none; }

/* Profile sidebar */
.profile-sidebar .btn-sidebar {
  display: block; width: 100%; text-align: left; padding: 0.75rem 1rem;
  border-radius: var(--radius); border: none; background: transparent;
  color: var(--color-fg); transition: background 0.2s;
}
.profile-sidebar .btn-sidebar:hover { background: var(--color-muted); }
.profile-sidebar .btn-sidebar.active { background: var(--color-primary); color: #fff; }
[data-bs-theme="dark"] .profile-sidebar .btn-sidebar.active { background: var(--color-primary); color: #060606; }

/* Page transitions */
.page-section { display: none; }
.page-section.active { display: block; }

/* Move WP Admin Bar to bottom */
#wpadminbar {
  top: auto !important;
  bottom: 0;
}
html { margin-top: 0 !important; }

/* Utility */
.text-muted-custom { color: var(--color-muted-fg) !important; }
.text-muted-custom h2,
.text-muted-custom h3,
.text-muted-custom h4 { color: var(--color-fg) !important; }
.border-custom { border-color: var(--color-border) !important; }

/* Login page */
.login-card { max-width: 448px; }

/* Modal / Dialog */
.modal-content { border-radius: var(--radius); }

/* Join Team modal – dark mode styling */
[data-bs-theme="dark"] #joinModal .modal-content {
  background-color: #060606;
  border: 1px solid #2e2e2e;
  box-shadow: 0 25px 25px rgba(0,0,0,0.25);
}
[data-bs-theme="dark"] #joinModal .modal-title {
  color: #f8f8f8;
}
[data-bs-theme="dark"] #joinModal .btn-close {
  filter: invert(1);
  opacity: 0.7;
}
[data-bs-theme="dark"] #joinModal .wpcf7-form label,
[data-bs-theme="dark"] #joinModal .wpcf7-form .form-label {
  color: #9e9e9e;
}
[data-bs-theme="dark"] #joinModal .wpcf7-form input[type="text"],
[data-bs-theme="dark"] #joinModal .wpcf7-form input[type="email"],
[data-bs-theme="dark"] #joinModal .wpcf7-form textarea {
  background: rgba(27,27,27,0.3);
  border: 1px solid #1b1b1b;
  border-radius: 8px;
  color: #f8f8f8;
}
[data-bs-theme="dark"] #joinModal .wpcf7-form input::placeholder,
[data-bs-theme="dark"] #joinModal .wpcf7-form textarea::placeholder {
  color: #6b6b6b;
}
[data-bs-theme="dark"] #joinModal .btn-link {
  color: #f8f8f8 !important;
  text-decoration: none;
}
[data-bs-theme="dark"] #joinModal .btn-link i {
  color: #f8f8f8 !important;
}
#joinModal .wpcf7-form p {
  margin-bottom: 0.5rem;
}
[data-bs-theme="dark"] #joinModal .wpcf7-submit,
[data-bs-theme="dark"] #joinModal .btn-dark {
  background-color: #f8f8f8 !important;
  color: #060606 !important;
  border-color: #f8f8f8 !important;
  border-radius: 9999px;
  font-weight: 500;
  box-shadow: 0 10px 7.5px rgba(0,0,0,0.1), 0 4px 3px rgba(0,0,0,0.1);
}
[data-bs-theme="dark"] #joinModal .wpcf7-submit:hover,
[data-bs-theme="dark"] #joinModal .btn-dark:hover {
  background-color: #e0e0e0 !important;
  color: #060606 !important;
  border-color: #e0e0e0 !important;
}

/* Turnstile is rendered as a hidden/invisible widget so no inline-flex needed.
   The submit button is centred via #ask-analysts .wpcf7-submit { margin: 0 auto }. */

.wpcf7 form .wpcf7-submit {
  white-space: nowrap;
  background-color: var(--bs-dark);
  color: #fff;
  border-color: var(--bs-dark);
}
.wpcf7 form .wpcf7-submit:hover {
  background-color: var(--bs-btn-hover-bg, #1a1a1a);
  border-color: var(--bs-btn-hover-border-color, #1a1a1a);
  color: #fff;
}

/* Join Team modal – hide native file input, style upload button */
#joinModal .wpcf7-form-control-wrap[data-name="team_file"] input[type="file"] {
  display: none;
}

/* Join Team modal – center turnstile label + widget, reduce gap */
#joinModal .wpcf7-form > div:has(.cf-turnstile),
#joinModal .wpcf7-form > p:has(.cf-turnstile) {
  flex-direction: column;
  align-items: center;
  gap: 0.0rem;
  font-size: smaller;
}
#joinModal .wpcf7-form .wpcf7-turnstile,
#joinModal .wpcf7-form .cf-turnstile {
  display: flex !important;
  justify-content: center !important;
}

/* Archive search dropdown */
.archive-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-top: none;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 4px 8px rgba(0,0,0,.1);
}
.archive-search-dropdown .dropdown-item {
  display: block;
  padding: .5rem .75rem;
  color: var(--color-fg);
  text-decoration: none;
  font-size: .875rem;
  border-bottom: 1px solid var(--color-border);
}
.archive-search-dropdown .dropdown-item:last-child { border-bottom: none; }
.archive-search-dropdown .dropdown-item:hover { background: var(--color-muted); }
.archive-search-dropdown .dropdown-item.disabled { pointer-events: none; opacity: .6; }

/* Responsive */
@media (max-width: 767.98px) {
  h1 { font-size: 2rem; }
  .hero-section { padding: 3rem 0; }
  .hero-card { padding: 1.5rem; }
}
