/* ==========================================================================
   KidsMap Dedicated Typed Reviews & Moderation Hub
   ========================================================================== */

.typed-reviews {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  overflow-wrap: anywhere;
  color: #1e2b23;
  font-family: inherit;
}

/* --------------------------------------------------------------------------
   Back Navigation
   -------------------------------------------------------------------------- */
.typed-reviews__nav {
  margin-bottom: 20px;
}

.typed-reviews__back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #f0f5f2;
  border: 1px solid #e0e9e3;
  border-radius: var(--radius-pill, 999px);
  color: #334439;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.typed-reviews__back-link:hover {
  background: #e0e9e3;
  color: #1f2933;
  transform: translateX(-2px);
  text-decoration: none;
}

.typed-reviews__back-link:focus-visible {
  outline: 3px solid #1f8a4c;
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Hero Card & Header
   -------------------------------------------------------------------------- */
.typed-reviews__hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  background: #ffffff;
  border: 1px solid #e0e9e3;
  border-radius: var(--radius-xl, 24px);
  padding: 28px 32px;
  margin-bottom: 32px;
  box-shadow: 0 2px 12px rgba(31, 41, 51, 0.04);
}

.typed-reviews__hero-content {
  flex: 1;
  min-width: 0;
}

.typed-reviews__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f3f9f2;
  border: 1px solid #cde7c5;
  color: #136f38;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill, 999px);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.typed-reviews__title,
.typed-reviews h1 {
  font-size: clamp(1.45rem, 3.2vw, 2.05rem);
  font-weight: 800;
  line-height: 1.25;
  color: #1f2933;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.typed-reviews__hero-sub,
.typed-reviews p {
  font-size: 14.5px;
  line-height: 1.6;
  color: #64776a;
  margin: 0;
}

.typed-reviews__hero-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8faf9, #f0f5f2);
  border: 1px solid #e0e9e3;
  border-radius: var(--radius-lg, 16px);
  padding: 16px 22px;
  min-width: 140px;
  text-align: center;
  flex-shrink: 0;
}

.typed-reviews__score-top {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.typed-reviews__score-val {
  font-size: 2.2rem;
  font-weight: 900;
  color: #1f2933;
  line-height: 1;
}

.typed-reviews__score-max {
  font-size: 14px;
  font-weight: 600;
  color: #91a798;
}

.typed-reviews__stars-visual {
  position: relative;
  display: inline-block;
  color: #cad7ce;
  font-size: 16px;
  letter-spacing: 2px;
  margin: 6px 0 4px;
}

.typed-reviews__rating-stat {
  font-size: 12.5px !important;
  font-weight: 600;
  color: #47584d !important;
  margin: 0 !important;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.typed-reviews__section,
.typed-reviews section {
  margin-top: 36px;
}

.typed-reviews__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.typed-reviews__section-title,
.typed-reviews h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #1f2933;
  margin: 0;
  letter-spacing: -0.01em;
}

.typed-reviews__section-sub {
  font-size: 14px;
  color: #64776a;
  margin: -10px 0 20px !important;
}

.typed-reviews__count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-pill, 999px);
  background: #e0e9e3;
  color: #334439;
}

.typed-reviews__count-badge--staff {
  background: #fef3c7;
  color: #92400e;
}

/* --------------------------------------------------------------------------
   Review Cards
   -------------------------------------------------------------------------- */
.typed-reviews__list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.typed-reviews__card,
.typed-reviews article {
  background: #ffffff;
  border: 1px solid #e0e9e3;
  border-radius: var(--radius-lg, 16px);
  padding: 24px;
  box-shadow: 0 1px 4px rgba(31, 41, 51, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  margin-block: 0;
}

.typed-reviews__card:hover {
  border-color: #cad7ce;
  box-shadow: 0 4px 12px rgba(31, 41, 51, 0.06);
}

.typed-reviews__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.typed-reviews__author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.typed-reviews__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #3730a3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

.typed-reviews__author-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.typed-reviews__author-name,
.typed-reviews h3 {
  font-size: 15.5px;
  font-weight: 750;
  color: #1f2933;
  margin: 0;
  line-height: 1.25;
}

.typed-reviews__badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #1f8a4c;
  font-size: 11.5px;
  font-weight: 600;
}

.typed-reviews__card-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fefce8;
  border: 1px solid #fef08a;
  padding: 4px 12px;
  border-radius: var(--radius-pill, 999px);
}

.typed-reviews__stars-row {
  display: inline-flex;
  gap: 1px;
}

.typed-reviews__star {
  color: #e0e9e3;
  font-size: 13px;
}

.typed-reviews__star.is-filled {
  color: #f59e0b;
}

.typed-reviews__rating-val {
  font-size: 13px;
  font-weight: 750;
  color: #854d0e;
  margin: 0 !important;
}

.typed-reviews__quote,
.typed-reviews blockquote {
  margin: 0 0 18px;
  padding: 0;
  font-size: 15px;
  line-height: 1.65;
  color: #334439;
  white-space: pre-line;
}

/* --------------------------------------------------------------------------
   Business Reply Aside
   -------------------------------------------------------------------------- */
.typed-reviews__reply,
.typed-reviews aside:not(.typed-reviews__alert) {
  background: #f3f9f2;
  border: 1px solid #cde7c5;
  border-left: 4px solid #1f8a4c;
  border-radius: var(--radius-md, 12px);
  padding: 16px 20px;
  margin: 16px 0;
}

.typed-reviews__reply-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.typed-reviews__reply-head strong {
  font-size: 13.5px;
  color: #14532d;
}

.typed-reviews__reply-text,
.typed-reviews aside p {
  font-size: 14px;
  color: #1e3a29;
  line-height: 1.55;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Card Footer & Actions
   -------------------------------------------------------------------------- */
.typed-reviews__card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #f0f5f2;
}

.typed-reviews__reaction-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
}

.typed-reviews__reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #f8faf9;
  border: 1px solid #e0e9e3;
  border-radius: var(--radius-pill, 999px);
  color: #47584d;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
}

.typed-reviews__reaction-btn:hover {
  background: #f0f5f2;
  border-color: #cad7ce;
  color: #1e2b23;
}

.typed-reviews__reaction-btn[aria-pressed="true"] {
  background: #e8f3e5;
  border-color: #86efac;
  color: #136f38;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #86efac;
}

.typed-reviews__reply-box {
  width: 100%;
  margin-top: 12px;
}

.typed-reviews__reply-form,
.typed-reviews__report-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px !important;
}

.typed-reviews__report-details {
  margin-left: auto;
}

.typed-reviews__report-summary,
.typed-reviews summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #91a798;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm, 8px);
  transition: all 0.2s ease;
}

.typed-reviews__report-summary:hover {
  color: #ef4444;
  background: #fef2f2;
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.typed-reviews__empty {
  background: #ffffff;
  border: 2px dashed #e0e9e3;
  border-radius: var(--radius-xl, 24px);
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.typed-reviews__empty-icon {
  font-size: 40px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.typed-reviews__empty-title {
  font-size: 17px;
  font-weight: 750;
  color: #1e2b23;
  margin: 0 !important;
}

.typed-reviews__empty-desc {
  font-size: 14px;
  color: #64776a;
  max-width: 440px;
  margin: 0 !important;
}

/* --------------------------------------------------------------------------
   Own Review & Form Styling
   -------------------------------------------------------------------------- */
.typed-reviews__own-section {
  margin-top: 48px;
}

.typed-reviews__composer-card {
  background: #ffffff;
  border: 1px solid #e0e9e3;
  border-radius: var(--radius-xl, 24px);
  padding: 28px;
  box-shadow: 0 2px 10px rgba(31, 41, 51, 0.04);
}

.typed-reviews__edit-form,
.typed-reviews form[data-review-edit] {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
}

.typed-reviews__form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.typed-reviews__form-label,
.typed-reviews label {
  font-size: 13.5px;
  font-weight: 700;
  color: #334439;
}

.typed-reviews__select,
.typed-reviews select {
  padding: 10px 14px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid #cad7ce;
  border-radius: var(--radius-md, 12px);
  background: #ffffff;
  color: #1e2b23;
  min-height: 44px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.typed-reviews__textarea,
.typed-reviews textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.6;
  border: 1px solid #cad7ce;
  border-radius: var(--radius-md, 12px);
  background: #ffffff;
  color: #1f2933;
  min-height: 110px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.typed-reviews :is(button, textarea, select, summary, a):focus-visible {
  outline: 3px solid #1f8a4c;
  outline-offset: 2px;
  border-color: #1f8a4c;
}

.typed-reviews__form-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  margin-top: 6px;
}

.typed-reviews__btn,
.typed-reviews button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius-md, 12px);
  padding: 10px 20px;
  min-height: 44px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
}

.typed-reviews__btn--primary {
  background: #136f38;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(21, 128, 61, 0.25);
}

.typed-reviews__btn--primary:hover {
  background: #166534;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.35);
}

.typed-reviews__btn--primary:active {
  transform: translateY(0);
}

.typed-reviews__btn--lg {
  padding: 12px 28px;
  font-size: 15px;
}

.typed-reviews__btn--success {
  background: #1f8a4c;
  color: #ffffff;
}

.typed-reviews__btn--success:hover {
  background: #136f38;
}

.typed-reviews__btn--danger {
  background: #ef4444;
  color: #ffffff;
}

.typed-reviews__btn--danger:hover {
  background: #dc2626;
}

.typed-reviews__reload-link {
  font-size: 13.5px;
  color: #b91c1c;
  font-weight: 600;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Alerts: Rejection & Conflict
   -------------------------------------------------------------------------- */
.typed-reviews__alert {
  padding: 20px;
  border-radius: var(--radius-lg, 16px);
  margin-bottom: 20px;
}

.typed-reviews__alert--danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.typed-reviews__alert--warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.typed-reviews__alert-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.typed-reviews__alert-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
  color: inherit;
}

.typed-reviews__alert-desc {
  font-size: 14px;
  line-height: 1.5;
  color: inherit;
  margin: 0 0 12px !important;
}

.typed-reviews__alert-meta {
  font-size: 13px;
  font-weight: 700;
  margin: 10px 0 4px !important;
  color: inherit;
}

.typed-reviews__alert-quote {
  background: rgba(255, 255, 255, 0.7);
  border-left: 3px solid currentColor;
  padding: 10px 14px;
  border-radius: var(--radius-sm, 8px);
  margin: 6px 0 10px !important;
  font-size: 14px;
  color: #1e2b23;
}

.typed-reviews__status-pill {
  padding: 3px 10px;
  border-radius: var(--radius-pill, 999px);
  font-size: 12px;
  font-weight: 700;
}

.typed-reviews__status-pill--pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* --------------------------------------------------------------------------
   Moderation Section
   -------------------------------------------------------------------------- */
.typed-reviews__card--moderation {
  border-left: 4px solid #f59e0b;
}

.typed-reviews__moderation-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e0e9e3;
}

.typed-reviews__mod-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 !important;
}

/* --------------------------------------------------------------------------
   Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .typed-reviews {
    padding: 16px 12px 48px;
  }
  .typed-reviews__hero {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 16px;
  }
  .typed-reviews__hero-score {
    align-self: flex-start;
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
  }
  .typed-reviews__card {
    padding: 16px;
  }
  .typed-reviews__card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .typed-reviews__report-details {
    margin-left: 0;
    width: 100%;
  }
  .typed-reviews__composer-card {
    padding: 18px;
  }
}

.typed-reviews__stars-fill { position:absolute; inset:0 auto 0 0; width:var(--rating-percent, 0%); overflow:hidden; white-space:nowrap; color:#b77900; }
.typed-reviews__guest { padding:20px; background:var(--surface, #fff); border:1px solid #dce7e0; border-radius:var(--radius-lg, 16px); }
.typed-reviews__guest h2 { margin:0 0 8px; font-size:20px; }
.typed-reviews__guest p { margin:0 0 16px; }
