/*
Theme Name: Systems-4
Theme URI: https://systems-4.com
Author: Brianna Flynn
Description: Custom block theme for Systems-4, real estate systems consulting by Brianna Flynn. Editorial navy/mint palette with coral accent, per the 2026 brand guide.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: systems4
*/

:root {
  --s4-navy: #1f3a5f;
  --s4-navy-900: #14263d;
  --s4-navy-100: #d6e0ea;
  --s4-teal: #006699;
  --s4-coral: #eb6565;
  --s4-coral-deep: #d94f4f;
  --s4-gold: #ffd166;
  --s4-slate: #b5cbd6;
  --s4-mint: #f4f9f4;
  --s4-card: #ffffff;
  --s4-body-text: #33506f;
  --s4-muted: #5f7891;
  --s4-line: #d3dfe6;
  --s4-shadow-sm: 0 1px 2px rgba(31,58,95,.06), 0 2px 8px rgba(31,58,95,.06);
  --s4-shadow-md: 0 2px 4px rgba(31,58,95,.07), 0 10px 28px rgba(31,58,95,.10);
  --s4-serif: 'Newsreader', Georgia, serif;
  --s4-sans: 'Instrument Sans', -apple-system, 'Helvetica Neue', sans-serif;
  --s4-mono: 'JetBrains Mono', ui-monospace, monospace;
}

body {
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

.s4-wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- type helpers ---------- */
.s4-eyebrow {
  font-family: var(--s4-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--s4-coral-deep);
}
.s4-it { font-style: italic; font-weight: 300; font-family: var(--s4-serif); }
h1 .s4-it, .s4-hero h1 em { color: var(--s4-coral); font-weight: 300; }
h1, h2, h3 { text-wrap: balance; margin: 0; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--s4-teal); outline-offset: 2px; border-radius: 3px;
}

/* ---------- buttons ---------- */
.s4-btn, .s4-btn:visited {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--s4-sans); font-weight: 600; font-size: 15px;
  padding: 10px 20px; border-radius: 999px; border: none; cursor: pointer;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.s4-btn-coral { background: var(--s4-coral); color: #fff; }
.s4-btn-coral:hover { background: var(--s4-coral-deep); color: #fff; text-decoration: none; }
.s4-btn-ghost { background: transparent; color: var(--s4-navy); border: 1px solid var(--s4-line); }
.s4-btn-ghost:hover { border-color: var(--s4-coral); color: var(--s4-coral); text-decoration: none; }

/* ---------- header ---------- */
.s4-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--s4-mint) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--s4-line);
}
.s4-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; max-width: 1080px; margin: 0 auto;
}
.s4-logo, .s4-logo:visited { font-family: var(--s4-serif); font-size: 24px; color: var(--s4-navy); text-decoration: none; }
.s4-logo em { font-weight: 300; }
.s4-logo strong { font-weight: 600; }
.s4-logo:hover { text-decoration: none; color: var(--s4-navy); }
.s4-nav-links { display: flex; align-items: center; gap: 28px; }
.s4-nav-links > a { color: var(--s4-navy); font-weight: 500; font-size: 15px; text-decoration: none; }
.s4-nav-links > a:hover { color: var(--s4-coral-deep); }
.s4-nav-links > a.s4-btn-coral { color: #fff; font-weight: 600; }
.s4-nav-links > a.s4-btn-coral:hover { color: #fff; }

/* ---------- sections ---------- */
.s4-section { padding: 72px 0; }
.s4-section.s4-wrap { padding: 72px 24px; }
.s4-section-head { margin-bottom: 40px; }
.s4-section-head::before {
  content: ""; display: block; width: 40px; height: 3px; border-radius: 2px;
  background: var(--s4-coral); margin-bottom: 20px;
}
.s4-section-head h2 { margin-top: 12px; }

/* ---------- hero ---------- */
.s4-hero { padding: 88px 0 72px; }
.s4-hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: center; }
.s4-hero h1 { margin-top: 16px; }
.s4-hero .s4-lede { font-size: 18px; max-width: 52ch; margin: 24px 0 0; }
.s4-hero-cta { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

.s4-headshot {
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--s4-navy-100), color-mix(in srgb, var(--s4-navy-100) 60%, var(--s4-mint)));
  border: 1.5px dashed var(--s4-slate);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: var(--s4-muted);
  box-shadow: var(--s4-shadow-md);
}
.s4-headshot:has(img) { border-style: solid; border-color: var(--s4-line); }
.s4-headshot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.s4-headshot svg { opacity: .55; }
.s4-ph-label {
  font-family: var(--s4-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--s4-muted);
}

/* ---------- four systems ---------- */
.s4-systems { border-top: 1px solid var(--s4-line); }
.s4-sys-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.s4-sys-card {
  background: var(--s4-card); border: 1px solid var(--s4-line); border-radius: 14px;
  padding: 28px 24px; box-shadow: var(--s4-shadow-sm);
  display: flex; flex-direction: column; gap: 12px;
  transition: box-shadow .24s ease, transform .24s ease, border-color .24s ease;
}
.s4-sys-card:hover {
  box-shadow: var(--s4-shadow-md);
  transform: translateY(-2px);
  border-color: var(--s4-slate);
}
.s4-sys-card .s4-num { font-family: var(--s4-mono); font-size: 11px; letter-spacing: .14em; color: var(--s4-muted); }
.s4-sys-card svg { color: var(--s4-coral); }
.s4-sys-card h3 { font-family: var(--s4-sans); font-weight: 600; font-size: 18px; color: var(--s4-navy); }
.s4-sys-card p { margin: 0; font-size: 14.5px; }

/* ---------- newsletter ---------- */
.s4-newsletter { padding: 0; }
.s4-news-inner {
  background: var(--s4-navy-900); border-radius: 20px;
  padding: 64px 56px; color: #b9c9d9;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
  box-shadow: var(--s4-shadow-md);
}
.s4-news-inner h2 { color: var(--s4-mint); }
.s4-news-inner .s4-eyebrow { color: var(--s4-gold); }
.s4-news-inner p { margin: 16px 0 0; max-width: 44ch; }
/* Kit inline forms — functional Kit markup, theme-owned styling */
.s4-kit-form { margin: 0; }
.s4-kit-form .formkit-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.s4-kit-form .formkit-field { flex: 1 1 220px; min-width: 0; }
.s4-kit-form input[type="email"] {
  width: 100%; box-sizing: border-box;
  font-family: var(--s4-sans); font-size: 15px;
  padding: 12px 18px; border-radius: 999px;
  border: 1px solid rgba(181,203,214,.35);
  background: rgba(244,249,244,.08); color: var(--s4-mint);
}
.s4-kit-form input[type="email"]::placeholder { color: #8fa5ba; }
.s4-kit-form .formkit-spinner { display: none; }
.s4-kit-form .formkit-alert {
  list-style: none; margin: 0 0 12px; padding: 0;
  font-size: 14.5px; font-weight: 500;
}
.s4-kit-form .formkit-alert:empty { display: none; }
.s4-news-inner .formkit-alert-error li { color: #ffb3a6; }
.s4-news-inner .formkit-alert-success { color: var(--s4-gold); }
.s4-kit-powered {
  display: inline-block; margin-top: 12px;
  font-size: 12px; color: #7d94ab; text-decoration: none;
}
.s4-kit-powered:hover { color: #b9c9d9; }

/* hero (light) variant */
.s4-hero-cta { display: block; }
.s4-kit-hero { max-width: 480px; }
.s4-kit-hero input[type="email"] {
  border: 1px solid var(--s4-line);
  background: var(--s4-card); color: var(--s4-navy);
  box-shadow: var(--s4-shadow-sm);
}
.s4-kit-hero input[type="email"]::placeholder { color: var(--s4-muted); }
.s4-kit-hero .formkit-alert-error li { color: var(--s4-coral-deep); }
.s4-kit-hero .formkit-alert-success { color: var(--s4-navy); }
.s4-hero-blog-link {
  display: inline-block; margin-top: 16px;
  font-weight: 600; color: var(--s4-coral-deep); text-decoration: none;
}
.s4-hero-blog-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.s4-kit-note {
  margin-top: 14px; font-family: var(--s4-mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: #7d94ab;
  display: flex; align-items: center; gap: 8px;
}
.s4-kit-note::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--s4-gold); flex: none; }

/* ---------- blog cards (query loop) ---------- */
.s4-blog-query .wp-block-post-template {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  list-style: none; padding: 0; margin: 0;
}
.s4-blog-query .wp-block-post {
  background: var(--s4-card); border: 1px solid var(--s4-line); border-radius: 14px;
  overflow: hidden; box-shadow: var(--s4-shadow-sm); display: flex; flex-direction: column;
  transition: box-shadow .24s ease, transform .24s ease;
}
.s4-blog-query .wp-block-post:hover { box-shadow: var(--s4-shadow-md); transform: translateY(-2px); }

.s4-thumb {
  aspect-ratio: 16 / 9; position: relative;
  background: linear-gradient(150deg, var(--s4-navy-100), color-mix(in srgb, var(--s4-navy-100) 55%, var(--s4-mint)));
  border-bottom: 1px solid var(--s4-line);
  color: var(--s4-coral);
  margin: 0;
}
.s4-thumb::before {
  content: ""; position: absolute; inset: 0; margin: auto; width: 40px; height: 40px;
  background-color: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M10 8.5l6 3.5-6 3.5v-7z"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M10 8.5l6 3.5-6 3.5v-7z"/></svg>') center / contain no-repeat;
}
.s4-thumb .wp-block-post-featured-image, .s4-thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; margin: 0; z-index: 1;
}

.s4-post-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.s4-post-body .wp-block-post-date { font-size: 13px; color: var(--s4-muted); }
.s4-post-body .wp-block-post-title {
  font-family: var(--s4-serif); font-weight: 400; font-size: 21px; line-height: 1.3; margin: 0;
}
.s4-post-body .wp-block-post-title a { color: var(--s4-navy); text-decoration: none; }
.s4-post-body .wp-block-post-title a:hover { color: var(--s4-coral-deep); }
.s4-post-body .wp-block-post-excerpt { font-size: 14.5px; margin: 0; flex: 1; }
.s4-post-body .wp-block-post-excerpt p { margin: 0; }
.s4-post-body .wp-block-post-excerpt__more-text { margin-top: 8px; }
.s4-post-body .wp-block-post-excerpt__more-link { font-weight: 600; color: var(--s4-coral-deep); }

.s4-view-all { margin-top: 36px; }
.s4-view-all a { font-weight: 600; color: var(--s4-coral-deep); text-decoration: none; }
.s4-view-all a:hover { text-decoration: underline; text-underline-offset: 3px; }

.wp-block-query-no-results p {
  background: var(--s4-card); border: 1px dashed var(--s4-slate); border-radius: 14px;
  padding: 40px; text-align: center; color: var(--s4-muted);
}

/* pagination */
.s4-blog-query .wp-block-query-pagination {
  margin-top: 48px; display: flex; align-items: center; justify-content: center; gap: 16px;
  font-weight: 600;
}
.s4-blog-query .wp-block-query-pagination a { color: var(--s4-coral-deep); text-decoration: none; }
.s4-blog-query .wp-block-query-pagination-numbers .current {
  color: var(--s4-navy);
}

/* ---------- page & single post content ---------- */
.s4-page-hero { padding: 72px 0 8px; }
.s4-wrap.s4-page-hero { padding: 72px 24px 8px; }
.s4-page-hero .s4-eyebrow { margin-bottom: 12px; }

.s4-content { padding: 32px 0 72px; }
.s4-content .wp-block-post-content > * { max-width: 720px; }
.s4-content h2 { font-size: clamp(26px, 3vw, 32px); margin: 40px 0 12px; }
.s4-content h3 { margin: 32px 0 10px; }
.s4-content p { margin: 0 0 20px; }
.s4-content ul, .s4-content ol { margin: 0 0 20px; padding-left: 24px; }
.s4-content li { margin-bottom: 8px; }
.s4-content img { max-width: 100%; height: auto; border-radius: 14px; }
.s4-content .wp-block-embed { margin: 32px 0; }
.s4-content .wp-block-embed iframe { border-radius: 14px; max-width: 100%; }
.s4-content .wp-block-embed__wrapper { position: relative; }
.s4-content blockquote {
  border-left: 3px solid var(--s4-coral); margin: 32px 0; padding: 4px 0 4px 24px;
  font-family: var(--s4-serif); font-size: 20px; color: var(--s4-navy);
}
.s4-content .wp-block-file, .s4-content .wp-block-buttons { margin: 24px 0; }

.s4-single-meta { font-size: 14px; color: var(--s4-muted); margin-top: 16px; display: flex; gap: 12px; align-items: center; }
.s4-back-link { padding: 0 0 72px; }
.s4-back-link a { font-weight: 600; color: var(--s4-coral-deep); text-decoration: none; }
.s4-back-link a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* download / file blocks styled as cards */
.s4-content .wp-block-file {
  background: var(--s4-card); border: 1px solid var(--s4-line); border-radius: 14px;
  padding: 20px 24px; box-shadow: var(--s4-shadow-sm);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.s4-content .wp-block-file a:first-child { font-weight: 600; color: var(--s4-navy); }
.s4-content .wp-block-file .wp-block-file__button {
  background: var(--s4-coral); color: #fff; border-radius: 999px; padding: 8px 18px;
  font-weight: 600; font-size: 14px; text-decoration: none;
}
.s4-content .wp-block-file .wp-block-file__button:hover { background: var(--s4-coral-deep); }

/* ---------- contact ---------- */
.s4-contact-lede { font-size: 18px; max-width: 52ch; }
.s4-contact-email { margin: 28px 0 0; }
.s4-contact-email a {
  font-family: var(--s4-serif); font-size: clamp(26px, 3.5vw, 36px);
  color: var(--s4-coral-deep); text-decoration: none;
}
.s4-contact-email a:hover { text-decoration: underline; text-underline-offset: 5px; }

/* newsletter callout box on inner pages */
.s4-content .wp-block-post-content > .s4-news-callout { max-width: none; }
.s4-news-callout { margin: 64px 0 8px; }
.s4-news-compact { align-items: center; }
@media (max-width: 1000px) {
  .s4-news-compact { grid-template-columns: 1fr; gap: 28px; padding: 44px 36px; }
}

/* ---------- footer ---------- */
.s4-footer {
  margin-top: 72px; background: var(--s4-navy-900); color: #b9c9d9;
  padding: 48px 0 40px;
}
.s4-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; flex-wrap: wrap; }
.s4-foot .s4-logo, .s4-foot .s4-logo:visited { color: var(--s4-mint); }
.s4-foot-links { display: flex; gap: 24px; }
.s4-foot-links a { color: #b9c9d9; font-size: 14.5px; text-decoration: none; }
.s4-foot-links a:hover { color: var(--s4-mint); }
.s4-foot-meta { font-family: var(--s4-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #6d849b; margin-top: 10px; }
.s4-foot-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(181,203,214,.15); font-size: 13px; color: #7d94ab; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .s4-hero-grid, .s4-news-inner, .s4-contact-grid { grid-template-columns: 1fr; }
  .s4-headshot { max-width: 360px; }
  .s4-sys-grid { grid-template-columns: repeat(2, 1fr); }
  .s4-blog-query .wp-block-post-template { grid-template-columns: 1fr; }
  .s4-news-inner { padding: 44px 28px; }
  .s4-nav-links { gap: 18px; }
}
@media (max-width: 520px) {
  .s4-sys-grid { grid-template-columns: 1fr; }
}

/* gentle entrance, guide: 120–340ms eases, no bounce */
@media (prefers-reduced-motion: no-preference) {
  .s4-fade { opacity: 0; transform: translateY(8px); animation: s4rise .34s ease forwards; }
  .s4-fade.s4-d1 { animation-delay: .06s; }
  .s4-fade.s4-d2 { animation-delay: .12s; }
  .s4-fade.s4-d3 { animation-delay: .18s; }
  @keyframes s4rise { to { opacity: 1; transform: none; } }
}
