/* =========================================================
   Theme-level overrides — Olivia Foster Theme
========================================================= */

/* Prevent horizontal scroll */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Remove gap between all site blocks */
.wp-site-blocks > header.wp-block-template-part,
.wp-site-blocks > main.wp-block-group,
.wp-site-blocks > footer.wp-block-template-part {
  margin-block-start: 0 !important;
}
.wp-site-blocks {
  --wp--style--block-gap: 0px !important;
  row-gap: 0 !important;
  gap: 0 !important;
}
.wp-site-blocks > * {
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
}

body:not(.home) .wp-site-blocks > header.wp-block-template-part {
  height: 0;
}

/* ---- Header position ---- */
body .hc-header { top: var(--hc-adminbar-h); }

/* Non-home: solid cream header */
body:not(.home) .hc-header {
  background: var(--wp--preset--color--of-cream) !important;
}

/* Pages with hero backgrounds: keep header transparent */
body.page-slug-about .hc-header {
  background: transparent !important;
}

/* Services + Programs + Blog + Contact pages: solid header matches the first section background */
body.page-slug-services .hc-header,
body.page-slug-programs .hc-header,
body.page-slug-blog .hc-header,
body.page-slug-contact .hc-header {
  background: #f4f1f0 !important;
}

/* About page: solid header matches the first section background */
body.page-slug-about .hc-header--solid {
  background: #f4f1f0 !important;
}

/* ---- Content clearance for fixed header ---- */
/* Pages with custom patterns handle their own top padding via .of-source-page */
.of-source-page {
  padding: clamp(92px, 10vw, 160px) clamp(20px, 4vw, 48px) clamp(56px, 7vw, 96px);
}

/* Hero pages (image behind header): extra top clearance */
.of-source-hero-page {
  padding-top: clamp(140px, 12vw, 180px);
}

/* Generic clearance for non-pattern pages (Privacy Policy etc.) */
body:not(.home) .wp-block-post-content > :not(.of-source-page):first-child {
  margin-top: clamp(80px, 7vw, 110px);
}

/* ---- Global is-layout-flow margin fix ---- */
/* WordPress 0,5,0 specificity: always use !important on margin overrides */

/* ---- Button global state ---- */
.wp-block-button__link:hover {
  background-color: var(--of-gold-hover, #a07c3c);
}

/* ---- Editor heading alignment ---- */
.of-source-title {
  font-family: var(--wp--preset--font-family--playfair-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1.1;
}

.of-source-title--center { text-align: center; }

/* ---- Scrolling marquee (hero background text) ---- */
.of-marquee-band {
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.of-marquee-band p,
.of-marquee-band__text {
  display: inline-block;
  white-space: nowrap;
  animation: of-marquee-scroll 70s linear infinite;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-family: var(--wp--preset--font-family--playfair-display);
  font-weight: 400;
  color: var(--wp--preset--color--of-ink);
  opacity: 0.12;
}

@keyframes of-marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---- Section dividers ---- */
.of-full-divider {
  width: 100% !important;
  border-color: rgba(30,42,56,.12);
}

/* ---- Utility ---- */
.of-text-gold { color: var(--wp--preset--color--of-gold) !important; }
.of-text-muted { color: var(--wp--preset--color--of-muted) !important; }
.of-italic { font-style: italic; }

/* ---- Contact Form 7 ----
   Theme-agnostic styling so any CF7 form a buyer builds looks on-brand.
   Works with both label-wrapped fields and <p>/<div>-wrapped fields. */
.wpcf7 {
  max-width: 640px;
  margin-inline: auto;
  text-align: left;
}
.wpcf7 .wpcf7-form > p,
.wpcf7 .wpcf7-form .of-field {
  margin: 0 0 24px;
}
/* Field labels */
.wpcf7 label,
.wpcf7 .of-field > label {
  display: block;
  font-family: var(--wp--preset--font-family--helvetica);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--wp--preset--color--custom-stone-gray);
}
/* Text-like inputs, selects and textareas */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 input[type="date"],
.wpcf7 input[type="password"],
.wpcf7 input[type="search"],
.wpcf7 select,
.wpcf7 textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 10px;
  padding: 15px 24px;
  border: 1px solid rgba(62, 75, 92, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  font-family: var(--wp--preset--font-family--helvetica);
  font-size: 16px;
  line-height: 1.4;
  color: var(--wp--preset--color--custom-stone-gray);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder { color: rgba(62, 75, 92, 0.55); }
.wpcf7 textarea {
  border-radius: 24px;
  min-height: 130px;
  resize: vertical;
}
/* Select with custom chevron */
.wpcf7 select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 48px;
  cursor: pointer;
  color: rgba(62, 75, 92, 0.7);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%233E4B5C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 22px center;
  background-size: 14px;
}
/* Focus state */
.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
  border-color: var(--of-gold);
  background: rgba(255, 255, 255, 0.75);
}
/* Checkboxes / radios / acceptance */
.wpcf7 .wpcf7-checkbox .wpcf7-list-item,
.wpcf7 .wpcf7-radio .wpcf7-list-item,
.wpcf7 .wpcf7-acceptance .wpcf7-list-item {
  display: block;
  margin: 8px 0 0 0;
  font-family: var(--wp--preset--font-family--helvetica);
  font-size: 15px;
  color: var(--wp--preset--color--custom-stone-gray);
}
.wpcf7 .wpcf7-list-item input { width: auto; margin-right: 8px; }
/* Submit button — gold pill, centered */
.wpcf7 .wpcf7-submit {
  display: block;
  margin: 8px auto 0;
  min-width: 240px;
  padding: 17px 48px;
  border: 0;
  border-radius: 999px;
  background: var(--of-gold);
  color: #fff;
  font-family: var(--wp--preset--font-family--helvetica);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease;
}
.wpcf7 .wpcf7-submit:hover { background: var(--of-gold-h); }
.wpcf7 .wpcf7-submit:disabled { opacity: 0.6; cursor: default; }
/* Validation + responses */
.wpcf7 .wpcf7-not-valid-tip {
  display: block;
  margin-top: 7px;
  padding-left: 4px;
  color: #c0392b;
  font-family: var(--wp--preset--font-family--helvetica);
  font-size: 13px;
}
.wpcf7 .wpcf7-not-valid { border-color: #c0392b !important; }
.wpcf7-response-output {
  margin: 22px 0 0 !important;
  padding: 14px 22px !important;
  border-radius: 14px !important;
  border-width: 1px !important;
  font-family: var(--wp--preset--font-family--helvetica);
  font-size: 14px;
  text-align: center;
}
.wpcf7 form.sent .wpcf7-response-output {
  border-color: var(--of-gold) !important;
  color: var(--wp--preset--color--custom-stone-gray);
}
.wpcf7 .wpcf7-spinner { margin: 0 auto; }

/* CF7 — tighten controls on small screens */
@media (max-width: 782px) {
  .wpcf7 input[type="text"],
  .wpcf7 input[type="email"],
  .wpcf7 input[type="tel"],
  .wpcf7 input[type="url"],
  .wpcf7 input[type="number"],
  .wpcf7 input[type="date"],
  .wpcf7 input[type="password"],
  .wpcf7 input[type="search"],
  .wpcf7 select,
  .wpcf7 textarea {
    padding: 14px 20px;
  }
  .wpcf7 .wpcf7-submit {
    width: 100%;
    min-width: 0;
  }
}

/* Placeholder shown when no CF7 form is configured (distributed theme) */
.of-form-placeholder {
  max-width: 640px;
  margin-inline: auto;
  padding: 40px 32px;
  border: 1px dashed rgba(62, 75, 92, 0.35);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.4);
  color: rgba(62, 75, 92, 0.75);
  font-size: 16px;
  line-height: 1.6;
}

/* ---- up-animation ---- */
.of-anim .up-animation {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .45s ease-out, transform .45s ease-out;
  transition-delay: .28s;
  will-change: opacity, transform;
}
.of-anim .up-animation.in-view { opacity: 1; transform: none; will-change: auto; }
