/**
 * PuntoPio Reviews - Frontend Styles
 * Design Philosophy: Calm, editorial, restraint
 */

/* ==========================================================================
   Base Styles - Reviews Container
   ========================================================================== */

.puntopio-reviews {
  max-width: 800px;
  margin: 0 auto;
}

.puntopio-review {
  padding: 2.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: padding 200ms ease-out;
}

.puntopio-review:first-child {
  padding-top: 0;
}

.puntopio-review:last-child {
  border-bottom: none;
}

/* ==========================================================================
   Review Header & Meta
   ========================================================================== */

.puntopio-review-header {
  margin-bottom: 1rem;
}

.puntopio-review-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.puntopio-review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  flex: 0 0 auto;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.puntopio-review-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.puntopio-review-avatar-fallback {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.55);
}

.puntopio-review-author {
  font-size: 1rem;
  font-weight: 500;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Egg Rating System
   ========================================================================== */

.puntopio-review-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0.7;
}

.puntopio-egg {
  display: inline-block;
  width: 0.85em;
  height: 1.1em;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 32"><ellipse cx="12" cy="16" rx="9" ry="12" fill="%23D4AF37"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
  vertical-align: middle;
  margin: 0 0.05em;
}

/* ==========================================================================
   Google Branding & Attribution
   ========================================================================== */

.puntopio-google-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #5f6368;
  margin-left: auto;
  opacity: 0.8;
  text-decoration: none;
  transition: all 0.2s ease;
}

a.puntopio-google-badge:hover {
  opacity: 1;
  color: #4285f4;
}

.puntopio-google-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ==========================================================================
   Reviewer Badges
   ========================================================================== */

.puntopio-reviewer-badges {
  display: inline-flex;
  gap: 0.5rem;
  margin-left: 0.5rem;
}

.puntopio-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.puntopio-badge-verified {
  background: rgba(52, 168, 83, 0.1);
  color: #34a853;
  border: 1px solid rgba(52, 168, 83, 0.2);
}

.puntopio-badge-local-guide {
  background: rgba(66, 133, 244, 0.1);
  color: #4285f4;
  border: 1px solid rgba(66, 133, 244, 0.2);
}

.puntopio-badge-top-reviewer {
  background: rgba(251, 188, 5, 0.1);
  color: #f9ab00;
  border: 1px solid rgba(251, 188, 5, 0.2);
}

/* ==========================================================================
   Time Ago Display
   ========================================================================== */

.puntopio-time-ago {
  font-size: 0.85rem;
  color: #5f6368;
  margin-left: 0.5rem;
}

/* ==========================================================================
   Review Content - Collapsed State
   ========================================================================== */

.puntopio-review-content {
  position: relative;
}

.puntopio-review-text p {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: #2a2a2a;
  margin: 0 0 1.5rem 0;
}

.puntopio-review-excerpt p {
  display: none;
  /* Removed in favor of full text */
}

/* Summary Card Styles */
.puntopio-summary-card {
  background: linear-gradient(135deg, white 0%, var(--shell) 100%) !important;
  border: 1px solid var(--clay) !important;
}

.puntopio-summary-content {
  padding: 1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.puntopio-summary-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.puntopio-summary-avatar {
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--shadow);
}

.puntopio-summary-avatar svg {
  width: 24px;
  height: 24px;
}

.puntopio-summary-title {
  display: flex;
  flex-direction: column;
}

.puntopio-summary-name {
  font-family: 'General Sans', sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
}

.puntopio-summary-rating {
  display: flex;
  gap: 2px;
}

.puntopio-summary-body {
  margin-bottom: 1.5rem;
}

.puntopio-summary-total {
  font-family: 'General Sans', sans-serif;
  font-weight: 600;
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.puntopio-summary-desc {
  font-family: 'Spectral', serif;
  font-size: 1rem;
  color: var(--smoke);
  line-height: 1.5;
}

.puntopio-summary-footer .puntopio-link-google {
  display: inline-block;
  background: var(--ink);
  color: white;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  font-family: 'General Sans', sans-serif;
  font-weight: 500;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.puntopio-summary-footer .puntopio-link-google:hover {
  background-color: var(--highlight);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.puntopio-review-full {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 200ms ease-out, opacity 180ms ease-out;
}

.puntopio-review-full[hidden] {
  display: block;
  visibility: hidden;
}

/* ==========================================================================
   Review Content - Expanded State
   ========================================================================== */

.puntopio-review.is-expanded .puntopio-review-excerpt {
  display: none;
}

.puntopio-review.is-expanded .puntopio-review-full {
  max-height: 2000px;
  opacity: 1;
  visibility: visible;
}

.puntopio-review.is-expanded .puntopio-review-full[hidden] {
  display: block;
  visibility: visible;
}

.puntopio-review-full p {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: #2a2a2a;
  margin: 0 0 1.5rem 0;
  white-space: pre-wrap;
}

/* ==========================================================================
   Owner Reply
   ========================================================================== */

.puntopio-review-reply {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
}

.puntopio-reply-label {
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  margin-bottom: 0.5rem;
}

.puntopio-review-reply p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #555;
  font-weight: 400;
  margin: 0;
}

/* ==========================================================================
   Toggle Button
   ========================================================================== */

.puntopio-review-toggle {
  display: none;
}

/* ==========================================================================
   Featured Review Highlight
   ========================================================================== */

.puntopio-review-highlight {
  max-width: 700px;
  margin: 3rem auto;
}

.puntopio-review-featured {
  padding: 2rem;
  background: #fafaf9;
  border-radius: 3px;
  border: none;
}

.puntopio-review-featured .puntopio-review-author {
  font-size: 1.125rem;
}

.puntopio-review-featured .puntopio-review-content p {
  font-size: 1.125rem;
  line-height: 1.65;
}

/* ==========================================================================
   Carousel Layout
   ========================================================================== */

.puntopio-reviews-carousel {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.puntopio-reviews-carousel-track {
  position: relative;
}

.puntopio-reviews-carousel .puntopio-review {
  display: none;
  padding: 2rem;
  border-bottom: none;
  background: #fafaf9;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.puntopio-reviews-carousel .puntopio-review.is-active {
  display: block;
}

.puntopio-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.65);
  transition: background 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out;
}

.puntopio-carousel-nav:hover {
  border-color: rgba(0, 0, 0, 0.2);
  color: rgba(0, 0, 0, 0.85);
}

.puntopio-carousel-prev {
  left: -22px;
}

.puntopio-carousel-next {
  right: -22px;
}

@media (max-width: 768px) {
  .puntopio-carousel-prev {
    left: 0;
  }

  .puntopio-carousel-next {
    right: 0;
  }
}

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

@media (max-width: 768px) {
  .puntopio-review {
    padding: 2rem 0;
  }

  .puntopio-review-excerpt p,
  .puntopio-review-full p {
    font-size: 1rem;
  }

  .puntopio-review-toggle {
    padding: 0.5rem 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .puntopio-review-featured {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .puntopio-review-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

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

.puntopio-reviews-empty {
  text-align: center;
  color: #666;
  font-size: 1rem;
  padding: 3rem 1rem;
}

/* ==========================================================================
   Review Photo - Enhanced Display
   ========================================================================== */

.puntopio-review-photo {
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.puntopio-review-photo img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.puntopio-review-photo-enhanced {
  margin: 1.25rem 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-width: 600px;
}

.puntopio-review-photo-enhanced img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.puntopio-review-photo-enhanced:hover img {
  transform: scale(1.02);
}

/* ==========================================================================
   Review Footer - View on Google Link
   ========================================================================== */

.puntopio-review-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.puntopio-review-footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: #4285f4;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.puntopio-review-footer a:hover {
  color: #1a73e8;
  text-decoration: underline;
}

.puntopio-review-footer a::after {
  content: '→';
  font-size: 1.1em;
  transition: transform 0.2s ease;
}

.puntopio-review-footer a:hover::after {
  transform: translateX(3px);
}