/*
Theme Name: Calyxa Editorial
Description: A native WordPress theme for Calyxa Health.
Version: 1.1.2
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: calyxa-editorial
License: GNU General Public License v2 or later
*/

@font-face {
	font-family: "Instrument Serif";
	src: url("assets/instrument-serif.woff2") format("woff2");
	font-display: swap;
}
@font-face {
	font-family: "Instrument Serif";
	src: url("assets/instrument-serif-italic.woff2") format("woff2");
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: "DM Sans";
	src: url("assets/dm-sans.woff2") format("woff2");
	font-weight: 400 700;
	font-display: swap;
}

:root {
	--paper: #fffaf6;
	--ink: #281d24;
	--muted: #624f59;
	--plum: #713b58;
	--wine: #412237;
	--blush: #f4e1e3;
	--line: #dfd0d0;
	--display: "Instrument Serif", Georgia, serif;
	--body: "DM Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 1rem/1.6 var(--body);
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--plum); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .13em; }
:focus-visible { outline: 3px solid #99547a; outline-offset: 4px; }
h1, h2, h3 {
	margin: 0;
	color: inherit;
	font-family: var(--display);
	font-weight: 400;
	line-height: 1.05;
}
h1 { font-size: clamp(3.1rem, 7vw, 6rem); letter-spacing: -.025em; }
h2 { font-size: clamp(2.6rem, 5vw, 3.8rem); letter-spacing: -.02em; }
h3 { font-size: 2rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1200px, calc(100% - 5rem)); margin-inline: auto; }
.skip-link {
	position: absolute;
	top: .5rem;
	left: .5rem;
	z-index: 10;
	padding: .6rem 1rem;
	background: var(--wine);
	color: white;
	transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner {
	min-height: 84px;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 1.5rem;
}
.wordmark {
	width: max-content;
	color: inherit;
	font: 2.35rem/.95 var(--display);
	letter-spacing: -.035em;
	text-decoration: none;
	white-space: nowrap;
}
.wordmark span, .wordmark i { color: var(--plum); }
.menu { display: flex; flex-wrap: wrap; gap: 1.8rem; list-style: none; margin: 0; padding: 0; }
.menu a, .search-link { color: inherit; font-size: .9rem; font-weight: 600; text-decoration: none; }
.menu a:hover, .menu a[aria-current], .search-link:hover { text-decoration: underline; }
.search-link { justify-self: end; display: inline-flex; gap: .7rem; align-items: center; }
.search-icon { display: inline-block; width: .82rem; height: .82rem; border: 1.5px solid currentColor; border-radius: 50%; position: relative; }
.search-icon::after { content: ""; position: absolute; width: .35rem; height: 1.5px; background: currentColor; top: .6rem; left: .58rem; transform: rotate(45deg); }
.mobile-nav { display: none; }
.hero {
	display: grid;
	grid-template-columns: 1.06fr .94fr;
	gap: clamp(2rem, 5vw, 5rem);
	align-items: stretch;
	padding-block: clamp(2.4rem, 6vw, 5rem);
}
.hero-copy { align-self: center; padding-block: 1.4rem; }
.eyebrow {
	margin-bottom: 1.3rem;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .15em;
	text-transform: uppercase;
}
.hero-copy .eyebrow { color: var(--plum); display: flex; align-items: center; gap: .7rem; }
.hero-copy .eyebrow span { width: .55rem; height: .55rem; background: var(--plum); border-radius: 50%; }
.hero h1 { font-size: clamp(3.35rem, 7.5vw, 6.9rem); line-height: .91; }
.hero h1 em { color: var(--plum); font-weight: inherit; }
.hero-description { max-width: 30rem; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.18rem); margin: 1.65rem 0 1.9rem; }
.button {
	display: inline-flex;
	align-items: center;
	gap: 1.4rem;
	min-height: 46px;
	padding: .65rem 1.15rem;
	border: 1px solid var(--wine);
	border-radius: 4px;
	background: var(--wine);
	color: #fffaf6;
	font: 650 .9rem var(--body);
	text-decoration: none;
	cursor: pointer;
}
.button:hover { background: var(--plum); }
.featured {
	display: grid;
	grid-template-rows: minmax(230px, 1fr) auto;
	background: var(--wine);
	color: #fff8f5;
	overflow: hidden;
	border-radius: 6px;
	position: relative;
}
.featured a { color: inherit; text-decoration: none; }
.featured a:hover { text-decoration: underline; }
/* Keep editorial titles legible when a plugin adds global link colors. */
body .home-content .featured h2 a,
body .home-content .featured h2 a:visited,
body .home-content .featured h2 a:hover,
body .home-content .featured h2 a:focus-visible { color: #fff8f5; }
body .home-content .article-card :is(h2, h3) a,
body .home-content .article-card :is(h2, h3) a:visited,
body .home-content .topic-card h3 a { color: var(--ink); }
body .site-footer a.wordmark,
body .site-footer a.wordmark:visited,
body .site-footer a.wordmark:hover { color: #fff7f6; }
.featured a::after { content: ""; position: absolute; inset: 0; }
.featured a:focus-visible { outline-color: #f9d5e0; }
.featured-copy { padding: 1.3rem clamp(1.25rem, 3vw, 2rem) 1.5rem; }
.featured-copy .eyebrow { color: #f4cbd9; margin-bottom: .6rem; }
.featured h2 { font-size: clamp(2rem, 3.7vw, 3.05rem); max-width: 18ch; }
.feature-link { margin: .9rem 0 0; font-size: .83rem; font-weight: 650; }
.feature-link span { margin-left: .35rem; }
.botanical {
	background: #ecd0d8;
	isolation: isolate;
	position: relative;
	overflow: hidden;
}
.botanical::before {
	content: "";
	position: absolute;
	inset: 8% auto auto 50%;
	width: 205px;
	aspect-ratio: 1;
	transform: translateX(-50%);
	border: 1px solid #a7617d;
	border-radius: 50%;
}
.botanical span {
	--angle: 0deg;
	position: absolute;
	width: 25%;
	height: 57%;
	left: 50%;
	top: 54%;
	transform-origin: 0 0;
	transform: rotate(var(--angle));
	border: 1px solid #884865;
	border-radius: 15% 75% 18% 75%;
	background: #cb8fa9;
}
.botanical span:nth-child(2) { --angle: 72deg; background: #b46f8e; }
.botanical span:nth-child(3) { --angle: 144deg; background: #eed5dc; }
.botanical span:nth-child(4) { --angle: 216deg; background: #a7607f; }
.botanical span:nth-child(5) { --angle: 288deg; background: #dba8bc; }
.article-section, .topic-section { padding: 2.6rem 0 3.2rem; border-top: 1px solid var(--line); }
.section-heading { margin-bottom: 1.35rem; }
.article-grid, .topic-grid { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.article-card {
	min-width: 0;
	padding: clamp(1.15rem, 2.5vw, 1.8rem);
	background: #fffdfb;
	border: 1px solid var(--line);
	border-radius: 5px;
}
.article-card h3, .article-card h2 { margin: .4rem 0 .7rem; font-size: clamp(1.85rem, 3vw, 2.5rem); }
.article-card h3 a, .article-card h2 a, .topic-card a { color: inherit; text-decoration: none; }
.article-card a:hover, .topic-card a:hover { text-decoration: underline; }
.article-card time { font-size: .78rem; font-weight: 650; color: var(--plum); }
.article-card p, .topic-card p { margin-bottom: 0; color: var(--muted); }
.card-image { margin: 0 0 1rem; }
.card-image img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 3px; }
.topic-card { padding: 1.45rem; border-radius: 5px; background: var(--blush); }
.topic-card:nth-child(2) { background: #e7ebdf; }
.topic-card:nth-child(3) { background: #f1e5da; }
.topic-card h3 { margin-bottom: .55rem; }
.topic-card h3 span { font: 1rem var(--body); }
.newsletter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: clamp(1.35rem, 4vw, 2.8rem); background: #f4e9df; border-radius: 5px; }
.newsletter h2 { font-size: clamp(2.2rem, 4.1vw, 3.4rem); }
.newsletter p { margin: .55rem 0 0; color: var(--muted); }
.site-footer { margin-top: 2rem; padding: 3rem 0 1.8rem; color: #fff7f6; background: var(--wine); }
.site-footer .wordmark :is(i, span) { color: #f3cbdc; }
.site-footer :focus-visible { outline-color: #f3cbdc; }
.footer-inner { display: flex; justify-content: space-between; align-items: start; gap: 2rem; flex-wrap: wrap; }
.footer-inner p, .footer-note { font-size: .87rem; color: #f2dfe6; }
.footer-inner p { margin: .65rem 0 0; }
.footer-note { margin: 1.6rem 0 0; padding-top: 1rem; border-top: 1px solid #8c687d; }
.story, .listing { padding: clamp(2.5rem, 6vw, 5rem) 0 3rem; }
.story-header { margin: 0 auto 2.2rem; max-width: 52rem; }
.story-header h1 { font-size: clamp(3rem, 6.9vw, 5.65rem); }
.story-header > p:not(.eyebrow), .archive-description { margin-top: 1rem; color: var(--muted); }
.story-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin-top: 1.3rem; color: var(--muted); font-size: .92rem; }

.story-image { max-width: 58rem; margin: 0 auto 2rem; }
.story-image img { border-radius: 5px; }
.prose { max-width: 43rem; margin-inline: auto; font-size: 1.12rem; line-height: 1.75; overflow-wrap: anywhere; }
.prose :is(h2, h3, h4) { margin: 1.25em 0 .5em; line-height: 1.13; }
.prose h2 { font-size: clamp(2.15rem, 4vw, 3.15rem); }
.prose h3 { font-size: clamp(1.65rem, 3vw, 2.15rem); }
.prose blockquote { border-inline-start: 3px solid var(--plum); margin-inline: 0; padding-inline: 1rem; }
.prose figure { max-width: 100%; margin-inline: 0; }
.prose table { width: 100%; border-collapse: collapse; }
.prose :is(td, th) { border: 1px solid var(--line); padding: .55rem; text-align: start; }
.prose :is(.wp-block-table, .tablepress-scroll-wrapper) { overflow-x: auto; }
.prose iframe { max-width: 100%; }
.medical-note, .author-bio { background: var(--blush); margin-top: 2rem; padding: 1.2rem; border-radius: 4px; font-size: .92rem; }
.author-bio h2 { font-size: 1.8rem; margin-top: 0; }
.story-comments { margin-bottom: 3rem; }
.search-form { max-width: 32rem; margin-top: 1.5rem; }
.search-form > div { display: flex; gap: .5rem; margin-top: .4rem; }
.search-form input { width: 100%; min-width: 0; border: 1px solid var(--muted); border-radius: 4px; padding: .5rem .8rem; font: inherit; }
.pagination { margin-top: 1.5rem; }
.pagination .page-numbers { margin-right: .6rem; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 850px) {
	.wrap { width: calc(100% - 3rem); }
	.hero { gap: 1.5rem; }
	.article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
	.wrap { width: calc(100% - 2rem); }
	.masthead-inner { min-height: 64px; grid-template-columns: 1fr auto; }
	.primary { display: none; }
	.wordmark { font-size: 2.05rem; }
	.mobile-nav { display: block; width: calc(100% - 2rem); margin-inline: auto; padding-bottom: .65rem; }
	.mobile-nav summary { cursor: pointer; width: max-content; min-height: 30px; font-size: .88rem; font-weight: 650; }
	.mobile-nav .menu { flex-direction: column; gap: 0; }
	.mobile-nav a { display: inline-flex; align-items: center; min-height: 44px; }
	.hero { grid-template-columns: 1fr; }
	.hero-copy { padding: 0; }
	.featured { grid-template-rows: minmax(180px, 1fr) auto; }
	.article-grid, .topic-grid { grid-template-columns: 1fr; }
	.footer-inner .menu { gap: .75rem 1.1rem; }
	.prose { font-size: 1.04rem; }
}

.article-bylines {
	display: flex;
	flex: 0 0 100%;
	flex-wrap: wrap;
	gap: .8rem 1.4rem;
	list-style: none;
	margin: 0 0 .2rem;
	padding: 0;
}
.article-bylines li, .author-bio {
	display: flex;
	align-items: center;
	gap: .75rem;
}
.article-bylines li > div {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .15rem .65rem;
}
.byline-name { font-weight: 700; }
.author-portrait {
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 50%;
	background: var(--blush);
	color: var(--wine);
	font-weight: 700;
}
.author-portrait img { width: 100%; height: 100%; object-fit: cover; }
.author-bio {
	align-items: flex-start;
	gap: clamp(.75rem, 3vw, 1.25rem);
	padding: clamp(1rem, 4vw, 1.5rem);
	scroll-margin-top: 2rem;
}
.author-bio .author-portrait {
	width: clamp(48px, 12vw, 72px);
	background: var(--paper);
}
.author-bio > div { min-width: 0; }
.author-links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }

body .home-content a.button,
body .home-content a.button:visited,
body .home-content a.button:hover,
body .home-content a.button:focus-visible,
body .search-form button.button,
body .wpforms-container button.wpforms-submit {
	background: var(--wine);
	color: var(--paper);
}
body .home-content a.button:hover,
body .search-form button.button:hover,
body .wpforms-container button.wpforms-submit:hover { background: var(--plum); }
.primary .menu a { display: inline-flex; padding: .55rem .2rem; }
.primary .menu a:hover, .primary .menu a[aria-current] { color: var(--plum); }
.masthead .search-link {
	padding: .45rem .8rem;
	border: 1px solid var(--line);
	border-radius: 999px;
}
.author-profile-button {
	display: inline-block;
	padding: .15rem .6rem;
	border: 1px solid var(--plum);
	border-radius: 999px;
	color: var(--wine);
	font-size: .82rem;
	text-decoration: none;
}
.author-profile-button:hover { background: var(--wine); color: var(--paper); }
.article-layout { max-width: 67rem; margin-inline: auto; }
.article-layout .prose { width: 100%; min-width: 0; }
.article-layout .medical-note {
	margin: 0 0 1.6rem;
	padding: .75rem 1rem;
	border-inline-start: 2px solid var(--plum);
	background: transparent;
	color: var(--muted);
}
.article-contents {
	max-width: 43rem;
	margin: 0 auto 1.3rem;
	padding: .7rem 1rem;
	border: 1px solid var(--line);
	border-radius: 5px;
	background: var(--paper);
}
.article-contents summary, .article-disclosure summary { cursor: pointer; font-weight: 700; }
.article-contents ul { list-style: none; padding: 0; margin: .45rem 0 0; }
.article-contents a { display: block; padding: .24rem 0; }
.article-content :is(h2, h3) { scroll-margin-top: 4rem; }
.article-disclosure {
	margin: .65rem 0;
	padding: .7rem 1rem;
	border: 1px solid var(--line);
	border-radius: 5px;
}
.article-disclosure[open] summary { margin-bottom: .65rem; }
.article-disclosure > :last-child { margin-bottom: 0; }
@media (min-width: 1080px) {
	.article-layout:has(.article-contents:not([hidden])) {
		display: grid;
		grid-template-columns: 13rem minmax(0, 43rem);
		gap: 2rem;
		justify-content: center;
	}
	.article-contents {
		position: sticky;
		top: 3rem;
		max-height: calc(100vh - 6rem);
		overflow-y: auto;
		align-self: start;
		width: 100%;
		font-size: .88rem;
	}
}

/* Editorial refinement: scoped against inherited builder typography. */
body.home, body.page, body.single-post, body.archive, body.search { background: var(--paper); color: var(--ink); }
body .home-content section :is(h2,h3) { color: var(--ink); }
body { background: var(--paper); color: var(--ink); }
body :is(h1,h2,h3,h4) { color: var(--ink); }
body .masthead { background: var(--paper); border-top: 5px solid var(--wine); }
body .masthead .wordmark { color: var(--wine); text-decoration: none; }
.masthead-inner { min-height: 104px; }
.journal-nav { display: flex; align-items: center; gap: 2rem; min-height: 47px; border-top: 1px solid var(--line); }
body .journal-nav a { color: var(--ink); font-size: .78rem; font-weight: 600; text-decoration: none; padding-block: .7rem; }
.journal-nav a:hover { text-decoration: underline; }
.journal-nav > span { margin-left: auto; font-size: .7rem; color: var(--muted); }
body .home-content .hero { grid-template-columns: 1.1fr 1fr; gap: clamp(2rem,5vw,4.5rem); padding-block: 4rem; }
body .home-content .hero h1 { color: var(--ink); font-size: clamp(3.4rem,6.5vw,6.1rem); line-height: .98; letter-spacing: -.035em; }
body .hero h1 em { color: var(--plum); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.6rem; }
body a.text-link { color: var(--wine); font-size: .84rem; font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--plum); padding-bottom: .25rem; }
body a.text-link:hover { color: var(--plum); }
body .button { border-radius: 2px; padding: .8rem 1.2rem; min-height: 48px; }
body .home-content .featured { border-radius: 160px 160px 3px 3px; grid-template-rows: minmax(190px,1fr) auto; box-shadow: 0 14px 35px -25px #41223780; }
body .featured-copy { padding: 1.8rem 2rem; }
body .featured h2 { color: #fff8f5; font-size: clamp(2rem,3vw,2.8rem); line-height: 1.08; }
.feature-summary { margin: .9rem 0 0; font-size: .86rem; line-height: 1.6; color: #f2dfe6; }
body .featured .feature-link { color: #fff8f5; border-top: 1px solid #856475; padding-top: .8rem; margin-top: 1.2rem; }
body .botanical { background: #edd7de; }
body .botanical::before { width: 235px; top: 9%; }
body .home-content .section-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2rem; }
.section-heading .eyebrow { margin-bottom: .8rem; color: var(--plum); }
body .section-heading h2 { font-size: clamp(2.5rem,4vw,3.8rem); }
.section-heading h2 em { color: var(--plum); }
.section-heading > p { max-width: 19rem; font-size: .9rem; color: var(--muted); margin-bottom: .2rem; }
body .topic-section { padding-block: 3rem 4rem; }
.topic-grid { counter-reset: topic; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
body .topic-card { position: relative; border-radius: 0; background: transparent; padding: 2rem 1.8rem; }
.topic-card + .topic-card { border-left: 1px solid var(--line); }
.topic-card::before { counter-increment: topic; content: '0' counter(topic); display: block; color: var(--plum); font: italic 1.6rem var(--display); margin-bottom: 1.6rem; }
body .topic-card h3 { font-size: 2.1rem; line-height: 1.12; }
body .topic-card p { font-size: .9rem; line-height: 1.65; }
.editorial-note { display: grid; grid-template-columns: 1.2fr 1fr; gap: 4rem; align-items: center; padding: 3rem; margin-bottom: 4rem; background: #f2e6e2; border-radius: 3px; }
.editorial-note .eyebrow { color: var(--plum); }
body .editorial-note h2 { font-size: clamp(2.3rem,3.7vw,3.5rem); }
.editorial-note h2 em { color: var(--plum); }
.editorial-note > div > p:not(.eyebrow) { font-size: 1rem; color: var(--muted); }
body .newsletter { background: transparent; border: 1px solid var(--line); border-radius: 3px; margin-bottom: 3rem; }
body .article-card { border-radius: 0; border: 0; border-top: 2px solid var(--wine); padding: 1.5rem 0; background: transparent; }
.article-grid { column-gap: 2.5rem; }
body .story-header { padding-bottom: 2.2rem; border-bottom: 1px solid var(--line); }
body .story .story-header h1 { color: var(--wine); font-size: clamp(3rem,6vw,5rem); line-height: 1.04; }
body .story { padding-top: 4rem; }
body .prose { line-height: 1.85; }
body .prose :is(h2,h3) { color: var(--wine); }
body .article-contents { background: #f4ebe7; border: none; border-top: 2px solid var(--plum); border-radius: 0; padding: 1.2rem; }
body .article-disclosure { border-width: 1px 0; border-radius: 0; padding: 1rem 0; }
body .author-bio { border-radius: 3px; border-top: 2px solid var(--plum); }
body .site-footer { padding-block: 4rem 2rem; }
body .site-footer .wordmark { font-size: 3.2rem; }
body .site-footer h2 { color: #fff8f5; }
@media (max-width: 850px) {
  .journal-nav { gap: 1.4rem; }
  .journal-nav > span { display: none; }
  body .home-content .hero { gap: 2rem; }
  body .featured-copy { padding: 1.5rem; }
  .editorial-note { gap: 2rem; padding: 2rem; }
}
@media (max-width: 650px) {
  .masthead-inner { min-height: 76px; }
  .journal-nav { min-height: 43px; gap: 1.4rem; }
  body .journal-nav a { font-size: .73rem; }
  body .home-content .hero { grid-template-columns: 1fr; padding-block: 2.5rem; gap: 2.5rem; }
  body .hero h1 { font-size: clamp(3.35rem,12vw,4.8rem); }
  .hero-actions { gap: 1rem; }
  body .home-content .featured { border-radius: 120px 120px 3px 3px; grid-template-rows: 210px auto; }
  body .home-content .section-heading { display: block; }
  .section-heading > p { margin-top: 1rem; }
  body .topic-card { padding: 1.7rem 0; }
  .topic-card + .topic-card { border-left: 0; border-top: 1px solid var(--line); }
  .topic-card::before { margin-bottom: .7rem; }
  .editorial-note { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.6rem; margin-bottom: 2.5rem; }
  body .story { padding-top: 2.5rem; }
  body .site-footer .wordmark { font-size: 2.7rem; }
}
