/*
Theme Name: The Common Field
Theme URI: https://vanessadionne.co/
Author: The Common Field
Description: Custom classic theme for vanessadionne.co — Phase 3. Wraps WordPress posts in the exact header/footer/design-system of the static site (shared /assets/site.css + site.js), styles post content to match /writing/ articles, and closes every post with the wine CTA band. See CLAUDE.md in the repo.
Version: 1.4.1
Requires PHP: 7.4
Text Domain: common-field
*/

/* ---------------------------------------------------------------------------
   POST CONTENT (.cf-content) — mirrors the inline typography of the static
   essay at /writing/parenting-and-boundaries/. WordPress outputs bare
   h2/p/ul/blockquote from the editor, so the classes live here instead of
   inline. If the static essay style changes, change this to match.
   --------------------------------------------------------------------------- */
.cf-content p {
  font-family: 'Karla', sans-serif;
  font-size: 17.5px;
  line-height: 1.8;
  color: var(--body);
  margin: 0 0 18px;
}
.cf-content h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.25;
  color: var(--ink);
  margin: 44px 0 18px;
}
.cf-content h3 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(19px, 2.4vw, 23px);
  line-height: 1.3;
  color: var(--ink);
  margin: 36px 0 14px;
}
.cf-content blockquote {
  margin: 28px 0;
  border-left: 2px solid var(--pers);
  padding: 4px 0 4px 22px;
}
.cf-content blockquote p {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(21px, 2.6vw, 26px);
  line-height: 1.45;
  color: var(--pers-deep);
  margin: 0;
}
.cf-content ul, .cf-content ol {
  margin: 0 0 18px;
  padding: 0 0 0 4px;
  list-style: none;
  display: grid;
  gap: 10px;
}
.cf-content li {
  font-family: 'Karla', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--body);
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.cf-content li::before {
  content: "";
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pers);
  transform: translateY(-2px);
}
.cf-content ol { counter-reset: cf-ol; }
.cf-content ol li::before {
  content: counter(cf-ol) ".";
  counter-increment: cf-ol;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  transform: none;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  color: var(--pers-deep);
}
.cf-content a { color: var(--pom-link); }
.cf-content a:hover { color: var(--pers); }
.cf-content img {
  max-width: 100%;
  height: auto;
  border-radius: 20px;
}
.cf-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px auto;
  max-width: 200px;
}
.cf-content strong { color: var(--ink); }

/* ---------------------------------------------------------------------------
   BYLINE — Vanessa's avatar + name + date under the title.
   --------------------------------------------------------------------------- */
.cf-byline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 36px;
  /* The byline is a link to /about/ — quiet by default, name tints on hover. */
  text-decoration: none;
}
a.cf-byline:hover .cf-byline-name { color: var(--pom-link); }
a.cf-byline:hover img { border-color: var(--pers); }
.cf-byline img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--petal);
  flex: 0 0 46px;
}
.cf-byline .cf-byline-name {
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.4;
}
.cf-byline .cf-byline-meta {
  font-family: 'Karla', sans-serif;
  font-size: 13px;
  color: var(--faint);
  line-height: 1.4;
}

/* ---------------------------------------------------------------------------
   FEATURED IMAGE — an EDITORIAL object, deliberately quieter than Vanessa's
   portraits (the thick cream frame + pink halo is HER visual language; a
   first pass used it here and it read all wrong — Jim, 2026-07-15).
   Wide 1.85:1 band (was 2:1 — "a smidge taller, less movie-screen",
   Jim 2026-07-17), cropped from the 3:2 source by object-fit, hairline
   border, the site's standard card shadow. Sources should still be
   shot/uploaded at 3:2 per the spec — the extra height is crop headroom.
   --------------------------------------------------------------------------- */
.cf-featured {
  margin: 10px 0 44px;
}
.cf-featured img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.85 / 1;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

/* ---------------------------------------------------------------------------
   BLOG INDEX (page-writing.php) — /writing/. One featured "latest essay" card
   (2:1 image, same crop language as .cf-featured) + a grid of quieter cards.
   Private posts carry the .cf-badge-private pill (only ever seen logged in).
   --------------------------------------------------------------------------- */
.cf-writing-rings {
  position: absolute;
  top: -90px;
  right: -120px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  /* Same 21px ring period as the site-wide motif, but with ~0.75px fades at
     each band edge — hard stops stair-step ("rasterize") at desktop size. */
  background: repeating-radial-gradient(circle at center, transparent 0 18.25px, var(--rings) 19px 20.25px, transparent 21px);
  z-index: 0;
}
/* Desktop: much larger circle, same ring spacing — more rings (Jim, 2026-07-17). */
@media (min-width: 900px) {
  .cf-writing-rings {
    top: -190px;
    right: -210px;
    width: 660px;
    height: 660px;
  }
}

.cf-blog-feature,
.cf-blog-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: transform .2s, border-color .2s;
}
.cf-blog-feature:hover,
.cf-blog-card:hover { transform: translateY(-2px); border-color: var(--pom-link); }
.cf-blog-feature > img,
.cf-blog-card > img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}
.cf-blog-feature > img { aspect-ratio: 1.85 / 1; }
.cf-blog-card > img { aspect-ratio: 16 / 10; }
.cf-blog-feature-body { padding: 26px 30px 30px; }
.cf-blog-card-body { padding: 20px 22px 24px; }
.cf-blog-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--pers-deep);
  margin: 0 0 14px;
}
.cf-blog-feature-title {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(24px, 3.2vw, 31px);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 10px;
}
.cf-blog-card-title {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 20.5px;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 10px;
}
.cf-blog-date {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Karla', sans-serif;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--faint);
  margin: 0 0 14px;
}
.cf-blog-card-body .cf-blog-date { margin-bottom: 10px; }
.cf-blog-excerpt {
  font-family: 'Karla', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--body);
  margin: 0 0 18px;
  max-width: 62ch;
}
.cf-blog-card-body .cf-blog-excerpt { font-size: 15px; margin-bottom: 14px; }
.cf-blog-read {
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--pom-link);
}
.cf-blog-card .cf-blog-read { font-size: 14px; }
.cf-blog-more {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--pers-deep);
  margin: 44px 0 18px;
}
.cf-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 22px;
}
.cf-badge-private {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--pers-deep);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}
.cf-badge-private::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pers);
}

/* ---------------------------------------------------------------------------
   GENERAL PAGES (page.php) — Gutenberg core blocks mapped to the design
   system, plus container classes for the editor's "Additional CSS
   class(es)" field. Everything scoped under .cf-page-content so post
   styling is untouched.
   --------------------------------------------------------------------------- */

/* Buttons: the pomegranate pill. Outline style = quiet secondary. */
.cf-page-content .wp-block-button__link {
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--on-accent);
  background: var(--pom);
  padding: 14px 30px;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  transition: filter .2s, transform .2s;
}
.cf-page-content .wp-block-button__link:hover { filter: brightness(1.07); transform: translateY(-1px); color: var(--on-accent); }
.cf-page-content .is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--pom-link);
  border: 1.5px solid var(--pom-link);
}
.cf-page-content .wp-block-buttons { gap: 14px; margin: 0 0 18px; }

/* Separators: the site's quiet centered rule (matches .cf-content hr). */
.cf-page-content .wp-block-separator {
  background: none;
  height: auto;
}

/* Images + captions. */
.cf-page-content .wp-block-image { margin: 28px 0; }
.cf-page-content .wp-block-image figcaption {
  font-family: 'Karla', sans-serif;
  font-size: 13px;
  color: var(--faint);
  text-align: center;
  margin-top: 10px;
}

/* Columns breathe like the site's grids. */
.cf-page-content .wp-block-columns { gap: 24px; margin: 0 0 18px; }

/* Pullquote: the big italic Fraunces voice. */
.cf-page-content .wp-block-pullquote {
  border: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
  margin: 32px 0;
}
.cf-page-content .wp-block-pullquote p {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.45;
  color: var(--pers-deep);
}
.cf-page-content .wp-block-pullquote cite {
  font-family: 'Karla', sans-serif;
  font-style: normal;
  font-size: 14px;
  color: var(--faint);
}

/* Tables, in the site's quiet voice. */
.cf-page-content .wp-block-table table { border-collapse: collapse; width: 100%; }
.cf-page-content .wp-block-table td,
.cf-page-content .wp-block-table th {
  font-family: 'Karla', sans-serif;
  font-size: 15.5px;
  color: var(--body);
  border: 1px solid var(--border);
  padding: 10px 14px;
}
.cf-page-content .wp-block-table th { color: var(--ink); font-weight: 700; }

/* Wide/full alignment breaks out of the 740px article measure. */
.cf-page-content .alignwide {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(1092px, calc(100vw - 48px));
}
.cf-page-content .alignfull {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
}

/* --- Container classes (type into "Additional CSS class(es)") ------------ */
/* cf-card: the surface card every page uses. Works on Group blocks. */
.cf-page-content .cf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  padding: 30px 30px 32px;
  margin: 0 0 22px;
}
/* cf-card-tint: the warm tinted panel (the La Suprema-box look). */
.cf-page-content .cf-card-tint {
  background: var(--tint);
  border-radius: 28px;
  padding: 36px 32px;
  margin: 0 0 22px;
}
/* cf-eyebrow: the letterspaced Fraunces caps label. */
.cf-page-content .cf-eyebrow {
  font-family: 'Fraunces', serif !important;
  font-weight: 500 !important;
  letter-spacing: .2em !important;
  text-transform: uppercase;
  font-size: 13px !important;
  color: var(--pers-deep) !important;
  margin: 0 0 14px;
}
/* cf-pill: the small rounded chip ("No preparation needed" etc.). */
.cf-page-content .cf-pill {
  display: inline-block;
  font-family: 'Karla', sans-serif !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  color: var(--pom-deep) !important;
  background: var(--tint);
  padding: 9px 17px;
  border-radius: 999px;
  margin: 0 6px 10px 0;
}
/* Inside a tinted panel, tint-on-tint disappears — pills go surface there. */
.cf-page-content .cf-card-tint .cf-pill { background: var(--surface); }

/* ---------------------------------------------------------------------------
   POST DECORATION (single.php) — upper-right composition on articles:
   the About page's plum-rose identity field (thin 1px --rings-mauve lines,
   its landed treatment), a SEPARATE orbit whose planet is the mobile home
   hero's muted persimmon (var(--pers) at .55 — soft terracotta passenger,
   not a second accent), and two small still planets (saffron, petal) in the
   field. main is the clipping box; the article sits above at z-index:1.
   --------------------------------------------------------------------------- */
.cf-post-deco { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.cf-post-field {
  position: absolute;
  top: -200px;
  right: -260px;
  width: 760px;
  height: 760px;
  border-radius: 50%;
  /* ~0.8px line core with sub-pixel fades — hard 1px stops stair-stepped
     badly at this size ("extremely rasterized", Jim 2026-07-17). Same
     anti-aliasing trick as .cf-writing-rings. */
  background: repeating-radial-gradient(circle at center, transparent 0 19.4px, var(--rings-mauve) 20.1px 20.9px, transparent 21.6px);
}
.cf-post-orbit {
  position: absolute;
  top: 110px;
  right: -80px;
  width: 360px;
  height: 360px;
  /* Phase-shifted 135°: the planet begins its arc at ~4:30 on the clock
     (Jim, 2026-07-17) instead of 12:00, sweeping down through the visible
     lower arc first. Same technique as site.css's cf-orbit-shift-45. */
  animation: cf-post-orbit-135 80s linear infinite;
}
@keyframes cf-post-orbit-135 {
  from { transform: rotate(135deg); }
  to   { transform: rotate(495deg); }
}
.cf-post-orbit > div:first-child {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--pers) 35%, transparent);
}
.cf-post-orbit > div:last-child {
  position: absolute;
  top: -6px;
  left: 50%;
  margin-left: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pers);
  opacity: .55;
  /* Synced with the 80s rotation, which starts phase-shifted at 135°
     (4:30). The off-page zone is fixed in space (~34°–146° clockwise from
     12:00, the orbit's right third): at t=0 the planet sits at 135° — just
     inside that zone — so it materializes moments in (~146° ≈ 3%), rides
     the long visible arc down-left-up-over, and dissolves as it re-enters
     the zone (34°+360° ≈ 72%). Linear/80s both, so phases track exactly. */
  animation: cf-post-planet-fade 80s linear infinite;
}
@keyframes cf-post-planet-fade {
  0%, 3%    { opacity: 0; }
  7%        { opacity: .55; }
  69%       { opacity: .55; }
  73%, 100% { opacity: 0; }
}
.cf-post-dot { position: absolute; border-radius: 50%; }
.cf-post-dot-a { top: 300px; right: 90px; width: 8px; height: 8px; background: var(--saff); opacity: .5; }
.cf-post-dot-b { top: 80px; right: 420px; width: 6px; height: 6px; background: var(--petal); opacity: .65; }
@media (max-width: 700px) {
  .cf-post-field { top: -100px; right: -120px; width: 320px; height: 320px; }
  /* Orbit fully in view on phones — no fade needed. */
  .cf-post-orbit { top: 44px; right: 60px; width: 170px; height: 170px; }
  .cf-post-orbit > div:last-child { animation: none; }
  .cf-post-dot-a { top: 128px; right: 40px; width: 7px; height: 7px; }
  .cf-post-dot-b { top: 34px; right: 196px; width: 5px; height: 5px; }
}

/* ---------------------------------------------------------------------------
   WP ADMIN BAR (logged-in only) — WordPress shifts the document down 32px
   (46px on small screens) under its toolbar, but the site header is fixed to
   the viewport top: the wordmark got clipped and the hero's blush peeked out
   from under the header with a visible elliptical edge (Jim, 2026-07-17).
   Pin the header just below the bar so geometry matches the static pages.
   !important is required — the header's top:0 is an inline style.
   --------------------------------------------------------------------------- */
body.admin-bar > header { top: 32px !important; }
@media screen and (max-width: 782px) {
  body.admin-bar > header { top: 46px !important; }
}

/* ---------------------------------------------------------------------------
   EVENT CARDS (page-workshops.php) — inside the tinted La Suprema section.
   Same surface-card language as the static page's "coming soon" card.
   --------------------------------------------------------------------------- */
.cf-events {
  display: grid;
  gap: 18px;
}
.cf-event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 26px 26px;
}
.cf-event-card .cf-badge-private {
  margin-bottom: 12px;
  background: var(--surface);
}
.cf-event-date {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--pers-deep);
  margin: 0 0 8px;
}
.cf-event-title {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 21px;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 6px;
}
.cf-event-meta {
  font-family: 'Karla', sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--body);
  margin: 0 0 14px;
}
.cf-event-desc {
  font-family: 'Karla', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--body);
  margin: 0 0 16px;
}
.cf-event-desc p { margin: 0 0 10px; }
.cf-event-desc p:last-child { margin-bottom: 0; }
.cf-event-signup {
  display: inline-block;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--on-accent);
  background: var(--pom);
  padding: 11px 24px;
  border-radius: 999px;
  text-decoration: none;
  transition: filter .2s;
}
.cf-event-signup:hover { filter: brightness(1.08); }
.cf-event-email {
  font-family: 'Karla', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: var(--body);
  margin: 0;
}

/* ---------------------------------------------------------------------------
   ARCHIVE FALLBACK (index.php) — quiet card list, same language as /writing/.
   --------------------------------------------------------------------------- */
.cf-archive-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 26px 26px 28px;
  text-decoration: none;
  margin: 0 0 20px;
  transition: transform .2s, border-color .2s;
}
.cf-archive-card:hover { transform: translateY(-2px); border-color: var(--pom-link); }
.cf-archive-card .cf-card-title {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 22px;
  color: var(--pom-link);
  margin: 0 0 8px;
}
.cf-archive-card .cf-card-excerpt {
  font-family: 'Karla', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--body);
  margin: 0;
}
