/* =============================================
   InfoOpp — Professional Stylesheet
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #1a56db;
  --primary-dark:  #1e429f;
  --primary-light: #ebf5ff;
  --accent:        #0ea5e9;
  --green:         #059669;
  --amber:         #d97706;
  --red:           #dc2626;
  --bg:            #f1f5f9;
  --card-bg:       #ffffff;
  --text:          #0f172a;
  --text-2:        #334155;
  --muted:         #64748b;
  --border:        #e2e8f0;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:     0 4px 14px rgba(0,0,0,0.10);
  --shadow-lg:     0 8px 30px rgba(0,0,0,0.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- TOP NAV ---- */
.topnav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-globe { font-size: 1.3rem; }
.logo-text { color: var(--text-2); }
.logo-text strong { color: var(--primary); }

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover,
.nav-links a.active { background: var(--primary-light); color: var(--primary); text-decoration: none; }

.nav-links .nav-cta {
  background: var(--primary);
  color: #fff !important;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  margin-left: 4px;
  font-weight: 600;
}

.nav-links .nav-cta:hover { background: var(--primary-dark) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ---- HERO (compact) ---- */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1a56db 50%, #0369a1 100%);
  color: white;
  padding: 20px 0 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.hero-title {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
  line-height: 1.2;
}

.hero-sub {
  font-size: 0.8rem;
  color: #bfdbfe;
  margin-bottom: 10px;
  letter-spacing: 0.2px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: #dbeafe;
  margin-bottom: 10px;
}

.hero-stats strong { color: #fff; font-size: 0.85rem; }
.stat-dot { color: #93c5fd; }

/* Category pills — slim horizontal row */
.hero-floats {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hero-float-item {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.hero-float-item:hover {
  background: rgba(255,255,255,0.25);
  text-decoration: none;
  color: #fff;
}

.hero-float-icon { font-size: 0.95rem; line-height: 1; }
.hero-float-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; }

/* ---- SEARCH SECTION ---- */
.search-section {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  position: sticky;
  top: 60px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.search-bar {
  position: relative;
  margin-bottom: 12px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

#search {
  width: 100%;
  padding: 12px 42px 12px 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
  background: #fff;
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 6px;
  border-radius: 4px;
}
.search-clear:hover { color: var(--text); background: var(--bg); }

.filters-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-filter-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-filter-toggle:hover { border-color: var(--primary); background: var(--bg); }
.btn-filter-toggle[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); background: rgba(26,86,219,0.05); }

.filter-badge {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}
.filter-badge.hidden { display: none; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

/* Desktop: always show filters, hide toggle button */
@media (min-width: 641px) {
  .btn-filter-toggle { display: none !important; }
  .filters { display: flex !important; }
  .btn-clear { display: inline-flex !important; }
}

.filters select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  flex: 1;
  min-width: 140px;
}

.filters select:focus { border-color: var(--primary); }

.btn-clear {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  background: white;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-clear:hover { border-color: var(--red); color: var(--red); }

/* ---- RESULTS BAR ---- */
.results-bar {
  padding: 10px 0;
  background: var(--bg);
}

.results-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.results-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
}

.results-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---- MAIN ---- */
.main-content { padding-bottom: 60px; }

/* ---- GRID ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  padding-top: 6px;
}

/* ---- CARD ---- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ---- Card cover: real photo + 10 rotating layout styles ---- */
.card-cover {
  width: calc(100% + 40px);
  margin: -20px -20px 0 -20px;
  height: 175px;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  background: #1e3a5f; /* fallback colour if image fails */
}
/* Background <img> used for all layouts */
.cv-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  z-index: 0; display: block;
}

/* ---- Layout 0: Bottom gradient overlay ---- */
.card-cover.lay0::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.80) 0%, rgba(0,0,0,0.15) 50%, transparent 100%);
}
.card-cover.lay0 .cv-info {
  position: absolute; bottom: 11px; left: 12px; right: 12px; z-index: 2;
}
.card-cover.lay0 .cv-funded { position: absolute; top: 10px; right: 10px; z-index: 2; }

/* ---- Layout 1: Dark centre tint ---- */
.card-cover.lay1::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: rgba(0,0,0,0.50);
}
.card-cover.lay1 .cv-center {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.card-cover.lay1 .cv-funded { position: absolute; top: 10px; right: 10px; z-index: 2; }

/* ---- Layout 2: Split (colour panel left / photo right) ---- */
.card-cover.lay2 { display: flex; background: none; }
.card-cover.lay2 .cv-panel {
  width: 44%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 10px 8px; flex-shrink: 0;
}
.card-cover.lay2 .cv-photo { flex: 1; height: 100%; position: relative; overflow: hidden; }

/* ---- Layout 3: Top banner + bottom text ---- */
.card-cover.lay3::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0.58) 0%, transparent 42%, rgba(0,0,0,0.55) 100%);
}
.card-cover.lay3 .cv-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  padding: 11px 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.card-cover.lay3 .cv-bottombar {
  position: absolute; bottom: 11px; left: 12px; z-index: 2;
}

/* ---- Layout 4: Frosted glass card ---- */
.card-cover.lay4 .cv-glass {
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 2;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 14px;
  padding: 14px 18px;
  text-align: center;
  min-width: 150px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.card-cover.lay4 .cv-funded { position: absolute; top: 10px; right: 10px; z-index: 2; }

/* ---- Layout 5: Diagonal gradient — icon+badge top-left, funded bottom-right ---- */
.card-cover.lay5::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(135deg, rgba(0,0,0,0.76) 0%, transparent 55%);
}
.card-cover.lay5 .cv-tl {
  position: absolute; top: 11px; left: 12px; z-index: 2;
  display: flex; flex-direction: column; gap: 4px;
}
.card-cover.lay5 .cv-br {
  position: absolute; bottom: 10px; right: 10px; z-index: 2;
}

/* ---- Layout 6: Solid colour strip at bottom, clear photo above ---- */
.card-cover.lay6 .cv-strip {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  padding: 9px 12px;
  display: flex; align-items: center; gap: 8px;
}

/* ---- Layout 7: Radial vignette edges, pill badge bottom-centre ---- */
.card-cover.lay7::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,0.62) 100%);
}
.card-cover.lay7 .cv-bottom-badge {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 2;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.22); border-radius: 40px;
  padding: 6px 14px;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}

/* ---- Layout 8: Left-side gradient, text left, photo bleeds right ---- */
.card-cover.lay8::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to right, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.35) 55%, transparent 100%);
}
.card-cover.lay8 .cv-left-panel {
  position: absolute; top: 0; left: 0; bottom: 0; z-index: 2;
  width: 55%; padding: 14px 14px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
}

/* ---- Layout 9: Top ribbon + country bottom-left ---- */
.card-cover.lay9::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0.65) 0%, transparent 35%, rgba(0,0,0,0.50) 100%);
}
.card-cover.lay9 .cv-ribbon {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  padding: 10px 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.card-cover.lay9 .cv-country-bottom {
  position: absolute; bottom: 10px; left: 12px; z-index: 2;
  color: rgba(255,255,255,0.80); font-size: 10px; font-family: system-ui,sans-serif;
}

/* ---- Shared badges / text ---- */
.cv-type-badge {
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  color: #fff; font-size: 9px; font-weight: 700;
  font-family: system-ui,sans-serif; letter-spacing: 0.8px;
  text-transform: uppercase; padding: 3px 9px; border-radius: 20px;
}
.cv-funded-pill {
  background: rgba(5,150,105,0.90); color: #fff; font-size: 8.5px;
  font-weight: 700; font-family: system-ui,sans-serif; padding: 3px 8px; border-radius: 20px;
}
.cv-country      { color: rgba(255,255,255,0.74); font-size: 10px; font-family: system-ui,sans-serif; margin-top: 2px; }
.cv-icon         { font-size: 38px; font-family: 'Segoe UI Emoji','Apple Color Emoji','Noto Color Emoji',sans-serif; line-height: 1; }
.cv-type-label   { color: rgba(255,255,255,0.93); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; font-family: system-ui,sans-serif; }
.cv-glass .cv-country   { color: rgba(255,255,255,0.85); }
.cv-glass .cv-type-label { color: #fff; }

.card.has-image { padding-top: 0; }
.card.has-image .card-tags { margin-top: 14px; }

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.tag-funding  { background: #dbeafe; color: #1d4ed8; }
.tag-level    { background: #dcfce7; color: #15803d; }
.tag-funded   { background: #fef3c7; color: #92400e; }
.tag-country  { background: #f1f5f9; color: #475569; }

.card-title {
  font-size: 0.985rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--primary); text-decoration: none; }

.card-desc {
  font-size: 0.855rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.55;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  gap: 8px;
}

.deadline { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.deadline.urgent { color: var(--red); font-weight: 600; }
.deadline.soon   { color: var(--amber); font-weight: 600; }

.btn-apply {
  display: inline-block;
  padding: 7px 16px;
  background: var(--primary);
  color: #fff !important;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-apply:hover { background: var(--primary-dark); }

/* ---- LOADING ---- */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- EMPTY STATE ---- */
.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty h3 { font-size: 1.1rem; color: var(--text-2); margin-bottom: 8px; }
.empty p  { font-size: 0.9rem; margin-bottom: 20px; }

.btn-reset {
  padding: 9px 22px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-reset:hover { background: var(--primary-dark); }

.hidden { display: none !important; }

/* ---- ABOUT SECTION ---- */
.about-section {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 60px 0;
  margin-top: 20px;
}

.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

.about-text p {
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 10px;
}

.about-notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 20px 22px;
}

.about-notice h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 10px;
}

.about-notice p {
  font-size: 0.855rem;
  color: #78350f;
  line-height: 1.65;
}

/* ---- FOOTER ---- */
.footer {
  background: #0f172a;
  color: #94a3b8;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
  padding: 56px 20px 40px;
}

.footer-brand .footer-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 14px;
}

.footer-brand .footer-logo strong { color: #60a5fa; }

.footer-brand p {
  font-size: 0.855rem;
  line-height: 1.7;
  margin-bottom: 20px;
  color: #94a3b8;
}

.social-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #1e293b;
  color: #94a3b8;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.social-btn:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

.footer-col h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #f1f5f9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 9px; }

.footer-col ul a {
  font-size: 0.855rem;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-col ul a:hover { color: #f1f5f9; text-decoration: none; }

.footer-newsletter p {
  font-size: 0.855rem;
  color: #94a3b8;
  margin-bottom: 14px;
  line-height: 1.6;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.newsletter-form input {
  padding: 9px 13px;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  background: #1e293b;
  color: #f1f5f9;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.newsletter-form input:focus { border-color: var(--accent); }
.newsletter-form input::placeholder { color: #475569; }

.newsletter-form button {
  padding: 9px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.newsletter-form button:hover { background: var(--primary-dark); }

.newsletter-note {
  font-size: 0.75rem !important;
  color: #475569 !important;
}

/* Footer bottom bar */
.footer-bottom {
  border-top: 1px solid #1e293b;
  padding: 18px 20px;
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: #475569;
}

.footer-disclaimer {
  text-align: right;
}

.footer-disclaimer a {
  color: #64748b;
  text-decoration: none;
  margin-left: 4px;
}

.footer-disclaimer a:hover { color: #94a3b8; }

/* ---- NAV ADVERTISE LINK ---- */
.nav-advertise {
  color: var(--amber) !important;
  font-weight: 600 !important;
}
.nav-advertise:hover { background: #fef3c7 !important; color: #92400e !important; }

/* ---- AD SLOTS ---- */
.ad-slot {
  padding: 8px 0;
  text-align: center;
}

.ad-leaderboard {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

.ad-mid {
  background: #fff;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}

.ad-placeholder {
  min-height: 90px;
  max-width: 728px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  border: 1px dashed var(--border);
  font-size: 0.78rem;
  color: #94a3b8;
}

/* ---- MAIN LAYOUT WITH SIDEBAR ---- */
.main-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
  padding-bottom: 60px;
}

.sidebar-ad {
  position: sticky;
  top: 140px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-ad-box {
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #94a3b8;
  position: relative;
  flex-direction: column;
  gap: 4px;
}

.sidebar-ad-box .ad-card-label {
  position: static;
  font-size: 0.65rem;
}

.sidebar-ad-box-tall { min-height: 600px; }

@media (max-width: 900px) {
  .main-with-sidebar {
    grid-template-columns: 1fr;
  }
  .sidebar-ad { display: none; }
}

/* Hide empty ad slots (no ad loaded yet) */
.ad-placeholder:empty { display: none; }

/* Native banner ad — spans full grid width between cards */
.native-banner-wrap {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 60px;
  margin: 4px 0;
  display: flex;
  justify-content: center;
}

/* In-feed ad card (injected by JS between opportunity cards) */
.ad-card {
  background: #f8fafc;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  grid-column: 1 / -1;
}

.ad-card-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #cbd5e1;
  position: absolute;
  top: 6px;
  right: 10px;
}

/* Sticky sidebar ad (for wider screens, future use) */
@media (min-width: 1200px) {
  .ad-sidebar {
    position: sticky;
    top: 140px;
  }
}

/* ---- SUBSCRIBE BUTTON IN NAV ---- */
.nav-links button.nav-cta {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
  font-family: inherit;
}
.nav-links button.nav-cta:hover { background: var(--primary-dark); }

/* ---- NEWSLETTER CTA IN FOOTER ---- */
.newsletter-cta {
  width: 100%;
  padding: 11px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
  margin-bottom: 8px;
}
.newsletter-cta:hover { background: var(--primary-dark); }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal {
  background: #fff;
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.25s ease;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: none;
  font-size: 1rem;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: #e2e8f0; color: var(--text); }

.modal-header {
  padding: 28px 28px 4px;
}
.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.modal-header p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
}

.modal-body {
  padding: 20px 28px 28px;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 18px 0 8px;
}
.field-label:first-child { margin-top: 0; }

#sub-email {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#sub-email:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: var(--text-2);
  transition: all 0.15s;
  user-select: none;
}

.chip input { display: none; }
.chip:hover { border-color: var(--primary); }
.chip:has(input:checked) {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.modal-submit {
  width: 100%;
  padding: 13px;
  margin-top: 22px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.modal-submit:hover:not(:disabled) { background: var(--primary-dark); }
.modal-submit:disabled { background: var(--muted); cursor: wait; }

.modal-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 10px;
}

.sub-status {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-top: 14px;
  text-align: center;
}

.sub-status.success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.sub-status.error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }

  .footer-brand { grid-column: 1 / -1; }
  .about-inner  { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 640px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border); padding: 12px 16px; gap: 2px; box-shadow: var(--shadow-md); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .topnav { position: relative; }

  .hero { padding: 16px 0 12px; }
  .hero-title { font-size: 1.1rem; }

  .search-section { top: 60px; }

  /* Mobile filter toggle */
  .btn-filter-toggle { display: flex; }
  .filters {
    display: none;
    flex-direction: column;
    margin-top: 10px;
  }
  .filters.open { display: flex; }
  .filters select { width: 100%; flex: none; min-width: unset; }

  /* Hide sidebar on mobile */
  .sidebar { display: none; }
  .main-with-sidebar { grid-template-columns: 1fr; }

  .grid { grid-template-columns: 1fr; }
  .card-meta { flex-wrap: wrap; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; }
  .footer-brand { grid-column: auto; }
  .footer-bottom-inner { flex-direction: column; align-items: flex-start; }
  .footer-disclaimer { text-align: left; }
}

/* =============================================
   OPPORTUNITY DETAIL PAGE
   ============================================= */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 24px;
  margin-top: 8px;
}
.back-link:hover { text-decoration: underline; }

.detail-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
  max-width: 780px;
  margin: 0 auto 60px;
}

.detail-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin: 14px 0 24px;
}

.detail-cover-img {
  width: calc(100% + 80px);
  margin: -36px -40px 24px -40px;
  height: 240px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  display: block;
}

@media (max-width: 600px) {
  .detail-cover-img {
    width: calc(100% + 36px);
    margin: -24px -18px 20px -18px;
  }
}

.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.detail-meta-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.detail-meta-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  text-transform: capitalize;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.detail-section p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.detail-apply {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.btn-apply-large {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s;
}
.btn-apply-large:hover { background: var(--primary-dark); }

.detail-host {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 6px 0 16px;
}

.detail-benefits {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.detail-benefits h2 { color: #15803d; }

.detail-apply-note {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.detail-no-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 0;
}

.deadline-closed {
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .detail-card { padding: 24px 18px; }
  .detail-title { font-size: 1.25rem; }
}
