/* ============================================================
   StackUI Widget: news  (scoped styles — ALL variants)
   ------------------------------------------------------------
   Everything is scoped under .stk-news so it can never leak into
   other widgets or fight the core.

   Variants covered:
     - col-12          full-width, two tabbed 4-card grids
     - col-6           half-width, two tabbed 2-card grids (production)
     - col-4           narrow, two tabs stacking cards
     - col-4-carousel  narrow, two tabs, each a Swiper carousel

   REMOVED vs the original ref-template (now provided by core):
     - Google-font @import, * reset, base body/p/a  -> core + tokens
     - .container + media queries                    -> Bootstrap
     - .row / .col-* grid                            -> Bootstrap grid
     - generic utils (.d-flex, .justify-content-between,
       .align-items-center, .float-end, .mt-0, .mb-0) -> Bootstrap

   KEPT (widget-specific — needed for fidelity), all scoped:
     .text-left (Bootstrap 5 renamed it to .text-start), all custom
     spacing (.mb-16/.mt-16/.mb-24 + responsive .mb-md-24/.mb-sm-24/
     .mt-xs-16), btn / card overrides, Swiper base (needed by the
     col-4-carousel variant), and every .investor-news / .tab-slider
     rule.

   Brand green (#57CC33) -> central token var(--stk-primary).
   ============================================================ */

.stk-news {
  /* original :root tokens, moved onto the widget scope */
  --text-header: #000000;
  --text-sub-header: #888888;
  --bg-white: #ffffff;
  --bg-gray: #FAFBFD;
  --bg-card: #FAFBFD;
  --button-primary-bg: #000000;
  --button-primary-text: #ffffff;
  --bg-color-primary: var(--stk-primary);  /* was #57CC33 */
  --border-radius-medium: 8px;
  --border-radius-xl: 100px;
}

/* ----- widget-scoped utility (Bootstrap 5 dropped .text-left for .text-start) ----- */
.stk-news .text-left { text-align: left; }

/* ----- widget-scoped custom spacing (override Bootstrap within widget) ----- */
.stk-news .mb-16 { margin-bottom: 16px; } /* was bootstrap mb-3 (16px) */
.stk-news .mt-16 { margin-top: 16px; }    /* was bootstrap mt-3 (16px) */
.stk-news .mb-24 { margin-bottom: 24px; }

@media (max-width: 991px) {
  .stk-news .mb-md-24 { margin-bottom: 24px; }
}
@media (max-width: 767px) {
  .stk-news .mb-sm-24 { margin-bottom: 24px; }
}
@media (max-width: 575px) {
  .stk-news .mb-md-24 { margin-bottom: 16px; }
  .stk-news .mb-sm-24 { margin-bottom: 16px; }
  .stk-news .mt-xs-16 { margin-top: 16px; }
}

/* ----- Button (widget-specific pill) ----- */
.stk-news .btn {
  padding: 8px 24px;
  border-radius: var(--border-radius-xl);
  cursor: pointer;
  white-space: nowrap;
}

.stk-news .btn-primary {
  color: var(--button-primary-text);
  background-color: var(--button-primary-bg);
  border-color: var(--button-primary-bg);
  width: max-content;
  cursor: pointer;
  transition: 0.35s;
}

.stk-news .btn-primary:hover {
  background-color: var(--bg-color-primary);
  border-color: var(--bg-color-primary);
}

.stk-news .btn-primary:active,
.stk-news .btn-primary:focus {
  background-color: var(--bg-color-primary) !important;
  border-color: var(--bg-color-primary) !important;
}

/* ----- Card (custom in the original style.css) ----- */
.stk-news .card-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-header);
}

.stk-news .card {
  padding: 24px;
  background-color: var(--bg-card);
  border-radius: var(--border-radius-medium);
  border: none;
}

.stk-news .card-header {
  background-color: var(--bg-card);
  border-radius: var(--border-radius-medium);
  border: none;
  padding: 0;
  margin-bottom: 24px;
}

.stk-news .card-header:first-child {
  border-radius: var(--border-radius-medium);
}

.stk-news .card-body {
  padding: 0;
}

@media (max-width: 575px) {
  .stk-news .card {
    padding: 20px;
  }

  .stk-news .card-header {
    margin-bottom: 12px;
  }

  .stk-news .card-title {
    font-size: 20px;
  }

  .stk-news .btn {
    font-size: 14px;
    padding: 6px 18px;
  }
}

/* ----- Swiper base (needed for the "col-4-carousel" variant) ----- */
.stk-news .swiper-container {
  width: 100%;
}

.stk-news .swiper-slide {
  text-align: center;
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stk-news .swiper-pagination {
  position: relative !important;
  padding-top: 20px;
}

/* ============================================================
   Investor News (component-specific)
   ============================================================ */
.stk-news .investor-news .card,
.stk-news .investor-news .card-header {
  background-color: var(--bg-white);
}

.stk-news .investor-news .card-body {
  padding: 0px 0;
}

.stk-news .tab-slider--nav {
  width: 100%;
  float: left;
  margin-bottom: 24px;
}

/* `.tab-slider--nav` is a 100%-width float (copied as-is from the original style.css).
   Without a clear, the following `.tab-slider--container` — a new block-formatting-context
   box because it (or its `.row` descendant) uses `display: grid` — has zero space left
   beside the float and collapses to 0 width instead of clearing below it. Bootstrap's
   flex-based `.row` never surfaced this; ours does. */
.stk-news .tab-slider--container {
  clear: both;
}

.stk-news .tab-slider--tabs {
  border: 1px solid #eee;
  border-radius: 100px;
  padding: 5px;
  list-style: none;
  position: relative;
  overflow: hidden;
  background: #fff;
  width: max-content;
  user-select: none;
}

.stk-news .tab-slider--trigger {
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  color: var(--text-sub-header);
  text-align: center;
  padding: 12px 18px;
  position: relative;
  z-index: 2;
  cursor: pointer;
  display: inline-block;
  transition: color 250ms ease-in-out;
  user-select: none;
}

.stk-news .tab-slider--trigger.active {
  font-weight: 600;
  color: var(--text-header);
  background-color: var(--bg-gray);
  border-radius: 100px;
}

.stk-news .investor-news .number {
  font-size: 18px;
  font-weight: 600;
  line-height: normal;
  color: var(--text-header);
}

.stk-news .investor-news .number-des {
  font-size: 14px;
  color: var(--text-sub-header);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stk-news .investor-news .investor-news-block .card {
  background-color: var(--bg-card);
  margin-bottom: 0;
}

@media (max-width: 1199px) {
  .stk-news .investor-news .card {
    padding: 24px 0;
  }

  .stk-news .investor-news .investor-news-block .card {
    padding: 24px;
  }
}

@media (max-width: 991px) {
  .stk-news .investor-news .number-des {
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 575px) {
  .stk-news .tab-slider--trigger {
    font-size: 14px;
  }

  .stk-news .investor-news .number {
    font-size: 16px;
  }
}
