/* ========================================
   Blog Post Page Styles
   Mobile-First Responsive Design
   Based on Figma Design
   Unified with Event Detail Page Structure
   ======================================== */

/* Page Container */
.blog-post-page {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ========================================
   Common Hero Styles (Shared with Event Detail)
   ======================================== */

/* Base hero styles - shared between blog-post and event-detail */
.blog-post-hero,
.event-detail-hero {
  width: 100%;
  box-sizing: border-box;
  position: relative;
  padding: 48px 24px;
  min-height: auto;
}

/* Blog post hero uses dance style gradients */
.blog-post-hero--tango {
  background: var(--gradient-blog-tango);
}

.blog-post-hero--salsa {
  background: var(--gradient-blog-salsa);
}

.blog-post-hero--bachata {
  background: var(--gradient-blog-bachata);
}

.blog-post-hero--fusion {
  background: var(--gradient-blog-fusion);
}

.blog-post-hero--contact {
  background: var(--gradient-blog-contact);
}

.blog-post-hero--wcs {
  background: var(--gradient-blog-wcs);
}

.blog-post-hero--zouk {
  background: var(--gradient-blog-zouk);
}

/* Common container styles */
.blog-post-hero__container {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 1;
}

.event-detail-hero__container {
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 1;
}

/* Common back button styles - matching Figma */
.blog-post-hero__back-btn,
.event-detail-hero__back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--font-family-montserrat);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5em;
  cursor: pointer;
  margin-bottom: 0;
  align-self: flex-start;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 18px -14px rgba(15, 23, 43, 0.25);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  text-decoration: none;
}

.blog-post-hero__back-btn:visited {
  color: rgba(255, 255, 255, 0.95);
}

.blog-post-hero__back-btn:hover,
.event-detail-hero__back-btn:hover {
  color: rgba(255, 255, 255, 0.98);
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.38);
  transform: translateY(-1px);
  text-decoration: none;
}

.blog-post-hero__back-btn:hover svg,
.event-detail-hero__back-btn:hover svg {
  transform: scale(1.1);
}

.blog-post-hero__back-btn svg,
.event-detail-hero__back-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transition: transform 0.3s ease;
}

.blog-post-hero__back-btn:active,
.event-detail-hero__back-btn:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: none;
}

.blog-post-hero__back-btn:focus-visible,
.event-detail-hero__back-btn:focus-visible {
  outline: 2px solid rgba(0, 150, 137, 0.35);
  outline-offset: 2px;
}

/* Common header styles */
.blog-post-hero__header,
.event-detail-hero__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 0;
}

/* Blog post specific header - badges container */
.blog-post-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Tags inside hero banner - styled as badges (for author convenience) */
.blog-post-hero__badges .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  background: var(--blog-tag-bg, rgba(255, 226, 226, 1));
  opacity: 0.85; /* Slightly transparent as per Figma */
  border: 1px solid rgba(0, 0, 0, 0);
  border-radius: 1000px; /* Full radius - matching Figma */
  font-family: var(--font-family-montserrat);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5em;
  color: var(--blog-tag-ink, #C10007);
  white-space: nowrap;
  margin: 0; /* Remove default margins */
}

/* Blog post badge styles - matching Figma (kept for backward compatibility) */
.blog-post-hero__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  background: rgba(255, 226, 226, 1);
  border: 1px solid rgba(0, 0, 0, 0);
  border-radius: 1000px; /* Full radius - matching Figma */
  font-family: var(--font-family-montserrat);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5em;
  color: var(--blog-tag-ink, #C10007);
  white-space: nowrap;
}

/* Blog post title - matching Figma */
.blog-post-hero__title {
  font-family: var(--font-family-montserrat);
  font-weight: 300;
  font-size: 60px;
  line-height: 1.25em;
  letter-spacing: 0;
  color: var(--color-text-white);
  margin: 0;
  text-align: left;
}

/* Blog post subtitle/description - matching Figma */
.blog-post-hero__subtitle {
  font-family: var(--font-family-montserrat);
  font-weight: 300;
  font-size: 20px;
  line-height: 1.625em;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  text-align: left;
}

/* Dates and Location in hero banner */
.blog-post-hero__dates,
.blog-post-hero__location {
  font-family: var(--font-family-montserrat);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5em;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  text-align: left;
}

.blog-post-hero__dates {
  margin-top: 8px;
}

.blog-post-hero__location {
  margin-top: -8px;
}

/* ========================================
   Common Content Section Styles
   ======================================== */

/* Base content container - shared */
.blog-post-content,
.event-detail-content {
  max-width: var(--container-max-width);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: 24px 16px 0;
}

/* Content container - shared */
.blog-post-content__container,
.event-detail-content__container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Main content area - shared */
.blog-post-content__main,
.event-detail-content__main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  order: 1;
}

/* Article content styles - matching Figma */
.blog-post-article {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Paragraph styles - matching Figma */
.blog-post-article p {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.625em;
  color: #314158;
 
}

.blog-post-article p:last-child {
  margin-bottom: 0;
}

/* Heading 2 styles - matching Figma */
.blog-post-article h2 {
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.3333333333333333em;
  color: #0F172B;
  margin: 18px 0 24px 0;
}

/* Heading 3 styles - matching Figma */
.blog-post-article h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5em;
  letter-spacing: 0.05em; /* 5% of font size */
  text-transform: uppercase;
  color: #475569;
  margin: 18px 0 12px 0;
}

/* Bold text in paragraphs */
.blog-post-article p strong {
  font-weight: 700;
}

/* Italic text in paragraphs */
.blog-post-article p em {
  font-style: italic;
}

/* Link styles - matching Figma */
.blog-post-article p a {
  color: var(--blog-tag-ink, #C10007);
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-post-article p a:hover {
  color: #E11D48;
  text-decoration: none;
}

/* Image Gallery Grid Layout */
.blog-post-article__gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 24px 0;
}

.blog-post-article__gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0px 4px 6px -4px rgba(0, 0, 0, 0.1), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);
  background: #f9fafb;
  aspect-ratio: 4 / 3;
}

/* All images full width on mobile */
.blog-post-article__gallery-item {
  grid-column: 1 / -1;
}

/* First two images - side by side (desktop only) */
@media (min-width: 768px) {
  .blog-post-article__gallery-item:nth-child(1),
  .blog-post-article__gallery-item:nth-child(2) {
    grid-column: span 1;
  }

  /* Third image (if exists) - full width */
  .blog-post-article__gallery-item:nth-child(3) {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
  }

  /* If only one image, make it full width */
  .blog-post-article__gallery-item:only-child {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
  }
}

.blog-post-article__gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.blog-post-article__gallery-item:hover img {
  transform: scale(1.05);
}

/* V1-style 3-image layout: portrait left, stacked right (desktop only). */
@media (min-width: 768px) {
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 {
    grid-template-columns: 1fr 1fr;
    /* v1 used fixed row heights to keep the grid crisp */
    grid-auto-rows: 260px;
  }

  /* Neutralize the default placement rules in this mode */
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item,
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item:nth-child(1),
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item:nth-child(2),
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item:nth-child(3),
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item:only-child {
    grid-column: auto;
    grid-row: auto;
  }

  /* In v1-3 mode, size by grid rows (not by aspect-ratio) */
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item {
    aspect-ratio: auto;
    height: 100%;
  }

  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item--v1-portrait {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item--v1-right-top {
    grid-column: 2;
    grid-row: 1;
  }

  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item--v1-right-bottom {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 767px) {
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item--v1-portrait,
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item--v1-right-top,
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item--v1-right-bottom {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  /* v1 behavior on mobile: let images keep natural aspect */
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item {
    aspect-ratio: auto;
    height: auto;
  }

  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item img {
    height: auto;
  }
}

/* ========================================
   Event Details Card (Blog Post Specific)
   ======================================== */

/* Event details card - matching Figma */
.blog-post-event-details {
  background: var(--color-text-white);
  border: 1px solid #E5E7EB;
  border-radius: 24px;
  margin: 0 0 28px;
  position: relative;
  overflow: hidden;
}

/* Gradient top border - matching Figma */
.blog-post-event-details::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--blog-event-details-gradient, linear-gradient(90deg, rgba(251, 44, 54, 1) 0%, rgba(230, 0, 118, 1) 100%));
  z-index: 1;
}

/* Event details content */
.blog-post-event-details__content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  z-index: 0;
}

/* Event details item */
.blog-post-event-details__item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.blog-post-event-details__item-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--blog-icon-color, #FB2C36); /* fallback to tango color */
}

.blog-post-event-details__item-content {
  flex: 1;
}

.blog-post-event-details__item-content p {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.625em;
  color: #1D293D;
  margin: 0;
}

/* ========================================
   Action Buttons (Blog Post Specific)
   ======================================== */

.blog-post-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
  width: 100%;
}

.blog-post-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  width: 100%;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-family: var(--font-family-montserrat);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.43em;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, filter 0.3s ease;
  cursor: pointer;
  border: none;
  will-change: transform;
}

/* Button colors matching Figma */
.blog-post-action-btn--primary {
  background: var(--blog-primary-button-gradient, linear-gradient(135deg, rgba(251, 44, 54, 1) 0%, rgba(230, 0, 118, 1) 100%));
  color: var(--color-text-white);
  box-shadow: 0px 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Secondary button - matching blog-stories__view-all styles exactly */
.blog-post-action-btn--secondary {
  background: var(--color-bg-white);
  border: 1px solid #cad5e2;
  color: #314158;
  box-shadow: none;
}

.blog-post-action-btn:hover {
  transform: scale(1.05);
  box-shadow: 0px 30px 60px -12px rgba(0, 0, 0, 0.35);
  text-decoration: none;
}

.blog-post-action-btn--primary:hover {
  filter: brightness(1.1);
  color: var(--color-text-white);
}

/* Secondary button hover - matching blog-stories__view-all:hover exactly */
.blog-post-action-btn--secondary:hover {
  transform: none;
  box-shadow: none;
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.5) 0%, rgba(203, 213, 225, 0.3) 100%);
  border-color: #94a3b8;
  color: #314158;
  text-decoration: none;
}

/* Back button when inside article (at bottom of page) - more specific to avoid conflicts with hero button */
.blog-post-content .blog-post-article .blog-post-hero__back-btn {
  color: #475569;
  margin-top: 24px;
  margin-bottom: 52px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transform: none;
}

.blog-post-content .blog-post-article .blog-post-hero__back-btn svg {
  stroke: #475569;
}

.blog-post-content .blog-post-article .blog-post-hero__back-btn svg path {
  stroke: #475569;
}

.blog-post-content .blog-post-article .blog-post-hero__back-btn:hover {
  color: #64748b;
  text-decoration: none;
}

.blog-post-content .blog-post-article .blog-post-hero__back-btn:hover svg {
  stroke: #64748b;
  transform: scale(1.1);
}

.blog-post-content .blog-post-article .blog-post-hero__back-btn:hover svg path {
  stroke: #64748b;
}

/* ========================================
   Responsive Styles
   ======================================== */

/* Mobile Styles - matching About page */
@media (max-width: 768px) {
  .blog-post-hero,
  .event-detail-hero {
    padding: 40px 24px;
  }

  .blog-post-hero__title {
    font-size: 40px;
    line-height: 1.1em;
  }

  .blog-post-hero__subtitle {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .blog-post-hero__title {
    font-size: 32px;
  }

  .blog-post-hero__subtitle {
    font-size: 16px;
  }
}

/* Tablet Styles */
@media (min-width: 768px) {
  .blog-post-hero,
  .event-detail-hero {
    padding: 32px 24px 40px;
  }

  .blog-post-hero__container,
  .event-detail-hero__container {
    padding: 0 24px;
    gap: 32px;
  }

  .blog-post-hero__title {
    font-size: 48px;
    line-height: 60px;
  }

  .blog-post-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .blog-post-action-btn {
    width: auto;
  }

  .blog-post-event-details__content {
    padding: 32px 32px 24px;
  }

  .blog-post-content,
  .event-detail-content {
    padding: 48px 24px 0;
  }

  .blog-post-content__container,
  .event-detail-content__container {
    gap: 32px;
  }

  .blog-post-article__gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* Desktop Styles - matching Figma exactly */
@media (min-width: 1024px) {
  .blog-post-hero {
    padding: 48px 264px 0px;
  }

  .event-detail-hero {
    padding: 48px var(--container-padding) 40px;
  }

  .blog-post-hero__container {
    max-width: 800px;
    padding: 0;
    gap: 0;
  }

  .event-detail-hero__container {
    max-width: 1424px;
    padding: 0 200px;
    gap: 0;
  }

  .blog-post-hero__back-btn,
  .event-detail-hero__back-btn {
    margin-bottom: 24px;
  }

  .blog-post-hero__header,
  .event-detail-hero__header {
    margin-bottom: 32px;
  }

  .blog-post-hero__title {
    font-size: 48px;
    line-height: 1.25em;
  }

  .blog-post-content {
    padding: 48px 264px 0;
  }

  .event-detail-content {
    padding: 48px var(--container-padding) 0;
  }

  .blog-post-content__container {
    max-width: 832px;
    margin: 0 auto;
  }

  .event-detail-content__container {
    max-width: 100%;
  }

  .blog-post-article__gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .blog-post-article__gallery-item:last-child {
    grid-column: 1 / -1;
  }

  /* In v1-3 mode, never force the last item full-width */
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item:last-child {
    grid-column: auto;
  }

  /* Re-assert positions in this breakpoint (overrides above rule) */
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item--v1-portrait {
    grid-column: 1;
    grid-row: 1 / span 2;
  }
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item--v1-right-top {
    grid-column: 2;
    grid-row: 1;
  }
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item--v1-right-bottom {
    grid-column: 2;
    grid-row: 2;
  }
}

/* Hardcoded v1 3-image layout must always win */
@media (min-width: 768px) {
  .blog-post-article__gallery.blog-post-article__gallery--v1-3 {
    grid-auto-rows: 260px;
  }

  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item {
    grid-column: auto !important;
    grid-row: auto !important;
    aspect-ratio: auto !important;
    height: 100%;
  }

  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item--v1-portrait {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
  }

  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item--v1-right-top {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  .blog-post-article__gallery.blog-post-article__gallery--v1-3 .blog-post-article__gallery-item--v1-right-bottom {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }
}

