/*
Theme Name: Urban Splatter
Theme URI: https://theurbansplatter.com/
Author: The Urban Splatter
Author URI: https://theurbansplatter.com/
Description: A fast, clean magazine theme for The Urban Splatter. Category-led homepage, readable articles with an automatic table of contents, responsive tables, breadcrumbs, related posts and share links. No page builder, no jQuery, no external fonts.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.1
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: urbansplatter
Tags: blog, news, grid-layout, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, wide-blocks, editor-style
*/

/* ---------- Tokens ---------- */
:root {
	--navy: #1b2e4b;
	--navy-deep: #13223a;
	--blue: #2f80d1;
	--blue-bright: #4a9be8;
	--sky: #7cc4ff;
	--ink: #1c2633;
	--muted: #5b6b80;
	--line: #e3e8ef;
	--surface: #f4f7fb;
	--bg: #ffffff;
	--radius: 12px;
	--shadow: 0 1px 2px rgba(19, 34, 58, .06), 0 6px 18px rgba(19, 34, 58, .06);
	--wrap: 1200px;
	--prose: 720px;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-head: "Inter Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.65;
	color: var(--ink);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); color: var(--navy-deep); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
p { margin: 0 0 1.1em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.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;
}
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: #fff; color: var(--navy); padding: 10px 16px; border-radius: 8px; font-weight: 700; }
.skip-link:focus { left: 8px; }

.btn, button.btn, input[type="submit"] {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	font: 700 15px/1 var(--font); color: #fff; background: var(--blue);
	border: 0; border-radius: 999px; padding: 12px 20px; cursor: pointer; text-decoration: none;
}
.btn:hover, input[type="submit"]:hover { background: var(--navy); color: #fff; }

input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea {
	width: 100%; font: 16px/1.4 var(--font); color: var(--ink);
	border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff;
}
input:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(74, 155, 232, .25); }

/* ---------- Header ---------- */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex-shrink: 0; }
.brand:hover { color: #fff; }
.brand-mark { width: 40px; height: 40px; border-radius: 9px; object-fit: contain; }
.brand-name { font: 800 17px/1 var(--font-head); letter-spacing: .06em; white-space: nowrap; }
.brand-name b { color: var(--sky); font-weight: 800; }

.site-nav { margin-left: auto; }
.site-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav li { position: relative; }
.site-nav a {
	display: block; color: #dbe6f5; text-decoration: none; font-weight: 600; font-size: 15px;
	padding: 8px 12px; border-radius: 8px;
}
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav .current-cat > a { color: #fff; background: rgba(255, 255, 255, .1); }
.site-nav .sub-menu, .site-nav .children {
	list-style: none; margin: 0; padding: 8px; position: absolute; left: 0; top: 100%; min-width: 200px;
	background: #fff; border-radius: 10px; box-shadow: var(--shadow); display: none;
}
.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { display: block; }
.site-nav .sub-menu a { color: var(--ink); }
.site-nav .sub-menu a:hover { background: var(--surface); color: var(--navy); }

.icon-btn { background: transparent; border: 0; color: #fff; padding: 8px; border-radius: 8px; cursor: pointer; display: inline-flex; }
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.nav-toggle { display: none; }
.header-search { background: var(--navy-deep); padding: 14px 0; }
.search-form { display: flex; gap: 8px; max-width: 640px; }
.header-search .search-field { border: 0; }

@media (max-width: 900px) {
	.nav-toggle { display: inline-flex; margin-left: auto; }
	.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--navy); padding: 8px 20px 18px; margin: 0; box-shadow: 0 12px 24px rgba(0, 0, 0, .2); }
	.nav-open .site-nav { display: block; }
	.site-nav .menu { flex-direction: column; }
	.site-nav .sub-menu, .site-nav .children { position: static; display: block; background: transparent; box-shadow: none; padding: 0 0 0 12px; }
	.site-nav .sub-menu a { color: #dbe6f5; }
	.header-inner { position: relative; }
	.search-toggle { margin-left: 0; }
}
@media (max-width: 420px) { .brand-name { font-size: 14px; } .brand-mark { width: 34px; height: 34px; } }

/* ---------- Pills, meta ---------- */
.pill {
	display: inline-block; font: 800 11.5px/1 var(--font); letter-spacing: .09em; text-transform: uppercase;
	color: var(--blue); background: #e8f2fc; padding: 6px 10px; border-radius: 999px; text-decoration: none; margin-bottom: 10px;
}
.pill:hover { background: var(--blue); color: #fff; }
.cat-ai-tech.pill, .pill.cat-ai-and-tech { color: #5b3fc9; background: #efeafd; }
.cat-crypto.pill { color: #b45309; background: #fef3e2; }
.cat-business.pill { color: #0f766e; background: #e3f6f3; }
.cat-finance-law.pill, .pill.cat-finance-and-law { color: #1d4ed8; background: #e6edfd; }
.cat-homes-design.pill, .pill.cat-homes-and-design { color: #9a3412; background: #fdece4; }
.cat-lifestyle.pill { color: #be185d; background: #fde8f1; }
.cat-education.pill { color: #15803d; background: #e5f6ea; }
.pill:hover { color: #fff !important; background: var(--navy) !important; }

.post-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--muted); }
.post-meta a { color: var(--ink); font-weight: 600; text-decoration: none; }
.post-meta span + span::before { content: "·"; margin-right: 14px; color: #a3b0c0; }

/* ---------- Cards and grids ---------- */
.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3 { grid-template-columns: 1fr; } }

.card { display: flex; flex-direction: column; }
.card-media { display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface); margin-bottom: 14px; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card-placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--navy), var(--blue)); }
.card-title { font-size: 20px; margin: 0 0 8px; }
.card-title a { color: var(--navy-deep); text-decoration: none; }
.card-title a:hover { color: var(--blue); }
.card-excerpt { color: var(--muted); font-size: 15.5px; margin-bottom: 10px; }

/* ---------- Homepage ---------- */
.home-intro { background: var(--navy); color: #fff; padding: 34px 0 30px; }
.home-title { color: #fff; font-size: clamp(26px, 4vw, 40px); margin: 0 0 6px; letter-spacing: .02em; }
.home-tagline { color: #c9d8ee; margin: 0; font-size: 18px; }
.home-lead { display: grid; grid-template-columns: 2fr 1fr; gap: 36px; padding-top: 36px; padding-bottom: 10px; }
.lead-media { display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface); margin-bottom: 18px; }
.lead-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lead-title { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 10px; }
.lead-title a { color: var(--navy-deep); text-decoration: none; }
.lead-title a:hover { color: var(--blue); }
.lead-excerpt { color: var(--muted); font-size: 18px; }
.section-label { font: 800 13px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 3px solid var(--navy); padding-bottom: 10px; margin-bottom: 6px; }
.lead-list ol { list-style: none; margin: 0; padding: 0; counter-reset: n; }
.lead-list li { counter-increment: n; padding: 16px 0 16px 46px; border-bottom: 1px solid var(--line); position: relative; }
.lead-list li::before { content: counter(n); position: absolute; left: 0; top: 14px; font: 900 30px/1 var(--font-head); color: #c7d6ea; }
.lead-list .pill { margin-bottom: 6px; }
.lead-list-title { display: block; font: 700 17px/1.35 var(--font-head); color: var(--navy-deep); text-decoration: none; }
.lead-list-title:hover { color: var(--blue); }
@media (max-width: 900px) { .home-lead { grid-template-columns: 1fr; } }

.cat-section, .related { padding-top: 44px; padding-bottom: 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 3px solid var(--navy); margin-bottom: 24px; padding-bottom: 10px; }
.section-title { font-size: 26px; margin: 0; }
.section-title a { color: var(--navy-deep); text-decoration: none; }
.related .section-title { margin-bottom: 22px; }
.section-more { font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; }
.home-page-content { padding-top: 40px; }

/* ---------- Archive ---------- */
.archive-header { background: var(--surface); border-bottom: 1px solid var(--line); padding: 26px 0 30px; margin-bottom: 36px; }
.archive-title { font-size: clamp(28px, 4vw, 42px); margin: 6px 0 8px; }
.archive-desc { color: var(--muted); max-width: 720px; }
.archive-desc p:last-child { margin-bottom: 0; }
.archive-search { margin-top: 16px; }
.archive-body { padding-bottom: 20px; }
.pagination { margin: 40px 0 10px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pagination .page-numbers { display: inline-block; min-width: 42px; text-align: center; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; }
.pagination .page-numbers.current, .pagination a.page-numbers:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.empty-state { text-align: center; padding: 40px 0; color: var(--muted); }
.empty-state .search-form { margin: 0 auto; }

.breadcrumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--blue); }
.breadcrumbs .sep { margin: 0 8px; color: #b3bfcd; }
.breadcrumbs span[aria-current] { color: var(--ink); }

/* ---------- Article ---------- */
.article-wrap { padding-top: 30px; }
.article-wrap.has-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; }
@media (max-width: 1000px) { .article-wrap.has-sidebar { grid-template-columns: minmax(0, 1fr); } }
.article { max-width: var(--prose); margin: 0 auto; width: 100%; min-width: 0; }
.has-sidebar .article { margin: 0; max-width: none; }
.article-title { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.12; margin: 4px 0 14px; }
.article-dek { font-size: 20px; color: var(--muted); line-height: 1.5; }
.article-header { margin-bottom: 24px; }
.article-hero { margin: 0 0 30px; }
.article-hero img { width: 100%; border-radius: var(--radius); display: block; }
.article-hero figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.sidebar .widget { background: var(--surface); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; }
.widget-title { font-size: 17px; }
.sidebar ul { margin: 0; padding-left: 18px; }

/* Prose: everything inside post and page content */
.prose { font-size: 18px; line-height: 1.75; }
.prose > * { margin-top: 0; }
.prose h2 { font-size: clamp(24px, 3vw, 30px); margin: 1.9em 0 .6em; scroll-margin-top: 90px; }
.prose h3 { font-size: clamp(20px, 2.4vw, 23px); margin: 1.6em 0 .5em; scroll-margin-top: 90px; }
.prose h4 { font-size: 19px; margin: 1.4em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.3em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--blue); font-weight: 700; }
.prose blockquote, .prose .wp-block-quote {
	margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--blue);
	font-size: 20px; color: var(--navy-deep);
}
.prose blockquote cite { display: block; font-size: 15px; color: var(--muted); font-style: normal; margin-top: 8px; }
.prose img { border-radius: 10px; }
.prose figure { margin: 1.8em 0; }
.prose figcaption, .prose .wp-element-caption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 8px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose code { background: var(--surface); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.prose pre { background: var(--navy-deep); color: #e6eef8; padding: 18px; border-radius: 10px; overflow-x: auto; font-size: 15px; }
.prose pre code { background: none; padding: 0; }
.prose strong { color: var(--navy-deep); }
.prose th strong { color: inherit; }
.prose .wp-block-table thead { border-bottom: 0; }

/* Tables: these posts use many, so they scroll on phones and stripe on all screens */
.prose .wp-block-table, .prose .table-scroll { overflow-x: auto; margin: 1.6em 0; -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; min-width: 480px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 11px 14px; text-align: left; vertical-align: top; }
.prose thead th, .prose tr:first-child th { background: var(--navy); color: #fff; font-weight: 700; border-color: var(--navy); }
.prose tbody tr:nth-child(even) td { background: var(--surface); }
/* Older pasted tables put every row in the header: show only the first row as a header. */
.prose thead tr:not(:first-child) th { background: #fff; color: var(--ink); font-weight: 400; border-color: var(--line); }
.prose thead tr:not(:first-child):nth-child(even) th { background: var(--surface); }
.prose thead tr:not(:first-child) th:first-child { font-weight: 700; }

/* Search block (sidebar or footer widget) */
.wp-block-search__inside-wrapper { display: flex; gap: 8px; }
.wp-block-search__button { font: 700 15px/1 var(--font); color: #fff; background: var(--blue); border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer; margin: 0; }
.wp-block-search__button:hover { background: var(--navy); }
.wp-block-search__label { font-weight: 700; display: block; margin-bottom: 6px; }
.prose .wp-block-table table { margin: 0; }
.prose .wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: transparent; }

/* Download / call-to-action buttons */
.prose .wp-block-button__link { background: var(--blue); color: #fff; border-radius: 999px; padding: 13px 24px; font-weight: 700; text-decoration: none; }
.prose .wp-block-button__link:hover { background: var(--navy); color: #fff; }
.prose .wp-block-buttons { margin: 1.5em 0; }

/* Wide and full alignments */
.prose .alignwide { max-width: 1000px; margin-left: 50%; transform: translateX(-50%); width: min(1000px, calc(100vw - 40px)); }
.prose .alignfull { width: 100vw; max-width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.prose .alignleft { float: left; margin: .3em 1.4em 1em 0; max-width: 50%; }
.prose .alignright { float: right; margin: .3em 0 1em 1.4em; max-width: 50%; }
.prose .aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.has-sidebar .prose .alignwide, .has-sidebar .prose .alignfull { width: 100%; margin-left: 0; transform: none; }

/* Table of contents */
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 2em; font-size: 16px; }
.toc summary { cursor: pointer; font: 800 15px/1.2 var(--font); color: var(--navy-deep); letter-spacing: .02em; }
.toc ol { margin: 12px 0 0; padding-left: 1.3em; columns: 2; column-gap: 32px; }
.toc li { break-inside: avoid; margin-bottom: 6px; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--blue); text-decoration: underline; }
@media (max-width: 620px) { .toc ol { columns: 1; } }

/* Article footer */
.article-footer { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 24px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.tags-label, .share-label { font: 800 12px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.tags a { font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; text-decoration: none; }
.tags a:hover { border-color: var(--blue); color: var(--blue); }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 26px; }
.share a, .share button { font: 600 14px/1 var(--font); color: var(--navy); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; text-decoration: none; cursor: pointer; }
.share a:hover, .share button:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.author-box { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border-radius: var(--radius); padding: 20px; }
.author-box img { border-radius: 50%; flex-shrink: 0; }
.author-name { font-weight: 700; margin: 0 0 4px; }
.author-name a { color: var(--navy-deep); }
.author-bio { margin: 0; color: var(--muted); font-size: 15.5px; }

/* Comments */
.comments-wrap { max-width: calc(var(--prose) + 40px); padding-top: 40px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 30px; }
.comment-list .children { list-style: none; padding-left: 28px; }
.comment-body { border-bottom: 1px solid var(--line); padding: 18px 0; }
.comment-author img { border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.comment-meta { font-size: 14px; color: var(--muted); }
.comment-meta a { color: var(--muted); }
.comment-form p { margin-bottom: 14px; }
.comment-form label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.comment-form .comment-form-cookies-consent label { display: inline; font-weight: 400; }

/* 404 */
.not-found { text-align: center; padding-top: 60px; max-width: 680px; }
.nf-code { font: 900 96px/1 var(--font-head); color: #d4e1f1; margin: 0; }
.not-found .search-form { margin: 24px auto 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #c3d1e6; margin-top: 70px; padding-top: 50px; font-size: 15.5px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 36px; }
.footer-grid:has(> :nth-child(4)) { grid-template-columns: 2fr 1fr 1fr 1.4fr; }
.footer-brand p { margin-top: 16px; max-width: 420px; }
.footer-title { color: #fff; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #c3d1e6; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .brand { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 18px; padding-bottom: 24px; font-size: 14px; }
@media (max-width: 800px) { .footer-grid, .footer-grid:has(> :nth-child(4)) { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* WordPress core classes */
.wp-caption { max-width: 100%; }
.sticky .card-title::before { content: "★ "; color: var(--blue); }
.bypostauthor > .comment-body .fn::after { content: " (author)"; font-size: 13px; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.page-links { margin: 24px 0; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.card-media img { transition: none; }
}
@media print {
	.site-header, .site-footer, .share, .related, .comments-wrap, .toc { display: none; }
}
