﻿/*
Theme Name: FHS Blog
Theme URI: https://favoredhealthcareservices.com/seo/seo-blog/
Author: Favored Healthcare Services
Description: Block theme for the Favored Healthcare Services blog. Brand tokens, self-hosted Sora and Inter, a reading-first article layout, and the two compliance lines required on every public page.
Version: 1.0.1
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fhs-blog
Tags: blog, one-column, block-patterns, full-site-editing
*/

/* Most styling lives in theme.json. This file carries what theme.json cannot
   express: dark mode, print, and a few reading refinements.

   BROWSER SUPPORT
   Baseline widely available features only, and no polyfills. The audience skews
   to older devices, and the CSP on this domain blocks external scripts, so a
   CDN polyfill could not load even if one were wanted. */

/* ---------------------------------------------------------------------------
   READING
   Articles here run 1500 to 2000 words. Measure and rhythm matter more than
   anything decorative.
   --------------------------------------------------------------------------- */

.wp-block-post-content p {
  margin-block: 0 1.15em;
  text-wrap: pretty;             /* falls back to normal wrapping where absent */
}

.wp-block-post-content h2,
.wp-block-post-content h3 {
  margin-block-start: 2.2em;
  text-wrap: balance;
}

.wp-block-post-content > :first-child {
  margin-block-start: 0;
}

/* Lead paragraph. Sets the tone before the reader commits to 1700 words. */
.wp-block-post-content > p:first-of-type {
  font-size: var(--wp--preset--font-size--large);
  color: var(--wp--preset--color--navy);
  line-height: 1.55;
}

/* Long URLs in citations must not push the column sideways on a phone. */
.wp-block-post-content a { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------------------
   THE COMPLIANCE FOOTER
   Required on every public page. Deliberately quiet but never hidden: it is a
   legal notice, not decoration, so it keeps full contrast rather than being
   greyed into the background.
   --------------------------------------------------------------------------- */

.fhs-compliance {
  border-top: 1px solid var(--wp--preset--color--line);
  margin-block-start: 3rem;
  padding-block: 1.5rem;
  font-size: var(--wp--preset--font-size--small);
  line-height: 1.6;
}

.fhs-compliance p { margin: 0 0 0.5rem; }
.fhs-compliance p:last-child { margin-bottom: 0; }

.fhs-compliance strong { color: var(--wp--preset--color--navy); }

/* ---------------------------------------------------------------------------
   DARK MODE
   Light and dark each get their own treatment rather than a filter inversion.
   Navy headings would vanish on a dark page, so the palette is re-pointed:
   headings go to a light blue-white, links to a lifted blue that still passes
   contrast on the dark surface.
   --------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root {
    --wp--preset--color--base: #0F1724;
    --wp--preset--color--ink: #E7EEFA;
    --wp--preset--color--navy: #CBDBF5;
    --wp--preset--color--blue: #7FA8E8;
    --wp--preset--color--mute: #9BAAC4;
    --wp--preset--color--line: #2A3956;
    --wp--preset--color--blue-wash: #162134;
  }

  body {
    background: var(--wp--preset--color--base);
    color: var(--wp--preset--color--ink);
  }

  /* Amber on a dark ground reads hotter than intended; step it back. */
  .wp-block-quote { border-left-color: #D99A2B; }

  img, video { opacity: 0.94; }
}

/* ---------------------------------------------------------------------------
   FOCUS
   Visible keyboard focus everywhere. The default outline disappears against
   the navy header, so it is stated explicitly.
   --------------------------------------------------------------------------- */

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--wp--preset--color--amber);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip link. WordPress injects this itself on block themes, so the theme only
   styles it rather than adding a second one. */
.skip-link.screen-reader-text:focus {
  background: var(--wp--preset--color--navy);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   PRINT
   Families do print care information and take it to appointments.
   --------------------------------------------------------------------------- */

@media print {
  .wp-block-template-part header,
  .wp-block-post-navigation-link,
  .fhs-skip { display: none; }

  body { color: #000; background: #fff; font-size: 11pt; }

  /* Print the destination of every link, since a printed page cannot be clicked. */
  .wp-block-post-content a::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    word-break: break-all;
  }

  .fhs-compliance { border-top: 1pt solid #000; }
}

/* ---------------------------------------------------------------------------
   MOTION
   --------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

