/*
Theme Name: Story Loading Focus
Author: Story Loading Focus Contributors
Description: A responsive story magazine with a featured home page, an information-page sidebar, and a byline-first post layout.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: story-loading-focus
Tags: blog, news, two-columns, right-sidebar, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

:root {
	--ink: #222;
	--subtle: #606269;
	--accent: #d13a30;
	--orange: #bc3c1d;
	--peach: #fbe1db;
	--line: #e9e7e6;
	--sheet: #fff;
	--measure: 1170px;
	--shadow: 0 2px 14px rgba(48,25,21,.065);
	--radius: 17px;
}
* { box-sizing: border-box; }
body {
	margin: 0;
	background: #fff;
	color: var(--ink);
	font: 16px/1.65 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
body.home { background: #fffdfc; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--orange); }
:focus-visible { outline: 3px solid #b63b24; outline-offset: 3px; }
img, video, iframe, embed, object { max-width: 100%; }
img, video { height: auto; }
figure { margin: 0; }
button, input, textarea, select { font: inherit; }
button, input[type="submit"] { cursor: pointer; }
button, input, textarea, select { color: inherit; }
h1, h2, h3, h4 { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.wrap, .reading-wrap { width: min(var(--measure), calc(100% - 40px)); margin-inline: auto; }
.site-main { padding-block: 34px 70px; min-height: 48vh; }
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	clip: rect(0,0,0,0);
	clip-path: inset(50%);
	overflow: hidden;
	white-space: nowrap;
	border: 0;
}
.skip-link:focus {
	width: auto; height: auto; clip: auto; clip-path: none; inset: 10px auto auto 10px;
	background: white; padding: .6rem 1rem; z-index: 99999; color: var(--ink); font-weight: 700;
}
#top, #content:focus { outline: none; }

/* Masthead and navigation */
.site-header { background: white; }
.topbar { padding: 8px 0 3px; }
.bar-inner { width: min(var(--measure), calc(100% - 20px)); }
.bar-inner nav { min-width: 0; }
.topbar-date, .bar-tagline { display: none; }
.menu { list-style: none; margin: 0; padding: 0; }
.topbar .menu {
	display: flex; gap: 7px; overflow-x: auto; scrollbar-width: thin;
	padding: 4px 3px 7px; align-items: center;
}
.topbar .menu a {
	display: block; white-space: nowrap; border-radius: 24px;
	background: #f1f1f1; padding: 7px 15px; color: #292929; font-size: 12px; font-weight: 700;
}
.topbar .menu li:first-child a { background: var(--orange); color: white; }
.topbar .menu a:hover { background: #ffeadf; color: #983512; }
.branding { padding: 29px 0; text-align: center; }
.home .branding { padding: 15px 0 18px; }
.custom-logo-link { display: inline-block; margin-bottom: 5px; }
.custom-logo { display: block; max-height: 75px; width: auto; }
.site-title { margin: 0; font-size: clamp(33px,4.1vw,44px); line-height: 1.1; font-weight: 900; letter-spacing: -.05em; color: #171717; }
.site-description { margin: 8px auto 0; max-width: 90ch; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--subtle); }
.nav-shell { border-block: 1px solid var(--line); border-bottom: 2px solid #252525; }
.home .nav-shell { border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; gap: 18px; justify-content: space-between; align-items: center; }
.primary-nav { min-width: 0; }
.primary-nav .menu { display: flex; align-items: center; flex-wrap: wrap; }
.primary-nav li { position: relative; }
.primary-nav a { display: block; padding: 14px 16px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .045em; }
.primary-nav .current-menu-item > a, .primary-nav .current-menu-ancestor > a { color: var(--orange); }
.primary-nav .menu > li:first-child > a { padding-inline-start: 0; }
.primary-nav .sub-menu {
	display: none; list-style: none; margin: 0; padding: 4px; position: absolute; z-index: 5; min-width: 190px;
	background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
}
.primary-nav .sub-menu a { padding: 8px 10px; }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: block; }
.menu-toggle { display: none; align-items: center; gap: 9px; padding: 7px 11px; background: white; border: 1px solid var(--line); border-radius: 5px; font-weight: 700; font-size: 13px; }
.hamburger { position: relative; display: inline-block; width: 16px; height: 12px; border-block: 2px solid currentColor; }
.hamburger::after { content: ""; position: absolute; inset: 3px 0 auto; border-top: 2px solid currentColor; }
.search-form { display: flex; align-items: center; gap: 4px; min-width: 0; width: min(100%,260px); }
.search-form label { min-width: 0; flex: 1; }
.search-form input { width: 100%; min-width: 0; padding: 7px; border: 0; border-bottom: 1px solid #bfbfbf; background: transparent; font-size: 13px; }
.search-form button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; background: transparent; color: #393939; }
.nav-inner > .search-form { width: 174px; flex-shrink: 0; }
.magnifier { display: inline-block; width: 14px; height: 14px; border: 1.8px solid currentColor; border-radius: 50%; position: relative; }
.magnifier::after { content: ""; position: absolute; width: 7px; height: 2px; background: currentColor; inset: auto -5px -2px auto; transform: rotate(45deg); }

/* Magazine home */
.home-main { width: min(var(--measure), calc(100% - 24px)); padding-top: 22px; }
.home-intro { margin-bottom: 30px; }
.featured, .category-grid { display: grid; align-items: start; gap: 16px; }
.featured { grid-template-columns: minmax(0,1.8fr) minmax(0,.95fr); margin: 14px 0 26px; }
.featured > *, .category-grid > * { min-width: 0; }
.lead-story, .side-stack {
	border: 1px solid #efebe9; background: white; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.lead-copy { padding: 22px 22px 17px; }
.lead-top, .side-top, .section-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.lead-topic { margin: 9px 0 3px; font-size: 12px; color: var(--subtle); }
.feature-label, .side-top .category-link, .category-grid .lead-top .category-link {
	display: inline-block; border-radius: 20px; padding: 3px 9px; background: var(--orange); color: white;
	font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .025em; line-height: 1.55;
}
.lead-story h2 { margin: 8px 0; font-size: clamp(22px,2.3vw,30px); font-weight: 850; letter-spacing: -.028em; line-height: 1.3; }
.lead-story h3 { margin: 8px 0; font-size: 21px; line-height: 1.35; letter-spacing: -.02em; }
.deck { margin: 0; color: #55565b; font-size: 14px; line-height: 1.65; }
.meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; color: var(--subtle); font-size: 11px; line-height: 1.55; }
.meta > time { display: inline-block; }
.view-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 20px; background: #f3f3f3; color: #5e5e5e; font-size: 11px; font-weight: 650; line-height: 1.4; white-space: nowrap; }
.eye { display: inline-grid; place-content: center; width: 13px; height: 9px; border: 1.3px solid currentColor; border-radius: 50%; }
.eye::before { content: ""; width: 3px; height: 3px; background: currentColor; border-radius: 50%; }
.story-image { display: block; overflow: hidden; background: #f4f1ee; }
.story-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lead-image { aspect-ratio: 1.8; }
.side-stack { display: flex; flex-direction: column; align-self: stretch; }
.side-story { flex: 1; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.side-story:last-child { border-bottom: 0; }
.side-story h3 { margin: 8px 0 5px; font-size: clamp(16px,1.65vw,21px); line-height: 1.4; letter-spacing: -.024em; font-weight: 800; }
.side-story .deck { margin-top: 5px; font-size: 12px; }
.one-story { grid-template-columns: 1fr !important; }
.one-story .lead-image { max-height: 30rem; }
.category-panel { margin: 24px 0 30px; padding: 20px; border-radius: 18px; background: var(--peach); }
.section-bar { margin: 0 0 18px; }
.section-bar h2, .widget-title { margin: 0; font-size: 15px; font-weight: 850; line-height: 1.45; letter-spacing: .06em; text-transform: uppercase; }
#latest-stories > .section-bar::after, .related .section-bar::after, .widget-title::after { content: ""; height: 1px; background: #dedbd9; flex: 1; }
.category-panel .section-bar { margin-bottom: 15px; }
.category-panel .section-bar h2 { font-size: 16px; text-transform: none; letter-spacing: -.013em; }
.category-panel .section-bar a { font-size: 12px; color: #963826; font-weight: 750; }
.category-panel .section-bar a:hover { text-decoration: underline; }
.category-grid { grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); }
.lead-category { box-shadow: none; }
.lead-category .lead-copy { padding: 17px; }
.lead-category .deck { font-size: 13px; }
.lead-category .lead-image { aspect-ratio: 1.7; }
.mini-list { min-width: 0; }
.mini-story { display: flex; align-items: flex-start; gap: 11px; padding: 10px 0; border-bottom: 1px solid rgba(155,75,55,.19); }
.mini-story:first-child { padding-top: 0; }
.mini-story:last-child { border: 0; }
.mini-image { flex: 0 0 82px; aspect-ratio: 1.35; border-radius: 7px; }
.mini-story h3 { margin: 1px 0 3px; font-size: 14px; font-weight: 750; line-height: 1.42; }
.mini-story .meta { font-size: 11px; }
#latest-stories { margin-top: 26px; scroll-margin: 20px; }
.story-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 30px 24px; }
.story-card { min-width: 0; }
.card-image { aspect-ratio: 16 / 10; }
.card-body { padding-top: 11px; }
.story-card:not(.has-post-thumbnail) .card-body { border-top: 2px solid #d8d4d2; }
.story-card h2 { margin: 9px 0; font-size: 19px; line-height: 1.35; letter-spacing: -.025em; }
.story-card .meta > .category-link { text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: .035em; }
.story-card .deck { font-size: 14px; }
.empty-state { color: var(--subtle); padding: 12px 0; }

/* Pages, archives, widgets and article content */
.page-layout { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 42px; align-items: start; }
.page-column, .sidebar, .reader { min-width: 0; }
.page-title, .listing-header h1, .reader-title { margin: 0 0 18px; font-weight: 800; letter-spacing: -.035em; font-size: clamp(30px,3.2vw,43px); line-height: 1.2; }
.listing-header { border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.archive-description { max-width: 70ch; color: var(--subtle); }
.widget { margin-bottom: 28px; overflow-wrap: anywhere; }
.widget-title, .widget .wp-block-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.widget .wp-block-heading { font-size: 18px; }
.widget ul { margin-block: 0; padding-inline-start: 19px; }
.widget li + li { margin-top: 5px; }
.widget ul, .widget ol { font-size: 14px; }
.widget input, .widget select { max-width: 100%; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rank-list li + li { margin-top: 0; }
.rank-list a { font-weight: 710; line-height: 1.42; }
.rank { color: #bab7b5; font-size: 26px; font-weight: 800; line-height: 1.12; font-variant-numeric: tabular-nums; }
.entry-content { overflow-wrap: anywhere; font-size: 18px; line-height: 1.85; display: flow-root; }
.entry-content > :first-child { margin-top: 0; }
.entry-content p { margin: 0 0 1.45em; }
.entry-content :is(h2,h3,h4,h5,h6) { margin: 1.45em 0 .6em; line-height: 1.32; letter-spacing: -.025em; }
.entry-content a, .text-link, .comments-area .comment-content a { color: #a63024; text-decoration: underline; text-underline-offset: .16em; }
.entry-content :is(.wp-element-button,.wp-block-button__link) { color: white; text-decoration: none; }
.entry-content img, .wp-caption { max-width: 100%; }
.entry-content figure { margin-block: 1.2em; }
.entry-content figure img { display: block; }
.entry-content figure.aligncenter img { margin-inline: auto; }
.entry-content figcaption, .wp-caption-text, .gallery-caption { color: var(--subtle); font-size: 13px; line-height: 1.5; }
.entry-content blockquote { margin: 1.4em 0; padding: 16px 23px; background: #f7f7f7; border: 0; border-inline-start: 4px solid #ff4b24; font-style: italic; }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content blockquote cite { font-size: .85em; }
.entry-content pre { padding: 14px; background: #f4f4f4; overflow: auto; white-space: pre; }
.entry-content table { border-collapse: collapse; max-width: 100%; }
.entry-content :is(th,td) { border: 1px solid var(--line); padding: 7px; }
.entry-content .wp-block-table { overflow-x: auto; }
.entry-content :is(iframe,video,embed), .entry-content .alignfull, .entry-content .alignwide { max-width: 100%; }
.alignleft { float: left; margin: .35em 1.4em .7em 0; }
.alignright { float: right; margin: .35em 0 .7em 1.4em; }
.aligncenter { display: block; margin-inline: auto; }
.entry-content .alignfull, .entry-content .alignwide { clear: both; }
.entry-content::after { content: ""; display: block; clear: both; }
.page-parts, .pagination .nav-links, .pagination ul, .comments-pagination .nav-links {
	display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; align-items: center;
}
.pagination, .page-parts { margin-top: 28px; }
.pagination :is(a,span).page-numbers, .page-parts .post-page-numbers { display: inline-block; border: 1px solid #ddd; padding: 6px 12px; font-size: 13px; }
.pagination .current, .pagination a:hover, .page-parts .current { background: #272727; color: white; }
.page-parts > span:first-child { font-weight: 700; margin-inline-end: 7px; }

/* Focused single post */
body.single-post { background: #fdfcfb; }
.reading-wrap { padding-top: clamp(18px,3vw,36px); }
.reader { background: white; border-radius: 24px; padding: clamp(18px,3vw,34px); box-shadow: 0 8px 32px rgba(20,28,40,.06); }
.publisher-card { display: flex; align-items: center; gap: 15px; margin: 0 0 28px; }
.publisher-card > div { min-width: 0; }
.publisher-avatar { display: block; width: 68px; height: 68px; flex: 0 0 auto; object-fit: cover; border-radius: 50%; border: 3px solid #f04a25; }
.publisher-initial { display: grid; place-items: center; background: #fff0e9; color: #a9371d; text-transform: uppercase; font-size: 28px; font-weight: 850; }
.byline { color: var(--subtle); font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.byline a { font-weight: 800; color: #181b20; }
.byline a:hover { color: var(--orange); text-decoration: underline; }
.publisher-meta { margin-top: 5px; font-size: 13px; gap: 4px 8px; }
.publisher-meta > span:not(.reader-count)::before { content: "·"; display: inline-block; margin-inline-end: 8px; }
.reader-count .view-badge { padding: 3px 9px; border: 1px solid #f5b8a5; background: #fff7f4; color: #ac3419; text-transform: uppercase; font-weight: 750; }
.reader-image { text-align: center; margin: 0 0 23px; }
.reader-image img { vertical-align: middle; max-width: 100%; height: auto; }
.story-content { color: #202124; font-size: 21px; font-weight: 500; line-height: 1.8; }
.story-content p { margin: 0 0 1.15em; }
.story-content .sl-auto-dialogue, .story-content p.is-dialogue { color: #bc391a; font-weight: 700; }
.story-content > :last-child { margin-bottom: 0; }
.tag-list { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 22px; }
.tag-list a { padding: 4px 10px; border-radius: 20px; background: #f4f4f4; font-size: 12px; }
.related { margin-top: 34px; }
.related-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.related-grid h3 { font-size: 15px; line-height: 1.42; margin: 8px 0 0; }
.related-image { aspect-ratio: 16 / 10; border-radius: 7px; }
.comments-area { margin: 35px 0; max-width: 760px; overflow-wrap: anywhere; }
.comments-title, .comment-reply-title { font-size: 21px; line-height: 1.35; }
.comment-list, .comment-list .children { list-style: none; padding-inline-start: 0; }
.comment-list .children { margin-inline-start: 1.3rem; }
.comment-list .comment-body { padding: 15px 0; border-top: 1px solid var(--line); }
.comment-author .avatar { vertical-align: middle; margin-inline-end: 5px; border-radius: 50%; }
.comment-metadata, .reply, .comment-notes, .logged-in-as { font-size: 13px; color: var(--subtle); }
.comment-form label:not([for="wp-comment-cookies-consent"]), .post-password-form label { display: block; font-weight: 650; font-size: 14px; }
.comment-form input:not([type="checkbox"]):not([type="submit"]), .comment-form textarea, .post-password-form input[type="password"] { max-width: 100%; border: 1px solid #bbb; border-radius: 5px; padding: 8px; }
.comment-form textarea { display: block; width: 100%; }
.comment-form input[type="submit"], .post-password-form input[type="submit"] { padding: 8px 17px; border: none; border-radius: 5px; background: var(--orange); color: white; font-weight: 700; }

/* Footer */
.site-footer { padding: 40px 0 22px; color: #f3f3f3; background: #282828; }
.footer-grid { display: grid; grid-template-columns: 1.08fr 1fr 1fr; gap: clamp(30px,7vw,105px); }
.footer-brand { display: inline-block; font-weight: 900; font-size: clamp(22px,2.3vw,29px); line-height: 1.3; letter-spacing: -.025em; color: white; }
.footer-branding p { max-width: 340px; font-size: 16px; line-height: 1.85; margin: 12px 0 21px; }
.footer-privacy { display: inline-block; border: 1px solid #bbb; border-radius: 4px; padding: 6px 16px; font-size: 13px; }
.footer-group h2 { margin: 0 0 18px; font-weight: 800; text-transform: uppercase; letter-spacing: .035em; font-size: 15px; }
.footer-group nav + h2 { margin-top: 40px; }
.footer-group li + li { margin-top: 12px; }
.site-footer a:hover { color: #ffb6a2; }
.footer-bottom { border-top: 1px solid #494949; margin-top: 30px; padding-top: 15px; font-size: 12px; color: #ccc; }
.back-top {
	position: fixed; right: 22px; bottom: 20px; z-index: 8; display: grid; place-content: center;
	width: 43px; height: 48px; text-align: center; border-radius: 10px; background: #bd3c19; color: white; line-height: 1;
	box-shadow: 0 3px 12px #0002;
}
.back-top span { font-size: 21px; font-weight: 800; }
.back-top small { margin-top: 3px; font-size: 9px; font-weight: 800; }
.back-top:hover { background: #a33315; color: white; }

@media (prefers-reduced-motion: no-preference) {
	.story-image img { transition: transform .24s ease; }
	.story-image:hover img { transform: scale(1.025); }
}
@media (max-width: 950px) {
	.page-layout { grid-template-columns: minmax(0,1fr) 250px; gap: 25px; }
	.primary-nav a { padding: 12px 10px; }
	.story-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 720px) {
	.wrap, .reading-wrap, .home-main { width: min(var(--measure),calc(100% - 28px)); }
	.site-main { padding-block: 22px 45px; }
	.branding { padding: 21px 0; }
	.home .branding { padding: 13px 0; }
	.site-description { font-size: 10px; letter-spacing: .12em; }
	.nav-inner { flex-wrap: wrap; padding: 7px 0; gap: 3px 12px; }
	.slf-js .menu-toggle { display: inline-flex; }
	.primary-nav { order: 3; flex-basis: 100%; }
	.slf-js .primary-nav:not(.open) { display: none; }
	.primary-nav .menu, .primary-nav .sub-menu { display: block; }
	.primary-nav a { padding: 9px 4px; border-bottom: 1px solid var(--line); }
	.primary-nav .sub-menu { position: static; padding: 0 0 0 12px; border: 0; box-shadow: none; }
	.nav-inner > .search-form { margin-inline-start: auto; width: min(175px,54%); }
	.featured, .category-grid, .page-layout { grid-template-columns: minmax(0,1fr); }
	.featured { margin-top: 0; gap: 14px; }
	.lead-copy { padding: 18px; }
	.lead-hero h2 { font-size: clamp(21px,6vw,27px); }
	.lead-image, .lead-category .lead-image { aspect-ratio: 16 / 10; }
	.side-story { padding: 16px; }
	.side-story h3 { font-size: 17px; }
	.side-story .deck { font-size: 13px; }
	.category-panel { padding: 15px; }
	.mini-image { flex-basis: 88px; }
	.story-grid { grid-template-columns: 1fr; gap: 22px; }
	.page-layout { gap: 30px; }
	.related-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
	.entry-content { font-size: 17px; }
	.reading-wrap { padding-top: 16px; }
	.reader { padding: 18px 15px; }
	.publisher-card { gap: 11px; margin-bottom: 22px; }
	.publisher-avatar { width: 58px; height: 58px; }
	.byline { font-size: 16px; }
	.publisher-meta { font-size: 12px; }
	.story-content { font-size: 19px; line-height: 1.75; }
	.story-content blockquote { padding: 14px 17px; }
	.footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 30px; }
	.footer-branding { grid-column: 1 / -1; }
	.back-top { right: 14px; bottom: 16px; width: 40px; height: 44px; }
}
@media (max-width: 460px) {
	.related-grid, .footer-grid { grid-template-columns: 1fr; }
	.footer-branding { grid-column: auto; }
	.related-image { max-height: 230px; }
	.lead-top { align-items: flex-start; }
	.meta { gap: 4px 7px; }
	.alignleft, .alignright { float: none; margin-inline: 0; }
}
