/*
Theme Name: Wired & Whisker
Theme URI: https://wiredandwhisker.com
Description: Veterinary information blog. Posts hang on a brass wire; case notes carry a patient ID tag. Standalone classic theme, no parent.
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wiredandwhisker
*/

:root {
  --ink: #14284B;        /* navy ink: text, headings */
  --deep: #0A1730;       /* deep navy: bands, footer */
  --paper: #F2F4F6;      /* cool exam-paper background */
  --white: #FFFFFF;
  --brass: #C29632;      /* the wire; decorative + on-navy only */
  --brass-ink: #8A6512;  /* brass dark enough for text on paper */
  --slate: #556377;      /* secondary text */
  --rule: #D6DCE3;
  --case: #2F6B5A;       /* topic: case notes */
  --basics: #14284B;     /* topic: basics */
  --tech: #3D4F9A;       /* topic: pet tech */

  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Literata", Georgia, "Times New Roman", serif;

  --step--1: 0.875rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  --step-4: clamp(2.5rem, 1.5rem + 4.6vw, 4.75rem);

  --measure: 40rem;
  --wire-x: 1.25rem;     /* where the wire runs, from the content edge */
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.7 var(--body);
  font-optical-sizing: auto;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--brass); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--deep); color: var(--white); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: var(--gutter); }
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px;
  overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
}

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 4.25rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand svg { flex: none; }
.brand-name { font: 800 1.125rem/1 var(--display); font-stretch: 125%; letter-spacing: -0.01em; }
.brand-name .amp { color: var(--brass-ink); font-weight: 500; }
.nav { margin-left: auto; display: flex; gap: 1.25rem; align-items: center; font: 500 .95rem/1 var(--display); }
.nav a { text-decoration: none; padding: .5rem 0; }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--brass); }
.btn {
  display: inline-block; font: 650 .95rem/1 var(--display); font-stretch: 110%;
  background: var(--ink); color: var(--white); text-decoration: none;
  padding: .8rem 1.1rem; border-radius: 3px; border: 0; cursor: pointer;
}
.nav a.btn { padding: .8rem 1.1rem; }
.btn:hover { background: var(--deep); color: var(--white); }
.btn-brass { background: var(--brass); color: var(--deep); }
.btn-brass:hover { background: #D4A846; color: var(--deep); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

@media (max-width: 720px) {
  .site-header .wrap { gap: .25rem 1rem; padding-top: .5rem; }
  .nav { margin-left: 0; width: 100%; padding-bottom: .5rem; gap: 1rem; font-size: .95rem; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  /* The links scroll sideways; the button stays pinned at the right edge. */
  .nav .btn { margin-left: auto; position: sticky; right: 0; box-shadow: -1rem 0 .75rem -.25rem var(--paper); }
  .nav .btn .long { display: none; }
  .nav a.btn { padding: .6rem .8rem; }
}

/* ---------- Hero: the wire starts here ---------- */
.hero { position: relative; padding-top: clamp(3rem, 7vw, 6rem); }
.hero h1 {
  font: 850 var(--step-4)/0.98 var(--display);
  font-stretch: 125%;
  letter-spacing: -0.025em;
  margin: 0 0 1.5rem;
  max-width: 14ch;
}
.hero .lede { max-width: 34rem; font-size: var(--step-1); line-height: 1.55; margin: 0 0 2rem; color: var(--ink); }
.hero .lede em { font-style: normal; border-bottom: 2px solid var(--brass); }
.wire-start { display: block; width: 680px; max-width: none; height: 96px; margin-top: 2.5rem; overflow: visible; }
@media (max-width: 760px) { .wire-start { width: calc(100vw - 2 * var(--gutter)); } }
.wire-start path { fill: none; stroke: var(--brass); stroke-width: 2; stroke-linecap: round; }
.wire-start circle { fill: var(--paper); stroke: var(--brass); stroke-width: 2; }
@media (prefers-reduced-motion: no-preference) {
  .wire-start path { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: ww-draw 1.6s .2s cubic-bezier(.6,0,.2,1) forwards; }
  @keyframes ww-draw { to { stroke-dashoffset: 0; } }
}

/* ---------- Signup ---------- */
/* The live form is Jetpack's Subscribe block; its inline styles are overridden here. */
.signup { max-width: 30rem; }
.signup .signup-label { margin: 0 0 .5rem; font: 600 .95rem/1.3 var(--display); }
.signup form,
.signup .wp-block-jetpack-subscriptions__form-elements { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0; }
.signup .wp-block-jetpack-subscriptions,
.signup .wp-block-jetpack-subscriptions__container { margin: 0 !important; padding: 0 !important; }
.signup .wp-block-jetpack-subscriptions__form-elements p { margin: 0 !important; padding: 0 !important; }
.signup .wp-block-jetpack-subscriptions__form-elements #subscribe-email { flex: 1 1 14rem; min-width: 0; }
.signup input[type=email] {
  flex: 1 1 14rem; min-width: 0; width: 100% !important; box-sizing: border-box; margin: 0 !important;
  font: 400 1rem/1 var(--body) !important; padding: .8rem .9rem !important;
  border: 1.5px solid var(--ink) !important; border-radius: 3px !important; background: var(--white) !important; color: var(--ink) !important;
}
.signup input[disabled] { background: #E8ECF0 !important; }
.signup .wp-block-jetpack-subscriptions button {
  display: inline-block; width: auto !important; margin: 0 !important;
  font: 650 .95rem/1 var(--display) !important; font-stretch: 110%;
  background: var(--ink) !important; color: var(--white) !important;
  padding: .8rem 1.1rem !important; border: 0 !important; border-radius: 3px !important; cursor: pointer;
}
.signup .wp-block-jetpack-subscriptions button:hover { background: var(--deep) !important; }
.signup--brass .wp-block-jetpack-subscriptions button { background: var(--brass) !important; color: var(--deep) !important; }
.signup--brass .wp-block-jetpack-subscriptions button:hover { background: #D4A846 !important; }
.signup .wp-block-jetpack-subscriptions__subscount { display: none; }
.signup small { display: block; margin-top: .5rem; color: var(--slate); font-size: var(--step--1); }
.signup .admin-note { display: block; margin-top: .5rem; font-size: var(--step--1); background: #FFF6DD; border: 1px dashed var(--brass-ink); padding: .4rem .6rem; color: var(--ink); }
/* Jetpack's "check your inbox" / error notices after submitting. */
.signup .jetpack_subscription_widget, .signup .success, .signup .error { font-size: var(--step--1); }

/* ---------- The log (posts strung on the wire) ---------- */
.log { position: relative; margin: 0 0 4rem; padding: 0 0 0 calc(var(--wire-x) + 2rem); list-style: none; max-width: calc(var(--measure) + 6rem); }
.log::before { content: ""; position: absolute; left: var(--wire-x); top: 0; bottom: 0; width: 2px; background: var(--brass); }
.log::after { /* wire end: a plug */
  content: ""; position: absolute; left: calc(var(--wire-x) - 5px); bottom: -14px; width: 12px; height: 14px;
  background: var(--brass); border-radius: 2px 2px 4px 4px;
}
.entry { position: relative; padding: 0 0 2.75rem; }
.entry::before { /* the tag ring on the wire */
  content: ""; position: absolute; left: calc(-2rem - 7px + 1px); top: .45rem;
  width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--brass);
}
.entry time { font: 600 .9rem/1 var(--display); color: var(--slate); }
.entry h2 { font: 750 var(--step-2)/1.15 var(--display); font-stretch: 108%; letter-spacing: -0.01em; margin: .4rem 0 .5rem; }
.entry h2 a { text-decoration: none; }
.entry h2 a:hover { text-decoration: underline; text-decoration-color: var(--brass); }
.entry p { margin: 0 0 .6rem; max-width: var(--measure); color: #2B3B57; }
.topic { font: 600 .85rem/1 var(--display); display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; }
.topic::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }
.topic-case-notes { color: var(--case); }
.topic-basics { color: var(--basics); }
.topic-pet-tech { color: var(--tech); }
.entry .meta { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.entry--upcoming h2 { color: var(--slate); }
.entry--upcoming::before { border-style: dashed; }

.pagination { margin: -1rem 0 4rem; font-family: var(--display); }
.pagination .nav-links { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.pagination .page-numbers { padding: .4rem .6rem; text-decoration: none; }
.pagination .current { box-shadow: inset 0 -2px 0 var(--brass); }

/* ---------- Two-column home body ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; }
@media (min-width: 1000px) { .home-grid { grid-template-columns: minmax(0, 1fr) 19rem; gap: 4rem; } }
.aside-block { border-top: 2px solid var(--ink); padding-top: 1rem; margin-bottom: 2.5rem; }
.aside-block h2 { font: 750 1.15rem/1.2 var(--display); font-stretch: 112%; margin: 0 0 .75rem; }
.aside-block p, .aside-block li { font-size: 1rem; line-height: 1.6; }
.aside-block ul { padding-left: 1.1rem; margin: 0; }
.aside-block li { margin-bottom: .5rem; }

/* ---------- Navy band ---------- */
.band { background: var(--deep); color: var(--white); padding: clamp(3rem, 6vw, 4.5rem) 0; }
.band h2 { font: 800 var(--step-3)/1.05 var(--display); font-stretch: 120%; margin: 0 0 1rem; max-width: 18ch; }
.band p { max-width: 34rem; color: #C9D3E2; }
.band .signup .signup-label { color: var(--white); }
.band .signup input[type=email] { border-color: var(--white) !important; }
.band .signup small { color: #9FB0C8; }
.band a { color: var(--white); }

/* ---------- Footer ---------- */
.site-footer { background: var(--deep); color: #B7C3D6; border-top: 1px solid #1E2E4D; padding: 2rem 0 3rem; font-size: .95rem; }
.site-footer .wrap { display: grid; gap: 1.25rem; }
@media (min-width: 800px) { .site-footer .wrap { grid-template-columns: 1fr auto; align-items: start; } }
.site-footer a { color: var(--white); }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; font-family: var(--display); }
.disclosure-line { max-width: 44rem; margin: 0; }

/* ---------- Single post ---------- */
.post-head { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: 2rem; }
.post-head .meta { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; font: 500 .95rem/1.4 var(--display); color: var(--slate); margin-bottom: 1rem; }
.post-head h1 { font: 850 var(--step-4)/1.0 var(--display); font-stretch: 118%; letter-spacing: -0.02em; margin: 0 0 1.25rem; max-width: 18ch; overflow-wrap: break-word; }
.post-head .dek { font-size: var(--step-1); line-height: 1.5; max-width: 36rem; margin: 0; }
.post-figure { margin: 0 auto 2.5rem; }
.post-figure img { border-radius: 4px; width: 100%; max-height: 34rem; object-fit: cover; }
.post-figure figcaption { font-size: .85rem; color: var(--slate); margin-top: .5rem; }

.prose { --gap: 2rem; max-width: calc(var(--measure) + var(--wire-x) + var(--gap)); padding-left: calc(var(--wire-x) + var(--gap)); position: relative; }
.prose::before { content: ""; position: absolute; left: var(--wire-x); top: 0; bottom: 0; width: 2px; background: var(--brass); opacity: .45; }
@media (max-width: 640px) {
  .prose { --gap: 1.25rem; }
  .prose, .log { padding-left: calc(var(--wire-x) + 1.25rem); }
  .entry::before { left: calc(-1.25rem - 6px); }
  .case-tag { padding-left: 1.1rem; padding-right: 1.1rem; }
}
.prose h2 { font: 750 var(--step-2)/1.15 var(--display); font-stretch: 110%; margin: 2.5rem 0 .75rem; }
.prose h3 { font: 700 var(--step-1)/1.2 var(--display); font-stretch: 105%; margin: 2rem 0 .5rem; }
.prose p, .prose li { line-height: 1.75; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }
.prose blockquote { margin: 2rem 0; padding-left: 1rem; border-left: 3px solid var(--rule); font-style: italic; }
.prose figure { margin: 2rem 0; }
.prose figcaption { font-size: .85rem; color: var(--slate); margin-top: .5rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: 1rem; }
.prose th, .prose td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose .aff-label { font: 500 .8rem/1 var(--display); color: var(--slate); white-space: nowrap; }

.note-disclosure { font-size: .95rem; line-height: 1.55; color: var(--slate); border-left: 3px solid var(--rule); padding: .25rem 0 .25rem 1rem; margin: 0 0 2rem; }
.note-vet, .is-style-ww-call-vet {
  background: var(--white); border: 1.5px solid var(--ink); border-radius: 4px;
  padding: 1rem 1.25rem; margin: 2rem 0; font-size: 1rem; line-height: 1.6;
}
.note-vet strong, .is-style-ww-call-vet strong { font-family: var(--display); font-stretch: 110%; }

/* the case card: a patient ID tag hung on the wire */
.case-tag {
  position: relative; background: var(--white); border: 1.5px solid var(--ink); border-radius: 8px 8px 36px 36px;
  padding: 2.75rem 1.5rem 1.75rem; margin: 0 0 2.5rem; max-width: 32rem;
}
.case-tag::before { /* the tag hole, threaded on the wire */
  content: ""; position: absolute; top: 1rem; left: 1.25rem; width: 16px; height: 16px; z-index: 1;
  border-radius: 50%; border: 2px solid var(--brass); background: var(--paper);
}
.case-tag::after { /* the wire threads through the hole */
  content: ""; position: absolute; top: calc(1rem + 7px); left: calc(-1 * var(--gap, 2rem) - 1px); width: calc(var(--gap, 2rem) + 1.25rem + 8px); height: 2px; background: var(--brass);
}
.case-tag dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.1rem; margin: 0 0 1.1rem; font-size: 1rem; line-height: 1.5; }
.case-tag dt { font: 650 .95rem/1.5 var(--display); color: var(--slate); }
.case-tag dd { margin: 0; }
.case-tag .composite { margin: 0; padding-top: .9rem; border-top: 1px dashed var(--rule); font-size: .875rem; line-height: 1.5; color: var(--slate); }
.case-tag--bare { padding-top: 2.75rem; }
.case-tag--bare .composite { border-top: 0; padding-top: 0; }
.ww-composite-note { font-size: .875rem; line-height: 1.5; color: var(--slate); margin: 0 0 2rem; }

/* small inline version on the home log */
.case-line { font-size: .95rem; color: var(--slate); margin: 0 0 .6rem; }
.case-line b { font: 650 .95rem/1 var(--display); color: var(--ink); }
.case-line span + span { margin-left: .9rem; }

/* an Amazon product mention: quiet, secondary */
.product, .is-style-ww-product { border: 1px solid var(--rule); border-radius: 4px; padding: 1rem 1.25rem; margin: 2rem 0; background: var(--white); font-size: 1rem; }
.product h3, .is-style-ww-product h3 { font: 700 1.1rem/1.3 var(--display); margin: 0 0 .35rem; }
.product p, .is-style-ww-product p { margin: 0 0 .75rem; line-height: 1.6; }

.callout-emergency, .is-style-ww-emergency { border-left: 4px solid #A3261B; background: #FBEFED; padding: .9rem 1.1rem; margin: 2rem 0; font-size: 1rem; line-height: 1.6; }
.callout-emergency strong, .is-style-ww-emergency strong { font-family: var(--display); }

.is-style-ww-call-vet > :first-child, .is-style-ww-emergency > :first-child, .is-style-ww-product > :first-child,
.wp-block-group__inner-container > :first-child { margin-top: 0; }
.is-style-ww-call-vet > :last-child, .is-style-ww-emergency > :last-child, .is-style-ww-product > :last-child,
.wp-block-group__inner-container > :last-child { margin-bottom: 0; }

.post-end { border-top: 1px solid var(--rule); margin-top: 3rem; padding-top: 2rem; padding-bottom: 4rem; }

/* ---------- Plain pages ---------- */
.page-head { padding-top: clamp(2.5rem, 6vw, 4rem); padding-bottom: 1.5rem; }
.page-head h1 { font: 850 var(--step-3)/1.05 var(--display); font-stretch: 120%; margin: 0; }
.page-head .archive-description { max-width: 36rem; color: var(--slate); margin-top: .75rem; }
.page-head .archive-description p { margin: 0; }
.page-body { max-width: var(--measure); padding-bottom: 4rem; }
.page-body h2 { font: 750 var(--step-1)/1.2 var(--display); font-stretch: 110%; margin: 2rem 0 .5rem; }
.page-body table { border-collapse: collapse; width: 100%; font-size: 1rem; margin: 1rem 0; }
.page-body th, .page-body td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.page-body th { font: 650 .95rem/1.3 var(--display); }

/* ---------- Core alignment helpers ---------- */
.alignleft { float: left; margin: .3rem 1.5rem 1rem 0; }
.alignright { float: right; margin: .3rem 0 1rem 1.5rem; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text, .wp-element-caption { font-size: .85rem; color: var(--slate); }
