/* ==========================================================================
   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: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--tint-mist-050);
  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__title,
.typed-reviews h1 {
  font-size: clamp(1.45rem, 3.2vw, 2.05rem);
  font-weight: 800;
  line-height: 1.25;
  color: #1f2933;
  margin: 0;
  letter-spacing: -0.02em;
}

.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;
  border-inline-start: 1px solid var(--tint-line-200);
  padding-inline-start: 24px;
  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: var(--muted);
}

.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__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 {
  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__reply 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: 44px;
}

.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%;
  min-width: 0;
}

.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: var(--muted);
  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;
}

/* Leave the validation message visible above the fragment-focused reply field. */
.typed-reviews [id^="reply-text-"] {
  scroll-margin-block-start: min(42vh, 16rem);
}

.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 {
  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 {
    flex-direction: row;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px 12px;
    border-inline-start: 0;
    border-block-start: 1px solid var(--tint-line-200);
    padding: 12px 0 0;
  }
  .typed-reviews__score-val {
    font-size: 1.5rem;
  }
  .typed-reviews article.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; }

.typed-reviews .typed-reviews__quote p {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.6;
}
.typed-reviews__quote p + p { margin-block-start: .6rem; }
.typed-reviews__reaction-form { flex-wrap: wrap; }
.typed-reviews__report-summary { min-height: 44px; }

.typed-reviews__reply-form {
  display: grid;
  gap: .75rem;
  margin: 0;
  padding: clamp(.85rem, 2.5vw, 1.4rem);
  border: 1px solid var(--tint-turf-200);
  border-radius: var(--radius-lg);
  background: var(--tint-turf-050);
}

.typed-reviews__reply-form label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--brand-spruce);
  font-size: 1rem;
  line-height: 1.35;
}

.typed-reviews__reply-form label::before {
  content: "";
  flex: none;
  inline-size: 21px;
  block-size: 21px;
  background: currentColor;
  mask: url("../../img/icon/coolicons.iconjar/icons/edit-pencil-line-02.83471e12807e.svg") center / contain no-repeat;
}

.typed-reviews__reply-form p[id^="reply-note-"] {
  max-inline-size: 62ch;
  margin-block-start: -.4rem;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.5;
}

.typed-reviews__reply-form textarea {
  min-height: 6rem;
  padding: .75rem .9rem;
  border-color: var(--tone-border-strong);
  font: 400 1rem/1.5 var(--font-body);
}

.typed-reviews__reply-form textarea[aria-invalid="true"] { border-color: #a33030; }

.typed-reviews__reply-form [role="alert"],
.typed-reviews__draft-alert {
  padding: .65rem .85rem;
  border-inline-start: 3px solid #ab3c36;
  border-radius: var(--radius-sm);
  background: #fff1ef;
  color: #7c2626;
}

.typed-reviews__draft-alert { margin-block-end: 1rem; }
.typed-reviews__draft-alert p { color: inherit; }
.typed-reviews__draft-alert blockquote { margin: .5rem 0 0; }

.typed-reviews__reply-form details summary {
  text-decoration: underline;
  min-height: 44px;
}

.typed-reviews__send-reply {
  justify-self: end;
  background: var(--brand-turf);
  padding-inline: 1.25rem;
}

.typed-reviews__send-reply::before {
  content: "";
  inline-size: 18px;
  block-size: 18px;
  background: currentColor;
  mask: url("../../img/icon/coolicons.iconjar/icons/paper-plane.42264c45de29.svg") center / contain no-repeat;
}

@media (max-width: 640px) {
  .typed-reviews__send-reply { justify-self: stretch; }
}
