/*
Theme Name: Storytelling Business Editorial
Theme URI: https://storytelling.business/
Author: OpenAI for storytelling.business
Description: A modern editorial WordPress theme built for storytelling.business. Typography-first, conversion-aware, fast and responsive.
Version: 1.6.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: storytelling-business
License: GNU General Public License v2 or later
*/

:root {
  --sb-bg: #f4f1ea;
  --sb-surface: #ffffff;
  --sb-ink: #111111;
  --sb-muted: #6d6a63;
  --sb-line: #d7d2c9;
  --sb-accent: #ff4f27;
  --sb-accent-dark: #d73b17;
  --sb-max: 1280px;
  --sb-reading: 760px;
  --sb-radius: 18px;
  --sb-shadow: 0 18px 50px rgba(17,17,17,.08);
  --sb-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --sb-serif: Iowan Old Style, Baskerville, "Times New Roman", Times, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--sb-bg);
  color: var(--sb-ink);
  font-family: var(--sb-sans);
  font-size: var(--sb-body-size, 17px);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .16em; }
a:hover { color: var(--sb-accent); }
button, input, textarea, select { font: inherit; }

.sb-wrap { width: min(calc(100% - 40px), var(--sb-max)); margin-inline: auto; }
.sb-reading { width: min(calc(100% - 40px), var(--sb-reading)); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--sb-bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.site-header.is-scrolled { border-color: var(--sb-line); }
.header-inner { min-height: 86px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.site-branding { display: flex; align-items: center; gap: 12px; }
.site-title { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.04em; }
.site-title a { text-decoration: none; }
.custom-logo { max-height: 42px; width: auto; }
.main-navigation ul { display: flex; gap: 26px; align-items: center; list-style: none; margin: 0; padding: 0; }
.main-navigation a { text-decoration: none; font-size: var(--sb-nav-size, 14px); font-weight: 650; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.header-actions .sb-button { height: 42px; min-height: 42px; box-sizing: border-box; }
.menu-toggle { display: none; appearance: none; border: 0; background: transparent; padding: 8px; cursor: pointer; }
.sb-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 19px; border-radius: 999px; background: var(--sb-ink); color: white; text-decoration: none; font-size: 14px; font-weight: 750; border: 1px solid var(--sb-ink); transition: transform .18s ease, background .18s ease; }
.sb-button:hover { color: white; background: var(--sb-accent); border-color: var(--sb-accent); transform: translateY(-1px); }
.sb-button--light { background: transparent; color: var(--sb-ink); }
.sb-button--light:hover { color: var(--sb-ink); background: white; border-color: var(--sb-ink); }

/* Hero */
.home-hero { padding: clamp(72px, 9vw, 132px) 0 70px; border-bottom: 1px solid var(--sb-line); }
.hero-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero-kicker::before { content: ""; width: 28px; height: 2px; background: var(--sb-accent); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: clamp(40px, 8vw, 110px); align-items: end; }
.hero-title { margin: 0; max-width: 950px; font-family: var(--sb-serif); font-size: clamp(56px, 8.5vw, var(--sb-hero-max, 132px)); line-height: .88; font-weight: 500; letter-spacing: -.065em; }
.hero-title em { color: var(--sb-accent); font-style: italic; }
.hero-copy { max-width: 420px; font-size: clamp(18px, 2vw, 23px); line-height: 1.4; letter-spacing: -.02em; }
.hero-copy p { margin: 0 0 26px; }
.hero-note { color: var(--sb-muted); font-size: 13px; margin-top: 14px; }

/* Section heads */
.sb-section { padding: 76px 0; }
.section-heading { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; margin-bottom: 32px; }
.section-kicker { margin: 0 0 8px; color: var(--sb-muted); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.section-title { margin: 0; font-family: var(--sb-serif); font-weight: 500; font-size: clamp(38px, 5vw, var(--sb-section-max, 68px)); line-height: .98; letter-spacing: -.045em; }
.section-link { font-size: 14px; font-weight: 700; }

/* Posts */
.featured-post { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); min-height: 520px; background: var(--sb-ink); color: white; border-radius: var(--sb-radius); overflow: hidden; box-shadow: var(--sb-shadow); }
.featured-title-panel { padding: clamp(38px, 5.5vw, 78px); display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid rgba(255,255,255,.14); background: linear-gradient(145deg, rgba(255,255,255,.025), transparent 54%); }
.featured-label { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: #b9b9b9; }
.featured-label::before { content: ""; width: 24px; height: 2px; background: var(--sb-accent); }
.featured-content { padding: clamp(38px, 5vw, 70px); display: flex; flex-direction: column; justify-content: space-between; gap: 46px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.post-meta a { text-decoration: none; color: inherit; }
.meta-category { color: var(--sb-accent); }
.featured-title { margin: clamp(46px, 9vw, 118px) 0 0; max-width: 900px; font-family: var(--sb-serif); font-size: clamp(48px, 6.2vw, 88px); line-height: .92; font-weight: 500; letter-spacing: -.055em; text-wrap: balance; }
.featured-title a { text-decoration: none; }
.featured-title a:hover { color: white; }
.featured-excerpt { margin-top: 30px; color: #d4d4d4; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; }
.featured-excerpt p { margin: 0; }
.read-more { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; text-decoration: none; text-transform: uppercase; letter-spacing: .07em; }
.read-more::after { content: "→"; transition: transform .2s ease; }
.read-more:hover::after { transform: translateX(5px); }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.post-card { display: flex; flex-direction: column; min-width: 0; }
.post-card-media { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #ddd7cc; margin-bottom: 20px; }
.post-card-media a, .post-card-media img { display: block; width: 100%; height: 100%; }
.post-card-media img { object-fit: cover; transition: transform .45s ease; }
.post-card:hover .post-card-media img { transform: scale(1.025); }
.post-card-title { margin: 10px 0 12px; font-family: var(--sb-serif); font-size: clamp(28px, 3vw, var(--sb-card-max, 39px)); line-height: 1.02; letter-spacing: -.035em; font-weight: 500; }
.post-card-title a { text-decoration: none; }
.post-card-excerpt { color: var(--sb-muted); font-size: 15px; margin-bottom: 16px; }
.post-card .read-more { margin-top: auto; }

/* Statement / conversion */
.manifesto { border-top: 1px solid var(--sb-line); border-bottom: 1px solid var(--sb-line); }
.manifesto-inner { padding: clamp(70px, 9vw, 120px) 0; display: grid; grid-template-columns: .5fr 1.5fr; gap: 40px; }
.manifesto-label { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--sb-muted); }
.manifesto-copy { margin: 0; max-width: 1000px; font-family: var(--sb-serif); font-size: clamp(40px, 5.2vw, 72px); line-height: 1.03; letter-spacing: -.045em; }
.manifesto-copy strong { color: var(--sb-accent); font-weight: 500; }

.cta-section { padding: 90px 0; }
.cta-card { display: grid; grid-template-columns: 1.2fr .8fr; gap: 50px; align-items: end; padding: clamp(38px, 6vw, 76px); background: var(--sb-accent); color: #17100e; border-radius: var(--sb-radius); }
.cta-title { margin: 0; font-family: var(--sb-serif); font-size: clamp(44px, 6.2vw, 84px); line-height: .95; letter-spacing: -.05em; font-weight: 500; }
.cta-copy { font-size: 17px; max-width: 430px; }
.cta-card .sb-button { margin-top: 20px; }

/* Article */
.single-hero { padding: clamp(66px, 8vw, 110px) 0 54px; }
.single-header { width: min(calc(100% - 40px), 1050px); margin-inline: auto; }
.single-title { margin: 14px 0 26px; font-family: var(--sb-serif); font-size: clamp(48px, 7vw, var(--sb-single-max, 92px)); line-height: .94; letter-spacing: -.052em; font-weight: 500; }
.single-deck { max-width: 850px; color: var(--sb-muted); font-size: clamp(19px, 2.2vw, 25px); line-height: 1.42; }
.single-image { width: min(calc(100% - 40px), var(--sb-max)); margin: 0 auto 70px; border-radius: 16px; overflow: hidden; }
.single-image img { width: 100%; max-height: 760px; object-fit: cover; display: block; }
.entry-content { font-family: var(--sb-serif); font-size: clamp(19px, 1.8vw, var(--sb-article-max, 22px)); line-height: 1.72; }
.entry-content > * { max-width: var(--sb-reading); margin-left: auto; margin-right: auto; }
.entry-content > .alignwide { max-width: 1100px; }
.entry-content > .alignfull { max-width: none; width: 100%; }
.entry-content h2, .entry-content h3, .entry-content h4 { color: var(--sb-ink); font-family: var(--sb-sans); line-height: 1.1; letter-spacing: -.035em; }
.entry-content h2 { margin-top: 2.2em; font-size: clamp(32px, 4vw, 52px); }
.entry-content h3 { margin-top: 2em; font-size: 29px; }
.entry-content blockquote { border-left: 4px solid var(--sb-accent); padding-left: 28px; font-size: 1.35em; line-height: 1.35; font-style: italic; }
.entry-content a { text-decoration-color: var(--sb-accent); }
.entry-content img { border-radius: 10px; }
.entry-content figcaption { color: var(--sb-muted); font-family: var(--sb-sans); font-size: 13px; }
.entry-content hr { border: 0; border-top: 1px solid var(--sb-line); margin-top: 3em; margin-bottom: 3em; }
.article-footer { width: min(calc(100% - 40px), var(--sb-reading)); margin: 56px auto 100px; padding-top: 28px; border-top: 1px solid var(--sb-line); }

/* Archives */
.archive-hero { padding: 76px 0 50px; border-bottom: 1px solid var(--sb-line); }
.archive-title { margin: 0; font-family: var(--sb-serif); font-size: clamp(50px, 7vw, 92px); line-height: .95; letter-spacing: -.05em; font-weight: 500; }
.archive-description { max-width: 700px; color: var(--sb-muted); }
.pagination, .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 52px; }
.page-numbers { display: inline-grid; place-items: center; min-width: 42px; height: 42px; border: 1px solid var(--sb-line); border-radius: 999px; text-decoration: none; }
.page-numbers.current, .page-numbers:hover { background: var(--sb-ink); color: white; border-color: var(--sb-ink); }

/* Footer */
.site-footer { margin-top: 40px; background: var(--sb-ink); color: white; }
.footer-main { padding: 70px 0 42px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 70px; }
.footer-brand { font-family: var(--sb-serif); font-size: clamp(42px, 6vw, 76px); line-height: .95; letter-spacing: -.05em; }
.footer-brand span { color: var(--sb-accent); }
.footer-nav ul { columns: 2; list-style: none; padding: 0; margin: 0; }
.footer-nav li { margin-bottom: 12px; }
.footer-nav a { color: white; text-decoration: none; font-weight: 650; }
.footer-bottom { padding: 20px 0 30px; border-top: 1px solid #353535; color: #a7a7a7; font-size: 12px; display: flex; justify-content: space-between; gap: 20px; }

/* Utility */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { position: fixed !important; top: 12px; left: 12px; width: auto; height: auto; padding: 12px 16px; clip: auto; background: white; color: black; z-index: 999; }

@media (max-width: 980px) {
  .header-inner { grid-template-columns: 1fr auto; min-height: 72px; }
  .main-navigation { position: fixed; inset: 72px 0 auto; background: var(--sb-bg); border-bottom: 1px solid var(--sb-line); padding: 24px 20px 30px; transform: translateY(-120%); opacity: 0; pointer-events: none; transition: .2s ease; }
  .main-navigation.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .main-navigation ul { display: grid; gap: 16px; }
  .main-navigation a { font-size: 20px; }
  .menu-toggle { display: block; }
  .header-actions .sb-button { display: none; }
  .hero-grid, .featured-post, .cta-card, .footer-main { grid-template-columns: 1fr; }
  .featured-title-panel { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.14); }
  .hero-copy { max-width: 650px; }
  .featured-post { min-height: 0; }
  .post-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .manifesto-inner { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .sb-wrap, .sb-reading, .single-header, .single-image, .article-footer { width: min(calc(100% - 28px), var(--sb-max)); }
  .home-hero { padding-top: 58px; }
  .hero-title { font-size: clamp(52px, 17vw, 82px); }
  .section-heading { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; gap: 44px; }
  .post-card-title { font-size: 34px; }
  .featured-title { margin-top: 54px; font-size: clamp(44px, 12vw, 68px); }
  .featured-content { min-height: 330px; }
  .footer-bottom { flex-direction: column; }
  .footer-nav ul { columns: 1; }
}

/* Article discovery */
.article-overview-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 28px;
  color: var(--sb-muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .07em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color .18s ease, transform .18s ease;
}
.article-overview-link:hover {
  color: var(--sb-accent);
  transform: translateX(-3px);
}
.article-next-step {
  padding: 78px 0 96px;
  border-top: 1px solid var(--sb-line);
  background: color-mix(in srgb, var(--sb-bg) 93%, var(--sb-ink) 7%);
}
.article-next-step-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 36px;
}
.article-next-step-title {
  margin: 0;
  font-family: var(--sb-serif);
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: .98;
}
.article-all-posts {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid currentColor;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.article-all-posts span { transition: transform .18s ease; }
.article-all-posts:hover span { transform: translateX(4px); }
.article-recommendations .post-card { height: 100%; }

@media (max-width: 680px) {
  .article-next-step { padding: 58px 0 72px; }
  .article-next-step-bar { align-items: flex-start; flex-direction: column; gap: 18px; }
  .article-overview-link { margin-bottom: 22px; }
}


/* Header search */
.header-search { width: min(19vw, 230px); }
.search-form {
  display: flex; align-items: center; width: 100%; min-width: 0; height: 42px; box-sizing: border-box;
  border: 1px solid var(--sb-line); border-radius: 999px; background: var(--sb-surface);
  overflow: hidden; transition: border-color .18s ease, box-shadow .18s ease;
}
.search-form:focus-within { border-color: var(--sb-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sb-accent) 16%, transparent); }
.search-field {
  min-width: 0; width: 100%; height: 100%; padding: 0 4px 0 15px; border: 0; outline: 0;
  background: transparent; color: var(--sb-ink); font-size: 13px;
}
.search-field::placeholder { color: var(--sb-muted); opacity: .85; }
.search-submit {
  flex: 0 0 40px; width: 40px; height: 40px; border: 0; background: transparent; color: var(--sb-ink);
  cursor: pointer; display: grid; place-items: center; font-size: 20px; line-height: 1;
}
.search-submit:hover { color: var(--sb-accent); }

/* Dedicated all-articles index */
.articles-hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(40px, 8vw, 110px); align-items: end; }
.articles-intro { margin: 0; max-width: 520px; color: var(--sb-muted); font-size: clamp(18px, 1.8vw, 22px); line-height: 1.48; }
.articles-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 34px; padding-bottom: 18px; border-bottom: 1px solid var(--sb-line); }
.articles-toolbar > p { margin: 0; color: var(--sb-muted); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.articles-search { width: min(100%, 290px); }
.articles-grid { row-gap: 54px; }

@media (max-width: 1120px) {
  .header-inner { grid-template-columns: 1fr auto auto; }
  .main-navigation ul { gap: 18px; }
  .header-search { width: 180px; }
}

@media (max-width: 980px) {
  .header-search { width: min(46vw, 250px); }
  .articles-hero-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 680px) {
  .header-search { width: min(52vw, 220px); }
  .header-actions { gap: 4px; }
  .search-form { height: 38px; }
  .search-field { padding-left: 12px; font-size: 12px; }
  .search-submit { width: 36px; height: 36px; flex-basis: 36px; }
  .articles-toolbar { align-items: flex-start; flex-direction: column; }
  .articles-search { width: 100%; }
}
