/* ==========================================================================
   Public stock page: "Make Sense of the Ranks" and "Similar Stocks"
   Built after the app (Ranks.tsx / SimilarStocks.tsx). No JavaScript needed.
   ========================================================================== */

.rk-section,
.ss-section {
  margin: 60px auto;
  font-family: "Inter", sans-serif;
}

.rk-section h2,
.ss-section h2 {
  font-family: "SangBleuRegular", serif;
  font-weight: 400;
  color: #0f0f0f;
  line-height: 1.2;
  margin-bottom: 10px;
}

.rk-section .rk-intro,
.ss-section .ss-intro {
  font-size: var(--fluid-16-20);
  font-weight: 400;
  line-height: 1.3;
  color: #1e1e1e;
  margin: 0;
}

/* ---------- Make Sense of the Ranks ---------- */

.rk-section .rk-intro {
  margin-bottom: 32px;
}

.rk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.rk-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: #fff;
  border: 1.25px solid var(--color-border, #E0DAD1);
  border-radius: 12px;
}

.rk-section .rk-card h3.rk-card__title {
  display: flex;
  margin: 0;
  font-family: "Inter", sans-serif;
  align-items: center;
  gap: 8px;
  color: #3f3b37;
  font-size: 16px !important; /* global h3 rule uses !important */
  font-weight: 600;
  line-height: 1.5;
}

.rk-card__title svg,
.rk-card__title i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.rk-card__title img {
  width: 28px;
  height: auto;
  flex-shrink: 0;
}

.rk-card__desc {
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 1.625;
  color: rgba(63, 59, 55, 0.7);
}

.rk-card__labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.rk-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.33;
}

.rk-label::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.rk-label--good { color: #339933; }
.rk-label--bad { color: #E71313; }

.rk-card__more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  color: #472101;
  text-decoration: none;
}

.rk-card__more:hover { text-decoration: underline; }

.rk-card__more svg,
.rk-card__more i {
  width: 12px;
  height: 12px;
}

/* ---------- Similar Stocks ---------- */

.ss-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}

.ss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border: 1px solid #CFCDCA;
  border-radius: 999px;
  background: transparent;
  color: #1e1e1e;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.ss-btn:hover { background: #f9f2ec; }

.ss-btn--bottom {
  display: none;
  margin: 16px auto 0;
  width: fit-content;
}

.ss-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ss-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: #fff;
  border: 1.25px solid var(--color-border, #E0DAD1);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ss-card:hover {
  border-color: #b8a89a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ss-card__info {
  flex: 1;
  min-width: 0;
}

.ss-card__row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ss-flag {
  width: 20px;
  height: auto;
  flex-shrink: 0;
  background: transparent;
}

.ss-section .ss-card h3.ss-name {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Inter", sans-serif;
  font-size: 16px !important;
  font-weight: 700;
  line-height: 1.5;
  color: #1E1E1E;
}

.ss-ticker {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: #F3F3F3;
  color: #707070;
  font-size: 11px;
  text-transform: uppercase;
}

.ss-meta {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.375;
  color: #707070;
}

.ss-arrow {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #472101;
}

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
  .rk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ss-btn--top { display: none; }
  .ss-btn--bottom { display: flex; }
}

@media (max-width: 640px) {
  .rk-section,
  .ss-section { margin: 40px auto; }
  .rk-grid,
  .ss-grid { grid-template-columns: minmax(0, 1fr); }
  .ss-card { padding: 16px; }
}
