/* Magzin Home 2 bridge for NewsFactory.Web.Magzin.
   Use Magzin --tc-* tokens (remapped under [data-bs-theme="dark"] in main.css).
   Do not hardcode #fff — that blocks full-page dark mode. */
body.magzin-theme {
  background-color: var(--tc-neutral-50, #f7f8f9);
  color: var(--tc-neutral-600, #626568);
  font-family: Geist, system-ui, sans-serif;
  margin-bottom: 0;
}

.magzin-theme .navbar.style-2 {
  transition: transform 0.25s ease;
  z-index: 1020;
  background-color: var(--tc-system-white, #fff);
  border-bottom-color: var(--tc-neutral-100, #eaecee);
  /* Full Bootstrap sets flex-wrap:wrap; Magzin Home 2 needs a single horizontal row. */
  flex-wrap: nowrap;
  flex-direction: row;
  align-items: center;
}

/* Magzin main.css sets z-index:-1 on .navbar-brand (centered logo layering), which blocks clicks. */
.magzin-theme .navbar.style-2 .navbar-brand {
  z-index: 2;
  pointer-events: auto;
  cursor: pointer;
}

/* Hero leads: reserve 2 title lines and 2 summary lines so a wrap on one card
   does not drop that column's 2x2 grid. text-truncate-2 only sets a max. */
.magzin-theme .sec-1-home-2 .article.card-11 .card-title {
  min-height: calc(var(--tc-heading-line-height, 1.2) * 2em);
}

.magzin-theme .sec-1-home-2 .article.card-11 .card-text {
  min-height: calc(var(--tc-body-line-height, 1.5) * 2em);
}

/* Hero 2x2 side grids: reserve 2 title lines so wrapped titles keep rows aligned. */
.magzin-theme .sec-1-home-2 .hero-side-grid .article.card-5 .card-body {
  min-height: calc(1.2em * 2);
}

.magzin-theme .sec-1-home-2 .hero-side-grid .article.card-5 .card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  min-height: calc(1.2em * 2);
  margin-bottom: 0;
}

/* HEARTBOUND wordmark: Magzin gradient in light mode, light text in dark mode. */
.magzin-theme .magzin-logo-wordmark {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.magzin-theme .magzin-logo {
  display: block;
  height: 18px;
  width: auto;
  max-width: none;
}

.magzin-theme .magzin-logo--light {
  display: none;
}

html[data-bs-theme="dark"] .magzin-theme .magzin-logo--brand {
  display: none;
}

html[data-bs-theme="dark"] .magzin-theme .magzin-logo--light {
  display: block;
}

/* Magzin main.css sets display:flex on .navbar-nav but not direction; Bootstrap defaults to column. */
.magzin-theme .navbar .navbar-nav {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
}

/* Keep Magzin row nav on desktop only — do not override Bootstrap d-none below lg
   (that forced the links under the logo on phones). */
@media (min-width: 992px) {
  .magzin-theme .navbar .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
    align-items: center;
  }
}

/*
 * Bootstrap draws a border-triangle caret on .dropdown-toggle::after.
 * Magzin replaces that with an SVG background; clear borders or both show.
 */
.magzin-theme .navbar .navbar-nav .nav-item .dropdown-toggle::after {
  border: 0 !important;
  margin-left: 0 !important;
  vertical-align: middle;
  display: inline-block;
  width: 18px;
  height: 18px;
  background-image: url("/assets/imgs/template/icons/arrow-down.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}

html[data-bs-theme="dark"] .magzin-theme .navbar .navbar-nav .nav-item .dropdown-toggle::after {
  background-image: url("/assets/imgs/template/icons/arrow-down-light.svg");
}

/*
 * Magzin pastel badge backgrounds (bg-1..bg-5) need dark text.
 * Full Bootstrap .badge forces white (--bs-badge-color), so labels vanish.
 */
.magzin-theme .article .badge,
.magzin-theme .badge.bg-1,
.magzin-theme .badge.bg-2,
.magzin-theme .badge.bg-3,
.magzin-theme .badge.bg-4,
.magzin-theme .badge.bg-5 {
  --bs-badge-color: var(--tc-neutral-900, #0e0e0f);
  color: var(--tc-neutral-900, #0e0e0f) !important;
  font-weight: 500;
}

/* Staff Picks (dark section): light badge labels on dark pill backgrounds. */
.magzin-theme .sec-4-home-2 .article.card-7 .card-info .badge {
  --bs-badge-color: var(--tc-system-white, #fff);
  color: var(--tc-system-white, #fff) !important;
  background-color: var(--tc-neutral-800, #222324) !important;
  border: 1px solid var(--tc-neutral-700, #3a3b3c);
}

/* Staff Picks compact cards: hover bg goes white; override forced text-white. */
.magzin-theme .sec-4-home-2 .article.card-6 {
  border-color: var(--tc-neutral-700, #3a3b3c);
}

.magzin-theme .sec-4-home-2 .article.card-6:hover .card-title,
.magzin-theme .sec-4-home-2 .article.card-6:hover .text-white,
.magzin-theme .sec-4-home-2 .article.card-6:hover p {
  color: var(--tc-neutral-900, #0e0e0f) !important;
}

.magzin-theme .navbar.style-2.navbar-stick {
  box-shadow: 0 8px 24px rgba(14, 14, 15, 0.06);
  background-color: color-mix(in srgb, var(--tc-system-white, #fff) 85%, transparent);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

html[data-bs-theme="dark"] .magzin-theme .navbar.style-2.navbar-stick {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  background-color: rgba(34, 35, 36, 0.6);
}

.magzin-theme .popup-search-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--tc-system-white, #fff) 98%, transparent);
  color: var(--tc-neutral-900, #0e0e0f);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  overflow-y: auto;
}

html[data-bs-theme="dark"] .magzin-theme .popup-search-overlay {
  background: rgba(14, 14, 15, 0.96);
}

.magzin-theme .popup-search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.magzin-theme .popup-search-close {
  font-size: 2rem;
  line-height: 1;
  text-decoration: none;
  color: inherit;
}

.magzin-theme .dark-light-switcher {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.magzin-theme .dark-light-switcher .theme-icon-moon {
  display: none;
}

html[data-bs-theme="dark"] .magzin-theme .dark-light-switcher .theme-icon-sun {
  display: none;
}

html[data-bs-theme="dark"] .magzin-theme .dark-light-switcher .theme-icon-moon {
  display: inline;
}

.magzin-theme .btn-scroll-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tc-system-dark, #0e0e0f);
  color: var(--tc-system-white, #fff);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 1040;
  text-decoration: none;
}

.magzin-theme .sidebar-overlay {
  background-color: rgba(14, 14, 15, 0.45);
}

html[data-bs-theme="dark"] .magzin-theme .sidebar-overlay {
  background-color: rgba(0, 0, 0, 0.65);
}

.magzin-theme footer,
.magzin-theme .section-footer-2 {
  background-color: var(--tc-system-white, #fff);
  color: var(--tc-neutral-600, #626568);
  border-color: var(--tc-neutral-200, #e5e7eb);
}

.magzin-theme .btn-scroll-top.active-progress {
  opacity: 1;
  visibility: visible;
}

.magzin-theme .article img.cover-image,
.magzin-theme .card-recommend img.cover-image {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.magzin-theme .sec-2-home-2 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.magzin-theme main#content {
  min-height: 40vh;
  background-color: transparent;
}

/* Authors page: Magzin img{max-width:100%} shrinks width while height stays → oval. */
.magzin-theme .authors-page .author-card .author-avatar,
.magzin-theme .authors-page .author-card img.rounded-circle {
  width: 80px !important;
  height: 80px !important;
  max-width: none !important;
  object-fit: cover;
  flex-shrink: 0;
}

/* Home / cards: keep circular avatars square with cover crop. */
.magzin-theme .article .author img.avatar,
.magzin-theme .article .author img.rounded-circle {
  object-fit: cover;
  flex-shrink: 0;
}

/* Story pages: BootNews mid-article share is removed in HTML; hide leftovers. */
.magzin-theme .article-content .social-share {
  display: none !important;
}

/* Story chrome already inserts an SVG chevron as its own breadcrumb item.
   Bootstrap's default "/" divider paints in front of that chevron and the next label. */
.magzin-theme .article-content .breadcrumb .breadcrumb-item + .breadcrumb-item {
  padding-left: 0;
}

.magzin-theme .article-content .breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  content: none;
}

/* Category / Videos listings: story rows without bordered rounded cards. */
.magzin-theme .category-article-list > .category-article-item.card,
.magzin-theme .category-article-list > article.card.card-full,
.magzin-theme .video-article-list > article.card.card-full {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.magzin-theme .category-article-list > .category-article-item + .category-article-item,
.magzin-theme .video-article-list > article.card.card-full + article.card.card-full {
  border-top: 1px solid var(--tc-neutral-100, #eaecee) !important;
}

/* Shop landing: four square category tiles. */
.magzin-theme .shop-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  max-width: 920px;
  margin: 0 auto;
}

.magzin-theme .shop-category-tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 1rem;
  overflow: hidden;
}

.magzin-theme .shop-category-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.magzin-theme .shop-category-tile:hover img,
.magzin-theme .shop-category-tile:focus-visible img {
  transform: scale(1.03);
}

.magzin-theme .shop-merch-grid img {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  display: block;
}

.magzin-theme .shop-merch-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.magzin-theme .shop-merch-card:hover .shop-merch-card-title,
.magzin-theme .shop-merch-card:focus-visible .shop-merch-card-title {
  text-decoration: underline;
}

.magzin-theme .shop-merch-card-meta {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.magzin-theme .shop-merch-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}

.magzin-theme .shop-merch-card-price {
  font-size: 0.9rem;
  color: var(--tc-neutral-600, #5c6570);
}

.magzin-theme .shop-merch-card--sold-out img {
  opacity: 0.72;
  filter: grayscale(0.35);
}

.magzin-theme .shop-merch-card-price--sold-out,
.magzin-theme .shop-item-sold-out {
  font-weight: 600;
  color: var(--tc-neutral-700, #3d454d);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.magzin-theme .shop-item-image {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  display: block;
}

/* End of first chapter: random shop category tile → /Shop/{Category}. */
.magzin-theme .article-content .magzin-shop-category {
  clear: both;
  display: flex;
  justify-content: center;
  margin: 1.75rem 0;
}

.magzin-theme .article-content .magzin-shop-category-link {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
}

.magzin-theme .article-content .magzin-shop-category img {
  display: block;
  width: min(100%, 420px);
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}

/* Second chapter: shop ad creative from /img/shop/ads. */
.magzin-theme .article-content .magzin-shop-ad {
  clear: both;
  display: flex;
  justify-content: center;
  margin: 1.75rem 0;
}

.magzin-theme .article-content .magzin-shop-ad-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 300px;
  text-decoration: none;
  color: inherit;
}

.magzin-theme .article-content .magzin-shop-ad img {
  display: block;
  width: 300px;
  max-width: 100%;
  height: auto;
}

.magzin-theme .article-content .magzin-shop-ad-caption {
  display: block;
  margin-top: 0.55rem;
  padding: 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.35;
  color: var(--tc-neutral-600, #5c6570);
}

.magzin-theme .article-content .magzin-shop-ad-link:hover .magzin-shop-ad-caption,
.magzin-theme .article-content .magzin-shop-ad-link:focus-visible .magzin-shop-ad-caption {
  color: var(--tc-neutral-900, #1a1d21);
  text-decoration: underline;
}

/* Story tags as Magzin pill buttons (see .tag-item in main.css). */
.magzin-theme .article-content .magzin-story-meta-bar .tags-links,
.magzin-theme .article-content .magzin-story-meta-bar .tagcloud {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 0;
}

.magzin-theme .article-content .magzin-story-meta-bar a.tag-item {
  text-decoration: none;
  color: var(--tc-neutral-900, #0e0e0f);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.magzin-theme .article-content .magzin-story-meta-bar .group-social-icons {
  margin-top: 0;
}

.magzin-theme .article-content .magzin-story-share .text-dark {
  font-weight: 500;
}

.magzin-theme .article-content .magzin-story-listen--footer {
  margin-top: 0.25rem;
}

.magzin-theme .article-content .magzin-story-listen--footer .magzin-story-listen-btn,
.magzin-theme .article-content .magzin-story-subscribe-btn {
  min-width: 10.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.magzin-theme .article-content .magzin-story-listen-btn svg,
.magzin-theme .article-content .magzin-story-subscribe-btn svg {
  flex-shrink: 0;
}

.magzin-theme .article-content .magzin-story-listen-status,
.magzin-theme .article-content .magzin-story-subscribe-caption {
  color: var(--tc-neutral-700, #555);
  font-size: 0.9rem;
}

.magzin-theme .article-content .magzin-story-listen-audio {
  display: block;
  width: min(100%, 28rem);
  margin-left: auto;
  margin-right: auto;
}

/* Header Listen: same vertical size as category badge, to its right; player below title. */
.magzin-theme .article.card-info .magzin-story-listen--header {
  display: contents;
}

.magzin-theme .article.card-info .entry-title {
  order: 1;
}

.magzin-theme .article.card-info .magzin-story-listen--header .magzin-story-listen-status,
.magzin-theme .article.card-info .magzin-story-listen--header .magzin-story-listen-audio {
  order: 2;
  flex: 0 0 100%;
  width: 100%;
  max-width: 28rem;
}

.magzin-theme .article.card-info .magzin-story-listen-header-btn {
  --bs-badge-color: #fff;
  color: #fff !important;
  background-color: var(--tc-neutral-900, #0e0e0f) !important;
  font-weight: 500;
  cursor: pointer;
  line-height: inherit;
  vertical-align: middle;
}

.magzin-theme .article.card-info .magzin-story-listen-header-btn svg {
  width: 0.85rem;
  height: 0.85rem;
}

.magzin-theme .article-content .magzin-story-subscribe {
  margin-top: 0.25rem;
}

/*
 * Story author bio: Magzin layout does not load BootNews theme.css, so .media is not flex.
 * Default article HTML then stacks the avatar above .media-body.ms-3 (name looks indented).
 */
.magzin-theme .article-content .author-box {
  display: flex !important;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 1rem;
  text-align: left !important;
}

.magzin-theme .article-content .author-box .media-figure {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}

.magzin-theme .article-content .author-box .media-figure img {
  width: 3.5rem;
  height: 3.5rem;
  max-width: none;
  object-fit: cover;
  display: block;
}

.magzin-theme .article-content .author-box .media-body {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 0 !important; /* neutralize BootNews .ms-3; gap handles spacing */
  padding-left: 0;
}

/* Comments: Magzin ContentSingle icon inputs + list (override Bootstrap input-group quirks). */
.magzin-theme .magzin-comments .magzin-comment-form .input-group {
  flex-wrap: nowrap;
  width: 100%;
}

.magzin-theme .magzin-comments .magzin-comment-form .input-group > .form-control {
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
}

.magzin-theme .magzin-comments .magzin-comment-form .input-group > .form-control:focus {
  box-shadow: none;
  z-index: 1;
}

.magzin-theme .magzin-comments .magzin-comment-message .icon-input {
  min-height: 180px !important;
  align-items: flex-start;
}

.magzin-theme .magzin-comments .magzin-comment-message .form-control {
  max-height: none !important;
  min-height: 180px !important;
  resize: vertical;
}

.magzin-theme .magzin-comments .btn-dark.rounded-8 {
  border-radius: 8px !important;
  padding: 0.75rem 1.25rem;
}

.magzin-theme .magzin-comments .comments-list-items .avatar-xl {
  object-fit: cover;
  border-radius: 16px;
}

/* Sign-in: Magzin .btn defaults to white text on transparent bg, so outline
   social buttons are invisible until hover fills Bootstrap primary blue. */
.magzin-theme .login-page {
  padding-bottom: clamp(3.5rem, 12vw, 7rem);
  margin-bottom: 2rem;
}

.magzin-theme .login-page .card {
  background-color: var(--tc-system-white, #fff);
  color: var(--tc-neutral-900, #0e0e0f);
}

.magzin-theme .login-page .social-login-forms {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.magzin-theme .login-page .social-login-forms form {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.magzin-theme .login-page .social-login-btn {
  --tc-btn-color: var(--tc-neutral-900, #0e0e0f);
  --tc-btn-bg: var(--tc-system-white, #fff);
  --tc-btn-border-color: var(--tc-neutral-200, #e5e7eb);
  --tc-btn-padding-x: 1rem;
  --tc-btn-padding-y: 0.85rem;
  --tc-btn-border-radius: 50px;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  column-gap: 0.75rem;
  align-items: center;
  justify-content: stretch;
  width: 100%;
  color: var(--tc-btn-color) !important;
  background-color: var(--tc-btn-bg) !important;
  border: 1px solid var(--tc-btn-border-color) !important;
  box-shadow: none;
}

.magzin-theme .login-page .social-login-btn:hover,
.magzin-theme .login-page .social-login-btn:focus-visible {
  --tc-btn-color: var(--tc-system-white, #fff);
  --tc-btn-bg: #0d6efd;
  --tc-btn-border-color: #0d6efd;
  color: var(--tc-btn-color) !important;
  background-color: var(--tc-btn-bg) !important;
  border-color: var(--tc-btn-border-color) !important;
}

.magzin-theme .login-page .social-login-btn-icon-slot {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.magzin-theme .login-page .social-login-btn-icon-slot .social-login-btn-icon {
  width: 1.375rem;
  height: 1.375rem;
  flex-shrink: 0;
  display: block;
}

.magzin-theme .login-page .social-login-btn-icon-placeholder {
  width: 1.375rem;
  height: 1.375rem;
  flex-shrink: 0;
}

.magzin-theme .login-page .social-login-btn-label {
  text-align: center;
  min-width: 0;
  color: inherit;
}
