/* ─── Team Scaler Custom Styles ───────────────────────────────────────── */

:root {
  --ts-bg-dark: #090e13;
  --ts-text-muted: #bdc6d7;
  --ts-text-white: #ffffff;
  --ts-heading-muted: #c2c6d6;
  --ts-border-color: #2d333e;
}

/* ─── Post Page: Dark Background Overrides ─── */
/* Override Ghost's default white/light-gray backgrounds on post pages */
.post-template body,
.post-template .gh-main,
.post-template .gh-site,
.post-template .gh-subscribe-wrapper,
.page-template body,
.page-template .gh-main,
.page-template .gh-site,
.page-template .gh-subscribe-wrapper,
.tag-template body,
.tag-template .gh-main,
.tag-template .gh-site,
.tag-template .gh-subscribe-wrapper,
.author-template body,
.author-template .gh-main,
.author-template .gh-site,
.author-template .gh-subscribe-wrapper {
  background-color: var(--ts-bg-dark) !important;
}

/* Prevent horizontal scroll site-wide */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Article header area (date, title, share) */
.post-template .gh-article-header,
.page-template .gh-article-header {
  background-color: var(--ts-bg-dark) !important;
  color: var(--ts-text-white);
  padding-top: 100px !important; /* Clears the fixed navbar */
  padding-bottom: 0px !important; /* Gap handled by image margin */
  text-align: left !important;
  align-items: flex-start !important;
  justify-items: start !important;
  grid-template-columns: [full-start wide-start main-start] 100% [main-end wide-end full-end] !important;
}

/* Ensure feature image fills the wide container beautifully and doesn't overlap header */
.gh-article-image {
  width: 100% !important;
  margin-top: 40px !important; /* Overrides Ghost's negative margin */
}
.gh-article-image img {
  width: 100% !important;
  object-fit: cover;
  object-position: left center;
  border-radius: 8px;
}

/* ─── Article Header Figma Layout ─── */
.ts-article-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ts-heading-muted);
  margin-top: 50px;
  justify-content: flex-start !important;
  width: 100% !important;
}
.ts-article-meta-sep {
  color: var(--ts-heading-muted);
  user-select: none;
}

.gh-article-title,
.gh-content h1 {
  font-family: var(--font-serif) !important;
  font-weight: 300 !important;
  font-size: clamp(28px, 5vw, 64px) !important;
  line-height: clamp(40px, 5vw, 70px) !important;
  margin-bottom: 30px !important;
  max-width: 1100px !important;
  width: 100% !important;
  color: #dee3ec !important;
  text-align: left !important;
  margin-left: 0 !important;
}

.ts-article-author-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-start !important;
  width: 100% !important;
}
.ts-author-image-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--ts-border-color);
}
.ts-author-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ts-author-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ts-text-muted);
}
.ts-author-image-placeholder svg {
  width: 24px;
  height: 24px;
}
.ts-author-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ts-author-name {
  margin: 0;
  color: #dae2fd;
  font-size: clamp(16px, 2vw, 18px);
  font-weight: 600;
}
.ts-author-role-date {
  color: var(--ts-heading-muted);
  font-size: clamp(10px, 1vw, 14px);
}

/* Article content background */
.post-template .gh-content,
.page-template .gh-content {
  background-color: var(--ts-bg-dark);
  color: var(--ts-text-muted);
}

/* Article footer (prev/next nav) */
.post-template .gh-article-footer,
.page-template .gh-article-footer {
  background-color: var(--ts-bg-dark);
}

/* Navigation border color */
.gh-navigation {
  border-top-color: var(--ts-border-color) !important;
}

/* Explicit override of Ghost's canvas grid to expand width and remove huge side gaps */
.gh-canvas {
  max-width: 60%;
  margin: 0 auto;
  display: grid !important;
  grid-template-columns:
    [full-start] minmax(var(--content-padding), 1fr)
    [wide-start main-start] minmax(0, calc(1440px - var(--content-padding) * 2))
    [main-end wide-end]
    minmax(var(--content-padding), 1fr) [full-end] !important;
  justify-content: center !important;
}
/* Ensure all article content spans the new wide main column */
.gh-canvas > * {
  grid-column: main-start / main-end !important;
}

@media (max-width: 1280px) {
  .gh-canvas {
    --content-padding: 48px;
  }
}
@media (max-width: 1024px) {
  .gh-canvas {
    --content-padding: 40px;
  }
}
@media (max-width: 640px) {
  .gh-canvas {
    --content-padding: 24px;
  }
}

/* Article title & heading colors */
.gh-content h3,
.gh-content h4,
.gh-content h5,
.gh-content h6 {
  font-family: var(--font-serif) !important;
  color: #dae2fd !important;
  font-weight: 500 !important;
  font-size: clamp(12px, 4vw, 16px) !important;
  line-height: clamp(25px, 2vw, 40px) !important;
}
.gh-content h2 {
  font-family: var(--font-serif) !important;
  color: #dae2fd !important;
  font-weight: 500 !important;
  font-size: clamp(16px, 2vw, 24px) !important;
  line-height: clamp(25px, 2vw, 40px) !important;
}

/* Body text color in content */
.gh-content p,
.gh-content li,
.gh-content blockquote {
  font-family: var(--font-serif) !important;
  color: #dae2fd !important;
  font-weight: 500 !important;
  font-size: clamp(14px, 4vw, 18px) !important;
  line-height: clamp(25px, 2vw, 40px) !important;
}

/* Link color in content */
.gh-content a {
  color: #60afff !important;
  text-decoration: underline;
}

/* Date / meta text */
.gh-article-meta,
.gh-article-date {
  color: var(--ts-heading-muted) !important;
}

/* Share button */
.gh-button-share {
  color: var(--ts-text-muted);
  border-color: var(--ts-border-color);
}

/* Navigation link colors */
.gh-navigation-link,
.gh-navigation-middle {
  color: var(--ts-text-muted) !important;
}
.gh-navigation-link:hover,
.gh-navigation-middle:hover {
  color: var(--ts-text-white) !important;
}

/* ─── Subscribe Section Dark Theme Override ─── */
.gh-subscribe-wrapper {
  background-color: var(--ts-bg-dark) !important;
  box-sizing: border-box;
}

.gh-subscribe {
  background: #111823 !important; /* Darker card background */
  border: 1px solid var(--ts-border-color);
  box-sizing: border-box !important;
}
/* ─── Subscribe Section Colors ─── */
.gh-subscribe {
  background-color: #0e1319 !important; /* Card BG */
  border-radius: 16px;
  padding: 40px;
}

.gh-subscribe-title {
  color: #ffffff !important;
}

.gh-subscribe-description {
  color: #636f86 !important; /* Label Color */
}

.gh-subscribe-input {
  background-color: #353e4e38 !important; /* Input Box BG */
  border: 1px solid rgba(189, 198, 215, 0.1) !important;
  color: #bdc6d7 !important; /* Input Text Color */
}

.gh-subscribe-input::placeholder {
  color: #bdc6d7 !important; /* Placeholder Color */
  opacity: 0.6;
}

/* Button Styling */
.gh-subscribe-input-btn {
  background-color: #636f86 !important; /* Button BG */
  color: #ffffff !important; /* Button Text */
  border: none !important;
  font-weight: 600;
  transition: all 0.2s ease;
}

.gh-subscribe-input-btn:hover {
  background-color: #bdc6d7 !important;
  color: #0e1319 !important;
}

/* Hide "Powered by Ghost" badge */
.gh-portal-powered {
  display: none !important;
}

/* ─── Subscribe Responsive Fix ─── */
/* Switch to stacked layout on narrow screens so button doesn't overflow */
@media (max-width: 560px) {
  .gh-subscribe-input {
    flex-direction: column !important;
    height: auto !important;
    padding: 12px !important;
    border-radius: 12px !important;
    gap: 10px !important;
    align-items: stretch !important;
  }
  .gh-subscribe-input-btn {
    height: 44px !important;
    border-radius: 8px !important;
    justify-content: center !important;
    width: 100% !important;
    padding: 0 16px !important;
  }
}

/* ─── Navbar ─── */
.ts-header {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  width: 100%;
  background-color: var(--ts-bg-dark);
  transition: background-color 0.3s ease;
}

.ts-nav {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
}

@media (min-width: 640px) {
  .ts-nav {
    padding-left: 40px;
    padding-right: 40px;
  }
}

@media (min-width: 1024px) {
  .ts-nav {
    padding-left: 48px;
    padding-right: 48px;
  }
}

@media (min-width: 1280px) {
  .ts-nav {
    padding-left: 80px;
    padding-right: 80px;
  }
}

.ts-logo {
  color: var(--ts-text-white);
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 400;
  line-height: 100%;
  text-decoration: none;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.ts-logo:hover {
  opacity: 0.8;
}

.ts-desktop-list {
  display: none;
  align-items: center;
  gap: clamp(24px, 3.5vw, 65px);
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (min-width: 1024px) {
  .ts-desktop-list {
    display: flex;
  }
}

.ts-desktop-link {
  color: var(--ts-text-white);
  font-size: clamp(12px, 1.1vw, 14px);
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.ts-desktop-link:hover {
  color: var(--ts-text-muted);
}

.ts-hamburger {
  position: relative;
  z-index: 50;
  display: flex;
  height: 32px;
  width: 32px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
}

@media (min-width: 1024px) {
  .ts-hamburger {
    display: none;
  }
}

.ts-hamburger.active .ts-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.ts-hamburger.active .ts-bar:nth-child(2) {
  opacity: 0;
}
.ts-hamburger.active .ts-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.ts-bar {
  display: block;
  height: 2px;
  width: 24px;
  border-radius: 9999px;
  background-color: var(--ts-text-white);
  transition: all 0.3s ease;
}

.ts-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(9, 14, 19, 0.95);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease-in-out;
  opacity: 0;
  pointer-events: none;
}

.ts-mobile-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.ts-mobile-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.ts-mobile-link {
  font-size: clamp(1rem, 4vw, 1.25rem);
  color: #c6cdd8;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ts-mobile-link:hover {
  color: var(--ts-text-white);
}

/* ─── Footer ─── */
.ts-footer {
  padding: 60px 0 40px;
  color: #94a3b8;
  background-color: var(--ts-bg-dark);
}

.ts-footer-container {
  margin: 0 auto;
  padding: 0 140px;
  display: flex;
  flex-direction: column;
}

.ts-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr;
  gap: 40px;
  margin-bottom: 50px;
  align-items: start;
}

.ts-brand-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ts-logo-link {
  display: block;
  text-decoration: none;
  line-height: 0;
}

.ts-nuventure-link {
  display: flex;
  align-items: center;
  line-height: 0;
  transition: opacity 0.2s ease;
  margin-left: 20px;
}

.ts-col-heading {
  font-size: clamp(13px, 1.5vw, 16px);
  font-weight: 400;
  color: var(--ts-heading-muted);
  margin: 0 0 16px 0;
  line-height: 24px;
  text-transform: uppercase;
}

.ts-footer-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ts-footer-link {
  color: var(--ts-text-muted);
  text-decoration: none;
  font-size: clamp(12px, 1.5vw, 14px);
  font-weight: 400;
  transition: color 0.2s ease;
  line-height: 30px;
}

.ts-footer-link:hover {
  color: #f1f5f9;
}
/* ─── Related Posts (Next in Library) ─── */
.ts-related-section {
  background-color: var(--ts-bg-dark); /* #090E13 dark bg to match Figma */
  width: 100%;
  margin: 0 auto;
  padding: 0 0 80px 0;
  font-family: inherit;
  margin-top: 100px;
}

.ts-related-inner {
  max-width: 1440px;
  margin: 0 auto;
}

.ts-related-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 16px;
}

.ts-related-header h2 {
  color: #dae2fd;
  font-size: clamp(16px, 2vw, 24px);
  font-weight: 700;
  margin: 0;
}

.ts-view-all {
  color: #b0c6ff;
  font-size: clamp(12px, 2vw, 14px);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ts-view-all:hover {
  color: #dae2fd;
}

.ts-view-all svg {
  transition: transform 0.2s ease;
}

.ts-view-all:hover svg {
  transform: translateX(4px);
}

.ts-related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 768px) {
  .ts-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .ts-related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ts-related-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
}

.ts-related-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px; /* Less radius — matches Figma rectangular cards */
  overflow: hidden;
  margin-bottom: 20px;
  background-color: var(--ts-border-color);
}

.ts-related-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  transition: transform 0.4s ease;
}

.ts-related-card:hover .ts-related-image img {
  transform: scale(1.05);
}

.ts-related-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Pill badge — matches Figma "BUILD FASTER" label style */
.ts-related-tag {
  display: inline-block;
  align-self: flex-start;
  background-color: #2d3449;
  color: #5cdda2;
  font-size: clamp(10px, 2vw, 12px);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 4px;
}

.ts-related-title {
  color: #dae2fd;
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.35;
  font-weight: 500;
  margin: 0;
  transition: color 0.2s ease;
}

.ts-related-card:hover .ts-related-title {
  color: var(--ts-text-muted, #bdc6d7);
}

.ts-social-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ts-social-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ts-text-muted);
  text-decoration: none;
  font-size: clamp(12px, 1.5vw, 14px);
  font-weight: 400;
  transition: color 0.2s ease;
  line-height: 30px;
}

.ts-social-row img {
  flex-shrink: 0;
  filter: brightness(0.85);
}

.ts-contact-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ts-contact-item {
  color: var(--ts-text-muted);
  font-size: clamp(12px, 1.5vw, 14px);
  font-weight: 400;
  line-height: 30px;
  text-decoration: none;
  display: block;
  position: relative;
  padding: 0 0 14px 0;
  margin-bottom: 14px;
}

.ts-contact-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 1px;
  background-color: var(--ts-border-color);
}

.ts-contact-item-row {
  display: flex;
  align-items: flex-start;
  font-size: clamp(12px, 1.5vw, 14px);
  font-weight: 400;
  line-height: 30px;
  color: var(--ts-text-muted);
  gap: 8px;
}

.ts-contact-label {
  flex-shrink: 0;
  min-width: 30px;
  color: var(--ts-text-muted);
}

.ts-contact-numbers {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ts-divider {
  width: 100%;
  height: 1px;
  border: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='1'%3E%3Cline x1='0' y1='0.5' x2='100%25' y2='0.5' stroke='%232D333E' stroke-width='1' stroke-dasharray='8 8'/%3E%3C/svg%3E");
  background-size: 100% 1px;
  background-repeat: no-repeat;
  margin-bottom: 40px;
}

.ts-copyright {
  text-align: center;
  font-size: clamp(12px, 1.5vw, 14px);
  color: var(--ts-heading-muted);
  margin: 0;
  line-height: 30px;
}

/* ─── Previous / Next Article Navigation ─── */
.ts-article-nav-section {
  background-color: var(--ts-bg-dark);
}

@media (max-width: 1000px) {
  .gh-canvas {
    max-width: 90%;
  }
}

@media (max-width: 640px) {
  .ts-article-nav-section {
    padding-bottom: 60px;
  }
}

/* Always horizontal — prev on left, next on right */
.ts-article-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: clamp(16px, 4vw, 48px);
  padding-top: 40px;
  /* No border-top / dividers */
}

.ts-article-nav-prev {
  flex: 1;
  min-width: 0;
}

.ts-article-nav-next {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}

/* Link row: arrow + text side-by-side */
.ts-nav-link {
  text-decoration: none;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

/* Arrow icon */
.ts-nav-arrow {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: #bdc6d7;
  margin-top: 2px; /* Optical alignment with label text */
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.ts-nav-link:hover .ts-nav-arrow {
  color: #b0c6ff;
}

/* Hover nudge animations */
.ts-nav-link:hover .ts-nav-arrow-left {
  transform: translateX(-4px);
}
.ts-nav-link:hover .ts-nav-arrow-right {
  transform: translateX(4px);
}

/* Text block: label + title stacked */
.ts-nav-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ts-nav-label {
  font-size: clamp(10px, 1.2vw, 12px);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #bdc6d7;
  white-space: nowrap;
}

.ts-nav-title {
  font-size: clamp(14px, 1.6vw, 20px);
  font-weight: 500;
  line-height: 1.35;
  color: #dae2fd;
  margin: 0;
  transition: color 0.2s ease;
  word-break: break-word;
}

.ts-nav-link:hover .ts-nav-title {
  color: #b0c6ff;
}

/* Next link: arrow on the right, text on the left */
.ts-article-nav-next .ts-nav-text {
  align-items: flex-end;
  text-align: right;
}

/* Mobile: keep side-by-side but shrink gap */
@media (max-width: 480px) {
  .ts-article-nav-inner {
    gap: 12px;
    padding-top: 28px;
  }
  .ts-nav-arrow svg {
    width: 28px;
    height: 11px;
  }
  .ts-nav-label {
    font-size: 9px;
  }
  .ts-nav-title {
    font-size: 13px;
  }
}

/* Responsive */
@media (max-width: 1280px) {
  .ts-footer-container {
    padding: 0 60px;
  }
}

/* Tablet landscape */
@media (max-width: 1024px) {
  .ts-container {
    padding: 0 40px;
  }

  .ts-footer-container {
    padding: 0 40px;
  }

  .ts-footer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 50px;
  }

  .ts-brand-col {
    grid-column: 1 / -1;
    align-items: center;
    text-align: center;
  }
}

/* Tablet portrait */
@media (max-width: 768px) {
  .ts-footer {
    padding: 48px 0 32px;
  }

  .ts-container {
    padding: 0 32px;
  }

  .ts-footer-container {
    padding: 0 32px;
  }

  .ts-footer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 40px;
  }

  .ts-brand-col {
    grid-column: 1 / -1;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .ts-footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .ts-brand-col,
  .ts-nav-col,
  .ts-social-col,
  .ts-contact-col {
    align-items: center;
  }
  .ts-social-row,
  .ts-contact-item-row {
    justify-content: center;
  }
  .ts-contact-item {
    display: inline-block;
  }
  .ts-contact-item::after {
    left: 50%;
    transform: translateX(-50%);
  }
}
.ts-article-subtitle {
  color: var(--ts-heading-muted);
  font-size: clamp(12px, 1vw, 14px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 400;
}
