/* ==========================================================================
   Guestbook & Reviews Page Custom Stylesheet (reviews.css)
   ========================================================================== */

/* 1. Ratings Summary Badges Grid (Compact Desktop Bar with Brand Tints) */
.ratings-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 20px 0 30px;
}

.ratings-summary-grid .rating-badge-card {
  background-color: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius, 8px);
  padding: 8px 14px;
  text-decoration: none !important;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.rating-info {
  display: flex;
  flex-direction: column;
}

.platform-name {
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: var(--text-muted, #606f7b);
  font-weight: 700;
  white-space: nowrap;
}

.platform-action {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary, #3a5335);
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.platform-action::after {
  content: "→";
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.airbnb-dropdown-wrapper .platform-action::after {
  content: none;
}

.platform-icon {
  font-size: 1.25rem !important;
  flex-shrink: 0;
}

.icon-ta { color: #00af87; }
.icon-google { color: #4285f4; }
.icon-booking { color: #003580; }
.icon-airbnb { color: #FF5A5F; }
.icon-fb { color: #1877f2; }

/* Top Badge Brand Tints & Hover States */
.card-ta { border-color: rgba(0, 175, 135, 0.3); background-color: rgba(0, 175, 135, 0.04); }
.card-ta .platform-action { color: #00af87; }

.card-google { border-color: rgba(66, 133, 244, 0.3); background-color: rgba(66, 133, 244, 0.04); }
.card-google .platform-action { color: #4285f4; }

.card-booking { border-color: rgba(0, 53, 128, 0.3); background-color: rgba(0, 53, 128, 0.04); }
.card-booking .platform-action { color: #003580; }

.card-airbnb { border-color: rgba(255, 90, 95, 0.3); background-color: rgba(255, 90, 95, 0.04); }
.card-airbnb .platform-action { color: #FF5A5F; }

.card-fb { border-color: rgba(24, 119, 242, 0.3); background-color: rgba(24, 119, 242, 0.04); }
.card-fb .platform-action { color: #1877f2; }

.ratings-summary-grid .rating-badge-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.ratings-summary-grid .rating-badge-card:hover .platform-action::after {
  transform: translateX(3px);
}

.ratings-summary-grid .card-ta:hover { border-color: #00af87; background-color: rgba(0, 175, 135, 0.08); }
.ratings-summary-grid .card-google:hover { border-color: #4285f4; background-color: rgba(66, 133, 244, 0.08); }
.ratings-summary-grid .card-booking:hover { border-color: #003580; background-color: rgba(0, 53, 128, 0.08); }
.ratings-summary-grid .card-airbnb:hover { border-color: #FF5A5F; background-color: rgba(255, 90, 95, 0.08); }
.ratings-summary-grid .card-fb:hover { border-color: #1877f2; background-color: rgba(24, 119, 242, 0.08); }

/* Airbnb Top Dropdown Styles */
.airbnb-dropdown-wrapper {
  position: relative;
  cursor: pointer;
}

.dropdown-arrow {
  font-size: 0.7rem;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.airbnb-dropdown-wrapper:hover .dropdown-arrow,
.btn-airbnb-dropdown-wrapper:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.airbnb-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1.5px solid #FF5A5F;
  border-radius: var(--radius, 8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  padding: 6px 0;
  margin-top: 6px;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s ease;
}

.airbnb-dropdown-wrapper:hover .airbnb-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.airbnb-dropdown-menu a {
  display: block;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary, #3a5335);
  text-decoration: none !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.airbnb-dropdown-menu a:hover {
  background-color: rgba(255, 90, 95, 0.08);
  color: #FF5A5F;
}


/* ==========================================================================
   2. Action Buttons Hub (Share Your Experience Buttons)
   ========================================================================== */
.write-review-hub {
  margin-top: 40px;
  background-color: rgba(32, 122, 111, 0.06);
  border: 1px solid var(--text-accent, #207a6f);
  border-radius: var(--radius, 8px);
  padding: 20px;
  text-align: center;
  margin-bottom: 30px;
}

.write-review-hub h3 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary, #3a5335);
  margin: 0 0 8px 0;
  font-weight: 600;
}

/* 1st Paragraph: Exact gap above button row */
.write-review-hub > p:first-of-type {
  font-size: 0.9rem;
  color: var(--text-main, #2c3531);
  margin: 0 0 12px 0;
}

.review-buttons-flex {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0;
}

.btn-review {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm, 6px);
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.2px;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-review-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-text {
  display: flex;
  flex-direction: column;
  text-align: center;
  line-height: 1.2;
}

.btn-text .line-1 {
  font-size: 0.95em;
  font-weight: bold;
}

.btn-text .line-2 {
  font-size: 0.75em;
  opacity: 0.85;
  letter-spacing: 0.5px;
}

.btn-review:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Platform Brand Colors */
.btn-ta { background-color: #00af87; }
.btn-google { background-color: #4285f4; }
.btn-booking { background-color: #003580; }
.btn-airbnb { background-color: #FF5A5F; }
.btn-fb { background-color: #1877f2; }

/* Airbnb Post Review Dropdown Wrapper */
.btn-airbnb-dropdown-wrapper {
  position: relative;
  cursor: pointer;
}

.btn-airbnb-dropdown-wrapper span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.airbnb-btn-dropdown-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1.5px solid #FF5A5F;
  border-radius: var(--radius, 8px);
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.15);
  padding: 6px 0;
  margin-bottom: 6px;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.2s ease;
}

.btn-airbnb-dropdown-wrapper:hover .airbnb-btn-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.airbnb-btn-dropdown-menu a {
  display: block;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dark, #1c2d37);
  text-decoration: none !important;
  text-transform: none;
  letter-spacing: normal;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.airbnb-btn-dropdown-menu a:hover {
  background-color: rgba(255, 90, 95, 0.08);
  color: #FF5A5F;
}

/* 2nd Paragraph Note: Softened, smaller, exact gap below button row */
.review-platform-note {
  font-size: 0.75em;
  font-style: italic;
  font-weight: 400;
  color: var(--text-muted, #606f7b);
  letter-spacing: 0.02em;
  margin-top: 12px;
  margin-bottom: 0;
  opacity: 0.85;
}


/* ==========================================================================
   3. Section Divider Sub-Note & Pool Closure Highlight
   ========================================================================== */
.pool-closure-inline-note {
  font-size: 0.78rem !important;
  color: var(--text-muted, #606f7b) !important;
  margin-top: 4px !important;
  margin-bottom: 0 !important;
  opacity: 0.95;
}

.pool-closure-highlight {
  color: var(--text-accent, #207a6f);
  font-weight: 500;
}

.pool-closure-highlight i {
  margin-left: 2px;
  margin-right: 2px;
}

/* ==========================================================================
   3. Editorial Accent Image (Responsive Aspect Ratio & Frame Heights)
   ========================================================================== */
.reviews-hero-frame {
  width: 100%;
  height: 240px; /* Desktop height */
  border-radius: var(--radius, 8px);
  overflow: hidden;
  margin: 20px 0 30px 0;
  box-shadow: var(--shadow-soft, 0 4px 20px rgba(0, 0, 0, 0.06));
}

.reviews-hero-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%; /* Focus slightly above center for courtyard details */
  display: block;
  transition: transform 0.6s ease;
}

.reviews-hero-frame:hover img {
  transform: scale(1.03);
}

/* Tablet Scaling */
@media (max-width: 768px) {
  .reviews-hero-frame {
    height: 180px;
    margin: 16px 0 24px 0;
  }
}

/* Mobile & Ultra-Narrow Viewports (320px – 480px) */
@media (max-width: 480px) {
  .reviews-hero-frame {
    height: 140px; /* Compact height prevents excessive cropping and vertical scroll bulk */
    border-radius: var(--radius-sm, 6px);
    margin: 12px 0 20px 0;
  }
}
/* ==========================================================================
   4. Multi-Column Grid Feed & Uniform Review Cards
   ========================================================================== */
.reviews-vertical-feed {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
  gap: 16px !important;
  align-items: start !important;
}

.reviews-vertical-feed article {
  display: flex;
  flex-direction: column;
  height: 280px;
  overflow: hidden;
  transition: height 0.3s ease, box-shadow 0.2s;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius, 8px);
  padding: 20px;
  box-sizing: border-box;
  margin-bottom: 0 !important;
}

.reviews-vertical-feed article:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.reviews-vertical-feed article:nth-child(even) {
  background-color: var(--bg-alt, #f4f6f4);
}

.reviews-vertical-feed article:nth-child(odd) {
  background-color: #ffffff;
}

.reviews-vertical-feed article.expanded {
  height: auto !important;
}

/* Review Card (relative positioning required) */
.review-card {
  position: relative;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius, 8px);
  padding: 24px;
  margin-bottom: 20px;
}

/* Subtle Editorial Serif Index */
.review-card::before {
  content: attr(data-index);
  position: absolute;
  top: 18px;
  right: 22px;
  font-family: var(--font-heading, Georgia, serif);
  font-style: italic;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted, #606f7b);
  opacity: 0.45;
  letter-spacing: 0.5px;
  user-select: none;
  pointer-events: none;
}

.review-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #e2e8f0;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--primary, #3a5335);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.author-details h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--primary, #3a5335);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.author-details span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #606f7b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.review-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 0.925rem;
  line-height: 1.65;
  color: var(--text-main, #2c3531);
}

.review-body p {
  margin: 0 0 10px 0;
}

.review-body p:last-child {
  margin-bottom: 0;
}

.reviews-vertical-feed article:not(.expanded) .review-content {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more-btn {
  background: none;
  border: none;
  color: var(--text-accent, #207a6f);
  font-weight: 600;
  font-size: 0.825rem;
  letter-spacing: 0.2px;
  cursor: pointer;
  padding: 6px 0 0 0;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.read-more-btn:hover {
  color: var(--text-accent-hover, #16544d);
  text-decoration: underline;
}


/* ==========================================================================
   5. Modern Pagination Controls
   ========================================================================== */
.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.p-btn {
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  background: #ffffff;
  color: var(--primary, #3a5335);
  font-size: 0.825rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.03), 0 1px 2px rgba(15, 23, 42, 0.02);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.p-btn:hover:not(:disabled):not(.active) {
  border-color: var(--text-accent, #207a6f);
  color: var(--text-accent, #207a6f);
  background-color: var(--bg-alt, #f4f6f4);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(32, 122, 111, 0.12);
}

.p-btn.active {
  background-color: var(--primary, #3a5335);
  color: #ffffff;
  border-color: var(--primary, #3a5335);
  box-shadow: 0 4px 12px rgba(58, 83, 53, 0.22);
  transform: scale(1.04);
}

.p-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: #f1f5f9;
  background-color: #f8fafc;
  color: var(--text-muted, #606f7b);
  box-shadow: none;
  transform: none;
}

.p-prev, .p-next {
  padding: 8px 18px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.775rem;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   6. Mobile & Tablet Responsive Adjustments (Enhanced for 320px - 414px)
   ========================================================================== */
@media (max-width: 992px) {
  .ratings-summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .ratings-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px; /* Tighter gap on smaller screens */
  }

  /* Span the 5th badge full width on 2-column mobile grids */
  .ratings-summary-grid .rating-badge-card:nth-child(5) {
    grid-column: span 2;
  }

  .write-review-hub {
    padding: 16px 12px;
  }

  .review-buttons-flex {
    flex-direction: column;
  }

  .btn-review {
    width: 100%;
    justify-content: center;
  }

  .reviews-vertical-feed {
    grid-template-columns: 1fr !important; /* Single column on mobile viewports */
  }
}

@media (max-width: 380px) {
  .platform-name {
    font-size: 0.7rem;
  }
  
  .platform-action {
    font-size: 0.75rem;
  }

  .rating-badge-card {
    padding: 6px 10px;
  }
}