/*
Theme Name:   Simple Mind Blog
Theme URI:    https://simplemind.tech/blog/
Author:       Simple Mind
Description:  Blog theme that reuses the simplemind.tech header, footer, Sora typography and design tokens directly from the static website.
Version:      1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain:  simplemind-blog
*/

/* Colours, fonts and radii come from the website's /_shared.css (loaded first). */

.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; }
.sm-skip-link:focus { clip: auto; clip-path: none; height: auto; width: auto; left: 1rem; top: 1rem; z-index: 1000; background: var(--white); color: var(--blue); padding: .75rem 1.25rem; border-radius: var(--r); box-shadow: var(--sh-md); font-weight: 600; }

/* WordPress admin bar (only when logged in) */
.admin-bar #main-nav { top: 32px; }
@media (max-width: 782px) { .admin-bar #main-nav { top: 46px; } }

.sm-blog-main { display: block; min-height: 60vh; }

/* ===== HERO ===== */
.sm-blog-hero { padding: 9rem 0 4rem; background: linear-gradient(180deg, var(--blue-pale) 0%, var(--white) 100%); border-bottom: 1px solid var(--rule); position: relative; overflow: hidden; }
.sm-blog-hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle, #CBD5E1 1px, transparent 1px); background-size: 36px 36px; opacity: .25; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent); mask-image: linear-gradient(to bottom, #000 40%, transparent); }
.sm-blog-hero .container { position: relative; z-index: 1; }
.sm-blog-hero h1 { font-family: var(--font-serif); font-size: clamp(2.35rem, 5vw, 4.25rem); font-weight: 400; line-height: 1.08; letter-spacing: -.02em; color: var(--ink); margin-bottom: 1.25rem; max-width: 900px; overflow-wrap: anywhere; }
.sm-blog-hero h1 em { color: var(--blue); }
.sm-blog-hero > .container > p { max-width: 640px; color: var(--ink3); font-size: clamp(1rem, 1.6vw, 1.1rem); line-height: 1.8; margin-bottom: 2rem; }
@media (max-width: 768px) { .sm-blog-hero { padding: 7.5rem 0 3rem; } }

.sm-search { display: flex; align-items: center; gap: .5rem; max-width: 520px; background: var(--white); border: 1.5px solid var(--rule); border-radius: var(--r); padding: .35rem .35rem .35rem 1rem; box-shadow: var(--sh-sm); transition: border-color .2s, box-shadow .2s; }
.sm-search:focus-within { border-color: var(--blue-light); box-shadow: 0 0 0 4px rgba(59,130,246,.12); }
.sm-search-icon { color: var(--ink4); flex-shrink: 0; }
.sm-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-family: var(--font-sans); font-size: .92rem; color: var(--ink); padding: .55rem .25rem; }
.sm-search input::placeholder { color: var(--ink4); }
.sm-search input::-webkit-search-cancel-button { display: none; }
.sm-search .btn { padding: 10px 18px; font-size: .85rem; }

/* ===== LIST ===== */
.sm-blog-section { padding: 3rem 0 6rem; background: var(--white); }
.sm-topic-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.75rem; }
.sm-topic { display: inline-flex; align-items: center; font-size: .82rem; font-weight: 500; color: var(--ink3); background: var(--white); border: 1px solid var(--rule); padding: .45rem 1rem; border-radius: 100px; transition: all .15s; }
.sm-topic:hover { color: var(--ink); border-color: var(--ink4); background: var(--bg-alt); }
.sm-topic.is-active { color: var(--blue); background: var(--blue-pale); border-color: var(--blue-mid); font-weight: 600; }

.sm-post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; font-size: .78rem; color: var(--ink4); margin-bottom: .9rem; }
.sm-post-meta a.chip-blue:hover { background: var(--blue-mid); }

.sm-post-featured { display: grid; grid-template-columns: 1.15fr 1fr; border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: var(--white); box-shadow: var(--sh-sm); margin-bottom: 3rem; transition: box-shadow .25s, transform .25s; }
.sm-post-featured:hover { box-shadow: var(--sh-lg); transform: translateY(-2px); }
.sm-post-featured-media { display: block; position: relative; min-height: 340px; background: var(--bg-alt); }
.sm-post-featured-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sm-post-featured-body { padding: clamp(1.75rem, 3.5vw, 3rem); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.sm-post-featured-title { font-family: var(--font-serif); font-size: clamp(1.6rem, 2.6vw, 2.25rem); font-weight: 500; line-height: 1.2; letter-spacing: -.015em; color: var(--ink); margin-bottom: 1rem; }
.sm-post-featured-title a:hover { color: var(--blue); }
.sm-post-featured .sm-post-card-excerpt { font-size: 1rem; margin-bottom: 1.5rem; }
.sm-post-featured-foot { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; font-size: .82rem; color: var(--ink3); margin-bottom: 1.75rem; }
.sm-post-when { color: var(--ink4); }
@media (max-width: 900px) { .sm-post-featured { grid-template-columns: 1fr; } .sm-post-featured-media { min-height: 0; aspect-ratio: 16 / 9; } }

.sm-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; }
@media (max-width: 1024px) { .sm-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .sm-post-grid { grid-template-columns: 1fr; gap: 1.25rem; } }

.sm-post-card { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: var(--white); box-shadow: var(--sh-sm); transition: box-shadow .25s, transform .25s, border-color .25s; }
.sm-post-card:hover { box-shadow: var(--sh-lg); transform: translateY(-3px); border-color: var(--blue-mid); }
.sm-post-card-media { display: block; aspect-ratio: 16 / 9; background: var(--bg-alt); overflow: hidden; }
.sm-post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.sm-post-card:hover .sm-post-card-media img { transform: scale(1.04); }
.sm-post-card-body { padding: 1.5rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; align-items: flex-start; }
.sm-post-card-title { font-size: 1.12rem; font-weight: 600; line-height: 1.4; color: var(--ink); margin-bottom: .65rem; }
.sm-post-card-title a:hover { color: var(--blue); }
.sm-post-card-excerpt { font-size: .9rem; line-height: 1.7; color: var(--ink3); margin-bottom: 1.25rem; }
.sm-post-card .btn-text { margin-top: auto; }

.sm-post-card-placeholder { position: relative; display: flex; align-items: flex-end; width: 100%; height: 100%; padding: 1.25rem; background: linear-gradient(135deg, #0B1427 0%, #162040 55%, #1E3A8A 100%); overflow: hidden; }
.sm-post-card-placeholder::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; }
.sm-post-card-placeholder::after { content: ''; position: absolute; width: 60%; aspect-ratio: 1; right: -12%; top: -25%; border-radius: 50%; background: radial-gradient(circle, rgba(59,130,246,.45), transparent 65%); }
.sm-post-card-placeholder span { position: relative; z-index: 1; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(147,197,253,.9); }
.sm-post-featured-media .sm-post-card-placeholder { position: absolute; inset: 0; }
.sm-post-card-placeholder--lg { padding: 2rem; }

.sm-avatar { border-radius: 50%; display: inline-block; }
.sm-post-byline { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; color: var(--ink2); }

.sm-pagination { margin-top: 3.5rem; }
.sm-pagination .nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem; }
.sm-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 .9rem; border: 1px solid var(--rule); border-radius: var(--r); font-size: .88rem; font-weight: 600; color: var(--ink3); transition: all .15s; }
.sm-pagination a.page-numbers:hover { border-color: var(--ink4); color: var(--ink); background: var(--bg-alt); }
.sm-pagination .page-numbers.current { background: var(--blue); border-color: var(--blue); color: var(--white); }
.sm-pagination .page-numbers.dots { border-color: transparent; }

.sm-empty { text-align: center; padding: 4rem 1rem; border: 1px dashed var(--rule); border-radius: var(--r-lg); background: var(--bg-alt); }
.sm-empty h2 { font-family: var(--font-serif); font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 400; margin-bottom: .75rem; }
.sm-empty h2 em { color: var(--blue); }
.sm-empty p { color: var(--ink3); margin: 0 auto 1.75rem; max-width: 480px; }

/* ===== ARTICLE ===== */
.sm-narrow { max-width: 820px; }
.sm-article-hero { padding: 8.5rem 0 3rem; background: linear-gradient(180deg, var(--blue-pale) 0%, var(--white) 100%); }
@media (max-width: 768px) { .sm-article-hero { padding: 7rem 0 2.25rem; } }
.sm-back-link { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; color: var(--ink3); margin-bottom: 1.75rem; transition: color .15s, gap .2s; }
.sm-back-link:hover { color: var(--blue); gap: .65rem; }
.sm-article-hero .section-label a { color: inherit; }
.sm-article-hero h1 { font-family: var(--font-serif); font-size: clamp(2.1rem, 4.4vw, 3.5rem); font-weight: 500; line-height: 1.12; letter-spacing: -.02em; color: var(--ink); margin-bottom: 1.25rem; overflow-wrap: anywhere; }
.sm-article-dek { font-size: clamp(1.05rem, 1.8vw, 1.2rem); line-height: 1.7; color: var(--ink3); margin-bottom: 1.75rem; }
.sm-article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .85rem; color: var(--ink4); }
.sm-article-meta > span + span::before { content: '·'; margin-right: 1.25rem; color: var(--rule); }
.sm-article-meta a:hover { color: var(--blue); }
@media (max-width: 640px) { .sm-article-meta { gap: .5rem .9rem; } .sm-article-meta > span + span::before { display: none; } }

.sm-article-cover { margin: 0 auto 3rem; max-width: 1080px; }
.sm-article-cover img { width: 100%; height: auto; border-radius: var(--r-lg); box-shadow: var(--sh-md); }
.sm-article-cover figcaption { margin-top: .75rem; font-size: .8rem; color: var(--ink4); text-align: center; }

/* Article text (block editor content) */
.sm-prose { color: var(--ink2); font-size: 1.065rem; line-height: 1.85; padding-bottom: 1rem; overflow-wrap: break-word; }
.sm-prose > * + * { margin-top: 1.4em; }
.sm-prose h2, .sm-prose h3, .sm-prose h4, .sm-prose h5, .sm-prose h6 { color: var(--ink); line-height: 1.3; letter-spacing: -.01em; scroll-margin-top: 6rem; }
.sm-prose h2 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); font-weight: 600; margin-top: 2.4em; }
.sm-prose h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); font-weight: 600; margin-top: 2em; }
.sm-prose h4 { font-size: 1.08rem; font-weight: 600; margin-top: 1.8em; }
.sm-prose h2 + *, .sm-prose h3 + *, .sm-prose h4 + * { margin-top: .75em; }
.sm-prose em, .sm-prose i { font-style: italic; }
.sm-prose strong, .sm-prose b { font-weight: 600; color: var(--ink); }
.sm-prose a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.sm-prose a:hover { text-decoration-thickness: 2px; }
.sm-prose ul, .sm-prose ol { padding-left: 1.4em; }
.sm-prose li + li { margin-top: .5em; }
.sm-prose li::marker { color: var(--blue); font-weight: 600; }
.sm-prose blockquote, .sm-prose .wp-block-quote { border-left: 3px solid var(--blue); background: var(--blue-pale); padding: 1.25rem 1.5rem; border-radius: 0 var(--r) var(--r) 0; color: var(--ink); font-size: 1.12rem; line-height: 1.7; }
.sm-prose blockquote cite { display: block; margin-top: .9em; font-size: .82rem; font-style: normal; color: var(--ink3); }
.sm-prose hr, .sm-prose .wp-block-separator { border: 0; border-top: 1px solid var(--rule); margin: 2.75em auto; }
.sm-prose img { height: auto; border-radius: var(--r); }
.sm-prose figure { margin-left: 0; margin-right: 0; }
.sm-prose figcaption, .sm-prose .wp-element-caption { margin-top: .6rem; font-size: .8rem; color: var(--ink4); text-align: center; }
.sm-prose code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86em; background: var(--bg-alt); border: 1px solid var(--rule); padding: .12em .4em; border-radius: 6px; color: var(--ink); }
.sm-prose pre, .sm-prose .wp-block-code { background: var(--bg-dark); color: #E2E8F0; padding: 1.25rem 1.4rem; border-radius: var(--r); overflow-x: auto; font-size: .88rem; line-height: 1.65; }
.sm-prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.sm-prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.sm-prose .wp-block-table { overflow-x: auto; }
.sm-prose th, .sm-prose td { border: 1px solid var(--rule); padding: .7rem .9rem; text-align: left; vertical-align: top; }
.sm-prose th { background: var(--bg-alt); color: var(--ink); font-weight: 600; }
.sm-prose .wp-block-button__link { display: inline-flex; background: var(--blue); color: var(--white); text-decoration: none; font-weight: 600; font-size: .9rem; padding: 13px 26px; border-radius: var(--r); }
.sm-prose .wp-block-button__link:hover { background: #1344B8; }
.sm-prose iframe { max-width: 100%; border-radius: var(--r); }
.sm-prose .alignwide { margin-left: calc(-1 * min(8vw, 120px)); margin-right: calc(-1 * min(8vw, 120px)); max-width: none; }
.sm-prose .alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; width: 100vw; }
.sm-prose .alignleft { float: left; margin: .3em 1.5em 1em 0; max-width: 50%; }
.sm-prose .alignright { float: right; margin: .3em 0 1em 1.5em; max-width: 50%; }
.sm-prose .aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.sm-prose::after { content: ''; display: table; clear: both; }
@media (max-width: 900px) { .sm-prose .alignwide { margin-left: 0; margin-right: 0; } }
@media (max-width: 640px) { .sm-prose { font-size: 1rem; } .sm-prose .alignleft, .sm-prose .alignright { float: none; margin: 1em 0; max-width: 100%; } }

.has-sm-ink-color { color: #0F172A; } .has-sm-ink-background-color { background-color: #0F172A; }
.has-sm-blue-color { color: #1A56DB; } .has-sm-blue-background-color { background-color: #1A56DB; }
.has-sm-blue-pale-background-color { background-color: #EFF6FF; }
.has-sm-navy-background-color { background-color: #0B1427; }
.has-sm-bg-alt-background-color { background-color: #F5F7FB; }
.sm-prose .has-background { padding: 1.25rem 1.5rem; border-radius: var(--r); }

/* Tags, share, author */
.sm-article-footer { border-top: 1px solid var(--rule); margin-top: 3rem; padding: 2rem 0 5rem; display: flex; flex-direction: column; gap: 1.75rem; }
.sm-article-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.sm-share { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sm-share-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink4); margin-right: .5rem; }
.sm-share-btn { position: relative; width: 40px; height: 40px; border-radius: var(--r); border: 1px solid var(--rule); background: var(--white); color: var(--ink3); display: inline-flex; align-items: center; justify-content: center; transition: all .15s; }
.sm-share-btn:hover { color: var(--blue); border-color: var(--blue-mid); background: var(--blue-pale); }
.sm-copy-link.copied { color: var(--green); border-color: #A7F3D0; background: var(--green-pale); }
.sm-copy-feedback { position: absolute; left: calc(100% + .6rem); white-space: nowrap; font-size: .78rem; font-weight: 600; color: var(--green); pointer-events: none; }
.sm-author-box { display: flex; gap: 1.25rem; align-items: flex-start; padding: 1.5rem; border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--bg-alt); }
.sm-author-box .sm-avatar { flex-shrink: 0; }
.sm-author-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); margin-bottom: .2rem; }
.sm-author-name { font-weight: 700; color: var(--ink); margin-bottom: .35rem; }
.sm-author-box p { font-size: .9rem; color: var(--ink3); line-height: 1.7; }

/* Related */
.sm-related { padding: 5rem 0; background: var(--bg-alt); border-top: 1px solid var(--rule); }
.sm-related-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 2.25rem; flex-wrap: wrap; }
.sm-related-head h2 { font-family: var(--font-serif); font-size: clamp(1.9rem, 3.2vw, 2.75rem); font-weight: 400; line-height: 1.15; }
.sm-related-head h2 em { color: var(--blue); }

/* Comments */
.sm-comments-wrap { padding-bottom: 4rem; }
.sm-comments { border-top: 1px solid var(--rule); padding-top: 2.5rem; }
.sm-comments-title { font-size: 1.35rem; font-weight: 600; color: var(--ink); margin-bottom: 1.5rem; }
.sm-comment-list, .sm-comment-list .children { list-style: none; }
.sm-comment-list .children { padding-left: 1.5rem; border-left: 2px solid var(--rule); margin-top: 1rem; }
.sm-comment-list .comment-body { padding: 1.25rem; border: 1px solid var(--rule); border-radius: var(--r); margin-bottom: 1rem; }
.sm-comment-list .comment-author { display: flex; align-items: center; gap: .6rem; font-weight: 600; color: var(--ink); }
.sm-comment-list .comment-author .says { display: none; }
.sm-comment-list .comment-metadata { font-size: .78rem; color: var(--ink4); margin: .2rem 0 .75rem; }
.sm-comment-respond p { margin-bottom: 1rem; font-size: .9rem; color: var(--ink3); }
.sm-comment-respond label { display: block; font-size: .775rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink3); margin-bottom: .45rem; }
.sm-comment-respond input[type=text], .sm-comment-respond input[type=email], .sm-comment-respond input[type=url], .sm-comment-respond textarea { width: 100%; background: var(--bg-alt); border: 1.5px solid var(--rule); border-radius: var(--r); padding: .75rem 1rem; font-family: var(--font-sans); font-size: .9rem; outline: none; }

/* CTA + 404 */
.sm-blog-cta { padding: 0 0 6rem; background: var(--white); }
.sm-related + .sm-blog-cta, .sm-comments-wrap + .sm-blog-cta { padding-top: 5rem; }
.sm-404 { padding-bottom: 7rem; }
.sm-404-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }

/* Hebrew (right-to-left) */
[dir="rtl"] .sm-search { padding: .35rem 1rem .35rem .35rem; }
[dir="rtl"] .sm-dir-icon { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .sm-article-meta > span + span::before { margin-right: 0; margin-left: 1.25rem; }
.sm-prose[dir="rtl"] ul, .sm-prose[dir="rtl"] ol { padding-left: 0; padding-right: 1.4em; }
.sm-prose[dir="rtl"] blockquote { border-left: 0; border-right: 3px solid var(--blue); }