/**
 * Rifnote Post Listings and Styles
 *
 * Styles for the [rifnote_featured_post] shortcode.
 */
.rifnote-hero {
  position: relative; /* For overlay positioning */
  width: 100%;
  height: 450px;
  overflow: hidden; /* This is crucial to clip the scaled background */
  border-radius: 10px;
  background-color: #333; /* Fallback background for the container */
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  margin-bottom: 1.5em;
}

.rifnote-hero.loading {
  cursor: wait;
  opacity: 0.8;
  transition: opacity 0.2s ease-in-out;
}

.rifnote-hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Smooth transition */
}

/* Add a subtle gradient overlay to ensure text is readable */
.rifnote-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 50%);
  z-index: 1; /* Sit below the text overlay */
}

.rifnote-hero:hover .rifnote-hero-background {
  transform: scale(1.05) rotate(1deg); /* Subtle zoom and rotate effect */
}

.rifnote-hero-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background-color: var(--rpls-theme-color, #ed1c24);
  width: 0; /* Initial state */
  z-index: 5; /* Ensure it's on top */
  opacity: 0.8;
}

.rifnote-hero-progress-bar.is-animating {
  /* The animation will be applied via JS */
  transition: width 10s linear;
}
.rifnote-hero:hover .rifnote-hero-progress-bar {
  transition-duration: 0.2s; /* Make the pause/resume smoother */
}

.rifnote-hero-overlay {
  position: absolute; /* Revert to absolute to position from the bottom */
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px; /* Padding is now the main spacer */
  display: block; /* Use block layout to prevent flexbox overlap issues */
  color: #fff;
  z-index: 2; /* Ensure it's above the ::before pseudo-element */
  transition: padding 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.rifnote-hero:hover .rifnote-hero-overlay {
  padding: 10px; /* Lift the content slightly on hover */
}

.rifnote-hero-content {
  background-color: rgba(0, 0, 0, 0.5); /* Default fallback */
  padding: 15px;
  border-radius: 8px;
  display: inline-block; /* Make it only as wide as its content */
  margin-bottom: 50px; /* Add space between content and bottom buttons */
  gap: 20px;
}

.rifnote-hero-meta {
  flex-grow: 1;
}

.rifnote-hero-overlay .time {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 5px;
  display: block;
}

.rifnote-hero-overlay .title {
  font-size: 24px; /* Increased for more impact */
  font-weight: bold;
  margin: 0 0 10px 0;
  line-height: 1.2;
}

.rifnote-hero-overlay .title a {
  color: #fff;
  text-decoration: none;
}

.rifnote-hero-overlay .title a:hover {
  text-decoration: underline;
}

.rifnote-hero-overlay .excerpt {
  font-size: 14px;
  opacity: 0.9;
}

.rifnote-hero-share {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 3;
}

.rifnote-hero-share .rpls-social-share.is-toggleable {
  margin: 0;
  padding: 0;
  border: none;
  display: flex;
  justify-content: flex-end;
}

.rifnote-hero-share .rpls-share-toggle-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-sizing: border-box; /* Ensure padding/border is included in height/width */
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.rifnote-hero-share .rpls-share-toggle-button:hover,
.rifnote-hero-share .rpls-share-toggle-button.is-active {
  background-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.rifnote-hero-share .rpls-social-share-container {
  /* This holds the actual list of icons */
  position: absolute;
  bottom: calc(100% + 10px); /* Position it above the toggle button */
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 10px;
  border-radius: 8px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease-in-out;
  z-index: 10;
}

.rifnote-hero-share .rpls-social-share-container.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.rifnote-hero-share .rpls-social-share-container .rpls-social-share-label {
  display: none; /* Hide the "Share:" label */
}

.rifnote-hero-actions {
  /* Position the actions absolutely to the bottom right of the overlay */
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 3; /* Ensure actions are on top */
}

/* New Navigation Button Styles */
.rpls-hero-nav-group {
  display: flex;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

.rpls-hero-nav-button {
  background-color: transparent;
  border: none;
  color: #fff;
  padding: 8px 15px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rpls-hero-nav-button.is-prev {
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.rpls-hero-nav-button:hover {
  background-color: rgba(0, 0, 0, 0.5);
}

.rpls-hero-nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .rifnote-hero {
    height: 380px; /* A more reasonable height for tablets and large phones */
  }

  .rifnote-hero-overlay {
    left: 5px;
    right: 5px;
    padding: 5px;
    bottom: 5px;
  }

  .rifnote-hero-content {
    /* On mobile, the share button is inside the actions, so we don't need flex here */
    display: block;
  }


  .rifnote-hero-overlay .title {
    font-size: 20px; /* Reduce title size */
  }

  .rifnote-hero-overlay .excerpt {
    font-size: 13px; /* Slightly smaller excerpt text */
  }

  .rifnote-hero-share {
    bottom: 5px;
    left: 5px;
  }

  .rifnote-hero-share .rpls-share-toggle-button {
    /* Make the share button smaller on mobile, matching nav button height */
    height: 38px;
    width: 38px;
  }

  .rifnote-hero-actions {
    bottom: 5px;
    right: 5px;
  }
}

@media (max-width: 480px) {
  .rifnote-hero-overlay .excerpt {
    display: none; /* Hide the excerpt on very small screens to save space */
  }

  .rifnote-hero:hover .rifnote-hero-overlay .excerpt {
    display: block; /* On tap/hover, show the excerpt */
    margin-top: 10px; /* Add a little space above the revealed excerpt */
  }
}