/**
 * Events Archive Component Styles
 */

.events-archive {
  width: 100%;
  padding: 2rem 0;
  background: var(--Tertiary-40, #FBF3F2);
}

.events-archive-container {
  width: 100%;
  margin: 0 auto;
}

.events-archive-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem; /* gap-8 = 2rem = 32px */
}

/* Event Item */
.events-archive-item {
  width: 100%;
  position: relative;
  height: 600px; /* Default for large, will be overridden for medium */
  overflow: hidden;
}

/* Large Size - fixed aspect ratio on large screens so image area is 16:10 (padding-bottom hack: flex + absolute children otherwise give 0 height) */
.events-archive-item[data-size="Large"] {
  width: 100%;
  height: 0;
  padding-bottom: 31.25%; /* 10/32 = 31.25% of width → item ratio 32:10, image half = 16:10 */
  position: relative;
}

.events-archive-item[data-size="Large"] .events-archive-item-image-wrapper {
  height: 100%;
  position: absolute;
  top: 0;
  bottom: 0;
}

.events-archive-item[data-size="Large"] .events-archive-item-content {
  width: auto;
  max-width: 50%;
  height: 100%;
}

/* Medium Size - row height 400px, image area fixed 4:5 (320×400) */
.events-archive-item[data-size="Medium"] {
  width: 100%;
  height: 400px;
  padding: 0 2rem; /* px-8 = 2rem = 32px */
}

/* Medium image wrapper: explicit 320×400 for reliable 4:5 (aspect-ratio doesn’t apply when absolute + parent has fixed height) */
.events-archive-item[data-size="Medium"] .events-archive-item-image-wrapper {
  width: 320px;
  height: 400px;
  position: absolute;
  overflow: hidden;
}

.events-archive-item[data-size="Medium"] .events-archive-item-content {
  width: auto;
  max-width: 364px;
  height: 100%;
}

/* Image Positioning - Large Right (Row 1) - Right 50% width */
.events-archive-item[data-size="Large"][data-image-position="right"] .events-archive-item-image-wrapper {
  right: 0;
  width: 50%; /* Right 50% width */
  top: 0;
}

.events-archive-item[data-size="Large"][data-image-position="right"][data-content-side="left"] .events-archive-item-content {
  right: 50%; /* Content on right side of left 50%, next to image */
  align-items: flex-end;
}

.events-archive-item[data-size="Large"][data-image-position="right"][data-content-side="left"] .events-archive-item-text {
  align-items: flex-end;
  text-align: right;
}

/* Image Positioning - Large Left (Row 4) - Left 50% width */
.events-archive-item[data-size="Large"][data-image-position="left"] .events-archive-item-image-wrapper {
  left: 0; /* First 50% from left */
  width: 50%; /* Left 50% width */
  top: 0;
}

.events-archive-item[data-size="Large"][data-image-position="left"][data-content-side="right"] .events-archive-item-content {
  left: 50%; /* Content on right side, next to image (starts where image ends) */
  align-items: flex-start;
}

.events-archive-item[data-size="Large"][data-image-position="left"][data-content-side="right"] .events-archive-item-text {
  align-items: flex-start;
  text-align: left;
}

/* Image Positioning - Medium Center-Left (Row 2: 25-50%) */
.events-archive-item[data-size="Medium"][data-image-position="center-left"] .events-archive-item-image-wrapper {
  left: 25%; /* 360px on 1440px container */
  top: 0;
}

.events-archive-item[data-size="Medium"][data-image-position="center-left"][data-content-side="right"] .events-archive-item-content {
  left: calc(25% + 320px); /* Position to the right of the image (360px + 320px = 680px) */
  align-items: flex-start;
}

.events-archive-item[data-size="Medium"][data-image-position="center-left"][data-content-side="right"] .events-archive-item-text {
  align-items: flex-start;
  text-align: left;
}

/* Image Positioning - Medium Center-Right (Row 3: 50-75%) */
.events-archive-item[data-size="Medium"][data-image-position="center-right"] .events-archive-item-image-wrapper {
  left: 50%; /* 720px on 1440px container */
  top: 0;
}

.events-archive-item[data-size="Medium"][data-image-position="center-right"][data-content-side="left"] .events-archive-item-content {
  right: 50%; /* Content on right side, next to image (which starts at 50%) */
  align-items: flex-end;
}

.events-archive-item[data-size="Medium"][data-image-position="center-right"][data-content-side="left"] .events-archive-item-text {
  align-items: flex-end;
  text-align: right;
}

/* Content */
.events-archive-item-content {
  position: absolute;
  top: 0;
  display: inline-flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 1rem 1.5rem; /* px-6 py-4 = 1rem 1.5rem */
  border-top: 1.5px solid var(--Primary-100, #680144);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  background: transparent;
}


/* Hover state - reveal content */
.events-archive-item[data-state="Hover"] .events-archive-item-content,
.events-archive-item:hover .events-archive-item-content {
  opacity: 1;
}

/* Text */
.events-archive-item-text {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.5rem; /* gap-2 = 0.5rem = 8px */
}

.events-archive-item-name {
  color: var(--Primary-100, #680144);
  text-align: right;
  font-family: "DM Sans", sans-serif;
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: 120%; /* 28.8px */
  letter-spacing: -1.2px;
}

.events-archive-item[data-alignment="Left"] .events-archive-item-name {
  text-align: left;
}

.events-archive-item-details {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: stretch;
  gap: 0.125rem; /* gap-0.5 = 0.125rem = 2px */
}

.events-archive-item-location,
.events-archive-item-date {
  color: var(--Primary-100, #680144);
  text-align: right;
  align-self: stretch;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 140%; /* 19.6px */
  letter-spacing: -0.28px;
}

.events-archive-item[data-alignment="Left"] .events-archive-item-location,
.events-archive-item[data-alignment="Left"] .events-archive-item-date {
  text-align: left;
}

/* Image */
.events-archive-item-image-wrapper {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

.events-archive-item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.events-archive-item-image-placeholder {
  width: 100%;
  height: 100%;
  background-color: rgba(104, 1, 68, 0.05);
}

/* Load More Button Wrapper */
.events-archive-load-more-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 3rem;
  padding: 0 2rem;
}

/* Load More Button */
.events-archive-load-more-btn {
  width: 192px; /* w-48 = 12rem = 192px */
  padding: 1rem; /* p-4 = 1rem = 16px */
  border-radius: 0.5rem; /* rounded-lg = 0.5rem = 8px */
  outline: 1px solid var(--Primary-100, #680144);
  outline-offset: -0.5px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.625rem; /* gap-2.5 = 0.625rem = 10px */
  transition: all 0.3s ease;
}

.events-archive-load-more-btn:hover {
  background: var(--Primary-100, #680144);
}

.events-archive-load-more-btn:hover .events-archive-load-more-text {
  color: #ffffff;
}

.events-archive-load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.events-archive-load-more-text {
  flex: 1;
  text-align: center;
  color: var(--Primary-100, #680144);
  font-family: "DM Sans", sans-serif;
  font-size: 18px; /* text-lg = 1.125rem = 18px */
  font-weight: 400;
  line-height: 24px; /* leading-6 = 1.5rem = 24px */
  transition: color 0.3s ease;
}

/* Responsive - Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .events-archive {
    padding: 1rem 0;
  }
  
  .events-archive-container {
    padding: 0;
  }
  
  .events-archive-list {
    gap: 1rem;
  }
  
  /* Reset all base styles for tablet - height from image aspect ratio */
  .events-archive-item,
  .events-archive-item[data-size="Large"],
  .events-archive-item[data-size="Medium"] {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 280px;
    display: inline-flex !important;
    flex-direction: row !important;
    justify-content: flex-start;
    align-items: stretch;
    overflow: hidden;
  }
  
  /* Reset all image wrapper base styles */
  .events-archive-item-image-wrapper {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    min-height: auto !important;
  }
  
  /* Reset all content base styles */
  .events-archive-item-content {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    opacity: 1 !important;
  }
  
  /* Left alignment: image left, content right (data-content-side="right") */
  .events-archive-item[data-content-side="right"] {
    flex-direction: row !important;
  }
  
  .events-archive-item[data-content-side="right"] .events-archive-item-image-wrapper {
    order: 1;
    flex: 1 1 0;
    height: auto !important;
    width: auto !important;
    min-width: 0;
    min-height: 0 !important; /* let aspect-ratio control height (overrides flex + reset) */
    aspect-ratio: 16 / 10;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    overflow: hidden;
    display: block; /* block lets aspect-ratio apply */
    gap: 10px;
  }
  
  .events-archive-item[data-content-side="right"] .events-archive-item-content {
    order: 2;
    position: static !important;
    opacity: 1 !important;
    width: auto !important;
    max-width: none !important;
    height: 100% !important;
    padding: 12px !important;
    border-top: 1.5px solid var(--Primary-100, #680144) !important;
    border-bottom: none !important;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 8px;
    display: inline-flex;
  }
  
  .events-archive-item[data-content-side="right"] .events-archive-item-text {
    align-items: flex-end !important;
    text-align: left !important;
    gap: 8px;
  }
  
  .events-archive-item[data-content-side="right"] .events-archive-item-name {
    text-align: left !important;
    color: var(--Primary-100, #680144);
    font-size: 16px;
    font-family: "DM Sans", sans-serif;
    font-weight: 400;
    line-height: 22.40px;
    word-wrap: break-word;
  }
  
  .events-archive-item[data-content-side="right"] .events-archive-item-details {
    align-self: stretch;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 2px;
  }
  
  .events-archive-item[data-content-side="right"] .events-archive-item-location,
  .events-archive-item[data-content-side="right"] .events-archive-item-date {
    align-self: stretch;
    text-align: left !important;
    justify-content: center;
    display: flex;
    flex-direction: column;
    color: var(--Primary-100, #680144);
    font-size: 12px;
    font-family: "DM Sans", sans-serif;
    font-weight: 400;
    line-height: 16.80px;
    word-wrap: break-word;
  }
  
  /* Right alignment: content left, image right (data-content-side="left") */
  .events-archive-item[data-content-side="left"] {
    flex-direction: row !important;
  }
  
  .events-archive-item[data-content-side="left"] .events-archive-item-content {
    order: 1;
    position: static !important;
    opacity: 1 !important;
    width: auto !important;
    max-width: none !important;
    height: 100% !important;
    padding: 12px !important;
    border-top: 1.5px solid var(--Primary-100, #680144) !important;
    border-bottom: none !important;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 8px;
    display: inline-flex;
  }
  
  .events-archive-item[data-content-side="left"] .events-archive-item-image-wrapper {
    order: 2;
    flex: 1 1 0;
    height: auto !important;
    width: auto !important;
    min-width: 0;
    min-height: 0 !important;
    aspect-ratio: 16 / 10;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    overflow: hidden;
    display: block;
    gap: 10px;
  }
  
  .events-archive-item[data-content-side="left"] .events-archive-item-text {
    align-items: flex-end !important;
    text-align: right !important;
    gap: 8px;
  }
  
  .events-archive-item[data-content-side="left"] .events-archive-item-name {
    text-align: right !important;
    color: var(--Primary-100, #680144);
    font-size: 16px;
    font-family: "DM Sans", sans-serif;
    font-weight: 400;
    line-height: 22.40px;
    word-wrap: break-word;
  }
  
  .events-archive-item[data-content-side="left"] .events-archive-item-details {
    align-self: stretch;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 2px;
  }
  
  .events-archive-item[data-content-side="left"] .events-archive-item-location,
  .events-archive-item[data-content-side="left"] .events-archive-item-date {
    align-self: stretch;
    text-align: right !important;
    justify-content: center;
    display: flex;
    flex-direction: column;
    color: var(--Primary-100, #680144);
    font-size: 12px;
    font-family: "DM Sans", sans-serif;
    font-weight: 400;
    line-height: 16.80px;
    word-wrap: break-word;
  }
  
  /* Image styling for tablet */
  .events-archive-item-image {
    flex: 1 1 0;
    align-self: stretch;
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .events-archive-item-image-placeholder {
    flex: 1 1 0;
    align-self: stretch;
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(255, 124.72, 120.38, 0.05) 0%, rgba(255, 124.72, 120.38, 0.05) 100%);
  }
  
  .events-archive-load-more-wrapper {
    padding: 0 1rem;
  }
}

/* Responsive - Mobile */
@media (max-width: 767px) {
  .events-archive {
    padding: 1rem 0;
  }
  
  .events-archive-container {
    padding: 0;
  }
  
  .events-archive-list {
    gap: 1rem;
  }
  
  /* Reset all base styles for mobile - height from image aspect ratio */
  .events-archive-item,
  .events-archive-item[data-size="Large"],
  .events-archive-item[data-size="Medium"] {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 180px;
    display: inline-flex !important;
    flex-direction: row !important;
    justify-content: flex-start;
    align-items: stretch;
    overflow: hidden;
  }
  
  /* Reset all image wrapper base styles */
  .events-archive-item-image-wrapper {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    min-height: auto !important;
  }
  
  /* Reset all content base styles */
  .events-archive-item-content {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    opacity: 1 !important;
  }
  
  /* Left alignment: image left, content right (data-content-side="right") */
  .events-archive-item[data-content-side="right"] {
    flex-direction: row !important;
  }
  
  .events-archive-item[data-content-side="right"] .events-archive-item-image-wrapper {
    order: 1;
    flex: 1 1 0;
    height: auto !important;
    width: auto !important;
    min-width: 0;
    min-height: 0 !important; /* let aspect-ratio control height (overrides flex + reset) */
    aspect-ratio: 16 / 10;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    overflow: hidden;
    display: block; /* block lets aspect-ratio apply */
    gap: 10px;
  }
  
  .events-archive-item[data-content-side="right"] .events-archive-item-content {
    order: 2;
    position: static !important;
    opacity: 1 !important;
    width: auto !important;
    max-width: none !important;
    height: 100% !important;
    padding: 12px !important;
    border-top: 1.5px solid var(--Primary-100, #680144) !important;
    border-bottom: none !important;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 8px;
    display: inline-flex;
  }
  
  .events-archive-item[data-content-side="right"] .events-archive-item-text {
    align-items: flex-end !important;
    text-align: left !important;
    gap: 8px;
  }
  
  .events-archive-item[data-content-side="right"] .events-archive-item-name {
    text-align: left !important;
    color: var(--Primary-100, #680144);
    font-size: 16px;
    font-family: "DM Sans", sans-serif;
    font-weight: 400;
    line-height: 22.40px;
    word-wrap: break-word;
  }
  
  .events-archive-item[data-content-side="right"] .events-archive-item-details {
    align-self: stretch;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 2px;
  }
  
  .events-archive-item[data-content-side="right"] .events-archive-item-location,
  .events-archive-item[data-content-side="right"] .events-archive-item-date {
    align-self: stretch;
    text-align: left !important;
    justify-content: center;
    display: flex;
    flex-direction: column;
    color: var(--Primary-100, #680144);
    font-size: 12px;
    font-family: "DM Sans", sans-serif;
    font-weight: 400;
    line-height: 16.80px;
    word-wrap: break-word;
  }
  
  /* Right alignment: content left, image right (data-content-side="left") */
  .events-archive-item[data-content-side="left"] {
    flex-direction: row !important;
  }
  
  .events-archive-item[data-content-side="left"] .events-archive-item-content {
    order: 1;
    position: static !important;
    opacity: 1 !important;
    width: auto !important;
    max-width: none !important;
    height: 100% !important;
    padding: 12px !important;
    border-top: 1.5px solid var(--Primary-100, #680144) !important;
    border-bottom: none !important;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 8px;
    display: inline-flex;
  }
  
  .events-archive-item[data-content-side="left"] .events-archive-item-image-wrapper {
    order: 2;
    flex: 1 1 0;
    height: auto !important;
    width: auto !important;
    min-width: 0;
    min-height: 0 !important;
    aspect-ratio: 16 / 10;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    overflow: hidden;
    display: block;
    gap: 10px;
  }
  
  .events-archive-item[data-content-side="left"] .events-archive-item-text {
    align-items: flex-end !important;
    text-align: right !important;
    gap: 8px;
  }
  
  .events-archive-item[data-content-side="left"] .events-archive-item-name {
    text-align: right !important;
    color: var(--Primary-100, #680144);
    font-size: 16px;
    font-family: "DM Sans", sans-serif;
    font-weight: 400;
    line-height: 22.40px;
    word-wrap: break-word;
  }
  
  .events-archive-item[data-content-side="left"] .events-archive-item-details {
    align-self: stretch;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 2px;
  }
  
  .events-archive-item[data-content-side="left"] .events-archive-item-location,
  .events-archive-item[data-content-side="left"] .events-archive-item-date {
    align-self: stretch;
    text-align: right !important;
    justify-content: center;
    display: flex;
    flex-direction: column;
    color: var(--Primary-100, #680144);
    font-size: 12px;
    font-family: "DM Sans", sans-serif;
    font-weight: 400;
    line-height: 16.80px;
    word-wrap: break-word;
  }
  
  /* Image styling for mobile */
  .events-archive-item-image {
    flex: 1 1 0;
    align-self: stretch;
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .events-archive-item-image-placeholder {
    flex: 1 1 0;
    align-self: stretch;
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(255, 124.72, 120.38, 0.05) 0%, rgba(255, 124.72, 120.38, 0.05) 100%);
  }
  
  .events-archive-load-more-wrapper {
    padding: 0 1rem;
  }
}
