/* ==============================
   BLOG PAGE - MODERN WHITE DESIGN
   Cleaned + arranged version
============================== */

/* ==============================
   Base page
============================== */
.blog-page {
  background: #ffffff;
  color: #1a1a1a;
}

/* Shared section styles */
.bp {
  padding: 5rem 0 3rem;
  background: #ffffff;
}

.bp--spaced {
  padding-top: 2rem;
  padding-bottom: 6rem;
  background: #fafafa;
}

.bp__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Section header */
.bp__head {
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
}

.bp__title {
  font-family: "Poppins", sans-serif;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin: 0 0 1rem 0;
  font-weight: 800;
  color: #1a1a1a;
  position: relative;
  display: inline-block;
}

.bp__title::after {
  content: '';
  position: absolute;
  bottom: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #6e1b1b, #8a2323);
  border-radius: 2px;
}

.bp__titleAccent {
  color: #6e1b1b;
  background: linear-gradient(135deg, #6e1b1b, #8a2323);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bp__description {
  font-size: 1.125rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  font-family: 'Inter', sans-serif;
}

/* ==============================
   Slider Layout
============================== */
.bpSlider {
  position: relative;
  margin: 0 auto;
  border-radius: 20px;
  background: white;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.bpViewport {
  overflow: hidden;
  border-radius: 16px;
  position: relative;
}

/* Track: grid column slider */
.bpTrack {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2rem) / 3);
  gap: 1.5rem;
  transform: translateX(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* ==============================
   Slider Arrows
============================== */
.bpArrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #f0f0f0;
  background: white;
  color: #6e1b1b;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.bpArrow svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
}

.bpArrow:hover,
.bpArrow:focus-visible {
  background: #6e1b1b;
  color: white;
  border-color: #6e1b1b;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 12px 25px rgba(110, 27, 27, 0.2);
  outline: none;
}

.bpArrow:active {
  transform: translateY(-50%) scale(0.95);
}

.bpArrow--prev {
  left: -28px;
}

.bpArrow--next {
  right: -28px;
}

/* ==============================
   Slider Dots
============================== */
.bpDots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
  list-style: none;
  padding: 0;
}

.bpDot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e0e0e0;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  border: none;
  padding: 0;
}

.bpDot::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bpDot:hover::before {
  opacity: 1;
  background: rgba(110, 27, 27, 0.1);
}

.bpDot.is-active {
  background: #6e1b1b;
  transform: scale(1.3);
}

.bpDot:focus-visible {
  outline: 2px solid #6e1b1b;
  outline-offset: 2px;
}

/* ==============================
   Blog Cards
============================== */
.bpCard {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #f0f0f0;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.bpCard:hover {
  transform: translateY(-10px);
  box-shadow: 0 25px 50px rgba(110, 27, 27, 0.1);
  border-color: rgba(110, 27, 27, 0.2);
}

/* Card Media */
.bpCard__media {
  display: block;
  position: relative;
  overflow: hidden;
  height: 240px;
  text-decoration: none;
}

.bpCard__media::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bpCard:hover .bpCard__media::before {
  opacity: 1;
}

.bpCard__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.bpCard:hover .bpCard__media img {
  transform: scale(1.05);
}

/* Category badge */
.bpCard__category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(255, 255, 255, 0.95);
  color: #6e1b1b;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-family: 'Inter', sans-serif;
}

/* Card Content */
.bpCard__content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.bpCard__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: #666;
  font-family: 'Inter', sans-serif;
}

.bpCard__date,
.bpCard__read-time {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.bpCard__date::before {
  content: '📅';
  font-size: 0.875rem;
}

.bpCard__read-time::before {
  content: '⏱️';
  font-size: 0.875rem;
}

.bpCard__title {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
  font-family: 'Poppins', sans-serif;
}

.bpCard__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
  display: block;
}

.bpCard__title a:hover {
  color: #6e1b1b;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bpCard__excerpt {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #666;
  margin-bottom: 1.5rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

/* Card Footer */
.bpCard__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f0;
  margin-top: auto;
}

.bpCard__author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #666;
  font-family: 'Inter', sans-serif;
}

.bpCard__author-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #f0f0f0;
}

.bpCard__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: #6e1b1b;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  background: rgba(110, 27, 27, 0.1);
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.bpCard__link:hover {
  background: #6e1b1b;
  color: white;
  transform: translateX(4px);
  text-decoration: none;
}

.bpCard__link::after {
  content: '→';
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.bpCard__link:hover::after {
  transform: translateX(4px);
}

/* ==============================
   Popular Grid
============================== */
.bpGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.bpCard--grid {
  background: white;
}

.bpCard--grid .bpCard__media {
  height: 200px;
}

/* Featured card (optional) */
.bpCard--featured {
  grid-column: span 2;
}

.bpCard--featured .bpCard__media {
  height: 320px;
}

.bpCard--featured .bpCard__title {
  font-size: 1.5rem;
}

/* ==============================
   Newsletter
============================== */
.bp__newsletter {
  background: #f3e7e7;
  color: #000000;
  padding: 4rem 2rem;
  margin-top: 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.bp__newsletter::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(243, 231, 231, 1) 0%, rgba(243, 231, 231, 0.95) 100%);
  z-index: 0;
}

.bp__newsletter .container {
  position: relative;
  z-index: 1;
}

.bp__newsletter-title {
  font-size: 2.25rem;
  margin-bottom: 1rem;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
  color: #6e1b1b;
  letter-spacing: -0.5px;
}

.bp__newsletter-description {
  font-size: 1.125rem;
  color: #5a6473;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  opacity: 0.9;
}

.bp__newsletter-form {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
  gap: 1rem;
  position: relative;
}

.bp__newsletter-input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: 2px solid rgba(110, 27, 27, 0.1);
  border-radius: 50px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
  color: #1a1a1a;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.bp__newsletter-input:focus {
  outline: none;
  border-color: #6e1b1b;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(110, 27, 27, 0.15);
}

.bp__newsletter-input::placeholder {
  color: #8a8a8a;
  opacity: 0.7;
}

.bp__newsletter-button {
  padding: 1rem 2.5rem;
  border: 2px solid #6e1b1b;
  border-radius: 50px;
  background: #6e1b1b;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(110, 27, 27, 0.2);
  position: relative;
  overflow: hidden;
}

.bp__newsletter-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.bp__newsletter-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(110, 27, 27, 0.3);
  background: #7c1b1b;
  border-color: #7c1b1b;
}

.bp__newsletter-button:hover::before {
  left: 100%;
}

.bp__newsletter-button:active {
  transform: translateY(0);
}

.bp__newsletter-button:focus-visible {
  outline: 3px solid rgba(110, 27, 27, 0.4);
  outline-offset: 2px;
}

/* Success/Error states */
.bp__newsletter-form.success .bp__newsletter-input {
  border-color: #38a169;
  background: rgba(56, 161, 105, 0.05);
}

.bp__newsletter-form.error .bp__newsletter-input {
  border-color: #e53e3e;
  background: rgba(229, 62, 62, 0.05);
}

.bp__newsletter-message {
  margin-top: 1rem;
  font-size: 0.875rem;
  min-height: 1.25rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

.bp__newsletter-message.success { color: #38a169; }
.bp__newsletter-message.error { color: #e53e3e; }

/* ==============================
   Utilities / Animations
============================== */
.bpCard.is-loading {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ==============================
   Responsive (keep ALL breakpoints together)
============================== */

/* <= 1024px */
@media (max-width: 1024px) {
  .bp { padding: 4rem 0 2rem; }
  .bp--spaced { padding-bottom: 4rem; }
  .bpSlider { padding: 1.5rem; }
  .bp__title { font-size: clamp(2rem, 4vw, 3rem); }

  .bpTrack {
    grid-auto-columns: calc((100% - 1.5rem) / 2);
  }

  .bpCard--featured { grid-column: span 1; }
}

/* <= 768px */
@media (max-width: 768px) {
  .bp { padding: 3rem 0 1.5rem; }
  .bp--spaced { padding-bottom: 3rem; }
  .bp__head { margin-bottom: 2rem; }
  .bp__title { font-size: 2rem; }
  .bp__description { font-size: 1rem; padding: 0 1rem; }

  .bpSlider { padding: 1rem; }

  .bpTrack {
    grid-auto-columns: 100%;
    gap: 1rem;
  }

  .bpArrow {
    width: 48px;
    height: 48px;
    display: none; /* Hide on mobile, use swipe */
  }

  .bpArrow--prev { left: -24px; }
  .bpArrow--next { right: -24px; }

  .bpGrid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .bpCard__media { height: 200px; }
  .bpCard__content { padding: 1.25rem; }

  .bp__newsletter {
    padding: 3rem 1.5rem;
    margin-top: 3rem;
  }

  .bp__newsletter-title { font-size: 1.75rem; }
  .bp__newsletter-description { font-size: 1rem; padding: 0 1rem; }

  .bp__newsletter-form {
    flex-direction: column;
    padding: 0 1rem;
  }

  .bp__newsletter-button {
    width: 100%;
    justify-content: center;
  }
}

/* <= 480px */
@media (max-width: 480px) {
  .bp__container { padding: 0 1rem; }

  .bpCard__title { font-size: 1.125rem; }

  .bpCard__excerpt {
    font-size: 0.875rem;
    -webkit-line-clamp: 2;
  }

  .bpCard__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .bpCard__author { font-size: 0.75rem; }

  .bpCard__link {
    width: 100%;
    justify-content: center;
  }

  .bp__newsletter { padding: 2.5rem 1rem; }
  .bp__newsletter-title { font-size: 1.5rem; }
  .bp__newsletter-description { font-size: 0.9375rem; }
  .bp__newsletter-input { padding: 0.875rem 1.25rem; }
  .bp__newsletter-button { padding: 0.875rem 2rem; }
}

/* ==============================
   Feature Queries (bottom)
============================== */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bpTrack,
  .bpCard,
  .bpCard__media img,
  .bpArrow,
  .bpCard__link,
  .bp__newsletter-button,
  .bp__newsletter-input {
    transition: none !important;
    animation: none !important;
  }

  .bp__newsletter-button::before { display: none; }

  .bpCard:hover { transform: none; }
  .bpCard:hover .bpCard__media img { transform: none; }
  .bp__newsletter-button:hover { transform: none; }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .bp__newsletter {
    background: #2d1f1f;
    color: #ffffff;
  }

  .bp__newsletter::before {
    background: linear-gradient(135deg, rgba(45, 31, 31, 1) 0%, rgba(45, 31, 31, 0.95) 100%);
  }

  .bp__newsletter-title { color: #ff8a8a; }
  .bp__newsletter-description { color: #c1c1c1; }

  .bp__newsletter-input {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
  }

  .bp__newsletter-input:focus {
    border-color: #ff8a8a;
    background: rgba(255, 255, 255, 0.15);
  }

  .bp__newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
  }

  .bp__newsletter-button {
    background: #ff8a8a;
    border-color: #ff8a8a;
    color: #1a1a1a;
    box-shadow: 0 4px 15px rgba(255, 138, 138, 0.3);
  }

  .bp__newsletter-button:hover {
    background: #ff9c9c;
    border-color: #ff9c9c;
    box-shadow: 0 8px 25px rgba(255, 138, 138, 0.4);
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .bpCard { border: 2px solid #1a1a1a; }

  .bpCard__title a:hover {
    color: #000;
    text-decoration: underline;
  }

  .bpCard__link { border: 2px solid #6e1b1b; }
}

/* Print styles */
@media print {
  .bpSlider,
  .bpArrow,
  .bpDots,
  .bpCard__link,
  .bp__newsletter {
    display: none !important;
  }

  .bpGrid { display: block; }

  .bpCard {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    border: 1px solid #ddd;
    box-shadow: none;
  }

  .bpCard__media img { filter: grayscale(100%); }
}
