/* 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 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;
}

.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 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;
}

/* Model attribution already has a bottom rule; Magzin meta bar adds its own top rule. */
.magzin-theme .article-content .article-model-attribution {
  border-bottom: 0 !important;
  padding-bottom: 0.5rem !important;
  margin-bottom: 0 !important;
}

/*
 * 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;
}
