/* ==========================================================================
   Sector pages — Anantys Design System aligned
   Covers: sectors_index.html + sector.html
   ========================================================================== */

/* ---------- Sector hero card ---------- */
body.portal .sector-hero {
  padding: 1rem var(--ap-space-6, 24px);
}

body.portal .sector-hero-title {
  font-family: var(--ap-font-title);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ap-text);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

body.portal .sector-hero-subtitle {
  font-size: 0.85rem;
  color: var(--ap-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

body.portal .sector-hero-stats {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

body.portal .sector-hero-stat {
  text-align: center;
}

body.portal .sector-hero-stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ap-text-secondary);
}

body.portal .sector-hero-stat-val {
  font-family: var(--ap-font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ap-text);
}

/* ---------- Exchange filter pills ---------- */
body.portal .sector-pills {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

body.portal .sector-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--ap-border);
  background: var(--ap-surface-1);
  color: var(--ap-text-secondary);
  transition: border-color 200ms, color 200ms, background 200ms;
}

body.portal .sector-pill:hover {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--ap-text);
  text-decoration: none;
}

body.portal .sector-pill.active {
  background: var(--ap-accent);
  color: var(--ap-bg);
  border-color: var(--ap-accent);
}

body.portal .sector-pill.active:hover {
  opacity: 0.9;
  color: var(--ap-bg);
}

/* ---------- Sector grid cards ---------- */
body.portal .sector-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--ap-surface-card);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-xl, 16px);
  overflow: hidden;
  backdrop-filter: blur(8px);
  transition: border-color 200ms;
  text-decoration: none;
  color: var(--ap-text);
}

body.portal .sector-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: var(--ap-text);
}

body.portal .sector-card-body {
  display: flex;
  flex-direction: column;
  padding: var(--ap-space-5, 20px);
}

body.portal .sector-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.25rem;
}

body.portal .sector-card-name-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1;
}

body.portal .sector-card-icon {
  font-size: 1rem;
  color: var(--ap-accent);
  flex-shrink: 0;
}

body.portal .sector-card-name {
  font-family: var(--ap-font-title);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ap-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.portal .sector-card-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--ap-font-mono);
  flex-shrink: 0;
}

body.portal .sector-card-delta.gain { color: var(--ap-success); }
body.portal .sector-card-delta.loss { color: var(--ap-danger); }

body.portal .sector-card-sub {
  font-size: 0.75rem;
  color: var(--ap-text-muted);
  margin-bottom: 0.75rem;
}

body.portal .sector-card-footer-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--ap-text-muted);
  margin-top: auto;
}

body.portal .sector-card-top-ticker {
  font-family: var(--ap-font-mono);
  font-weight: 600;
  color: var(--ap-accent);
}

body.portal .sector-card-top-label {
  color: var(--ap-text-muted);
}

/* ---------- Breadcrumb (sector page) ---------- */
body.portal .sector-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

body.portal .sector-breadcrumb a {
  color: var(--ap-text-secondary);
  text-decoration: none;
}

body.portal .sector-breadcrumb a:hover {
  color: var(--ap-accent);
}

body.portal .sector-breadcrumb-sep {
  color: var(--ap-text-muted);
  font-size: 0.7rem;
}

body.portal .sector-breadcrumb-active {
  color: var(--ap-text);
  font-weight: 600;
}

/* ---------- Section titles (Top Gainers, etc.) ---------- */
body.portal .sector-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ap-text-secondary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.portal .sector-section-title i {
  color: var(--ap-accent);
}

/* ---------- Sector page body text ---------- */
body.portal .sector-body-text {
  font-size: 0.9rem;
  color: var(--ap-text-muted);
  max-width: 800px;
  line-height: 1.6;
}

/* ---------- Portfolio-style stock cards ---------- */
body.portal .sector-stock-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--ap-space-5, 20px);
  background: var(--ap-surface-card);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-xl, 16px);
  backdrop-filter: blur(8px);
  text-decoration: none;
  color: var(--ap-text);
  transition: border-color 200ms;
}

body.portal .sector-stock-card:hover {
  border-color: rgba(0, 229, 160, 0.2);
  text-decoration: none;
  color: var(--ap-text);
}

body.portal .sector-stock-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

body.portal .sector-stock-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

body.portal .sector-stock-name-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

body.portal .sector-stock-name {
  font-family: var(--ap-font-title);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ap-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.portal .sector-stock-ticker {
  font-family: var(--ap-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ap-text-muted);
}

body.portal .sector-stock-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--ap-font-mono);
  flex-shrink: 0;
}

body.portal .sector-stock-delta.gain { color: var(--ap-success); }
body.portal .sector-stock-delta.loss { color: var(--ap-danger); }

body.portal .sector-stock-price {
  margin-bottom: 0.5rem;
}

body.portal .sector-stock-price-val {
  font-family: var(--ap-font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ap-text);
}

body.portal .sector-stock-desc {
  font-size: 0.8rem;
  color: var(--ap-text-muted);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

body.portal .sector-seo-text {
  font-size: 0.8rem;
  color: var(--ap-text-muted);
  line-height: 1.5;
  max-width: 800px;
}

/* ---------- Promo grid cards (fill orphan slots) ---------- */
body.portal .sector-card-promo {
  border-color: rgba(0, 229, 160, 0.12);
}

body.portal .sector-card-promo:hover {
  border-color: rgba(0, 229, 160, 0.25);
}

body.portal .sector-card-promo-logo {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  flex-shrink: 0;
}

body.portal .sector-card-promo-text {
  font-size: 0.8rem;
  color: var(--ap-text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

body.portal .sector-card-promo-text em {
  font-style: normal;
  color: var(--ap-accent);
}

/* ---------- Bottom spacing ---------- */
body.portal .portal-main-container {
  padding-bottom: 3rem;
}
