/* Testinar Design System
   Bootstrap is the layout/forms foundation. These tn-* classes are the shared
   Testinar visual layer used across articles, products, quizzes, and admin pages. */

:root {
  --tn-ink: #071d36;
  --tn-muted: #52657d;
  --tn-soft: #f5f8fb;
  --tn-soft-blue: #eef7ff;
  --tn-line: #d9e6f0;
  --tn-line-strong: #c9dcea;
  --tn-teal: #138f76;
  --tn-teal-bright: #08b894;
  --tn-blue: #2563eb;
  --tn-gold: #ffc744;
  --tn-warm: #fff8e9;
  --tn-danger: #d94852;
  --tn-radius-sm: 5px;
  --tn-radius: 8px;
  --tn-radius-lg: 10px;
  --tn-shadow-sm: 0 8px 18px rgba(8, 35, 63, .05);
  --tn-shadow: 0 14px 30px rgba(8, 35, 63, .08);
  --tn-shadow-lg: 0 18px 44px rgba(15, 23, 42, .08);
}

.tn-page-title {
  background: linear-gradient(135deg, #f8fbff 0%, #fffaf0 100%);
  border-bottom: 1px solid var(--tn-line);
}

.tn-page-title .container {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.tn-page-title h1 {
  color: var(--tn-ink);
  letter-spacing: -.02em;
  min-width: 0;
  overflow-wrap: anywhere;
}

.tn-page-title .breadcrumb {
  background: transparent;
  flex: 0 1 42%;
  justify-content: flex-end;
  margin: 0 !important;
  max-width: 520px;
  min-width: 0;
  position: static !important;
  text-align: right;
  transform: none !important;
}

.tn-page-title .breadcrumb-item {
  color: var(--tn-muted);
  display: block;
  line-height: 1.45;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.tn-kicker,
.tn-eyebrow {
  color: #d17a00;
  display: block;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .14em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.tn-card {
  background: #fff;
  border: 1px solid var(--tn-line);
  border-radius: var(--tn-radius-lg);
  box-shadow: var(--tn-shadow);
  overflow: hidden;
}

.tn-card-hover {
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.tn-card-hover:hover,
.tn-card-hover:focus-within {
  border-color: #52c7b3;
  box-shadow: var(--tn-shadow-lg);
  transform: translateY(-2px);
}

.tn-btn,
.btn.tn-btn {
  align-items: center;
  border-radius: var(--tn-radius-sm);
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  letter-spacing: .02em;
  min-height: 44px;
  padding: 10px 18px;
  text-decoration: none;
}

.tn-btn-primary,
.btn.tn-btn-primary {
  background: var(--tn-teal);
  border-color: var(--tn-teal);
  color: #fff !important;
}

.tn-btn-primary:hover,
.tn-btn-primary:focus {
  background: #0f755f;
  border-color: #0f755f;
  color: #fff !important;
}

.tn-btn-gold,
.btn.tn-btn-gold {
  background: var(--tn-gold);
  border-color: var(--tn-gold);
  color: var(--tn-ink) !important;
}

.btn-sm.tn-btn,
.tn-btn.btn-sm {
  font-size: 13px;
  min-height: 34px;
  padding: 7px 12px;
}

.tn-search-card {
  background: #fff;
  border: 1px solid rgba(17, 24, 39, .08);
  border-radius: var(--tn-radius-lg);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .05);
  margin-bottom: 30px;
  padding: 18px;
}

.tn-search-card .form-control {
  border-color: #cfddea;
  min-height: 52px;
}

.tn-search-card .btn {
  min-height: 52px;
}

.tn-article-card {
  height: 100%;
}

.tn-article-media {
  align-items: center;
  aspect-ratio: 7 / 4;
  background: linear-gradient(180deg, #f8fafc 0%, #edf4fb 100%);
  border-bottom: 1px solid rgba(17, 24, 39, .08);
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.tn-article-media a {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.tn-article-media img {
  display: block;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center center;
  width: 100%;
}

.tn-article-card .card-body {
  padding: 22px 24px 26px;
}

.tn-article-card h2,
.tn-article-card h3 {
  font-size: 26px;
  line-height: 1.25;
  margin-bottom: 12px;
}

.tn-article-card h2 a,
.tn-article-card h3 a,
.tn-product-title,
.tn-product-title a {
  color: var(--tn-ink);
  text-decoration: none;
}

.tn-article-card h2 a:hover,
.tn-article-card h3 a:hover,
.tn-product-title:hover,
.tn-product-title a:hover {
  color: var(--tn-teal-bright);
}

.tn-article-summary {
  color: #293a4f;
  font-size: 17px !important;
  line-height: 1.7;
  margin-top: 0 !important;
}

.tn-pagination .page-link {
  border-color: rgba(17, 24, 39, .12);
  border-radius: 999px !important;
  color: #17324f;
  font-size: 15px;
  font-weight: 800;
  margin: 4px;
  min-width: 42px;
  text-align: center;
}

.tn-pagination .page-item.active .page-link {
  background: #17324f;
  border-color: #17324f;
  color: #fff;
}

.tn-pagination .page-item.disabled .page-link {
  background: transparent;
  border-color: transparent;
  color: #64748b;
}

.tn-reading-progress,
.article-reading-progress {
  background: rgba(226, 232, 240, .95);
  height: 3px;
  left: 0;
  pointer-events: none;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 2147483000;
}

.tn-reading-progress-bar,
.article-reading-progress-bar {
  background: linear-gradient(90deg, #0ea5e9 0%, #2563eb 72%, #f59e0b 100%);
  box-shadow: 0 0 14px rgba(37, 99, 235, .35);
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 80ms linear;
  width: 100%;
}

.tn-article-main-image {
  background: var(--tn-soft);
  border: 1px solid var(--tn-line);
  border-radius: var(--tn-radius-lg);
  margin-bottom: 28px;
  overflow: hidden;
  padding: 0;
}

.tn-article-main-image img {
  display: block;
  height: auto;
  max-width: 100%;
  width: 100%;
}

.tn-entry-content,
.entry-content {
  color: #293a4f;
}

.tn-entry-content img,
.entry-content img {
  height: auto;
  max-width: 100%;
}

.article-svg-figure,
.article-png-figure {
  margin: 24px auto;
  text-align: center;
  width: min(100%, var(--article-figure-max-width, 720px));
}

.article-svg-figure img,
.article-svg-figure svg {
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

.article-png-figure img,
.article-static-figure img {
  display: inline-block;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

.article-svg-figure.is-overview {
  --article-figure-max-width: 720px;
}

.article-svg-figure.is-example,
.article-svg-figure.is-problem {
  --article-figure-max-width: 660px;
}

.article-svg-figure.is-practice {
  --article-figure-max-width: 620px;
}

.article-static-figure {
  margin: 24px auto;
  max-width: 100%;
  text-align: center;
}

.article-inline-tikz,
.article-choice-visual {
  display: block;
  margin: 10px 0 14px 28px;
  max-width: 100%;
  overflow-x: auto;
}

.article-choice-list .article-inline-tikz svg {
  display: block;
  height: auto;
  max-width: min(100%, 360px);
}

.article-choice-visual svg {
  display: block;
  height: auto;
  max-width: min(100%, 420px);
}

.article-table-figure,
.article-data-table-wrap {
  display: block;
  margin: 22px auto;
  max-width: 100%;
  overflow-x: auto;
  text-align: center;
}

.article-table-figure table,
.article-data-table {
  background: #fff;
  border: 1px solid #cfdcea;
  border-collapse: collapse;
  border-radius: var(--tn-radius);
  box-shadow: 0 10px 26px rgba(8, 35, 63, .06);
  color: #17324d;
  font-size: 16px;
  line-height: 1.45;
  margin: 0 auto;
  min-width: 220px;
  overflow: hidden;
  width: auto;
}

.article-data-table {
  min-width: min(100%, 520px);
}

.article-table-figure th,
.article-table-figure td,
.article-data-table th,
.article-data-table td {
  border: 1px solid #d8e3ee;
  padding: 10px 14px;
  text-align: center;
  vertical-align: middle;
}

.article-table-figure th,
.article-data-table th {
  background: #e0f2fe;
  color: #0f2f4a;
  font-weight: 800;
}

.article-table-figure tr:nth-child(even) td {
  background: #f8fafc;
}

.article-data-table td:first-child,
.article-data-table th:first-child {
  text-align: left;
}

.article-table-note {
  margin: 10px 0 0;
  text-align: center;
}

.article-topic-lesson .article-choice-list {
  display: grid;
  gap: 12px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin: 16px 0 20px;
  padding: 0;
}

.article-topic-lesson .article-choice-list li {
  background: linear-gradient(180deg, #fff, #f7fbff);
  border: 1px solid #d6e7f7;
  border-radius: var(--tn-radius);
  box-shadow: var(--tn-shadow-sm);
  color: #10233f;
  margin: 0;
  padding: 12px 14px;
}

.article-topic-lesson .article-answer-toggle-section {
  margin: 34px 0;
}

.article-topic-lesson .article-answer-toggle {
  background: #fff;
  border: 1px solid #bfe2f4;
  border-radius: var(--tn-radius-lg);
  box-shadow: var(--tn-shadow);
  overflow: hidden;
}

.article-topic-lesson .article-answer-toggle summary {
  align-items: center;
  background: linear-gradient(135deg, #06233f, #0b8f7a);
  color: #fff;
  cursor: pointer;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  list-style: none;
  padding: 20px 24px;
}

.article-topic-lesson .article-answer-toggle summary::-webkit-details-marker {
  display: none;
}

.article-topic-lesson .article-answer-toggle summary::after {
  align-items: center;
  background: var(--tn-gold);
  border-radius: var(--tn-radius-sm);
  color: var(--tn-ink);
  content: "+";
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 24px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.article-topic-lesson .article-answer-toggle[open] summary::after {
  content: "-";
}

.article-topic-lesson .article-answer-toggle-title {
  display: block;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

.article-topic-lesson .article-answer-toggle-subtitle {
  color: rgba(255, 255, 255, .82);
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-top: 4px;
}

.article-topic-lesson .article-answer-toggle-content {
  background: #f8fcff;
  display: grid;
  gap: 14px;
  padding: 20px;
}

.article-topic-lesson .article-answer-card {
  background: #fff;
  border: 1px solid #d7e7f2;
  border-radius: var(--tn-radius);
  margin: 0;
  padding: 18px;
}

.tn-section-heading {
  margin: 38px 0 22px;
}

.tn-section-heading h2,
.tn-section-heading h3 {
  color: var(--tn-ink);
  font-weight: 900;
}

.tn-product-card {
  background: #fff;
  border: 1px solid var(--tn-line);
  border-radius: var(--tn-radius-lg);
  box-shadow: var(--tn-shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 14px;
}

.tn-product-card-media {
  align-items: center;
  background: var(--tn-soft);
  border-radius: var(--tn-radius);
  display: flex;
  justify-content: center;
  min-height: 230px;
  overflow: hidden;
  padding: 10px;
}

.tn-product-card-media img {
  display: block;
  height: 100%;
  max-height: 260px;
  object-fit: contain;
  width: 100%;
}

.tn-product-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 14px 4px 4px;
  text-align: center;
}

.tn-product-title {
  display: block;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 12px;
}

.tn-price {
  color: #a33b00;
  font-size: 19px;
  font-weight: 900;
  margin-bottom: 14px;
}

.tn-price del {
  color: #8190a3;
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}

.tn-sidebar-stack {
  display: grid;
  gap: 18px;
}

.tn-product-mini {
  background: #fff;
  border: 1px solid var(--tn-line);
  border-radius: var(--tn-radius-lg);
  box-shadow: var(--tn-shadow);
  display: grid;
  gap: 14px;
  grid-template-columns: 96px minmax(0, 1fr);
  padding: 12px;
}

.tn-click-card {
  cursor: pointer;
  position: relative;
}

.tn-card-cover-link {
  border-radius: inherit;
  inset: 0;
  position: absolute;
  z-index: 1;
}

.tn-card-cover-link:focus {
  box-shadow: 0 0 0 3px rgba(19, 143, 118, .24);
  outline: 0;
}

.tn-click-card .tn-product-card-media,
.tn-click-card .tn-product-card-body,
.tn-click-card .tn-product-mini-media,
.tn-click-card .tn-product-mini-copy,
.tn-click-card .tn-sidebar-article-media,
.tn-click-card .tn-sidebar-article-copy {
  pointer-events: none;
  position: relative;
  z-index: 2;
}

.tn-click-card .tn-download-btn {
  pointer-events: auto;
  position: relative;
  z-index: 3;
}

.tn-product-mini-download {
  gap: 18px;
  grid-template-columns: 132px minmax(0, 1fr);
  min-height: 194px;
  padding: 16px;
}

.tn-product-card-download .tn-product-title {
  color: var(--tn-ink);
}

.tn-product-card-download .tn-download-btn {
  width: 100%;
}

.tn-product-mini-media {
  align-items: center;
  background: var(--tn-soft);
  border-radius: var(--tn-radius);
  display: flex;
  justify-content: center;
  min-height: 132px;
  overflow: hidden;
  padding: 6px;
}

.tn-product-mini-download .tn-product-mini-media {
  min-height: 166px;
  padding: 8px;
}

.tn-product-mini-media img {
  display: block;
  max-height: 140px;
  object-fit: contain;
  width: 100%;
}

.tn-product-mini-download .tn-product-mini-media img {
  max-height: 180px;
}

.tn-product-mini-copy {
  min-width: 0;
}

.tn-product-mini-download .tn-product-mini-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tn-product-mini .tn-product-title {
  font-size: 14px;
  margin-bottom: 8px;
}

.tn-product-mini-download .tn-product-title {
  color: var(--tn-ink);
  font-size: 16px;
  line-height: 1.28;
}

.tn-product-mini .tn-price,
.tn-product-card-download .tn-price {
  align-items: baseline;
  display: flex;
  flex-wrap: nowrap;
  font-size: 17px;
  gap: 8px;
  margin-bottom: 10px;
  white-space: nowrap;
}

.tn-product-mini .tn-price span,
.tn-product-card-download .tn-price span {
  flex: 0 0 auto;
  order: 1;
}

.tn-product-mini .tn-price del,
.tn-product-card-download .tn-price del {
  display: inline-block !important;
  flex: 0 0 auto;
  margin-bottom: 0;
  order: 2;
}

.tn-product-mini-download .tn-price {
  font-size: 20px;
  margin-bottom: 16px;
}

.tn-product-mini-action {
  margin-top: auto;
}

.tn-sidebar-article-card {
  background: #fff;
  border: 1px solid var(--tn-line);
  border-radius: var(--tn-radius-lg);
  box-shadow: var(--tn-shadow);
  display: block;
  overflow: hidden;
  padding: 12px;
}

.tn-sidebar-article-media {
  align-items: center;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #f6fbff 0%, #fff9ef 100%);
  border-radius: var(--tn-radius);
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.tn-sidebar-article-media img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.tn-sidebar-article-copy {
  display: block;
  min-width: 0;
  padding: 12px 4px 2px;
}

.tn-sidebar-resource-label {
  color: var(--tn-accent);
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.tn-sidebar-article-title {
  color: var(--tn-ink);
  display: block;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
}

.tn-download-btn {
  box-shadow: 0 10px 22px rgba(19, 143, 118, .18);
  min-width: 132px;
}

.testinar-team-page {
  max-width: 100%;
}

@media (max-width: 767px) {
  .tn-page-title {
    padding: 22px 0 !important;
    text-align: left !important;
  }

  .tn-page-title .container {
    align-items: flex-start;
    display: block;
  }

  .tn-page-title h1 {
    font-size: clamp(18px, 5.4vw, 24px) !important;
    line-height: 1.24 !important;
    margin-bottom: 8px !important;
  }

  .tn-page-title .breadcrumb {
    display: block;
    font-size: 13px;
    line-height: 1.45;
    max-width: 100%;
    padding: 0;
    text-align: left;
    width: 100% !important;
  }

  .tn-article-card .card-body {
    padding: 20px;
  }

  .tn-article-card h2,
  .tn-article-card h3 {
    font-size: 24px;
  }

  .article-topic-lesson .article-choice-list {
    grid-template-columns: 1fr;
  }

  .article-topic-lesson .article-answer-toggle summary {
    align-items: flex-start;
  }

  .article-svg-figure {
    max-width: 100%;
    width: 100%;
  }

  .article-data-table {
    font-size: 15px;
    min-width: 100%;
  }

  .tn-product-mini {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .tn-product-mini-download {
    gap: 14px;
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 172px;
    padding: 14px;
  }

  .tn-product-mini-download .tn-product-mini-media {
    min-height: 144px;
  }

  .tn-product-mini-download .tn-product-title {
    font-size: 15px;
  }

  .testinar-team-page {
    max-width: 100% !important;
    width: 100% !important;
  }

  .testinar-team-page > section:first-of-type {
    border-radius: var(--tn-radius) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 28px 20px !important;
  }

  .testinar-team-page > section:first-of-type > div:first-child {
    height: 160px !important;
    right: -80px !important;
    top: -80px !important;
    width: 160px !important;
  }

  .testinar-team-page > section:first-of-type > div:nth-child(2) {
    display: grid !important;
    gap: 24px !important;
    grid-template-columns: 1fr !important;
    text-align: left !important;
  }

  .testinar-team-page > section:first-of-type h2 {
    font-size: 38px !important;
    line-height: 1.04 !important;
    max-width: 100% !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  .testinar-team-page > section:first-of-type p {
    max-width: 100% !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  .testinar-team-page > section:first-of-type > div:nth-child(2) > div:last-child {
    border-radius: var(--tn-radius) !important;
    height: 166px !important;
    justify-self: center !important;
    width: 166px !important;
  }

  .testinar-team-page > section:first-of-type > div:nth-child(2) > div:last-child img {
    border-radius: var(--tn-radius-sm) !important;
  }

  .testinar-team-page > section:first-of-type a {
    justify-content: center !important;
    min-height: 46px !important;
  }
}
