/* Contact: a letter with the reason first, beside the routes (frame-09). Plan: docs/plans/contact.md */
:where(.wp-site-blocks) > .rv-contact-page,
.rv-contact-page,
.rv-contact-page > * { margin-block-start: 0 !important; }
:where(.wp-site-blocks) > .rv-contact-page + footer,
:where(.wp-site-blocks) > .rv-contact-page + footer > .rv-footer { margin-block-start: 0 !important; }

.rv-ct-wrap { box-sizing: border-box; max-width: 1264px; margin: 0 auto; padding: 56px 32px 80px; }
.rv-ct-k { margin: 0; font-size: var(--rv-text-xs); font-weight: 600; letter-spacing: 0.14em; line-height: 1.3; text-transform: uppercase; color: var(--rv-text-secondary); }

/* Opening */
.rv-ct-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 40px; margin-bottom: 40px; }
.rv-ct-head__t { flex: 1 1 480px; min-width: 0; max-width: 680px; }
.rv-ct-eye { margin: 0 0 12px; font-size: var(--rv-text-xs); font-weight: 600; letter-spacing: 0.14em; line-height: 1.3; text-transform: uppercase; color: var(--rv-hero-eyebrow); }
.rv-ct-h1 { margin: 0; font-family: var(--rv-font-serif); font-size: var(--rv-text-4xl); font-weight: 600; line-height: 1.15; color: var(--rv-text-heading); }
.rv-ct-lead { margin: 12px 0 0; font-family: var(--rv-font-serif); font-size: var(--rv-text-xl); line-height: 1.45; color: var(--rv-text-secondary); }
.rv-ct-reply { flex: none; padding: 14px 22px; border: 1px solid var(--rv-border-primary); border-radius: var(--rv-radius-md, 8px); background: var(--rv-surface-secondary); }
.rv-ct-reply__t { margin: 4px 0 0; font-family: var(--rv-font-serif); font-size: var(--rv-text-xl); font-weight: 600; line-height: 1.3; color: var(--rv-text-primary); }

/* The two columns */
.rv-ct-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: stretch; }

/* The letter */
.rv-ct-letter { min-width: 0; padding: 12px 32px 32px; border: 1px solid var(--rv-border-primary); border-radius: var(--rv-radius-lg); background: var(--rv-cream); }
.rv-ct-notice { margin: 20px 0 8px; padding: 12px 16px; border: 1px solid; border-radius: 8px; font-size: var(--rv-text-md); line-height: 1.45; }
.rv-ct-notice.is-sent { border-color: var(--rv-ready-now-border); background: var(--rv-ready-now-bg); color: var(--rv-ready-now); }
.rv-ct-notice.is-error { border-color: var(--rv-not-recommended-border); background: var(--rv-not-recommended-bg); color: var(--rv-not-recommended); }
.rv-ct-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px 0; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--rv-line); }
.rv-ct-to { font-family: var(--rv-font-serif); font-size: var(--rv-text-xl); font-weight: 600; line-height: 1.3; color: var(--rv-text-primary); }
.rv-ct-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-ct-chip { position: relative; cursor: pointer; }
.rv-ct-chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.rv-ct-chip span { display: block; padding: 7px 14px; border: 1px solid var(--rv-border-primary); border-radius: 999px; background: var(--rv-surface-primary); font-size: var(--rv-text-md); font-weight: 500; line-height: 1.3; color: var(--rv-text-primary); }
.rv-ct-chip input:checked + span { border-color: var(--rv-brand-fill); background: var(--rv-brand-fill); color: var(--rv-text-on-fill); }
.rv-ct-chip input:focus-visible + span { outline: 2px solid var(--rv-brand-accent); outline-offset: 2px; }
.rv-ct-from { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rv-ct-f { display: block; min-width: 0; }
.rv-ct-f span { display: block; margin-bottom: 4px; font-size: var(--rv-text-xs); font-weight: 500; line-height: 1.4; color: var(--rv-text-secondary); }
.rv-ct-f input, .rv-ct-msg { display: block; width: 100%; box-sizing: border-box; border: 1px solid var(--rv-border-primary); border-radius: 6px; background: var(--rv-surface-primary); color: var(--rv-text-primary); }
.rv-ct-f input { height: 44px; padding: 0 12px; font: 400 var(--rv-text-md) var(--rv-font-sans); }
.rv-ct-msg { min-height: 170px; margin-top: 20px; padding: 12px; font: 400 var(--rv-text-base)/1.55 var(--rv-font-serif); resize: vertical; }
.rv-ct-msg::placeholder { color: var(--rv-text-muted); opacity: 1; }
.rv-ct-f input:focus-visible, .rv-ct-msg:focus-visible { outline: 2px solid var(--rv-brand-accent); outline-offset: 1px; }
.rv-ct-send { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 20px; }
.rv-ct-btn { height: 42px; padding: 0 22px; border: 0; border-radius: 6px; background: var(--rv-brand-fill); font: 600 var(--rv-text-md) var(--rv-font-sans); color: var(--rv-text-on-fill); cursor: pointer; }
.rv-ct-note { font-size: var(--rv-text-md); line-height: 1.4; color: var(--rv-text-secondary); }

/* Before you write */
.rv-ct-before { min-width: 0; padding: 24px; border: 1px solid var(--rv-border-primary); border-radius: var(--rv-radius-lg); background: var(--rv-surface-secondary); }
.rv-ct-box { margin-top: 14px; padding: 16px 18px; border: 1px solid var(--rv-border-primary); border-radius: 8px; background: var(--rv-surface-primary); }
.rv-ct-box__t { margin: 0 0 6px; font-family: var(--rv-font-serif); font-size: var(--rv-text-base); font-weight: 600; line-height: 1.35; color: var(--rv-text-primary); }
.rv-ct-box p { margin: 0; font-size: var(--rv-text-md); line-height: 1.5; color: var(--rv-text-secondary); }
.rv-ct-box p.rv-ct-box__a { margin-top: 8px; font-weight: 600; }
.rv-ct-box a, .rv-ct-close a { color: var(--rv-link, var(--rv-brand-accent)); text-decoration: underline; text-underline-offset: 2px; }
.rv-ct-close { margin: 14px 0 0; font-size: var(--rv-text-md); line-height: 1.5; color: var(--rv-text-secondary); }

@media (max-width: 1000px) {
    .rv-ct-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .rv-ct-wrap { padding: 24px 16px 56px; }
    .rv-ct-head { margin-bottom: 20px; }
    .rv-ct-head__t { flex-basis: 100%; }
    .rv-ct-lead { font-size: var(--rv-text-base); }
    .rv-ct-reply { flex: 1 1 100%; box-sizing: border-box; }
    .rv-ct-grid { gap: 20px; }
    .rv-ct-letter { padding: 4px 16px 20px; }
    .rv-ct-row { grid-template-columns: minmax(0, 1fr); }
    .rv-ct-from { grid-template-columns: minmax(0, 1fr); }
    .rv-ct-btn { width: 100%; }
    .rv-ct-before { padding: 16px; }
}
