/*
Theme Name: Spanmarks Journal
Theme URI: https://spanmarksventures.com/
Author: Spanmarks Ventures
Description: Block theme for Spanmarks Ventures: an investor journal with a founder voice. Built for the WordPress block editor (no page builder). Colors come from the Spanmarks Ventures logo.
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Version: 1.0.23
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: spanmarks-journal
*/

/* ---------- Base ---------- */
body { -webkit-font-smoothing: antialiased; }
:where(h1, h2, h3, h4) { text-wrap: balance; }
a:focus-visible, button:focus-visible, summary:focus-visible, .wp-element-button:focus-visible {
	outline: 2px solid var(--wp--preset--color--brand);
	outline-offset: 2px;
}

/* Kicker / eyebrow text */
.sj-kicker {
	font-size: 12px !important;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brand);
	margin: 0;
}
.sj-kicker a { text-decoration: none; color: inherit; }
.sj-muted { color: var(--wp--preset--color--soft); }
.sj-meta, .sj-meta a { font-size: 14px; color: var(--wp--preset--color--soft); }
.sj-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.sj-meta > * { margin: 0 !important; }

/* ---------- Header ---------- */
header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
	background: var(--wp--preset--color--paper);
	border-bottom: 1px solid var(--wp--preset--color--rule);
}
.sj-header { gap: 22px; }
.sj-logo img { height: 76px; width: auto; display: block; }
.sj-header .wp-block-navigation { flex: 1; font-size: 15px; font-weight: 600; }
.sj-header .wp-block-navigation-item__content { color: var(--wp--preset--color--soft); text-decoration: none; padding-block: 4px; border-bottom: 2px solid transparent; }
.sj-header .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--ink); }
.sj-header .current-menu-item > .wp-block-navigation-item__content,
.sj-header .wp-block-navigation-item__content[aria-current="page"] { color: var(--wp--preset--color--ink); border-bottom-color: var(--wp--preset--color--brand); }
.sj-header .wp-block-buttons { gap: 10px; }
.sj-header .wp-block-button__link { font-size: 14.5px; padding: 10px 16px; }
@media (max-width: 960px) {
	.sj-header .sj-hide-mobile { display: none; }
	.sj-logo img { height: 52px; }
}
@media (max-width: 600px) {
	.sj-logo img { height: 42px; }
	.sj-header .wp-block-buttons { display: none; }
	/* Menu icon sits at the right edge on phones */
	.sj-header .wp-block-navigation { justify-content: flex-end; }
	.sj-header .wp-block-navigation__responsive-container-open { margin-left: auto; }
}

/* ---------- Buttons ---------- */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 1px solid var(--wp--preset--color--rule);
	color: var(--wp--preset--color--ink);
	background: transparent;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { border-color: var(--wp--preset--color--ink); }
.sj-btn-light .wp-block-button__link { background: #fff !important; color: var(--wp--preset--color--ink) !important; }

/* ---------- Sections ---------- */
.sj-section { padding-block: 56px; }
.sj-tint { background: var(--wp--preset--color--tint); }
.sj-sechead { justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 24px; }
.sj-sechead h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin: 0; }
.sj-sechead p a, .sj-link { font-weight: 700; color: var(--wp--preset--color--brand); text-decoration: none; font-size: 15px; }

/* Page header band */
.sj-phead { background: var(--wp--preset--color--tint); padding-block: 48px 40px; }
.sj-phead h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: 8px 0 12px; }
.sj-phead p:not(.sj-kicker) { max-width: 62ch; color: var(--wp--preset--color--soft); font-size: 1.1rem; }

/* ---------- Home hero ---------- */
.sj-hero { padding-block: 48px 40px; gap: 40px; }
.sj-feature h1, .sj-feature h2 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); line-height: 1.15; }
.sj-feature .wp-block-post-title a { text-decoration: none; }
.sj-feature .wp-block-post-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.sj-feature .wp-block-post-excerpt { font-size: 18px; color: var(--wp--preset--color--soft); }
.sj-feature .wp-block-post-featured-image img { border-radius: 8px; }
.sj-letter { background: var(--wp--preset--color--tint); border-radius: 10px; padding: 28px; position: sticky; top: 110px; }
.sj-letter h2 { font-size: 1.5rem; }
.sj-fine { font-size: 12.5px; color: var(--wp--preset--color--soft); }
@media (max-width: 781px) { .sj-letter { position: static; } }

/* Founder strip */
.sj-founder { background: var(--wp--preset--color--navy); color: #E4EAF1; border-top: 3px solid var(--wp--preset--color--sky); padding-block: 24px; }
.sj-founder-row { gap: 22px; align-items: center; }
.sj-avatar { width: 76px; height: 76px; min-width: 76px; border-radius: 50%; background: linear-gradient(160deg, #3B4C8E, #283888); color: #AEBBCB; font-size: 11px; display: flex; align-items: center; justify-content: center; text-align: center; margin: 0 !important; }
.sj-avatar.is-small { width: 44px; height: 44px; min-width: 44px; font-size: 9px; }
.sj-founder-name { font-family: var(--wp--preset--font-family--serif); font-size: 1.3rem; font-weight: 600; color: #fff; margin: 0; }
.sj-founder-line { color: #C3CCE6; font-size: 15px; margin: 4px 0 0; }
.sj-founder .wp-block-buttons { margin-left: auto; }

/* ---------- Cards ---------- */
.sj-cards .wp-block-post { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sj-cards .wp-block-post > * { margin: 0; }
.sj-cards .wp-block-post-featured-image img { border-radius: 8px; aspect-ratio: 16/9; object-fit: cover; }
.sj-cards .wp-block-post-featured-image:empty { display: none; }
.sj-cards .wp-block-post-terms { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.sj-cards .wp-block-post-terms a { color: var(--wp--preset--color--brand); text-decoration: none; }
.sj-cards .wp-block-post-title { font-size: 1.3rem; line-height: 1.25; }
.sj-cards .wp-block-post-title a { text-decoration: none; }
.sj-cards .wp-block-post-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.sj-cards .wp-block-post-excerpt { font-size: 15px; color: var(--wp--preset--color--soft); }
.sj-cards .wp-block-post-excerpt__more-text { display: none; }
.sj-cards .wp-block-post { border-top: 3px solid var(--wp--preset--color--tint-2); padding-top: 16px; }
.sj-tint .sj-cards .wp-block-post { border-top-color: #fff; }

/* Topic tabs */
.sj-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 28px; padding: 0; list-style: none; }
.sj-tabs a { display: inline-block; font-size: 14px; font-weight: 600; border: 1px solid var(--wp--preset--color--rule); border-radius: 999px; padding: 6px 14px; background: #fff; color: var(--wp--preset--color--soft); text-decoration: none; }
.sj-tabs a:hover { border-color: var(--wp--preset--color--ink); color: var(--wp--preset--color--ink); }
.sj-tabs a[aria-current="page"] { background: var(--wp--preset--color--brand); color: #fff; border-color: var(--wp--preset--color--brand); }

/* Step ladder, guides, focus areas */
.sj-rung { background: #fff; border: 1px solid var(--wp--preset--color--rule); border-top: 3px solid var(--wp--preset--color--sky); border-radius: 10px; padding: 20px; }
.sj-rung > * { margin: 0 !important; }
.sj-rung > * + * { margin-top: 8px !important; }
.sj-rung h3, .sj-guide h3, .sj-term h3 { font-size: 1.2rem; }
.sj-rung p:not(.sj-kicker), .sj-guide p, .sj-term p, .sj-area p:not(.sj-area-name) { font-size: 15px; color: var(--wp--preset--color--soft); }
.sj-guide { background: #fff; border: 1px solid var(--wp--preset--color--rule); border-radius: 10px; padding: 22px; }
.sj-guide:hover { border-color: var(--wp--preset--color--ink); }
.sj-guide h3 a { text-decoration: none; }
.sj-guide > *, .sj-term > *, .sj-area > * { margin: 0 !important; }
.sj-guide > * + *, .sj-term > * + *, .sj-area > * + * { margin-top: 6px !important; }
.sj-area { border-top: 2px solid var(--wp--preset--color--brand); padding-top: 14px; }
.sj-area.is-later { border-top-style: dashed; border-top-color: var(--wp--preset--color--soft); }
.sj-area-name { font-weight: 700; font-size: 17px; }

.sj-box { border: 1px solid var(--wp--preset--color--rule); border-radius: 10px; padding: 24px 28px; gap: 20px; }
.sj-box h3 { font-size: 1.5rem; margin: 6px 0; }

/* Start here path */
.sj-step { border: 1px solid var(--wp--preset--color--rule); border-radius: 10px; padding: 18px 20px; background: #fff; gap: 18px; align-items: center; flex-wrap: nowrap !important; }
.sj-step:hover { border-color: var(--wp--preset--color--ink); }
.sj-step-n { width: 40px; height: 40px; min-width: 40px; border-radius: 50%; background: var(--wp--preset--color--tint); color: var(--wp--preset--color--brand); font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 !important; }
.sj-step-body { flex: 1; min-width: 0; }
.sj-step-body > * { margin: 0 !important; }
.sj-step-body h3 { font-size: 1.25rem; }
.sj-step-body h3 a { text-decoration: none; }
.sj-step-body p { font-size: 15px; color: var(--wp--preset--color--soft); margin-top: 4px !important; }
.sj-step > .sj-meta { white-space: nowrap; }

/* Panels, checklists, FAQ */
.sj-panel { background: #fff; border: 1px solid var(--wp--preset--color--rule); border-radius: 12px; padding: 26px; }
.sj-panel > *:first-child { margin-top: 0; }
.sj-check { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.sj-check li { padding-left: 26px; position: relative; }
.sj-check li::before { content: ""; position: absolute; left: 0; top: .55em; width: 12px; height: 7px; border-left: 2px solid var(--wp--preset--color--brand); border-bottom: 2px solid var(--wp--preset--color--brand); transform: rotate(-45deg); }
.wp-block-details { border-bottom: 1px solid var(--wp--preset--color--rule); padding-block: 16px; }
.wp-block-details summary { cursor: pointer; font-weight: 700; font-size: 17px; }
.wp-block-details p { margin-top: 10px; color: var(--wp--preset--color--soft); max-width: 70ch; }
.sj-embed iframe { width: 100%; border: 0; border-radius: 8px; }

/* Photo placeholders */
.sj-ph { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; color: var(--wp--preset--color--soft); border-radius: 8px; padding: 12px; background: repeating-linear-gradient(135deg, #E2E9F4 0 12px, #EDF2F9 12px 24px); min-height: 200px; margin: 0 !important; }
.sj-ph.is-square { aspect-ratio: 1; min-height: 0; }
.sj-ph.is-tall { min-height: 380px; }

/* ---------- Article ---------- */
.sj-art-head { padding-block: 44px 24px; }
.sj-art-head h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); }
.sj-crumb { font-size: 14px; color: var(--wp--preset--color--soft); gap: 6px; }
.sj-crumb > * { margin: 0 !important; }
.sj-crumb a { color: var(--wp--preset--color--brand); text-decoration: none; }
.sj-prose { font-size: 18px; line-height: 1.7; }
.sj-prose h2 { font-size: 1.75rem; margin-top: 1.6em; }
.sj-prose h3 { font-size: 1.35rem; margin-top: 1.4em; }
.sj-prose h1 { font-size: 2rem; }
.sj-callout { border-left: 3px solid var(--wp--preset--color--sky); background: var(--wp--preset--color--tint); padding: 18px 20px; border-radius: 0 8px 8px 0; font-size: 16px; }
.sj-callout > * { margin: 0 !important; }
.sj-callout > * + * { margin-top: 6px !important; }
.sj-endcta { background: var(--wp--preset--color--navy); color: #E4EAF1; border-radius: 12px; padding: 28px; gap: 24px; }
.sj-endcta h3 { color: #fff; font-size: 1.5rem; margin: 0 0 6px; }
.sj-endcta p { color: #B9C4D1; margin: 0; }
.sj-author { border-top: 1px solid var(--wp--preset--color--rule); border-bottom: 1px solid var(--wp--preset--color--rule); padding-block: 20px; gap: 16px; align-items: center; flex-wrap: nowrap !important; font-size: 16px; }
.sj-author > div > * { margin: 0; }
.sj-disc { font-size: 13.5px !important; color: var(--wp--preset--color--soft); line-height: 1.55; }

/* ---------- Values / team ---------- */
.sj-value h3 { font-size: 1.3rem; }
.sj-value > * { margin: 0 !important; }
.sj-value > * + * { margin-top: 6px !important; }
.sj-value p { color: var(--wp--preset--color--soft); }
.sj-member > * { margin: 0 !important; }
.sj-member > * + * { margin-top: 8px !important; }
.sj-member h3 { font-size: 1.1rem; font-family: var(--wp--preset--font-family--sans); font-weight: 700; }

/* ---------- Footer ---------- */
footer.wp-block-template-part { margin-top: 0; }
.sj-footer { background: var(--wp--preset--color--tint); color: var(--wp--preset--color--soft); padding-block: 44px 28px; border-top: 4px solid var(--wp--preset--color--brand); }
.sj-footer .sj-logo img { height: 60px; }
.sj-footer-col h2 { font-family: var(--wp--preset--font-family--sans); font-size: 15px; font-weight: 700; color: var(--wp--preset--color--ink); margin: 0 0 10px; }
.sj-footer-col p { margin: 0; padding-block: 3px; font-size: 15px; }
.sj-footer-col a { color: var(--wp--preset--color--soft); text-decoration: none; }
.sj-footer-col a:hover { color: var(--wp--preset--color--brand); }
.sj-footer .sj-disc { border-top: 1px solid var(--wp--preset--color--rule); padding-top: 20px; margin-top: 32px; }

/* Pagination */
.wp-block-query-pagination { margin-top: 36px; gap: 12px; font-weight: 600; }
.wp-block-query-pagination a { color: var(--wp--preset--color--brand); text-decoration: none; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (min-width: 961px) { .sj-header .sj-portal-mobile { display: none; } }

/* Centered band and Start Here reading path */
.sj-center { text-align: center; }
.sj-center .wp-block-buttons { justify-content: center; }
.sj-path { margin-left: 0; }
.sj-path > * + * { margin-top: 12px; }
.sj-crumb p, .sj-meta p { margin: 0; }
.sj-crumb, .sj-meta { gap: 6px; }

/* Portfolio */
.sj-tight { padding-top: 28px !important; padding-bottom: 8px !important; }
.sj-stats { gap: 0 !important; border: 1px solid var(--wp--preset--color--rule); border-radius: 12px; background: #fff; }
.sj-stat { padding: 18px 22px; border-left: 1px solid var(--wp--preset--color--rule); }
.sj-stat:first-child { border-left: 0; }
.sj-stat > * { margin: 0 !important; }
.sj-stat-n { font-family: var(--wp--preset--font-family--serif, Georgia, serif); font-size: 2.2rem; line-height: 1.1; color: var(--wp--preset--color--brand); font-weight: 700; }
.sj-stat-l { font-size: 14px; color: var(--wp--preset--color--soft); margin-top: 4px !important; }
.sj-jump { gap: 8px 22px; margin-top: 18px !important; font-size: 15px; font-weight: 600; }
.sj-jump p { margin: 0; }
.sj-deal { background: #fff; border: 1px solid var(--wp--preset--color--rule); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s ease, transform .2s ease; }
.sj-deal:hover { box-shadow: 0 10px 28px rgba(22, 32, 58, .10); transform: translateY(-2px); }
.sj-deal > * { margin: 0 !important; }
.sj-deal-media { position: relative; }
.sj-deal-media > * { margin: 0 !important; }
.sj-deal-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.is-closed .sj-deal-img img { aspect-ratio: 4 / 3; }
.sj-deal-ph { aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--wp--preset--color--brand) 0%, var(--wp--preset--color--ink) 100%); display: flex; align-items: flex-end; padding: 18px; }
.is-closed .sj-deal-ph { aspect-ratio: 4 / 3; }
.sj-deal-ph-label { color: #fff; font-weight: 700; font-size: 15px; opacity: .9; margin: 0; }
.sj-status { position: absolute; top: 14px; left: 14px; margin: 0 !important; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--wp--preset--color--soft); }
.sj-status.is-open { background: var(--wp--preset--color--brand); color: #fff; }
.sj-deal-ph + .sj-status.is-open, .sj-deal-media:has(.sj-deal-ph) .sj-status.is-open { background: #fff; color: var(--wp--preset--color--brand); }
#open, #past { scroll-margin-top: 110px; }
.sj-deal-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.sj-deal-body > * { margin: 0 !important; }
.sj-deal-body > * + * { margin-top: 8px !important; }
.sj-deal h3 { font-size: 1.35rem; }
.is-closed h3 { font-size: 1.1rem; }
.sj-deal-body > p:not(.sj-kicker):not(.sj-meta) { font-size: 15px; color: var(--wp--preset--color--soft); }
.sj-facts { gap: 0 !important; border-top: 1px solid var(--wp--preset--color--rule); border-bottom: 1px solid var(--wp--preset--color--rule); margin-top: 14px !important; }
.sj-fact { padding: 10px 12px 10px 0; }
.sj-fact > * { margin: 0 !important; }
.sj-fact-k { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--wp--preset--color--soft); }
.sj-fact-v { font-size: 15px; font-weight: 600; margin-top: 2px !important; }
.sj-deal .wp-block-buttons { margin-top: auto !important; padding-top: 16px; }
@media (max-width: 600px) {
  .sj-stats { grid-template-columns: 1fr 1fr !important; }
  .sj-stat:nth-child(3) { border-left: 0; }
  .sj-stat:nth-child(n+3) { border-top: 1px solid var(--wp--preset--color--rule); }
}
.sj-proj-note { margin-top: 18px !important; font-size: 13px; }

/* Founder photo */
.sj-photo { overflow: hidden; margin: 0 !important; }
.sj-photo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.sj-avatar.sj-photo { background: none; padding: 0; }
.sj-member-photo { aspect-ratio: 1; border-radius: 8px; }
.sj-portrait { border-radius: 8px; max-width: 420px; }

/* Investor Letter sign-up form */
.sj-letter-cta { margin: 18px 0 8px; }
.sj-center .sj-letter-cta { justify-content: center; }
