/*
Theme Name: Tipsheet
Theme URI: https://example.com/tipsheet
Author: Your Name
Author URI: https://example.com
Description: A community theme for football pools and betting tips sites. Organises content by pools week, gives comment counts the weight they deserve, and stays fast on cheap Android phones.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tipsheet
Tags: blog, news, two-columns, right-sidebar, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ---------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------- */

:root {
	--paper:      #efeee4;   /* newsprint ground */
	--surface:    #faf9f4;   /* cards, table stripes */
	--ink:        #1b1f1a;   /* body text, near-black olive */
	--ink-soft:   #5c6058;   /* meta text */
	--rule:       #cfcdbc;   /* hairlines */
	--rule-soft:  #e2e0d3;
	--stamp:      #4a2fa3;   /* duplicator ink: links, current week */
	--stamp-dark: #33207a;
	--hit:        #16704a;   /* confirmed draw, win */
	--alert:      #a8321d;   /* dead game, closed, error */

	--font-ui:   "Archivo", "Helvetica Neue", Arial, sans-serif;
	--font-body: "Newsreader", Georgia, "Times New Roman", serif;

	--step--1: 0.833rem;
	--step-0:  1.0625rem;
	--step-1:  1.25rem;
	--step-2:  1.5rem;
	--step-3:  1.9rem;
	--step-4:  2.5rem;

	--gap:   1.25rem;
	--wrap:  1180px;
	--radius: 2px;
}

/* ---------------------------------------------------------------
   2. Reset and base
   --------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: var(--step-0);
	line-height: 1.65;
	font-optical-sizing: auto;
}

img, svg, iframe, video { max-width: 100%; height: auto; }
img { display: block; }

a { color: var(--stamp); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--stamp-dark); }

:focus-visible {
	outline: 2px solid var(--stamp);
	outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-ui);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.011em;
	margin: 0 0 0.5em;
	text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p, ul, ol, blockquote, table, pre { margin: 0 0 1.1em; }

blockquote {
	border-left: 3px solid var(--stamp);
	margin-left: 0;
	padding: 0.2em 0 0.2em 1.1em;
	color: var(--ink-soft);
}

code, pre, .tabular { font-variant-numeric: tabular-nums; }

pre {
	background: var(--surface);
	border: 1px solid var(--rule);
	padding: 1em;
	overflow-x: auto;
}

hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip-link:focus {
	position: fixed;
	top: 0.5rem; left: 0.5rem;
	z-index: 999;
	width: auto; height: auto;
	clip-path: none;
	background: var(--ink);
	color: var(--paper);
	padding: 0.6rem 1rem;
}

/* ---------------------------------------------------------------
   3. Layout
   --------------------------------------------------------------- */

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 1rem;
}

.layout {
	display: grid;
	gap: 2.5rem;
	grid-template-columns: minmax(0, 1fr);
	padding: 1.75rem 0 3rem;
}

@media (min-width: 900px) {
	.layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 3rem; }
	.layout--full { grid-template-columns: minmax(0, 1fr); }
}

.entry-content { max-width: 68ch; }

/* ---------------------------------------------------------------
   4. Masthead and navigation
   --------------------------------------------------------------- */

.masthead {
	background: var(--ink);
	color: var(--paper);
	border-bottom: 3px solid var(--stamp);
}

.masthead__bar {
	display: flex;
	align-items: center;
	gap: 1rem;
	min-height: 66px;
	padding-top: 0.6rem;
	padding-bottom: 0.6rem;
}

.masthead__brand { margin: 0; font-size: var(--step-2); line-height: 1; }

.masthead__brand a {
	color: var(--paper);
	text-decoration: none;
	font-family: var(--font-ui);
	font-weight: 700;
	letter-spacing: -0.02em;
}

.masthead__brand img { max-height: 46px; width: auto; }

.masthead__tagline {
	margin: 0.3rem 0 0;
	font-size: var(--step--1);
	color: #a9ab9f;
	font-family: var(--font-ui);
}

.masthead__tools { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

.nav-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	background: transparent;
	border: 1px solid #4a4e46;
	color: var(--paper);
	font-family: var(--font-ui);
	font-size: var(--step--1);
	padding: 0.45rem 0.7rem;
	border-radius: var(--radius);
	cursor: pointer;
}

.nav-toggle:hover { border-color: var(--paper); }

.nav-toggle__bars { display: block; width: 16px; height: 2px; background: currentColor; position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after {
	content: ""; position: absolute; left: 0; width: 16px; height: 2px; background: currentColor;
}
.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }

.primary-nav { background: #262b24; font-family: var(--font-ui); }

.primary-nav ul { list-style: none; margin: 0; padding: 0; }

.primary-nav > div > ul {
	display: flex;
	flex-wrap: wrap;
}

.primary-nav li { position: relative; }

.primary-nav a {
	display: block;
	color: #e8e7dc;
	text-decoration: none;
	font-size: var(--step--1);
	font-weight: 600;
	padding: 0.75rem 0.9rem;
	border-bottom: 3px solid transparent;
}

.primary-nav a:hover,
.primary-nav a:focus-visible { color: #fff; background: #31382e; }

.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a { border-bottom-color: var(--stamp); color: #fff; }

.primary-nav .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 40;
	min-width: 220px;
	background: #262b24;
	border: 1px solid #3c4239;
	border-top: 3px solid var(--stamp);
}

.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu { display: block; }

.primary-nav .sub-menu a { padding: 0.6rem 0.9rem; border-bottom: 1px solid #333a30; }

@media (max-width: 899px) {
	.primary-nav { display: none; }
	.primary-nav.is-open { display: block; }
	.primary-nav > div > ul { display: block; }
	.primary-nav .sub-menu {
		display: block;
		position: static;
		border: 0;
		background: #1f241d;
	}
	.primary-nav .sub-menu a { padding-left: 1.9rem; }
}

@media (min-width: 900px) {
	.nav-toggle { display: none; }
}

/* ---------------------------------------------------------------
   5. Week plate — the loudest object on the site
   --------------------------------------------------------------- */

.week-plate {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.25rem;
	background: var(--surface);
	border: 1px solid var(--rule);
	border-left: 6px solid var(--stamp);
	padding: 1.1rem 1.25rem;
	margin: 1.75rem 0 0;
}

.week-plate__number {
	font-family: var(--font-ui);
	font-weight: 700;
	font-size: clamp(2.75rem, 9vw, 4.25rem);
	line-height: 0.85;
	color: var(--stamp);
	font-variant-numeric: tabular-nums;
}

.week-plate__number small {
	display: block;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--ink-soft);
	line-height: 1.4;
}

.week-plate__body { flex: 1 1 14rem; }

.week-plate__body p { margin: 0; }

.week-plate__deadline { font-family: var(--font-ui); font-weight: 600; font-size: var(--step-1); }

.week-plate__note { color: var(--ink-soft); font-size: var(--step--1); }

.week-plate__cta {
	display: inline-block;
	background: var(--stamp);
	color: #fff;
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: var(--step--1);
	text-decoration: none;
	padding: 0.6rem 1rem;
	border-radius: var(--radius);
}

.week-plate__cta:hover { background: var(--stamp-dark); color: #fff; }

.custom-logo-link { display: inline-block; }
.custom-logo { max-height: 46px; width: auto; }

/* ---------------------------------------------------------------
   5b. Home widget columns
   --------------------------------------------------------------- */

.home-columns {
	display: grid;
	gap: 1.5rem 2rem;
	grid-template-columns: 1fr;
	margin-bottom: 2rem;
}

@media (min-width: 620px) {
	.home-columns { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------------------------
   6. Thread rows — the homepage and archive workhorse
   --------------------------------------------------------------- */

.thread-list { border-top: 1px solid var(--rule); }

.thread {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: start;
	gap: 0.75rem 1rem;
	padding: 0.95rem 0;
	border-bottom: 1px solid var(--rule-soft);
}

.thread:hover { background: var(--surface); }

.thread__title {
	font-family: var(--font-ui);
	font-size: 1.15rem;
	font-weight: 600;
	line-height: 1.3;
	margin: 0;
}

.thread__title a { color: var(--ink); text-decoration: none; }
.thread__title a:hover { color: var(--stamp); text-decoration: underline; }

.thread__meta {
	font-family: var(--font-ui);
	font-size: var(--step--1);
	color: var(--ink-soft);
	margin: 0.3rem 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.9rem;
}

.thread__count {
	font-family: var(--font-ui);
	font-variant-numeric: tabular-nums;
	text-align: center;
	text-decoration: none;
	min-width: 3.4rem;
	padding: 0.15rem 0.4rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--ink);
	line-height: 1.1;
}

.thread__count:hover { border-color: var(--stamp); color: var(--stamp); }

.thread__count b { display: block; font-size: var(--step-1); font-weight: 700; }
.thread__count span { font-size: 0.7rem; color: var(--ink-soft); }

.thread__count--busy { border-color: var(--stamp); background: #ece7fa; }
.thread__count--busy b { color: var(--stamp); }

.week-chip {
	display: inline-block;
	font-family: var(--font-ui);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--stamp);
	border: 1px solid var(--stamp);
	border-radius: var(--radius);
	padding: 0.05rem 0.4rem;
	text-decoration: none;
	font-variant-numeric: tabular-nums;
}

.week-chip--past { color: var(--ink-soft); border-color: var(--rule); }

/* ---------------------------------------------------------------
   7. Single post and pages
   --------------------------------------------------------------- */

.entry-header { margin-bottom: 1.5rem; }

.entry-title { margin-bottom: 0.4rem; }

.entry-meta {
	font-family: var(--font-ui);
	font-size: var(--step--1);
	color: var(--ink-soft);
	display: flex;
	flex-wrap: wrap;
	gap: 0.9rem;
	padding-bottom: 0.9rem;
	border-bottom: 1px solid var(--rule);
}

.entry-thumb { margin: 0 0 1.5rem; border: 1px solid var(--rule); }

.entry-content h2 { margin-top: 1.8em; }
.entry-content h3 { margin-top: 1.5em; }

.entry-content table,
.widget table {
	width: 100%;
	border-collapse: collapse;
	font-family: var(--font-ui);
	font-size: var(--step--1);
	font-variant-numeric: tabular-nums;
}

.entry-content th, .entry-content td,
.widget th, .widget td { border: 1px solid var(--rule); padding: 0.45rem 0.6rem; text-align: left; }
.entry-content thead th,
.widget thead th { background: var(--ink); color: var(--paper); }
.entry-content tbody tr:nth-child(even),
.widget tbody tr:nth-child(even) { background: var(--surface); }

.table-scroll { overflow-x: auto; }

.entry-footer {
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid var(--rule);
	font-family: var(--font-ui);
	font-size: var(--step--1);
}

.post-nav {
	display: grid;
	gap: 1rem;
	margin: 2rem 0;
	font-family: var(--font-ui);
	font-size: var(--step--1);
}

@media (min-width: 640px) { .post-nav { grid-template-columns: 1fr 1fr; } }

.post-nav a {
	display: block;
	border: 1px solid var(--rule);
	padding: 0.7rem 0.9rem;
	text-decoration: none;
	background: var(--surface);
	color: var(--ink);
}

.post-nav a:hover { border-color: var(--stamp); }
.post-nav span { display: block; color: var(--ink-soft); font-size: 0.78rem; }
.post-nav .is-next { text-align: right; }

/* ---------------------------------------------------------------
   8. Sidebar and widgets
   --------------------------------------------------------------- */

.widget { margin-bottom: 2rem; }

.widget__title {
	font-family: var(--font-ui);
	font-size: var(--step--1);
	font-weight: 700;
	letter-spacing: 0.02em;
	margin: 0 0 0.75rem;
	padding-bottom: 0.4rem;
	border-bottom: 2px solid var(--ink);
}

.widget ul { list-style: none; margin: 0; padding: 0; }

.widget > ul > li {
	border-bottom: 1px solid var(--rule-soft);
	padding: 0.4rem 0;
	font-family: var(--font-ui);
	font-size: var(--step--1);
}

.widget a { text-decoration: none; }
.widget a:hover { text-decoration: underline; }

.postlist { list-style: none; margin: 0; padding: 0; }

.postlist li {
	display: grid;
	grid-template-columns: 76px 1fr;
	gap: 0.75rem;
	padding: 0.65rem 0;
	border-bottom: 1px solid var(--rule-soft);
}

.postlist li.has-no-thumb { grid-template-columns: 1fr; }

.postlist img { border: 1px solid var(--rule); width: 76px; height: auto; }

.postlist__title {
	font-family: var(--font-ui);
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.3;
	margin: 0;
}

.postlist__title a { color: var(--ink); }
.postlist__title a:hover { color: var(--stamp); }

.postlist__meta {
	font-family: var(--font-ui);
	font-size: 0.75rem;
	color: var(--ink-soft);
	margin: 0.2rem 0 0;
	display: flex;
	gap: 0.7rem;
}

/* ---------------------------------------------------------------
   9. Forms, buttons, search
   --------------------------------------------------------------- */

input[type="text"], input[type="email"], input[type="url"], input[type="search"],
input[type="password"], textarea, select {
	width: 100%;
	font: inherit;
	font-size: var(--step-0);
	padding: 0.55rem 0.7rem;
	background: #fff;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	color: var(--ink);
}

textarea { min-height: 8rem; resize: vertical; }

.btn, button, input[type="submit"] {
	display: inline-block;
	font-family: var(--font-ui);
	font-size: var(--step--1);
	font-weight: 600;
	background: var(--stamp);
	color: #fff;
	border: 1px solid var(--stamp);
	border-radius: var(--radius);
	padding: 0.6rem 1.1rem;
	cursor: pointer;
	width: auto;
}

.btn:hover, button:hover, input[type="submit"]:hover { background: var(--stamp-dark); color: #fff; }

.search-form { display: flex; gap: 0.4rem; }
.search-form label { flex: 1; }
.search-form input[type="submit"] { flex: none; }

.masthead .search-form { max-width: 260px; }

@media (max-width: 767px) { .masthead .search-form { display: none; } }

/* ---------------------------------------------------------------
   10. Comments — the busiest part of a pools site
   --------------------------------------------------------------- */

.comments-area { margin-top: 2.5rem; }

.comments-title {
	font-size: var(--step-2);
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--ink);
}

.comment-list { list-style: none; margin: 0; padding: 0; }

.comment-list .children { list-style: none; margin: 0 0 0 1rem; padding: 0 0 0 1rem; border-left: 2px solid var(--rule); }

.comment-body {
	padding: 0.9rem 0;
	border-bottom: 1px solid var(--rule-soft);
}

.comment-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.6rem;
	font-family: var(--font-ui);
	font-size: var(--step--1);
	margin-bottom: 0.35rem;
}

.comment-author-name { font-weight: 700; color: var(--ink); }

.comment-author-name .badge-author {
	background: var(--stamp);
	color: #fff;
	font-size: 0.68rem;
	padding: 0.05rem 0.35rem;
	border-radius: var(--radius);
	margin-left: 0.35rem;
}

.comment-date { color: var(--ink-soft); text-decoration: none; }

.comment-content { margin: 0; }
.comment-content p:last-child { margin-bottom: 0; }

.comment-reply-link {
	font-family: var(--font-ui);
	font-size: 0.78rem;
	font-weight: 600;
	text-decoration: none;
}

.comment-respond { margin-top: 1.75rem; background: var(--surface); border: 1px solid var(--rule); padding: 1.1rem; }
.comment-respond .comment-reply-title { margin-top: 0; font-size: var(--step-1); }
.comment-form p { margin-bottom: 0.9rem; }
.comment-form label { display: block; font-family: var(--font-ui); font-size: var(--step--1); font-weight: 600; margin-bottom: 0.2rem; }

.comment-list .pingback,
.comment-list .trackback { font-size: var(--step--1); padding: 0.4rem 0; }

/* ---------------------------------------------------------------
   11. Pagination, notices, footer
   --------------------------------------------------------------- */

.pagination { margin: 2rem 0; font-family: var(--font-ui); font-size: var(--step--1); }

.pagination .page-numbers {
	display: inline-block;
	min-width: 2.2rem;
	text-align: center;
	padding: 0.4rem 0.5rem;
	border: 1px solid var(--rule);
	margin: 0 0.15rem 0.3rem 0;
	text-decoration: none;
	background: var(--surface);
	border-radius: var(--radius);
}

.pagination .current { background: var(--stamp); border-color: var(--stamp); color: #fff; }

.notice {
	border: 1px solid var(--rule);
	border-left: 4px solid var(--alert);
	background: var(--surface);
	padding: 0.9rem 1.1rem;
	font-size: var(--step--1);
}

.site-footer { background: var(--ink); color: #c3c5b9; margin-top: 2rem; }

.site-footer a { color: #ded9f5; }

.footer-widgets {
	display: grid;
	gap: 1.75rem;
	grid-template-columns: 1fr;
	padding: 2.5rem 0;
}

@media (min-width: 640px) { .footer-widgets { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .footer-widgets { grid-template-columns: repeat(4, 1fr); } }

.site-footer .widget__title { color: var(--paper); border-bottom-color: #454a41; }
.site-footer .widget > ul > li { border-bottom-color: #333930; }
.site-footer .postlist li { border-bottom-color: #333930; }
.site-footer .postlist__title a { color: #e8e7dc; }

.play-safe {
	border-top: 1px solid #363c33;
	border-bottom: 1px solid #363c33;
	padding: 1rem 0;
	font-family: var(--font-ui);
	font-size: var(--step--1);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.85rem;
}

.play-safe__age {
	flex: none;
	border: 2px solid #c3c5b9;
	border-radius: 50%;
	width: 2.4rem; height: 2.4rem;
	display: grid; place-items: center;
	font-weight: 700;
	font-size: 0.8rem;
	color: #fff;
}

.play-safe p { margin: 0; max-width: 60ch; }

.colophon {
	padding: 1.1rem 0;
	font-family: var(--font-ui);
	font-size: var(--step--1);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem;
}

.colophon p { margin: 0; }

.footer-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

@media (min-width: 900px) {
	.sidebar { position: sticky; top: 1rem; align-self: start; }
}

/* ---------------------------------------------------------------
   12. WordPress core classes
   --------------------------------------------------------------- */

.alignleft  { float: left; margin: 0.3rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.3rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 0 auto 1.5rem; }
.alignwide, .alignfull { margin-left: 0; margin-right: 0; }

.wp-caption { max-width: 100%; }
.wp-caption-text, .wp-element-caption {
	font-family: var(--font-ui);
	font-size: 0.8rem;
	color: var(--ink-soft);
	padding-top: 0.35rem;
}

.sticky .thread__title::before {
	content: "Pinned";
	display: inline-block;
	font-size: 0.68rem;
	background: var(--hit);
	color: #fff;
	padding: 0.05rem 0.4rem;
	border-radius: var(--radius);
	margin-right: 0.4rem;
	vertical-align: 2px;
}

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.5rem; }
.gallery-item { margin: 0; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------------
   13. No-grid fallback

   Opera Mini and older Android browsers are still common on a
   pools site. Without this the columns stack, which is fine, but
   the thread rows lose their reply counts to the right edge.
   --------------------------------------------------------------- */

@supports not (display: grid) {
	.layout, .home-columns, .footer-widgets, .post-nav { display: block; }

	.thread { display: table; width: 100%; }
	.thread > div { display: table-cell; vertical-align: top; }
	.thread > .thread__count { display: table-cell; width: 3.4rem; vertical-align: top; }

	.postlist li { display: table; width: 100%; }
	.postlist li > a,
	.postlist li > div { display: table-cell; vertical-align: top; }
	.postlist li > a { width: 76px; padding-right: 0.75rem; }

	.play-safe__age { display: inline-block; line-height: 2.1rem; text-align: center; }

	.thread__meta > *,
	.entry-meta > *,
	.postlist__meta > *,
	.comment-meta > * { margin-right: 0.9rem; }

	@media (min-width: 900px) {
		.layout > div { float: left; width: 66%; }
		.layout > .sidebar { float: right; width: 30%; }
		.layout::after { content: ""; display: table; clear: both; }
	}
}
