/* ==========================================================================
   Insights Page Styles - Pixel Perfect from Figma Design
   ========================================================================== */

/* Color Variables */
:root {
  --text-dark: #090703;
  --text-medium: #6a6a6a;
  --stroke-light: #dbdbdb;
  --bg-light: #f5f5f5;
  --bg-white: #ffffff;
  --primary-black: #1a1a1a;
  --white-60: rgba(255, 255, 255, 0.6);
}

/* Fonts */
/* Make sure to include these fonts in your _Layout.cshtml:
   - Lora (Regular)
   - Inter (Light, Regular, Medium, SemiBold)
   - Poppins (Regular)
*/

/* Page Container */
.insights-page {
  background-color: var(--bg-light);
  border-top-right-radius: 20px;
  border-top-left-radius: 20px;
  overflow: hidden;
  min-height: 100vh;
}

/* Hero Section */
.hero-section {
  padding-top: 200px;
  padding-bottom: 60px;
}

.hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

/* Fix section-dots positioning - should be above title, not absolute */
.hero-content .section-dots {
  position: static;
  transform: none;
  display: inline-flex;
  margin: 0 auto 31px;
}

.decorative-icon {
  margin: 0 auto 31px;
  width: 17px;
  height: 17px;
}

  .decorative-icon img {
    width: 100%;
    height: 100%;
  }

.hero-title {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 38px;
  line-height: 1.2;
  color: var(--text-dark);
  margin-bottom: 16px;
  letter-spacing: 0;
}

.hero-description {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.68;
  color: var(--text-medium);
  letter-spacing: 0.28px;
  max-width: 581px;
  margin: 0 auto 17px;
}

/* Subscription Form */
.subscription-form {
  max-width: 414px;
  margin: 0 auto;
  position: relative;
  height: 46px;
}

.email-input {
  width: 100%;
  height: 46px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--stroke-light);
  border-radius: 4px;
  padding: 11px 16px 11px 135px;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.78;
  color: var(--text-dark);
  text-align: right;
  direction: ltr;
}

  .email-input::placeholder {
    color: var(--text-dark);
  }

  .email-input:focus {
    outline: none;
    border-color: var(--text-dark);
  }

.subscribe-btn {
  position: absolute;
  left: 0;
  top: 0;
  width: 123px;
  height: 46px;
  background: var(--text-dark);
  border: none;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: #f1f1f1;
  cursor: pointer;
  transition: background 0.3s ease;
}

  .subscribe-btn:hover {
    background: #000000;
  }

/* Filter Section */
.filter-section {
  padding: 25px 0 53px 0;
}

/* Scroll wrapper — provides the gradient fade masks (RTL: right=start, left=end) */
.filter-scroll-wrapper {
  position: relative;
}

.filter-scroll-wrapper::before,
.filter-scroll-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  height: 100%;
  width: 64px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Right fade — shown when there is hidden overflow to the right (RTL start = right) */
.filter-scroll-wrapper::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-light), transparent);
}

/* Left fade — shown when user has scrolled towards the left (RTL end = left) */
.filter-scroll-wrapper::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-light), transparent);
}

.filter-scroll-wrapper.has-overflow::after  { opacity: 1; }
.filter-scroll-wrapper.at-end::after        { opacity: 0; }
.filter-scroll-wrapper.is-scrolled::before  { opacity: 1; }

/* Centre the pills when they all fit; flex-start when they overflow (prevents left-edge clipping) */
.filter-scroll-wrapper:not(.has-overflow) .filter-buttons {
  justify-content: center;
}

.filter-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-buttons::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  background: #e8e8e8;
  border: none;
  border-radius: 9999px;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 14px;
  line-height: 21px;
  color: #364153;
  cursor: pointer;
  transition: all 0.3s ease;
}

  .filter-btn.active {
    background: #141414;
    color: #ffffff;
    box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1), 0px 4px 6px -4px rgba(0, 0, 0, 0.1);
  }

  .filter-btn .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18.5px;
    padding: 2px 8px;
    background: rgba(16, 24, 40, 0.1);
    border-radius: 9999px;
    font-size: 12px;
    line-height: 16px;
  }

  .filter-btn.active .count {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
  }

  .filter-btn:hover:not(.active) {
    background: #d0d0d0;
  }

/* Insights Grid Section */
.insights-grid-section {
  padding: 0 0 40px;
}

.insights-grid {
  /* Using Bootstrap row - no need for display: grid */
  margin-right: -13px;
  margin-left: -13px;
}

  .insights-grid > [class*='col-'] {
    padding-right: 13px;
    padding-left: 13px;
    margin-bottom: 48px;
  }

/* Featured Items - Full Width on Desktop */
.insight-item.featured {
  /* Bootstrap handles this with col-12 class */
}

/* Insight Item Card */
.insight-item {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.insight-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease;
}

  .insight-link:hover {
    transform: translateY(-4px);
  }

.insight-image {
  width: 100%;
  height: 504px;
  border-radius: 12px;
  border: 6px solid white;
  overflow: hidden;
  position: relative;
}

.insight-item:not(.featured) .insight-image {
  height: 333px;
}

.insight-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.insight-content {
  padding-top: 24px;
}

.insight-category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  height: 38px;
  border: 1px solid var(--stroke-light);
  border-radius: 32px;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.2;
  color: var(--text-medium);
  letter-spacing: 0.14px;
  margin-bottom: 24px;
}

.insight-date {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.2;
  color: var(--text-medium);
  letter-spacing: 0.14px;
  margin-bottom: 16px;
}

.insight-title {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.2;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.insight-item.featured .insight-title {
  max-width: 600px;
}

.insight-item:not(.featured) .insight-title {
  max-width: 344px;
}

.insight-description {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.68;
  color: var(--text-medium);
  letter-spacing: 0.14px;
  display: none;
}

.insight-item.featured .insight-description {
  display: block;
  max-width: 600px;
}

/* Pagination Section */
.pagination-section {
  padding: 40px 0 40px;
}

.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.pagination-control {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.3s ease;
  transform: rotate(180deg);
}

  .pagination-control:hover:not(.disabled) {
    opacity: 0.7;
  }

  .pagination-control.disabled {
    opacity: 0.3;
    cursor: not-allowed;
  }

  .pagination-control img {
    width: 100%;
    height: 100%;
  }

.pagination-page {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(26, 26, 26, 0.2);
  border-radius: 48px;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: normal;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
}

  .pagination-page.active {
    background: white;
    border-color: #676767;
    color: var(--primary-black);
  }

  .pagination-page:hover:not(.active) {
    border-color: #333;
  }

.pagination-ellipsis {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(26, 26, 26, 0.2);
  border-radius: 48px;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: #333;
}

/* Loading State */
.insights-grid.loading {
  opacity: 0.5;
  pointer-events: none;
}

.loading-spinner {
  text-align: center;
  padding: 60px 0;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-medium);
}

/* Responsive Design */
@media (max-width: 1200px) {
  /* Bootstrap handles column changes automatically */
}

@media (max-width: 991px) {
  .hero-title {
    font-size: 32px;
  }

  .insight-title {
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding-top: 180px;
    padding-bottom: 40px;
  }

  .hero-title {
    font-size: 28px;
  }

  .insight-image {
    height: 300px !important;
  }

  .insight-title {
    font-size: 20px;
  }

  .subscription-form {
    max-width: 100%;
  }

  .pagination-wrapper {
    gap: 8px;
  }

  .pagination-page,
  .pagination-control,
  .pagination-ellipsis {
    width: 44px;
    height: 44px;
    font-size: 14px;
  }

  .insights-grid {
    margin-right: -15px;
    margin-left: -15px;
  }

    .insights-grid > [class*='col-'] {
      padding-right: 15px;
      padding-left: 15px;
    }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 24px;
  }

  .hero-description {
    font-size: 13px;
  }

  .filter-btn {
    font-size: 13px;
    padding: 0 16px;
    height: 40px;
  }

  .insight-title {
    font-size: 18px;
  }

  .email-input {
    font-size: 13px;
    padding-left: 115px;
  }

  .subscribe-btn {
    width: 100px;
    font-size: 13px;
  }
}

/* GSAP handles all animations - no CSS animations needed */
