/* =========================================================
   TDG College Manager – Frontend Styles (v2.0.1 redesign)
   ========================================================= */

:root {
  --tdg-primary:      #20b2aa;
  --tdg-primary-dk:   #178f88;
  --tdg-primary-lt:   #e6fbfa;
  --tdg-accent:       #f59e0b;
  --tdg-accent-dk:    #d97706;
  --tdg-success:      #059669;
  --tdg-danger:       #dc2626;
  --tdg-text:         #1e293b;
  --tdg-muted:        #64748b;
  --tdg-border:       #e2e8f0;
  --tdg-surface:      #ffffff;
  --tdg-bg:           #f8fafc;
  --tdg-radius:       10px;
  --tdg-radius-sm:    6px;
  --tdg-shadow:       0 1px 6px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.06);
  --tdg-shadow-hover: 0 4px 20px rgba(32,178,170,.18);
  --tdg-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.tdg-table-wrap {
  overflow-x: auto;
  margin: 1.75em 0;
  border-radius: var(--tdg-radius);
  box-shadow: var(--tdg-shadow);
}

.tdg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-family: var(--tdg-font);
  background: var(--tdg-surface);
  border-radius: var(--tdg-radius);
  overflow: hidden;
}

.tdg-table caption {
  caption-side: top;
  font-weight: 700;
  font-size: 1rem;
  text-align: left;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--tdg-primary-lt) 0%, #dbeafe 100%);
  border-bottom: 3px solid var(--tdg-primary);
  color: var(--tdg-primary-dk);
  letter-spacing: .02em;
}

.tdg-table th,
.tdg-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--tdg-border);
  text-align: left;
  vertical-align: middle;
}

.tdg-table thead th {
  background: var(--tdg-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.tdg-table tbody tr:nth-child(even) { background: #f8faff; }
.tdg-table tbody tr:hover            { background: var(--tdg-primary-lt); transition: background .15s; }
.tdg-table tbody tr:last-child td    { border-bottom: none; }

/* row-header cells (bond table, etc.) */
.tdg-table tbody th {
  background: var(--tdg-bg);
  color: var(--tdg-text);
  font-weight: 600;
  font-size: 0.85rem;
}


/* ── Mobile Card Tables (≤ 640px) ────────────────────────────────────────── */
@media (max-width: 640px) {

  /* Hide the horizontal scroll wrapper, let cards flow naturally */
  .tdg-table-wrap {
    overflow-x: visible;
    box-shadow: none;
    border-radius: 0;
    margin: 1em 0;
  }

  /* Each <table> becomes a block of stacked cards */
  .tdg-table,
  .tdg-table thead,
  .tdg-table tbody,
  .tdg-table tr,
  .tdg-table th,
  .tdg-table td {
    display: block;
    width: 100%;
  }

  /* Hide thead — labels come from data-label */
  .tdg-table thead {
    display: none;
  }

  /* Hide caption on mobile (redundant with section title) */
  .tdg-table caption {
    display: none;
  }

  /* Each <tr> = one card */
  .tdg-table tbody tr {
    background: var(--tdg-surface);
    border: 1px solid var(--tdg-border);
    border-radius: var(--tdg-radius);
    box-shadow: var(--tdg-shadow);
    margin-bottom: 12px;
    overflow: hidden;
  }
  .tdg-table tbody tr:nth-child(even) { background: var(--tdg-surface); }
  .tdg-table tbody tr:hover { background: var(--tdg-surface); }
  .tdg-table tbody tr:last-child td { border-bottom: none; }

  /* Each <td> = one row inside the card */
  .tdg-table td {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid var(--tdg-border);
    font-size: 0.88rem;
  }
  .tdg-table td:last-child { border-bottom: none; }

  /* Label column (from data-label) */
  .tdg-table td::before {
    content: attr(data-label);
    display: block;
    min-width: 38%;
    max-width: 38%;
    padding: 11px 12px;
    background: var(--tdg-bg);
    color: var(--tdg-primary);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: .02em;
    border-right: 2px solid var(--tdg-primary-lt);
    word-break: break-word;
    flex-shrink: 0;
  }

  /* Value column */
  .tdg-table td > * ,
  .tdg-table td {
    padding-left: 0;
  }
  .tdg-table tbody td {
    padding: 0;
  }
  /* The actual cell text/content */
  .tdg-table td > strong,
  .tdg-table td {
    padding: 0;
  }

  /* Wrap the inner text content so it gets proper padding */
  .tdg-table td::after {
    display: none; /* not used */
  }
}

/* Inline padding trick: wrap td text in a span-like way via direct padding on td itself
   after the ::before pseudo takes its 38% — we use padding-left on the td and negative
   margin on ::before to create the two-column layout */
@media (max-width: 640px) {
  .tdg-table tbody td {
    position: relative;
    padding-left: calc(38% + 1px) !important;
    padding-right: 12px;
    padding-top: 11px;
    padding-bottom: 11px;
    min-height: 42px;
    align-items: center;
  }
  .tdg-table td::before {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 38%;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    box-sizing: border-box;
  }

  /* Bond table: th cells also need card treatment */
  .tdg-table tbody th {
    display: flex;
    align-items: center;
    padding: 11px 12px;
    background: var(--tdg-primary);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.15);
    letter-spacing: .02em;
  }

  /* NEET accordion on mobile */
  .tdg-neet-wrap .tdg-table-wrap { margin: 0; }
  .tdg-neet-year { font-size: 0.88rem; padding: 11px 14px; }

  /* ── NEET Cutoff table – robust mobile card layout ───────────────────
     Re-declared here with !important to win against theme/Elementor
     styles that may apply width/display/table-layout rules to nested
     tables inside <details>/<summary> accordions. */
  .tdg-neet-table,
  .tdg-neet-table thead,
  .tdg-neet-table tbody,
  .tdg-neet-table tr {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .tdg-neet-table thead { display: none !important; }
  .tdg-neet-table tr {
    background: var(--tdg-surface);
    border: 1px solid var(--tdg-border);
    border-radius: var(--tdg-radius-sm);
    box-shadow: var(--tdg-shadow);
    margin: 0 0 10px;
    overflow: hidden;
  }
  .tdg-neet-table td {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative;
    padding: 10px 12px 10px calc(38% + 12px) !important;
    border-bottom: 1px solid var(--tdg-border);
    font-size: 0.85rem;
    white-space: normal;
    word-break: break-word;
    min-height: 40px;
  }
  .tdg-neet-table td:last-child { border-bottom: none; }
  .tdg-neet-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 38%;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: var(--tdg-bg);
    color: var(--tdg-primary);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: .02em;
    border-right: 2px solid var(--tdg-primary-lt);
    box-sizing: border-box;
    word-break: break-word;
  }
}

/* ── NEET Cutoff Accordion ────────────────────────────────────────────────── */
.tdg-neet-wrap { margin: 1.75em 0; max-width: 100%; overflow: hidden; }
.tdg-neet-wrap details {
  margin-bottom: 12px;
  border: 1px solid var(--tdg-border);
  border-radius: var(--tdg-radius);
  overflow: hidden;
  box-shadow: var(--tdg-shadow);
  max-width: 100%;
  box-sizing: border-box;
}
.tdg-neet-year {
  background: linear-gradient(135deg, #1e40af 0%, var(--tdg-primary) 100%);
  color: #fff;
  padding: 13px 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  transition: background .2s;
  word-break: break-word;
}
.tdg-neet-year::before { content: '▶'; font-size: .7rem; transition: transform .2s; }
.tdg-neet-year::marker,
.tdg-neet-year::-webkit-details-marker { display: none; }
details[open] .tdg-neet-year { background: linear-gradient(135deg, #1344b8 0%, #1a56db 100%); }
details[open] .tdg-neet-year::before { transform: rotate(90deg); }
.tdg-neet-wrap .tdg-table-wrap { margin: 0; box-shadow: none; border-radius: 0; }

/* ── Bond Table ───────────────────────────────────────────────────────────── */
.tdg-bond-wrap {
  margin: 1.75em 0;
  border: 1px solid var(--tdg-border);
  border-radius: var(--tdg-radius);
  overflow: hidden;
  box-shadow: var(--tdg-shadow);
}
.tdg-bond-wrap h3 {
  margin: 0;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--tdg-primary-lt), #dbeafe);
  border-bottom: 3px solid var(--tdg-primary);
  font-size: 1rem;
  color: var(--tdg-primary-dk);
  font-weight: 700;
}
.tdg-bond-table { box-shadow: none; }
.tdg-bond-table tbody th { width: 230px; }

/* ── Gallery ──────────────────────────────────────────────────────────────── */
.tdg-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 1.75em 0;
}
.tdg-gallery-item {
  display: block;
  overflow: hidden;
  border-radius: var(--tdg-radius-sm);
  box-shadow: var(--tdg-shadow);
  position: relative;
}
.tdg-gallery-item img {
  width: 100%;
  height: 165px;
  object-fit: cover;
  transition: transform .3s ease;
  display: block;
}
.tdg-gallery-item::after {
  content: '🔍';
  position: absolute;
  inset: 0;
  background: rgba(26,86,219,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  opacity: 0;
  transition: opacity .25s;
}
.tdg-gallery-item:hover img   { transform: scale(1.08); }
.tdg-gallery-item:hover::after { opacity: 1; }

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.tdg-faq { margin: 1.75em 0; }
.tdg-faq-item {
  border: 1px solid var(--tdg-border);
  border-radius: var(--tdg-radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: box-shadow .2s;
}
.tdg-faq-item:hover { box-shadow: var(--tdg-shadow); }
.tdg-faq-q {
  width: 100%;
  background: var(--tdg-bg);
  border: none;
  text-align: left;
  padding: 14px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--tdg-text);
  gap: 12px;
  transition: background .2s, color .2s;
  font-family: var(--tdg-font);
}
.tdg-faq-q:hover { background: var(--tdg-primary-lt); color: var(--tdg-primary); }
.tdg-faq-q[aria-expanded="true"] {
  background: var(--tdg-primary);
  color: #fff;
}
.tdg-faq-icon {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  transition: transform .25s;
  line-height: 1;
}
.tdg-faq-q[aria-expanded="true"] .tdg-faq-icon { transform: rotate(45deg); }
.tdg-faq-a {
  padding: 18px 20px;
  background: var(--tdg-surface);
  line-height: 1.75;
  font-size: 0.92rem;
  color: var(--tdg-text);
  border-top: 1px solid var(--tdg-border);
}
/* Rich HTML content inside FAQ answers */
.tdg-faq-a p                { margin: 0 0 .85em; color: var(--tdg-muted); }
.tdg-faq-a p:last-child     { margin-bottom: 0; }
.tdg-faq-a strong, .tdg-faq-a b { color: var(--tdg-text); font-weight: 700; }
.tdg-faq-a em, .tdg-faq-a i { color: var(--tdg-muted); }
.tdg-faq-a a                { color: var(--tdg-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.tdg-faq-a a:hover          { color: var(--tdg-primary-dk); }
.tdg-faq-a ul, .tdg-faq-a ol { margin: .6em 0 .85em 1.4em; padding: 0; color: var(--tdg-muted); }
.tdg-faq-a ul li, .tdg-faq-a ol li { margin-bottom: .35em; }
.tdg-faq-a h3, .tdg-faq-a h4, .tdg-faq-a h5 {
  color: var(--tdg-text);
  font-weight: 700;
  margin: 1em 0 .45em;
  line-height: 1.3;
}
.tdg-faq-a h3 { font-size: 1rem; }
.tdg-faq-a h4 { font-size: 0.93rem; }
.tdg-faq-a h5 { font-size: 0.88rem; }
/* Inline code / code block */
.tdg-faq-a code {
  background: var(--tdg-bg);
  border: 1px solid var(--tdg-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.85em;
  font-family: ui-monospace, monospace;
  color: var(--tdg-primary-dk);
}
.tdg-faq-a pre {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--tdg-radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.84rem;
  margin: .8em 0;
}
.tdg-faq-a pre code { background: none; border: none; padding: 0; color: inherit; }
/* Inline tables inside FAQ */
.tdg-faq-a table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  margin: .85em 0;
  border-radius: var(--tdg-radius-sm);
  overflow: hidden;
  box-shadow: var(--tdg-shadow);
}
.tdg-faq-a table th {
  background: var(--tdg-primary);
  color: #fff;
  font-weight: 600;
  padding: 8px 12px;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.tdg-faq-a table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--tdg-border);
  color: var(--tdg-text);
  vertical-align: middle;
}
.tdg-faq-a table tr:last-child td { border-bottom: none; }
.tdg-faq-a table tr:nth-child(even) td { background: #f8faff; }
/* Blockquote / highlight box */
.tdg-faq-a blockquote {
  margin: .8em 0;
  padding: 12px 16px 12px 18px;
  border-left: 4px solid var(--tdg-primary);
  background: var(--tdg-primary-lt);
  border-radius: 0 var(--tdg-radius-sm) var(--tdg-radius-sm) 0;
  color: var(--tdg-primary-dk);
  font-style: normal;
}
/* Highlight / notice boxes via class on div/p */
.tdg-faq-a .tdg-notice,
.tdg-faq-a .notice {
  padding: 10px 14px;
  border-radius: var(--tdg-radius-sm);
  font-size: 0.88rem;
  margin: .75em 0;
}
.tdg-faq-a .tdg-notice-info   { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.tdg-faq-a .tdg-notice-warn   { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.tdg-faq-a .tdg-notice-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
/* Horizontal rule */
.tdg-faq-a hr {
  border: none;
  border-top: 1px solid var(--tdg-border);
  margin: 1em 0;
}
/* Image inside FAQ */
.tdg-faq-a img {
  max-width: 100%;
  height: auto;
  border-radius: var(--tdg-radius-sm);
  margin: .5em 0;
}
/* Mobile FAQ answer */
@media (max-width: 640px) {
  .tdg-faq-a { padding: 14px 14px; font-size: 0.88rem; }
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.tdg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--tdg-primary);
  color: #fff;
  border: 2px solid transparent;
  padding: 9px 22px;
  border-radius: var(--tdg-radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--tdg-font);
  transition: background .2s, transform .1s, box-shadow .2s;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.tdg-btn:hover {
  background: var(--tdg-primary-dk);
  box-shadow: 0 4px 12px rgba(26,86,219,.3);
  transform: translateY(-1px);
  color: #fff;
}
.tdg-btn:active { transform: translateY(0); }
.tdg-btn-outline {
  background: transparent;
  border-color: var(--tdg-primary);
  color: var(--tdg-primary);
}
.tdg-btn-outline:hover {
  background: var(--tdg-primary-lt);
  box-shadow: none;
}
.tdg-btn-sm   { padding: 5px 13px; font-size: 0.82rem; }
.tdg-btn:disabled { background: #94a3b8; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Search & Filters ─────────────────────────────────────────────────────── */
.tdg-search-wrap { margin: 1.75em 0; font-family: var(--tdg-font); }

.tdg-search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px;
  background: linear-gradient(135deg, #eff4ff 0%, #dbeafe 100%);
  border-radius: var(--tdg-radius);
  border: 1px solid #c7d9ff;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(26,86,219,.07);
}

.tdg-input,
.tdg-select {
  padding: 10px 14px;
  border: 1.5px solid var(--tdg-border);
  border-radius: var(--tdg-radius-sm);
  font-size: 0.9rem;
  flex: 1 1 200px;
  background: var(--tdg-surface);
  color: var(--tdg-text);
  font-family: var(--tdg-font);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.tdg-input:focus,
.tdg-select:focus {
  border-color: var(--tdg-primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

/* ── College Cards ────────────────────────────────────────────────────────── */
.tdg-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}

.tdg-college-card {
  border: 1px solid var(--tdg-border);
  border-radius: var(--tdg-radius);
  overflow: hidden;
  background: var(--tdg-surface);
  box-shadow: var(--tdg-shadow);
  transition: box-shadow .25s, transform .25s;
  display: flex;
  flex-direction: column;
}
.tdg-college-card:hover {
  box-shadow: var(--tdg-shadow-hover);
  transform: translateY(-3px);
}

.tdg-college-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  border-bottom: 3px solid var(--tdg-primary);
}

.tdg-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.tdg-card-body h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}
.tdg-card-body h3 a {
  color: var(--tdg-text);
  text-decoration: none;
  font-weight: 700;
  transition: color .15s;
}
.tdg-card-body h3 a:hover { color: var(--tdg-primary); }

.tdg-card-meta {
  color: var(--tdg-muted);
  font-size: 0.8rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tdg-card-meta::before {
  content: '📍';
  font-size: .75rem;
}

.tdg-card-body p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--tdg-text);
}
.tdg-card-body p strong { color: var(--tdg-primary-dk); }

/* badge-style chips */
.tdg-card-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--tdg-primary-lt);
  color: var(--tdg-primary);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}

.tdg-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--tdg-border);
}
.tdg-card-actions .tdg-btn,
.tdg-card-actions .tdg-btn-compare {
  flex: 1;
  justify-content: center;
}

/* compare button state */
.tdg-btn-compare {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: 1.5px solid var(--tdg-border);
  color: var(--tdg-muted);
  padding: 5px 13px;
  border-radius: var(--tdg-radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  font-family: var(--tdg-font);
  transition: all .2s;
}
.tdg-btn-compare:hover {
  border-color: var(--tdg-accent);
  color: var(--tdg-accent-dk);
  background: #fffbeb;
}
.tdg-btn-compare.active {
  background: #ecfdf5;
  border-color: var(--tdg-success);
  color: var(--tdg-success);
}

/* ── Comparison Tray ──────────────────────────────────────────────────────── */
.tdg-compare-wrap { margin: 1.75em 0; font-family: var(--tdg-font); }

#tdg-compare-tray {
  background: linear-gradient(135deg, #eff4ff 0%, #dbeafe 100%);
  padding: 18px 20px;
  border-radius: var(--tdg-radius);
  border: 1px solid #c7d9ff;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(26,86,219,.07);
}
#tdg-compare-tray p { margin: 0 0 12px; font-size: 0.9rem; color: var(--tdg-muted); }

.tdg-compare-slot {
  background: var(--tdg-surface);
  padding: 8px 14px;
  border-radius: var(--tdg-radius-sm);
  border: 1px solid var(--tdg-border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--tdg-text);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.tdg-compare-table thead th { background: var(--tdg-primary); color: #fff; }
.tdg-compare-table th:first-child { background: var(--tdg-bg); width: 180px; color: var(--tdg-text); }
.tdg-compare-table tbody tr:hover { background: var(--tdg-primary-lt); }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.tdg-pagination { margin-top: 20px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tdg-page-btn {
  padding: 7px 14px;
  border: 1.5px solid var(--tdg-border);
  border-radius: var(--tdg-radius-sm);
  background: var(--tdg-surface);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--tdg-text);
  font-family: var(--tdg-font);
  font-weight: 500;
  transition: all .15s;
}
.tdg-page-btn:hover { border-color: var(--tdg-primary); color: var(--tdg-primary); background: var(--tdg-primary-lt); }
.tdg-pg-active {
  background: var(--tdg-primary);
  color: #fff;
  border-color: var(--tdg-primary);
  font-weight: 700;
}

/* ── Empty / Loading States ───────────────────────────────────────────────── */
.tdg-empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--tdg-muted);
  font-size: 0.95rem;
}
.tdg-empty-state svg { margin-bottom: 12px; opacity: .4; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .tdg-search-filters         { flex-direction: column; padding: 14px; }
  .tdg-results-grid           { grid-template-columns: 1fr; }
  .tdg-gallery                { grid-template-columns: repeat(2, 1fr); }
  .tdg-table th, .tdg-table td { padding: 8px 10px; font-size: 0.82rem; }
  .tdg-bond-table tbody th    { width: 140px; }
  #tdg-compare-tray           { padding: 14px; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   SINGLE COLLEGE PAGE TEMPLATE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset wrapper ────────────────────────────────────────────────────────── */
.tdg-college-single {
  font-family: var(--tdg-font);
  color: var(--tdg-text);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 40px;
  box-sizing: border-box;
}

/* Reduce the gap between the theme header and the hero banner.
   Many themes wrap content in containers with default top padding/margin
   (e.g. .site-content, .entry-content, .ast-container, .elementor-section
   first-child margins). Target the immediate ancestors generated by common
   themes/builders and zero out their top spacing when our hero is the
   first element on the page. */
.tdg-college-single { margin-top: 0; }

body.single-college .site-content,
body.single-college .content-area,
body.single-college .ast-container,
body.single-college #content,
body.single-college main,
body.single-college .entry-content {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

body.single-college .entry-header,
body.single-college .page-header,
body.single-college .entry-title {
  display: none !important;
}

/* Collapse first empty paragraphs/wrappers some themes inject before content */
body.single-college .tdg-college-single > p:empty,
body.single-college .entry-content > p:empty {
  display: none !important;
}

/* ── Hero Banner ──────────────────────────────────────────────────────────── */
.tdg-hero {
  position: relative;
  background: linear-gradient(135deg, #0a1628 0%, #1e3a8a 55%, #1a56db 100%);
  border-radius: var(--tdg-radius);
  overflow: hidden;
  margin: 16px 0 0;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Featured Image: full-bleed background */
.tdg-hero-img {
  position: absolute;
  inset: 0;
}
.tdg-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

/* Multi-layer overlay: subtle texture at top, strong darken at bottom */
.tdg-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(10, 22, 40, 0.10)  0%,
      rgba(10, 22, 40, 0.30) 40%,
      rgba(10, 22, 40, 0.80) 75%,
      rgba(10, 22, 40, 0.96) 100%
    );
}

/* Decorative accent line at top */
.tdg-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--tdg-accent) 0%, #f97316 50%, var(--tdg-primary) 100%);
  z-index: 3;
}

/* Content panel */
.tdg-hero-content {
  position: relative;
  z-index: 2;
  padding: 40px 44px 36px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Badges row */
.tdg-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.tdg-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}
.tdg-badge-type  {
  background: rgba(255,255,255,.12);
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,.25);
}
.tdg-badge-state {
  background: rgba(245,158,11,.22);
  color: #fde68a;
  border: 1px solid rgba(245,158,11,.45);
}
.tdg-badge-estd  {
  background: rgba(16,185,129,.18);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,.35);
}

/* College title */
.tdg-college-title {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 10px;
  line-height: 1.15;
  letter-spacing: -.01em;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
}

/* Affiliation */
.tdg-hero-affil {
  color: rgba(255,255,255,.75);
  font-size: 1rem;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Divider line between title area and meta */
.tdg-hero-divider {
  display: none; /* legacy — kept for compat */
}

/* Star Rating */
.tdg-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 22px;
}
.tdg-star { font-size: 1.25rem; color: rgba(255,255,255,.22); }
.tdg-star.filled { color: #f59e0b; filter: drop-shadow(0 0 4px rgba(245,158,11,.5)); }
.tdg-star.half   { color: #fbbf24; }
.tdg-rating-num  {
  color: rgba(255,255,255,.65);
  font-size: 0.9rem;
  margin-left: 6px;
  font-weight: 600;
}

/* Hero Action Buttons */
.tdg-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.tdg-btn-accent {
  background: linear-gradient(135deg, var(--tdg-accent) 0%, #f97316 100%);
  color: #fff;
  border: none;
  padding: 11px 26px;
  border-radius: var(--tdg-radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(245,158,11,.35);
}
.tdg-btn-accent:hover {
  background: linear-gradient(135deg, #f97316 0%, var(--tdg-accent-dk) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245,158,11,.45);
  color: #fff;
}
.tdg-btn-outline-white {
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 2px solid rgba(255,255,255,.5);
  padding: 11px 26px;
  border-radius: var(--tdg-radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .2s;
  backdrop-filter: blur(4px);
}
.tdg-btn-outline-white:hover {
  background: rgba(255,255,255,.18);
  border-color: #fff;
  color: #fff;
  transform: translateY(-2px);
}

/* ── Info Bar ─────────────────────────────────────────────────────────────── */
.tdg-infobar {
  display: flex;
  flex-wrap: wrap;
  background: var(--tdg-surface);
  border: 1px solid var(--tdg-border);
  border-top: 3px solid var(--tdg-primary);
  border-radius: 0 0 var(--tdg-radius) var(--tdg-radius);
  box-shadow: var(--tdg-shadow);
  margin-bottom: 28px;
}
.tdg-infobar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  flex: 1 1 200px;
  border-right: 1px solid var(--tdg-border);
}
.tdg-infobar-item:last-child { border-right: none; }
.tdg-infobar-icon { font-size: 1.3rem; flex-shrink: 0; }
.tdg-infobar-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tdg-muted);
  font-weight: 600;
}
.tdg-infobar-val {
  display: block;
  font-size: 0.88rem;
  color: var(--tdg-text);
  font-weight: 600;
  margin-top: 1px;
}

/* ── Layout: main + sidebar ───────────────────────────────────────────────── */
.tdg-content-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}
/* Prevent main column overflow */
.tdg-main-col {
  min-width: 0;
  overflow: hidden;
}

/* ── Sections ─────────────────────────────────────────────────────────────── */
.tdg-section {
  margin-bottom: 36px;
  scroll-margin-top: 80px;
}
.tdg-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--tdg-text);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--tdg-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tdg-prose { line-height: 1.75; font-size: 0.95rem; color: var(--tdg-muted); }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.tdg-sidebar { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 18px; width: 300px; min-width: 0; }
.tdg-sidebar-card {
  background: var(--tdg-surface);
  border: 1px solid var(--tdg-border);
  border-radius: var(--tdg-radius);
  box-shadow: var(--tdg-shadow);
  overflow: hidden;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}
.tdg-sidebar-card h3 {
  margin: 0;
  padding: 13px 18px;
  background: linear-gradient(135deg, var(--tdg-primary-lt), #dbeafe);
  border-bottom: 2px solid var(--tdg-primary);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--tdg-primary-dk);
}

/* Quick Nav */
.tdg-quick-nav ul { margin: 0; padding: 8px 0; list-style: none; }
.tdg-quick-nav li { border-bottom: 1px solid var(--tdg-border); }
.tdg-quick-nav li:last-child { border-bottom: none; }
.tdg-quick-nav a {
  display: block;
  padding: 9px 18px;
  font-size: 0.88rem;
  color: var(--tdg-text);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.tdg-quick-nav a:hover {
  background: var(--tdg-primary-lt);
  color: var(--tdg-primary);
  padding-left: 22px;
}

/* Detail Table */
.tdg-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.tdg-detail-table tr { border-bottom: 1px solid var(--tdg-border); }
.tdg-detail-table tr:last-child { border-bottom: none; }
.tdg-detail-table th {
  padding: 9px 12px 9px 14px;
  text-align: left;
  color: var(--tdg-muted);
  font-weight: 600;
  width: 42%;
  background: var(--tdg-bg);
  white-space: normal;
  word-break: break-word;
}
.tdg-detail-table td {
  padding: 9px 14px;
  color: var(--tdg-text);
  font-weight: 500;
}
.tdg-contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--tdg-border);
  background: var(--tdg-bg);
}
.tdg-contact-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 10px;
  background: var(--tdg-primary-lt);
  color: var(--tdg-primary);
  border: 1px solid #c7d9ff;
  border-radius: var(--tdg-radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
}
.tdg-contact-btn:hover { background: var(--tdg-primary); color: #fff; }

/* Map */
.tdg-map-wrap { padding: 0; }
.tdg-map-wrap iframe { display: block; border-radius: 0 0 var(--tdg-radius) var(--tdg-radius); }

/* ── Single page responsive ───────────────────────────────────────────────── */

/* Tablet: sidebar moves below main content */
@media (max-width: 1024px) {
  .tdg-college-single { padding: 0 14px 32px; }
  .tdg-content-wrap { grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; }
  .tdg-sidebar { width: 260px; }
}

@media (max-width: 900px) {
  .tdg-college-single { padding: 0 12px 28px; }
  /* Stack sidebar below main content */
  .tdg-content-wrap {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .tdg-main-col { grid-row: 1; }
  .tdg-sidebar {
    grid-row: 2;
    position: static;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px;
  }
  .tdg-sidebar-card {
    flex: 1 1 calc(50% - 7px);
    min-width: 240px;
  }
  .tdg-hero-content { padding: 28px 24px 24px; }
  .tdg-hero { min-height: 340px; }
}

/* Mobile */
@media (max-width: 640px) {
  .tdg-college-single { padding: 0 0 24px; }
  .tdg-hero { min-height: 260px; border-radius: 0; }
  .tdg-hero-content { padding: 18px 16px 20px; }
  .tdg-college-title { font-size: 1.4rem; }
  .tdg-hero-badges { gap: 6px; }
  .tdg-badge { font-size: 0.7rem; padding: 4px 10px; }
  .tdg-hero-actions { gap: 8px; }
  .tdg-btn-accent,
  .tdg-btn-outline-white { padding: 9px 16px; font-size: 0.85rem; }

  /* Info bar: 2-column grid on mobile */
  .tdg-infobar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 0 0 var(--tdg-radius) var(--tdg-radius);
  }
  .tdg-infobar-item {
    padding: 10px 12px;
    border-right: 1px solid var(--tdg-border);
    border-bottom: 1px solid var(--tdg-border);
  }
  .tdg-infobar-item:nth-child(even) { border-right: none; }
  .tdg-infobar-item:nth-last-child(-n+2) { border-bottom: none; }
  .tdg-infobar-val { font-size: 0.78rem; word-break: break-all; }

  /* Sidebar: full-width single column */
  .tdg-sidebar { flex-direction: column; }
  .tdg-sidebar-card { flex: none; width: 100%; min-width: 0; border-radius: 0; border-left: none; border-right: none; }
  .tdg-sidebar-card:first-child { border-top: none; }

  /* Sections */
  .tdg-section-title { font-size: 1.05rem; }
  .tdg-section { margin-bottom: 24px; }

  /* Quick nav: horizontal scrollable on mobile */
  .tdg-quick-nav ul {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
    gap: 0;
    white-space: nowrap;
  }
  .tdg-quick-nav li {
    border-bottom: none;
    border-right: 1px solid var(--tdg-border);
    flex-shrink: 0;
  }
  .tdg-quick-nav li:last-child { border-right: none; }
  .tdg-quick-nav a { padding: 10px 14px; font-size: 0.82rem; }

  .tdg-contact-links { gap: 6px; padding: 10px 12px; }
  .tdg-contact-btn { font-size: 0.75rem; padding: 6px 8px; }
}

/* Very small screens */
@media (max-width: 380px) {
  .tdg-college-title { font-size: 1.25rem; }
  .tdg-infobar { grid-template-columns: 1fr; }
  .tdg-infobar-item { border-right: none; }
  .tdg-infobar-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--tdg-border); }
  .tdg-infobar-item:last-child { border-bottom: none; }
}

/* =========================================================
   TDG Archive Template – College Listing (/college/)
   ========================================================= */

.tdg-archive-wrap {
  background: var(--tdg-bg);
  padding: 32px 0 60px;
  font-family: var(--tdg-font);
}
.tdg-archive-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.tdg-archive-header {
  text-align: center;
  margin-bottom: 28px;
}
.tdg-archive-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--tdg-text);
  margin: 0 0 10px;
}
.tdg-archive-sub {
  color: var(--tdg-muted);
  font-size: 1rem;
  max-width: 640px;
  margin: 0 auto;
}

/* ── Filter Bar ───────────────────────────────────────────────────────────── */
.tdg-archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--tdg-surface);
  padding: 16px;
  border-radius: var(--tdg-radius);
  box-shadow: var(--tdg-shadow);
  margin-bottom: 30px;
}
.tdg-arch-input,
.tdg-arch-select {
  flex: 1 1 200px;
  padding: 10px 14px;
  border: 1px solid var(--tdg-border);
  border-radius: var(--tdg-radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  background: #fff;
  color: var(--tdg-text);
}
.tdg-arch-input:focus,
.tdg-arch-select:focus {
  outline: none;
  border-color: var(--tdg-primary);
}

/* ── Card Grid ────────────────────────────────────────────────────────────── */
.tdg-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.tdg-arch-card {
  background: var(--tdg-surface);
  border-radius: var(--tdg-radius);
  overflow: hidden;
  box-shadow: var(--tdg-shadow);
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.tdg-arch-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--tdg-shadow-hover);
}

.tdg-arch-card-img {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--tdg-primary-lt);
}
.tdg-arch-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
  display: block;
}
.tdg-arch-card:hover .tdg-arch-card-img img { transform: scale(1.06); }

.tdg-arch-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--tdg-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.tdg-arch-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.tdg-arch-location {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tdg-primary);
  margin-bottom: 6px;
  display: inline-block;
}

.tdg-arch-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 14px;
}
.tdg-arch-card-title a {
  color: var(--tdg-text);
  text-decoration: none;
  transition: color .15s;
}
.tdg-arch-card-title a:hover { color: var(--tdg-primary); }

.tdg-arch-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--tdg-border);
}
.tdg-arch-meta {
  flex: 1 1 80px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tdg-arch-meta-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--tdg-muted);
  font-weight: 600;
}
.tdg-arch-meta-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--tdg-text);
}

.tdg-arch-readmore {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--tdg-primary);
  text-decoration: none;
  transition: gap .15s;
}
.tdg-arch-readmore:hover { gap: 10px; color: var(--tdg-primary-dk); }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.tdg-arch-pagination {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.tdg-arch-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--tdg-radius-sm);
  background: var(--tdg-surface);
  border: 1px solid var(--tdg-border);
  color: var(--tdg-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all .15s;
}
.tdg-arch-pagination .page-numbers:hover { border-color: var(--tdg-primary); color: var(--tdg-primary); }
.tdg-arch-pagination .page-numbers.current {
  background: var(--tdg-primary);
  border-color: var(--tdg-primary);
  color: #fff;
}

/* ── Empty State ──────────────────────────────────────────────────────────── */
.tdg-arch-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--tdg-surface);
  border-radius: var(--tdg-radius);
  color: var(--tdg-muted);
  font-size: 1.05rem;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .tdg-archive-title { font-size: 1.6rem; }
  .tdg-archive-grid { grid-template-columns: 1fr; }
  .tdg-archive-filters { flex-direction: column; }
  .tdg-arch-input, .tdg-arch-select { flex: 1 1 100%; }
}

@media (max-width: 380px) {
  .tdg-arch-meta-row { flex-direction: column; gap: 8px; }
}
