/* MargoStory feedback block — light, warm, matches site cream language */

.margo-fb {
  max-width: 1080px;
  margin: 56px auto 0;
  padding: 0 24px 12px;
  font-family: "Poppins", sans-serif;
  color: #7A644E;
  text-align: center;
}

.margo-fb-inner {
  padding: 36px 32px 30px;
  background: rgba(255, 248, 241, 0.55);
  border: 1px solid rgba(201, 168, 106, 0.28);
  border-radius: 24px;
}

.margo-fb-title {
  margin: 0 0 12px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 600;
  color: #3F352C;
  line-height: 1.25;
}

.margo-fb-lead {
  margin: 0 auto 28px;
  max-width: 52ch;
  font-size: 15px;
  line-height: 1.65;
  color: #8A7765;
}

.margo-fb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.margo-fb-card {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 96px;
  padding: 18px 14px;
  margin: 0;
  border: 1px solid rgba(180, 139, 67, 0.22);
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.9);
  color: #5C4C3C;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.margo-fb-card:hover,
.margo-fb-card:focus-visible {
  border-color: rgba(180, 139, 67, 0.55);
  background: #FFF8F1;
  outline: none;
  transform: translateY(-1px);
}

.margo-fb-card:focus-visible {
  box-shadow: 0 0 0 2px rgba(180, 139, 67, 0.35);
}

.margo-fb-emoji {
  font-size: 1.35rem;
  line-height: 1;
}

.margo-fb-support-wrap {
  margin-top: 26px;
  overflow: visible;
}

.margo-fb-support {
  --tea-art: 88px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(340px, 100%);
  min-height: 54px;
  box-sizing: border-box;
  padding-block: 10px;
  padding-inline-start: calc(var(--tea-art) + 10px);
  padding-inline-end: 22px;
  border-radius: 999px;
  border: 1px solid rgba(180, 139, 67, 0.42);
  background: rgba(255, 248, 241, 0.95);
  color: #9A7335;
  font-family: inherit;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  overflow: visible;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease;
}

.margo-fb-support::before,
.margo-fb-support::after {
  content: "";
  position: absolute;
  inset-inline-start: 4px;
  top: 50%;
  width: var(--tea-art);
  height: var(--tea-art);
  margin-top: calc(var(--tea-art) / -2);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.margo-fb-support::before {
  background-image: url("../assets/tea-button/author-tea-idle.png");
  opacity: 1;
  z-index: 1;
}

.margo-fb-support::after {
  background-image: url("../assets/tea-button/author-tea-hover.png");
  opacity: 0;
  z-index: 2;
}

.margo-fb-support:hover,
.margo-fb-support:focus-visible {
  background: #FFF4E8;
  border-color: rgba(180, 139, 67, 0.62);
  color: #86612C;
  outline: none;
  transform: translateY(-1px);
}

.margo-fb-support:hover::before,
.margo-fb-support:focus-visible::before {
  opacity: 0;
}

.margo-fb-support:hover::after,
.margo-fb-support:focus-visible::after {
  opacity: 1;
}

.margo-fb-support:focus-visible {
  box-shadow: 0 0 0 2px rgba(180, 139, 67, 0.32);
}

/* Modal */
.margo-fb-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(63, 53, 44, 0.35);
  backdrop-filter: blur(2px);
}

.margo-fb-overlay[hidden] {
  display: none !important;
}

.margo-fb-dialog {
  width: min(100%, 420px);
  max-height: min(88vh, 640px);
  overflow: auto;
  padding: 22px 20px 18px;
  border-radius: 22px;
  background: #FFFCF7;
  border: 1px solid rgba(201, 168, 106, 0.35);
  box-shadow: 0 16px 40px rgba(63, 53, 44, 0.16);
  text-align: left;
}

html[dir="rtl"] .margo-fb-dialog {
  text-align: right;
}

.margo-fb-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.margo-fb-dialog-title {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  font-weight: 600;
  color: #3F352C;
  line-height: 1.2;
}

.margo-fb-close {
  appearance: none;
  border: none;
  background: transparent;
  color: #9A8570;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
}

.margo-fb-close:hover,
.margo-fb-close:focus-visible {
  color: #3F352C;
  background: rgba(0, 0, 0, 0.04);
  outline: none;
}

.margo-fb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(180, 139, 67, 0.12);
  color: #7A644E;
  font-size: 12px;
  font-weight: 500;
}

.margo-fb-field {
  margin: 0 0 12px;
}

.margo-fb-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 500;
  color: #8A7765;
}

.margo-fb-field input,
.margo-fb-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid rgba(180, 139, 67, 0.28);
  border-radius: 12px;
  background: #FFF8F1;
  color: #3F352C;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  resize: vertical;
}

.margo-fb-field input:focus,
.margo-fb-field textarea:focus {
  outline: none;
  border-color: rgba(180, 139, 67, 0.65);
  box-shadow: 0 0 0 2px rgba(180, 139, 67, 0.18);
}

.margo-fb-field textarea {
  min-height: 110px;
}

.margo-fb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.margo-fb-submit {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 10px 18px;
  background: #D8BC87;
  color: #3F352C;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease;
}

.margo-fb-submit:hover,
.margo-fb-submit:focus-visible {
  background: #C8A86A;
  outline: none;
}

.margo-fb-cancel {
  appearance: none;
  border: 1px solid rgba(180, 139, 67, 0.3);
  border-radius: 14px;
  padding: 10px 16px;
  background: transparent;
  color: #7A644E;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.margo-fb-cancel:hover,
.margo-fb-cancel:focus-visible {
  background: rgba(255, 248, 241, 0.9);
  outline: none;
}

.margo-fb-thanks {
  padding: 18px 4px 8px;
  text-align: center;
}

.margo-fb-thanks[hidden],
.margo-fb-form[hidden] {
  display: none !important;
}

.margo-fb-thanks-emoji {
  display: block;
  margin-bottom: 8px;
  font-size: 1.6rem;
}

.margo-fb-thanks-title {
  margin: 0 0 8px;
  font-family: "Cormorant Garamond", serif;
  font-size: 26px;
  font-weight: 600;
  color: #3F352C;
}

.margo-fb-thanks-text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #7A644E;
}

html[dir="rtl"] .margo-fb {
  text-align: center;
}

@media (max-width: 700px) {
  .margo-fb {
    margin-top: 36px;
    padding: 0 16px 4px;
  }

  .margo-fb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .margo-fb-inner {
    padding: 20px 16px 16px;
  }

  .margo-fb-title {
    font-size: clamp(22px, 5.5vw, 26px);
    margin-bottom: 8px;
  }

  .margo-fb-lead {
    margin-bottom: 18px;
    font-size: 14px;
    max-width: none;
  }

  .margo-fb-card {
    min-height: 78px;
    padding: 14px 10px;
    font-size: 12.5px;
  }

  .margo-fb-emoji {
    font-size: 1.2rem;
  }

  .margo-fb-support-wrap {
    margin-top: 18px;
  }

  .margo-fb-support {
    --tea-art: 72px;
    width: min(340px, 100%);
    min-height: 50px;
    padding-block: 9px;
    padding-inline-start: calc(var(--tea-art) + 8px);
    padding-inline-end: 16px;
    font-size: 15.5px;
  }
}

@media (max-width: 380px) {
  .margo-fb-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .margo-fb-card,
  .margo-fb-support,
  .margo-fb-support::before,
  .margo-fb-support::after,
  .margo-fb-submit {
    transition: none;
  }

  .margo-fb-card:hover,
  .margo-fb-card:focus-visible,
  .margo-fb-support:hover,
  .margo-fb-support:focus-visible {
    transform: none;
  }
}
