/**
 * Event Card Block - Frontend Styles
 * Based on Figma node 318-372
 */

.wp-block-anone-event,
.wp-block-anone-event * {
  box-sizing: border-box;
}

.wp-block-anone-event {
  position: relative;
  width: 100%;
}

/* =============================================================
   Event Card Container
   ============================================================= */

.event-card {
  position: relative;
  width: 100%;
  aspect-ratio: 351 / 466.6;
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* =============================================================
   Background Image
   ============================================================= */

.event-card__image-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.event-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Gradient Overlay - from Figma */
.event-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(176, 170, 153, 0.9) 19.37%,
    rgba(196, 189, 172, 0) 77.7%
  );
  pointer-events: none;
}

/* =============================================================
   Content
   ============================================================= */

.event-card__content {
  position: relative;
  z-index: 1;
  padding: 1.25rem 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

/* Tag (EVENT) */
.event-card__tag {
  background: #ccd63c;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.6875rem; /* 11px */
  line-height: 140%;
  font-weight: 500;
  color: #1d1d1f;
  display: inline-block;
}

/* Title & Subtitle Container */
.event-card__text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  text-align: center;
}

/* Title */
.event-card__title {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.3125rem; /* 21px */
  line-height: 140%;
  font-weight: 500;
  color: #1d1d1f;
  margin: 0;
}

/* Subtitle */
.event-card__subtitle {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.0625rem; /* 17px */
  line-height: 180%;
  font-weight: 400;
  color: #1d1d1f;
  margin: 0;
}

/* =============================================================
   CTA Buttons
   ============================================================= */

.event-card__cta {
  display: flex;
  flex-direction: row;
  gap: 0.75rem; /* 12px */
  width: 100%;
  margin-top: 0.875rem; /* 14px from Figma */
  justify-content: center; /* Center buttons */
}

.event-card__btn {
  border-radius: 6.25rem; /* 100px */
  padding: 0.5rem 1.5rem; /* 8px 24px */
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.9375rem; /* 15px */
  line-height: 160%;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap; /* Prevent text wrap */
}

.event-card__btn:hover {
  opacity: 0.8;
}

.event-card__btn--primary,
.wp-block-anone-event a.event-card__btn--primary,
.wp-block-anone-event a.event-card__btn--primary:link,
.wp-block-anone-event a.event-card__btn--primary:visited,
.wp-block-anone-event a.event-card__btn--primary:hover,
.wp-block-anone-event a.event-card__btn--primary:focus {
  background: #1d1d1f;
  color: #ffffff;
  border: none;
}

.event-card__btn--secondary,
.wp-block-anone-event a.event-card__btn--secondary,
.wp-block-anone-event a.event-card__btn--secondary:link,
.wp-block-anone-event a.event-card__btn--secondary:visited,
.wp-block-anone-event a.event-card__btn--secondary:hover,
.wp-block-anone-event a.event-card__btn--secondary:focus {
  background: #ffffff;
  color: #1d1d1f;
  border: 1px solid #1d1d1f;
}

/* =============================================================
   Empty State
   ============================================================= */

.event-card--empty {
  aspect-ratio: 351 / 466.6;
  background: linear-gradient(
    180deg,
    rgba(176, 170, 153, 0.5) 0%,
    rgba(196, 189, 172, 0.3) 100%
  );
  border: 2px dashed #ccc;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-card--empty p {
  margin: 0;
  color: #666;
  text-align: center;
  padding: 1rem;
}

/* =============================================================
   Responsive - Mobile
   ============================================================= */

@media (max-width: 767px) {
  .event-card__title {
    font-size: 1.125rem; /* 18px */
  }

  .event-card__subtitle {
    font-size: 0.9375rem; /* 15px */
  }

  .event-card__btn {
    font-size: 0.875rem; /* 14px */
    padding: 0.4rem 1rem;
  }

  .event-card__cta {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }
}

/* =============================================================
   Event Popup Banner (Fixed when card out of view)
   Based on Figma node 464-14655 & AutoHTML export
   ============================================================= */

.event-popup,
.event-popup * {
  box-sizing: border-box;
}

.event-popup {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%) translateX(calc(100% + 2rem));
  z-index: 999;
  
  /* From AutoHTML popup.css */
  background: #ffffff;
  border-radius: 0.5rem;
  border-style: solid;
  border-color: #82cddb;
  border-width: 0.25rem; /* 4px */
  padding: 1.25rem; /* 20px */
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
  justify-content: flex-start;
  box-shadow: 0rem 0.125rem 0.625rem 0rem rgba(0, 0, 0, 0.1);
  
  /* Animation */
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.event-popup.is-visible {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
  visibility: visible;
}

/* Link wrapper - matches frame-161 structure */
.event-popup__link {
  display: flex;
  flex-direction: row;
  gap: 0.875rem; /* 14px */
  align-items: flex-start;
  justify-content: flex-start;
  align-self: stretch;
  text-decoration: none;
  color: inherit;
}

.event-popup__link:hover {
  text-decoration: none;
}

/* Thumbnail - matches rectangle-63 */
.event-popup__thumb {
  border-radius: 0.25rem;
  flex-shrink: 0;
  width: 6.0625rem; /* 97px */
  height: 7.25rem; /* 116px */
  position: relative;
  overflow: hidden;
}

.event-popup__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Content - matches frame-81 */
.event-popup__content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem; /* 4px */
  align-items: flex-start;
  justify-content: flex-start;
  flex: 1;
  position: relative;
}

/* Tag - matches frame-56 */
.event-popup__tag {
  background: #ccd63c;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  
  /* Text style - matches popupbanner__event */
  color: #1d1d1f;
  text-align: left;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.6875rem; /* 11px */
  line-height: 140%;
  font-weight: 500;
}

/* Title - matches popupbanner__div */
.event-popup__title {
  color: #1d1d1f;
  text-align: left;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.3125rem; /* 21px */
  line-height: 140%;
  font-weight: 500;
  position: relative;
  align-self: stretch;
  margin: 0;
}

/* Subtitle - matches popupbanner__div2 */
.event-popup__subtitle {
  color: #1d1d1f;
  text-align: left;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.0625rem; /* 17px */
  line-height: 160%;
  font-weight: 400;
  position: relative;
  align-self: stretch;
  margin: 0;
}

/* Close Button */
.event-popup__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #999;
  padding: 0;
  transition: color 0.2s ease;
}

.event-popup__close:hover {
  color: #1d1d1f;
}

/* =============================================================
   Popup Responsive - Mobile
   ============================================================= */

@media (max-width: 767px) {
  .event-popup {
    right: 0.75rem;
    padding: 1rem;
  }

  .event-popup__thumb {
    width: 4.5rem;
    height: 5.5rem;
  }

  .event-popup__title {
    font-size: 1rem;
  }

  .event-popup__subtitle {
    font-size: 0.875rem;
  }
}


