/*
 * WordPress glue for the AFN design: what the design set with inline styles or the
 * design tool's preview frame, plus Contact Form 7 output styled to match the design.
 */

/* ── Page frame ─────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--surface); }
.afn-root { width: 100%; font-family: var(--font-sans); background: var(--surface); color: var(--ink); }
.afn-header, .afn-footer { font-family: var(--font-sans); color: var(--on-brand); }
/* Scripts toggle visibility with the hidden attribute; component display rules must not override it. */
[hidden] { display: none !important; }

/* ── Logo sizes (header 40px, footer 48px) ──────────────────── */
.afn-logo { width: auto; background: none; }
.afn-logo.afn-logo--40 { height: 40px; }
.afn-logo.afn-logo--48 { height: 48px; }
.afn-logo-text { font-family: var(--font-serif); font-size: 22px; line-height: 1.2; color: var(--on-brand); }

/* ── Pathways art ───────────────────────────────────────────── */
.home-hero__ribbons .afn-pathways { position: absolute; inset: 0; }
.afn-pathways__band--front { animation-delay: 60ms; }
.afn-pathways__band--d1 { animation-delay: 140ms; }
.afn-pathways__band--front.afn-pathways__band--d1 { animation-delay: 200ms; }
.afn-pathways__band--d2 { animation-delay: 280ms; }
.afn-pathways__band--front.afn-pathways__band--d2 { animation-delay: 340ms; }

/* ── Stagger steps (replaces the design's inline --d / --i values) ── */
[data-d="1"] { --d: 1; } [data-d="2"] { --d: 2; } [data-d="3"] { --d: 3; }
[data-d="4"] { --d: 4; } [data-d="5"] { --d: 5; } [data-d="6"] { --d: 6; }
[data-d="7"] { --d: 7; } [data-d="8"] { --d: 8; } [data-d="9"] { --d: 9; }
.afn-nav__list > li:nth-child(2) { --i: 1; } .afn-nav__list > li:nth-child(3) { --i: 2; }
.afn-nav__list > li:nth-child(4) { --i: 3; } .afn-nav__list > li:nth-child(5) { --i: 4; }
.afn-nav__list > li:nth-child(6) { --i: 5; } .afn-nav__list > li:nth-child(7) { --i: 6; }

/* ── Spacing utilities for the design's one-off inline margins ─ */
.afn-stack-sm { margin-top: var(--space-4); }
.afn-stack-lg { margin-top: var(--space-8); }
.evd-content { margin-top: var(--space-4); }
.evd-content > :first-child { margin-top: 0; }

/* Links typed into rich-text fields pick up the design's link style. */
.fz__help a, .ct-hours a, .pp-doc a, .afn-prose a:not(.afn-btn) { color: var(--link); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.fz__help a:hover, .ct-hours a:hover, .pp-doc a:hover, .afn-prose a:not(.afn-btn):hover { color: var(--link-hover); text-decoration-thickness: 2px; }
.afn-inverse .afn-prose a:not(.afn-btn) { color: inherit; }

/* News post: poster covers show the whole poster; share icon swap. */
.np-cover[data-poster="true"] > img { object-fit: contain; padding: var(--space-6) 0; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35)); }
.np-flip { display: grid; transform: rotate(180deg); }
.np-share__icon { display: contents; }

/* ── Contact Form 7 ─────────────────────────────────────────── */
.cf .wpcf7 { margin: 0; }
/* CF7's hidden inputs live in a fieldset that would otherwise add space (they still submit). */
.cf .hidden-fields-container { display: none; }
.cf .wpcf7-form-control-wrap > .afn-input { display: block; width: 100%; box-sizing: border-box; }
.cf .wpcf7-form-control-wrap { display: block; position: relative; }
.cf .afn-select-wrap .wpcf7-form-control-wrap { flex: 1; }
.cf .afn-select-wrap .afn-icon { z-index: 1; }
.cf .afn-input.wpcf7-not-valid { border-color: var(--danger); }

/* Inline error under a field, matching .afn-field__error. */
.cf .wpcf7-not-valid-tip { display: flex; gap: var(--space-2); align-items: flex-start; margin-top: var(--space-2); font-size: 14px; line-height: 20px; font-weight: 500; color: var(--danger); }
.cf .wpcf7-not-valid-tip::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 1px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' x2='12' y1='8' y2='12'/%3E%3Cline x1='12' x2='12.01' y1='16' y2='16'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' x2='12' y1='8' y2='12'/%3E%3Cline x1='12' x2='12.01' y1='16' y2='16'/%3E%3C/svg%3E") center / contain no-repeat; }
.js .cf .wpcf7-not-valid-tip { animation: afn-rise var(--duration-base) var(--ease-standard); }

/* The theme shows its own error summary; keep CF7's response line for screen readers only. */
.cf .wpcf7-response-output { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cf .screen-reader-response { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Sending state. */
.cf .wpcf7-spinner { display: none; }
.cf form.submitting .afn-btn[type="submit"] { opacity: 0.7; pointer-events: none; }

/* ── Hero art legibility on small screens ───────────────────── */
/* The art covers the hero, so on narrow screens the bright bands land behind the text.
   A navy tint keeps the ribbons visible but lets the white text read clearly. */
@media (max-width: 1023px) {
	.afn-page-hero__art::after,
	.st__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--surface-brand) 78%, transparent) 0%, color-mix(in srgb, var(--surface-brand) 62%, transparent) 100%); }
}
