/*
Theme Name: Firm Footing
Description: Theme for a nonprofit that helps young adults build stable lives.
Version: 1.0
Requires at least: 6.5
*/

@font-face { font-family: "Bricolage"; src: url("fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Source Serif"; src: url("fonts/serif-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Serif"; src: url("fonts/serif-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Serif"; src: url("fonts/serif-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("fonts/mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --teal: #0e4a4c;
  --teal-deep: #08302f;
  --chalk: #f4f1ea;
  --paper: #fbf9f4;
  --tape: #f5c243;
  --brick: #b4452c;
  --ink: #17201f;
  --u: 8px;
  --gutter: clamp(18px, 4vw, 56px);
  --max: 1200px;
  --display: "Bricolage", "Avenir Next", "Segoe UI", sans-serif;
  --serif: "Source Serif", Georgia, serif;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--brick); }

h1, h2, h3, h4 { font-family: var(--display); color: var(--teal-deep); margin: 0 0 calc(var(--u) * 2); }
h1 { font-size: clamp(44px, 7vw, 96px); font-weight: 760; line-height: .95; letter-spacing: -0.035em; }
h2 { font-size: clamp(32px, 4.4vw, 56px); font-weight: 680; line-height: 1.02; letter-spacing: -0.025em; }
h3 { font-size: clamp(22px, 2.2vw, 28px); font-weight: 620; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0 0 calc(var(--u) * 2); }

.ff-skip { position: absolute; left: -999px; }
.ff-skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--tape); padding: 8px 14px; }

.ff-label, .ff-eyebrow {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* header */
.ff-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(244, 241, 234, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(14, 74, 76, .12);
}
.ff-header__in {
  max-width: var(--max); margin: 0 auto; padding: 14px var(--gutter);
  display: flex; align-items: center; gap: 24px;
}
.ff-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--teal-deep); }
.ff-brand__mark { width: 30px; height: 30px; flex: none; }
.ff-brand__name { font-family: var(--display); font-weight: 720; font-size: 21px; letter-spacing: -0.02em; }
.ff-nav { margin-left: auto; }
.ff-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; align-items: center; }
.ff-nav a { font-family: var(--display); font-weight: 520; font-size: 16px; color: var(--ink); text-decoration: none; }
.ff-nav a:hover, .ff-nav .current-menu-item > a { color: var(--brick); }
.ff-nav .ff-nav__donate a {
  background: var(--brick); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 640;
}
.ff-nav .ff-nav__donate a:hover { background: var(--teal-deep); color: #fff; }
.ff-menu-toggle { display: none; }

@media (max-width: 900px) {
  .ff-menu-toggle {
    display: inline-flex; margin-left: auto; align-items: center; gap: 8px;
    background: var(--teal-deep); color: var(--chalk); border: 0; border-radius: 999px;
    padding: 10px 16px; font-family: var(--display); font-size: 15px; font-weight: 600;
  }
  .ff-nav { position: fixed; inset: 64px 0 auto 0; background: var(--chalk); border-bottom: 3px solid var(--tape); display: none; margin: 0; }
  .ff-nav.is-open { display: block; }
  .ff-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 20px; }
  .ff-nav li a { display: block; padding: 14px 0; border-bottom: 1px solid rgba(14,74,76,.12); font-size: 20px; }
  .ff-nav .ff-nav__donate a { text-align: center; margin-top: 14px; border: 0; }
}

/* main */
.ff-main { min-height: 60vh; }
.ff-page-head { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 8vw, 104px) var(--gutter) clamp(24px, 4vw, 40px); }
.ff-page-head .ff-eyebrow { color: var(--brick); margin-bottom: 14px; }
.ff-page-head h1 { max-width: 14ch; }
.ff-content { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(64px, 9vw, 120px); }
.ff-content > * { max-width: 720px; }
.ff-content > .alignwide { max-width: var(--max); }
.ff-content > .alignfull { max-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); }
.ff-content .wp-block-image img { border-radius: 4px; }

.home .ff-content { padding: 0; max-width: none; }
.home .ff-content > * { max-width: none; }
.home .ff-content > .alignfull { margin-left: 0; margin-right: 0; }
body { overflow-x: clip; }

/* buttons */
.wp-block-button__link, .ff-btn, button.ff-submit {
  font-family: var(--display); font-weight: 640; font-size: 17px; letter-spacing: -0.005em;
  background: var(--teal-deep); color: var(--chalk);
  border-radius: 999px; padding: 15px 26px; text-decoration: none; border: 0; cursor: pointer;
  display: inline-block; transition: transform .2s, background .2s;
}
.wp-block-button__link:hover, .ff-btn:hover, button.ff-submit:hover { background: var(--brick); color: #fff; transform: translateY(-2px); }
.is-style-ff-tape .wp-block-button__link { background: var(--tape); color: var(--teal-deep); }
.is-style-ff-tape .wp-block-button__link:hover { background: var(--chalk); color: var(--teal-deep); }
.is-style-outline .wp-block-button__link { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.is-style-outline .wp-block-button__link:hover { background: var(--chalk); color: var(--teal-deep); box-shadow: none; }

/* the floor tape: rhyme element */
.ff-tape {
  height: 14px;
  background: repeating-linear-gradient(-45deg, var(--tape) 0 22px, var(--teal-deep) 22px 44px);
}

/* home: hero */
.ff-hero.wp-block-cover { min-height: min(92svh, 860px) !important; padding: 0 !important; align-items: flex-end; }
.ff-hero.wp-block-cover { background: var(--teal-deep); }
.ff-hero .wp-block-cover__image-background { left: 36% !important; width: 64% !important; object-position: 50% 25% !important; }
.ff-hero .wp-block-cover__background { background: linear-gradient(90deg, rgba(8,48,47,1) 0%, rgba(8,48,47,1) 36%, rgba(8,48,47,.45) 50%, rgba(8,48,47,0) 70%) !important; opacity: 1 !important; }
.ff-hero .wp-block-cover__inner-container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(56px, 9vw, 120px); }
.ff-hero .ff-eyebrow { color: var(--tape); }
.ff-hero h1 { color: var(--chalk); max-width: 11ch; margin-top: 16px; }
.ff-hero h1 em { font-style: normal; color: var(--tape); }
.ff-hero p.ff-hero__sub { color: rgba(244,241,234,.86); font-size: 20px; max-width: 32rem; }
.ff-hero .wp-block-buttons { margin-top: 28px; gap: 12px; }

@media (max-width: 760px) {
  .ff-hero .wp-block-cover__background { background: linear-gradient(0deg, rgba(8,48,47,.97) 18%, rgba(8,48,47,.78) 58%, rgba(8,48,47,.25)) !important; }
  .ff-hero .wp-block-cover__image-background { left: 0 !important; width: 100% !important; object-position: 38% 18% !important; }
  .ff-hero p.ff-hero__sub { font-size: 18px; }
}

/* two doors */
.ff-doors > .wp-block-group__inner-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 0 !important; }
.ff-door { padding: clamp(40px, 6vw, 80px) var(--gutter) !important; margin: 0 !important; }
.ff-door--need { background: var(--paper); }
.ff-door--give { background: var(--teal-deep); color: var(--chalk); }
.ff-door--give h2, .ff-door--give h3 { color: var(--chalk); }
.ff-door .ff-eyebrow { color: var(--brick); }
.ff-door--give .ff-eyebrow { color: var(--tape); }
.ff-door p { max-width: 30rem; }

/* the staircase: the one visual risk */
.ff-stairs-wrap { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 10vw, 140px) var(--gutter) 0; }
.ff-stairs-wrap h2 { max-width: 16ch; }
.ff-stairs-wrap > .wp-block-group__inner-container > p { max-width: 36rem; opacity: .8; }
.ff-stairs > .wp-block-group__inner-container { display: grid !important; grid-template-columns: repeat(4, 1fr); align-items: end; gap: 10px !important; margin-top: 48px !important; }
.ff-step {
  position: relative; margin: 0 !important; padding: 24px 22px 28px !important;
  background: var(--paper); border-top: 6px solid var(--tape);
  min-height: 340px;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), background .35s;
}
.ff-step:nth-child(2) { min-height: 400px; }
.ff-step:nth-child(3) { min-height: 460px; }
.ff-step:nth-child(4) { min-height: 520px; background: var(--teal-deep); color: var(--chalk); }
.ff-step:nth-child(4) h3 { color: var(--chalk); }
.ff-step:hover { transform: translateY(-8px); }
.ff-step .ff-step__num { font-family: var(--display); font-weight: 780; font-size: 64px; line-height: 1; color: var(--brick); margin-bottom: 12px; letter-spacing: -0.04em; }
.ff-step:nth-child(4) .ff-step__num { color: var(--tape); }
.ff-step p { font-size: 16px; line-height: 1.5; margin: 0; }
.ff-stairs-floor { height: 14px; margin-top: 0; background: repeating-linear-gradient(-45deg, var(--tape) 0 22px, var(--teal-deep) 22px 44px); }

@media (max-width: 860px) {
  .ff-stairs > .wp-block-group__inner-container { grid-template-columns: 1fr; gap: 8px !important; }
  .ff-step, .ff-step:nth-child(n) { min-height: 0; margin-left: 0 !important; }
  .ff-step:nth-child(2) { margin-left: 6% !important; }
  .ff-step:nth-child(3) { margin-left: 12% !important; }
  .ff-step:nth-child(4) { margin-left: 18% !important; }
  .ff-step .ff-step__num { font-size: 44px; }
}

/* numbers / proof */
.ff-impact { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 10vw, 130px) var(--gutter); }
.ff-quote { font-family: var(--serif); font-style: italic; font-size: clamp(24px, 2.8vw, 34px); line-height: 1.35; color: var(--teal-deep); max-width: 24em; margin: 0; padding-left: 24px; border-left: 6px solid var(--tape); }
.ff-quote cite { display: block; margin-top: 14px; font-family: var(--mono); font-style: normal; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--brick); }
.ff-demo-note { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .55; margin-top: 18px; }

/* volunteer band */
.ff-band.wp-block-cover { min-height: 520px !important; }
.ff-band .wp-block-cover__background { background: rgba(8,48,47,.72) !important; opacity: 1 !important; }
.ff-band h2 { color: var(--chalk); max-width: 14ch; }
.ff-band p { color: rgba(244,241,234,.88); max-width: 32rem; }
.ff-band .wp-block-cover__inner-container { max-width: var(--max); width: 100%; margin: 0 auto; padding: 0 var(--gutter); }

/* blog teaser + cards */
.ff-posts { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 10vw, 130px) var(--gutter); }
.ff-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 28px; margin-top: 28px; }
.ff-card { text-decoration: none; color: inherit; display: block; }
.ff-card__img { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: var(--paper); }
.ff-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.ff-card:hover .ff-card__img img { transform: scale(1.04); }
.ff-card__meta { margin: 14px 0 6px; color: var(--brick); }
.ff-card h3 { margin: 0 0 8px; }
.ff-card p { font-size: 16px; opacity: .8; margin: 0; }

/* single post */
.ff-single { max-width: 760px; margin: 0 auto; padding: clamp(48px, 8vw, 96px) var(--gutter); }
.ff-single h1 { font-size: clamp(38px, 5.4vw, 64px); }
.ff-single__img { margin: 28px 0 36px; border-radius: 4px; overflow: hidden; }

/* forms */
.ff-form { display: grid; gap: 18px; max-width: 640px; background: var(--paper); padding: clamp(22px, 4vw, 40px); border-top: 6px solid var(--tape); }
.ff-form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 18px; }
.ff-form label { display: grid; gap: 6px; font-family: var(--display); font-weight: 560; font-size: 16px; color: var(--teal-deep); }
.ff-form input, .ff-form select, .ff-form textarea {
  font: inherit; font-family: var(--serif); font-size: 17px; color: var(--ink);
  background: #fff; border: 1.5px solid rgba(14,74,76,.28); border-radius: 6px; padding: 12px 14px; width: 100%;
}
.ff-form input:focus, .ff-form select:focus, .ff-form textarea:focus { outline: 3px solid var(--tape); outline-offset: 1px; border-color: var(--teal); }
.ff-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.ff-form legend { font-family: var(--display); font-weight: 560; color: var(--teal-deep); margin-bottom: 8px; }
.ff-checks { display: flex; flex-wrap: wrap; gap: 10px; }
.ff-checks label { display: inline-flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 400; background: #fff; border: 1.5px solid rgba(14,74,76,.2); border-radius: 999px; padding: 8px 14px; cursor: pointer; color: var(--ink); }
.ff-checks input { width: auto; accent-color: var(--brick); }
.ff-hp { position: absolute; left: -9999px; }
.ff-notice { padding: 16px 20px; background: var(--teal-deep); color: var(--chalk); border-left: 6px solid var(--tape); max-width: 640px; margin-bottom: 20px; }
.ff-notice--error { background: var(--brick); }

/* donate page */
.ff-donate-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 64px); align-items: start; max-width: var(--max) !important; }
@media (max-width: 860px) { .ff-donate-grid { grid-template-columns: 1fr; } }
.ff-gives { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 12px; }
.ff-gives li { background: var(--paper); padding: 14px 18px; border-left: 6px solid var(--tape); }
.ff-gives strong { font-family: var(--display); font-size: 22px; color: var(--brick); margin-right: 8px; }

/* footer */
.ff-footer { background: var(--teal-deep); color: rgba(244,241,234,.86); }
.ff-footer__in { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 7vw, 80px) var(--gutter) 32px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .ff-footer__in { grid-template-columns: 1fr; } }
.ff-footer h3 { color: var(--chalk); font-size: 20px; }
.ff-footer a { color: var(--chalk); }
.ff-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ff-footer__tag { font-family: var(--display); font-weight: 680; font-size: clamp(26px, 3vw, 36px); line-height: 1.05; color: var(--chalk); letter-spacing: -0.02em; }
.ff-footer__base { border-top: 1px solid rgba(244,241,234,.14); max-width: var(--max); margin: 0 auto; padding: 18px var(--gutter) 28px; font-size: 14px; opacity: .7; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.ff-stairs { margin-top: 48px; }
.ff-step > .wp-block-group__inner-container > :last-child { margin-bottom: 0; }
.wp-block-group__inner-container > :last-child { margin-bottom: 0; }

/* one left edge for every home section */
.home .ff-content > .alignfull { --edge: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); }
.home .ff-stairs-wrap, .home .ff-impact, .home .ff-posts { max-width: none; margin: 0; padding-left: var(--edge); padding-right: var(--edge); }
.home .ff-doors > .wp-block-group__inner-container > .ff-door--need { padding-left: max(var(--gutter), calc((100cqw - var(--max)) / 2 + var(--gutter))) !important; }
.home .ff-doors > .wp-block-group__inner-container > .ff-door--give { padding-right: max(var(--gutter), calc((100cqw - var(--max)) / 2 + var(--gutter))) !important; }
.ff-hero .wp-block-cover__inner-container, .ff-band .wp-block-cover__inner-container { max-width: none; padding-left: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); padding-right: var(--gutter); }

.home .ff-doors { container-type: inline-size; }
.ff-band.wp-block-cover, .ff-hero.wp-block-cover { padding-left: 0 !important; padding-right: 0 !important; }

/* programs: alternating rows that rhyme with the staircase */
.ff-program { margin: 0 0 clamp(28px, 4vw, 48px) !important; background: var(--paper); border-top: 6px solid var(--tape); grid-template-columns: 46% 1fr; }
.ff-program.has-media-on-the-right { grid-template-columns: 1fr 46%; }
.ff-program .wp-block-media-text__media img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; height: 100%; }
.ff-program .wp-block-media-text__content { padding: clamp(24px, 4vw, 56px) !important; }
.ff-program .ff-step__num { font-family: var(--display); font-weight: 780; font-size: 56px; line-height: 1; color: var(--brick); margin-bottom: 10px; letter-spacing: -0.04em; }
.ff-program h2 { font-size: clamp(28px, 3vw, 40px); }
@media (max-width: 600px) { .ff-program, .ff-program.has-media-on-the-right { grid-template-columns: 100% !important; } }
