/*
Theme Name: Thyrowell
Theme URI: https://blog.thyrowellapp.com/
Author: Thyrowell
Description: The Thyrowell blog. Indigo & Saffron, Newsreader headings, Manrope body. Same structure as the Medhya blog, no page builder. Pair with the Thyrowell Blog mu-plugin.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: Proprietary
Text Domain: thyrowell
*/

:root {
  --tw-bg: #FAF6EE;
  --tw-surface: #FFFFFF;
  --tw-quiet: #F1ECE1;
  --tw-ink: #1E1B3A;
  --tw-body: #3A3654;
  --tw-soft: #5E5A72;
  --tw-primary: #2E2F7A;
  --tw-primary-pressed: #23246A;
  --tw-selected: #ECEBF8;
  --tw-accent: #E2A23B;
  --tw-accent-soft: #FBF0DC;
  --tw-line: #E4DCCB;
  --tw-line-soft: #EEE7DA;
  --tw-shadow: 0 6px 20px rgba(30, 27, 58, 0.06);
  --tw-radius: 20px;
  --tw-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --tw-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tw-wrap: 1120px;
  --tw-narrow: 720px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--tw-bg);
  color: var(--tw-body);
  font: 400 17px/1.65 var(--tw-sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--tw-primary); text-underline-offset: 3px; }
a:hover { color: var(--tw-primary-pressed); }
:focus-visible { outline: 3px solid var(--tw-accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--tw-serif); color: var(--tw-ink); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
em { font-style: italic; }
h1 em, h2 em { color: var(--tw-primary); }

.screen-reader-text, .tw-skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tw-skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--tw-surface); padding: 8px 14px; }

.tw-wrap { max-width: var(--tw-wrap); margin: 0 auto; padding: 0 16px; }
.tw-wrap--narrow { max-width: var(--tw-narrow); }
@media (min-width: 720px) { .tw-wrap { padding: 0 24px; } }

/* Buttons */
.tw-btn {
  display: inline-block; background: var(--tw-primary); color: #fff; text-decoration: none;
  font: 600 16px/1 var(--tw-sans); padding: 15px 26px; border-radius: 999px; transition: background .15s;
}
.tw-btn:hover { background: var(--tw-primary-pressed); color: #fff; }
.tw-btn--small { font-size: 14px; padding: 11px 18px; }
.tw-btn--saffron { background: var(--tw-accent); color: var(--tw-ink); }
.tw-btn--saffron:hover { background: #D39230; color: var(--tw-ink); }

.tw-eyebrow { font: 700 12px/1.4 var(--tw-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--tw-primary); margin: 0 0 12px; }
.tw-eyebrow--light { color: var(--tw-accent); }
.tw-kicker { display: inline-block; font: 700 12px/1.4 var(--tw-sans); letter-spacing: .08em; text-transform: uppercase; color: #9A6514; text-decoration: none; }

/* Header */
.tw-header { background: var(--tw-bg); border-bottom: 1px solid var(--tw-line); position: sticky; top: 0; z-index: 20; }
.admin-bar .tw-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tw-header { top: 0; position: relative; } }
.tw-header__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.tw-header__brand { display: flex; align-items: center; gap: 10px; }
.tw-header__tag { font: 600 13px/1 var(--tw-sans); color: var(--tw-soft); text-decoration: none; padding: 6px 10px; border: 1px solid var(--tw-line); border-radius: 999px; }
.tw-logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.tw-logo__mark { width: 30px; height: 30px; flex: none; }
.tw-logo__word { font: 600 22px/1 var(--tw-serif); color: var(--tw-primary); letter-spacing: -0.01em; }
.tw-logo__word span { color: var(--tw-accent); }

.tw-pills { border-top: 1px solid var(--tw-line-soft); }
.tw-pills__row { display: flex; gap: 8px; overflow-x: auto; padding-top: 10px; padding-bottom: 10px; scrollbar-width: none; }
.tw-pills__row::-webkit-scrollbar { display: none; }
.tw-pill {
  flex: none; font: 600 14px/1 var(--tw-sans); color: var(--tw-body); text-decoration: none;
  padding: 9px 14px; border-radius: 999px; background: var(--tw-surface); border: 1px solid var(--tw-line);
}
.tw-pill:hover, .tw-pill.is-active { background: var(--tw-selected); border-color: #CFCDEE; color: var(--tw-primary); }

/* Hero */
.tw-hero { padding: 48px 0 40px; }
.tw-hero__grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .tw-hero { padding: 72px 0 56px; } .tw-hero__grid { grid-template-columns: 1.25fr 1fr; gap: 56px; } }
.tw-hero__title { font-size: clamp(36px, 6vw, 58px); margin: 0 0 18px; }
.tw-hero__lead { font-size: 19px; max-width: 34em; margin: 0 0 26px; }
.tw-hero__small { font-size: 14px; color: var(--tw-soft); margin: 12px 0 0; }

.tw-start { background: var(--tw-surface); border: 1px solid var(--tw-line); border-radius: var(--tw-radius); padding: 22px; box-shadow: var(--tw-shadow); }
.tw-start__head { font: 700 13px/1.4 var(--tw-sans); color: var(--tw-soft); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .08em; }
.tw-start__list { list-style: none; margin: 0; padding: 0; }
.tw-start__list li + li { border-top: 1px solid var(--tw-line-soft); }
.tw-start__list a { display: flex; gap: 14px; padding: 14px 0; text-decoration: none; }
.tw-start__num { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--tw-accent-soft); color: #9A6514; font: 700 14px/32px var(--tw-sans); text-align: center; }
.tw-start__title { display: block; font: 500 19px/1.3 var(--tw-serif); color: var(--tw-ink); }
.tw-start__sub { display: block; font-size: 14px; color: var(--tw-soft); margin-top: 2px; }
.tw-start__list a:hover .tw-start__title { color: var(--tw-primary); }

/* Sections */
.tw-section { padding: 48px 0; }
.tw-section--tight { padding-top: 16px; }
.tw-section--quiet { background: var(--tw-quiet); }
.tw-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.tw-section__head .tw-h2 { margin: 0; }
.tw-section__lead { color: var(--tw-soft); max-width: 40em; margin: 0 0 24px; }
.tw-h1 { font-size: clamp(32px, 5vw, 48px); margin: 0 0 12px; }
.tw-h2 { font-size: clamp(26px, 3.6vw, 36px); margin: 0 0 8px; }
.tw-more { font: 600 15px/1 var(--tw-sans); text-decoration: none; }

.tw-topics { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tw-topics { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .tw-topics { grid-template-columns: repeat(3, 1fr); } }
.tw-topic {
  position: relative; display: block; text-decoration: none; background: var(--tw-surface);
  border: 1px solid var(--tw-line); border-radius: var(--tw-radius); padding: 20px 48px 20px 20px; transition: border-color .15s, box-shadow .15s;
}
.tw-topic:hover { border-color: var(--tw-primary); box-shadow: var(--tw-shadow); }
.tw-topic__name { display: block; font: 500 21px/1.25 var(--tw-serif); color: var(--tw-ink); margin-bottom: 4px; }
.tw-topic__desc { display: block; font-size: 15px; color: var(--tw-soft); line-height: 1.5; }
.tw-topic__arrow { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--tw-accent); font-size: 20px; }

/* Cards */
.tw-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tw-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .tw-grid { grid-template-columns: repeat(3, 1fr); } }
.tw-card { background: var(--tw-surface); border: 1px solid var(--tw-line); border-radius: var(--tw-radius); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.tw-card:hover { box-shadow: var(--tw-shadow); transform: translateY(-2px); }
.tw-card__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.tw-card__img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.tw-card__body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.tw-card__title { font: 500 21px/1.28 var(--tw-serif); color: var(--tw-ink); }
.tw-card__excerpt { font-size: 15px; color: var(--tw-soft); line-height: 1.55; }
.tw-card__meta { margin-top: auto; font-size: 13px; color: var(--tw-soft); }

/* App band */
.tw-band { background: var(--tw-primary); color: #E8E7F6; padding: 56px 0; }
.tw-band__inner { display: grid; gap: 28px; }
@media (min-width: 900px) { .tw-band__inner { grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; } }
.tw-band__title { color: #fff; font-size: clamp(28px, 4vw, 40px); margin: 0 0 14px; }
.tw-band__title em { color: var(--tw-accent); }
.tw-band__list { list-style: none; padding: 0; margin: 0 0 24px; }
.tw-band__list li { padding: 10px 0 10px 30px; position: relative; border-bottom: 1px solid rgba(255,255,255,.12); }
.tw-band__list li::before { content: ""; position: absolute; left: 4px; top: 18px; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--tw-accent); }
.tw-band__small { font-size: 13px; color: #B9B8DA; margin: 12px 0 0; }

/* Lists / search */
.tw-listhead { padding: 44px 0 20px; }
.tw-search { display: flex; gap: 8px; max-width: 560px; margin-top: 8px; }
.tw-search input { flex: 1; min-width: 0; font: 400 16px var(--tw-sans); padding: 13px 16px; border: 1px solid var(--tw-line); border-radius: 999px; background: var(--tw-surface); color: var(--tw-ink); }
.tw-search button { font: 600 15px var(--tw-sans); padding: 0 20px; border: 0; border-radius: 999px; background: var(--tw-primary); color: #fff; cursor: pointer; }
.tw-paging { margin-top: 32px; display: flex; gap: 8px; flex-wrap: wrap; }
.tw-paging .page-numbers { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--tw-line); background: var(--tw-surface); text-decoration: none; }
.tw-paging .current { background: var(--tw-primary); color: #fff; border-color: var(--tw-primary); }
.tw-empty { color: var(--tw-soft); }

/* Post */
.tw-post__head { padding-top: 40px; }
.tw-post__title { font-size: clamp(34px, 5.4vw, 50px); margin: 10px 0 16px; }
.tw-byline { font-size: 14px; color: var(--tw-soft); margin: 0 0 28px; }
.tw-byline a { color: var(--tw-soft); }
.tw-post__hero { margin: 0 auto 32px; max-width: 960px; }
.tw-post__hero img { border-radius: var(--tw-radius); width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }

.tw-content { font-size: 18px; line-height: 1.72; padding-bottom: 32px; }
.tw-content > * { margin-top: 0; margin-bottom: 1.1em; }
.tw-content h2 { font-size: 30px; margin: 1.8em 0 .5em; scroll-margin-top: 130px; }
.tw-content h3 { font-size: 23px; margin: 1.5em 0 .4em; }
.tw-content ul, .tw-content ol { padding-left: 1.3em; }
.tw-content li { margin-bottom: .4em; }
.tw-content li::marker { color: var(--tw-accent); }
.tw-content strong { color: var(--tw-ink); }
.tw-content blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--tw-accent); font: italic 21px/1.5 var(--tw-serif); color: var(--tw-ink); }
.tw-content table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--tw-surface); border-radius: 12px; overflow: hidden; display: block; overflow-x: auto; }
.tw-content th, .tw-content td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--tw-line-soft); vertical-align: top; }
.tw-content th { background: var(--tw-selected); color: var(--tw-ink); font-weight: 700; }
.tw-content img { border-radius: 14px; }

/* Blocks the blog engine writes (blog-engine/src/render.ts) */
.tw-answer { background: var(--tw-selected); border-radius: var(--tw-radius); padding: 18px 22px; border-left: 4px solid var(--tw-primary); }
.tw-answer p { margin: 0; color: var(--tw-ink); }
.tw-takeaways, .tw-clinician { background: var(--tw-surface); border: 1px solid var(--tw-line); border-radius: var(--tw-radius); padding: 6px 22px 10px; }
.tw-takeaways h2, .tw-clinician h2 { font-size: 22px; margin: 16px 0 8px; }
.tw-clinician { border-color: #F0CFA0; background: #FFFBF3; }
.tw-cta { background: var(--tw-primary); color: #E8E7F6; border-radius: var(--tw-radius); padding: 22px 24px; margin: 2em 0; }
.tw-cta p { margin: 0 0 12px; }
.tw-cta__title { font: 500 23px/1.3 var(--tw-serif); color: #fff; }
.tw-cta__button { display: inline-block; background: var(--tw-accent); color: var(--tw-ink) !important; text-decoration: none; font: 600 15px/1 var(--tw-sans); padding: 13px 22px; border-radius: 999px; }
.tw-sources { border-top: 1px solid var(--tw-line); margin-top: 2.4em; padding-top: 8px; font-size: 15px; }
.tw-sources h2 { font-size: 22px; }
.tw-sources a { word-break: break-word; }
.tw-disclaimer { font-size: 14px; color: var(--tw-soft); }

.tw-author { display: flex; gap: 16px; align-items: flex-start; background: var(--tw-surface); border: 1px solid var(--tw-line); border-radius: var(--tw-radius); padding: 20px; margin: 8px 0 48px; }
.tw-author__photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; }
.tw-author__name { font: 500 20px/1.3 var(--tw-serif); color: var(--tw-ink); margin: 0 0 6px; }
.tw-author__name span { font: 400 15px var(--tw-sans); color: var(--tw-soft); }
.tw-author__bio { font-size: 15px; margin: 0 0 8px; }
.tw-author__links { font-size: 14px; margin: 0; }

/* Newsletter + footer */
.tw-email { background: var(--tw-surface); border: 1px solid var(--tw-line); border-radius: var(--tw-radius); padding: 24px; margin-bottom: 40px; text-align: center; }
.tw-email__line { font: 500 24px/1.3 var(--tw-serif); color: var(--tw-ink); margin: 0 0 14px; }
.tw-email__frame { width: 100%; max-width: 480px; border: 0; background: transparent; display: block; margin: 0 auto; }
.tw-email__small { font-size: 13px; color: var(--tw-soft); margin: 8px 0 0; }
.tw-footer { background: var(--tw-quiet); padding: 48px 0 32px; border-top: 1px solid var(--tw-line); font-size: 15px; }
.tw-footer__grid { display: grid; gap: 32px; margin-bottom: 32px; }
@media (min-width: 800px) { .tw-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.tw-footer__about { color: var(--tw-soft); max-width: 30em; }
.tw-footer__head { font: 700 13px/1 var(--tw-sans); text-transform: uppercase; letter-spacing: .08em; color: var(--tw-ink); margin: 6px 0 14px; }
.tw-footer ul { list-style: none; padding: 0; margin: 0; }
.tw-footer li { margin-bottom: 8px; }
.tw-footer nav a { color: var(--tw-body); text-decoration: none; }
.tw-footer nav a:hover { color: var(--tw-primary); text-decoration: underline; }
.tw-footer__legal { font-size: 13px; color: var(--tw-soft); margin: 0 0 8px; max-width: 60em; }

/* WordPress core bits */
.alignwide { max-width: 960px; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.wp-block-image figcaption, .wp-caption-text { font-size: 14px; color: var(--tw-soft); }
.search-form { display: flex; gap: 8px; margin: 16px 0 24px; }
.search-form .search-field { flex: 1; padding: 12px 16px; border: 1px solid var(--tw-line); border-radius: 999px; font: 16px var(--tw-sans); }
.search-form .search-submit { padding: 0 18px; border: 0; border-radius: 999px; background: var(--tw-primary); color: #fff; font: 600 15px var(--tw-sans); }
