/* Feedback dialog, newsletter signup and blog. Loaded on every page by
   layouts/Base.astro; uses tokens from design-system.css. */

.cm-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Honeypot: off-screen, not display:none (some bots skip hidden fields). */
.cm-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cm-error {
  color: var(--accent-red);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

/* ── Feedback dialog ── */
.fb-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.fb-dialog {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  text-align: left;
}

.fb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fb-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.fb-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.fb-intro {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin: 0.4rem 0 1rem;
}

.fb-form,
.fb-page .fb-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fb-types {
  border: none;
  padding: 0;
  margin: 0 0 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.fb-types legend {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  padding: 0;
}

.fb-type {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border-hover);
  border-radius: 999px;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.fb-type input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.fb-type.is-active {
  border-color: var(--accent-gold);
  color: var(--accent-gold-light);
  background: rgba(212, 175, 55, 0.1);
}

.fb-type:focus-within {
  box-shadow: var(--focus-ring);
}

.fb-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.fb-optional {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 0.25rem;
}

.fb-form textarea,
.fb-form input[type="email"],
.nl-signup input[type="email"] {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.6rem 0.75rem;
}

.fb-form textarea {
  resize: vertical;
  min-height: 6rem;
}

.fb-form textarea:focus,
.fb-form input:focus,
.nl-signup input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: var(--focus-ring);
}

.fb-check {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  cursor: pointer;
}

.fb-check input {
  margin-top: 0.2rem;
  accent-color: var(--accent-gold);
}

.fb-actions {
  margin-top: 0.5rem;
}

.fb-small,
.nl-small {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.4rem 0 0;
}

.fb-done-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.fb-done p {
  color: var(--text-secondary);
}

.fb-done .btn {
  margin-top: 1rem;
}

/* Footer trigger looks like the other footer links. */
.footer-feedback {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

/* ── Newsletter signup ── */
.nl-signup {
  max-width: 520px;
}

.nl-heading {
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--text-primary);
}

.nl-purpose {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 0.6rem;
}

.nl-row {
  display: flex;
  gap: 0.5rem;
}

.nl-row input {
  flex: 1;
  min-width: 0;
}

.nl-row .btn {
  white-space: nowrap;
}

.nl-done {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.nl-signup--compact {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.footer-newsletter {
  max-width: 1100px;
  margin: 0 auto 2rem;
}

@media (max-width: 480px) {
  .nl-row {
    flex-direction: column;
  }
}

/* ── Standalone pages: /feedback, /newsletter/* ── */
.cm-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1rem 1rem;
}

.cm-page h1 {
  margin-bottom: 0.5rem;
}

.cm-page .lead {
  color: var(--text-secondary);
}

/* ── Blog ── */
.blog-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem 1rem;
}

.blog-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.blog-card {
  display: block;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.blog-card:hover {
  border-color: var(--border-hover);
}

.blog-card h2 {
  margin: 0.25rem 0 0.4rem;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.blog-card p {
  margin: 0;
  color: var(--text-secondary);
}

.blog-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.blog-post h1 {
  margin: 0.5rem 0;
  line-height: 1.2;
}

.blog-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-primary);
}

.blog-body h2 {
  margin-top: 2rem;
  font-size: 1.35rem;
}

.blog-body p,
.blog-body li {
  color: var(--text-secondary);
}

.blog-body ul,
.blog-body ol {
  padding-left: 1.4rem;
}

.blog-body li {
  margin: 0.35rem 0;
}

.blog-body a {
  color: var(--accent-gold);
}

.blog-after {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}
