/*
Theme Name:   Countathon
Theme URI:    https://countathon.com
Description:  The Countathon website theme. Brand-matched to the Countathon Mail plugin, with a "Client Mail" button in the header and on the home page that appears automatically when the plugin is active.
Author:       Countathon
Version:      1.0.0
Requires at least: 5.9
Tested up to: 7.1
Requires PHP: 7.4
License:      GPL-2.0-or-later
Text Domain:  countathon-theme
*/

:root {
	--navy: #072f42;
	--navy-2: #0d4560;
	--accent: #137ca8;
	--accent-dark: #0e6286;
	--accent-soft: #e5f2f8;
	--bg: #f2f5f7;
	--panel: #ffffff;
	--line: #dde5ea;
	--text: #15262f;
	--muted: #667985;
	--radius: 12px;
	--shadow: 0 1px 2px rgba(7, 47, 66, .08), 0 8px 24px rgba(7, 47, 66, .10);
	--wrap: 1120px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0; color: var(--text); background: var(--bg);
	font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.2; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-top: 0; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
h3 { font-size: 1.25rem; }
p, ul, ol { margin: 0 0 1.1em; }
:focus-visible { outline: 3px solid rgba(19, 124, 168, .5); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed !important; left: 12px; top: 12px; width: auto; height: auto; clip: auto; background: #fff; padding: 10px 16px; z-index: 100000; border-radius: 8px; }

/* Buttons */
.btn {
	display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 20px;
	border: 2px solid transparent; border-radius: 10px; background: var(--accent); color: #fff;
	font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background .15s, color .15s, transform .05s;
}
.btn, .btn:visited { color: #fff; }
.btn:hover, .btn:focus-visible { background: var(--accent-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; stroke: currentColor; }

.btn-light,
.btn-light:visited,
.site-nav .btn-light,
.site-nav .btn-light:visited {
	background: #fff;
	color: var(--navy) !important;
	border-color: #fff;
}
.btn-light:hover,
.btn-light:focus-visible,
.site-nav .btn-light:hover,
.site-nav .btn-light:focus-visible {
	background: var(--accent-soft);
	color: var(--navy) !important;
	border-color: var(--accent-soft);
}

.btn-outline,
.btn-outline:visited {
	background: transparent;
	border-color: rgba(255, 255, 255, .55);
	color: #fff;
}
.btn-outline:hover,
.btn-outline:focus-visible {
	background: rgba(255, 255, 255, .12);
	color: #fff;
	border-color: #fff;
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--navy); color: #fff; box-shadow: 0 2px 12px rgba(7, 47, 66, .25); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 700; font-size: 1.15rem; }
.brand img { height: 38px; width: auto; display: block; }
.custom-logo-link img { max-height: 44px; width: auto; }
.site-nav { margin-left: auto; display: flex; align-items: center; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.site-nav ul a,
.site-nav a:not(.btn) { display: block; padding: 10px 14px; color: #fff; text-decoration: none; border-radius: 8px; font-weight: 500; font-size: 15.5px; }
.site-nav ul a:hover,
.site-nav a:not(.btn):hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a { background: rgba(255, 255, 255, .12); color: #fff; }
.site-nav li { position: relative; }
.site-nav .sub-menu { display: none; position: absolute; left: 0; top: 100%; min-width: 210px; padding: 6px; background: var(--navy-2); border-radius: 10px; box-shadow: var(--shadow); flex-direction: column; align-items: stretch; }
.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { display: flex; }
.header-mail { margin-left: 4px; }
.nav-toggle { display: none; margin-left: auto; width: 46px; height: 46px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 22px; height: 2px; background: #fff; margin: 0 auto; position: relative; content: ""; border-radius: 2px; }
.nav-toggle span::before { position: absolute; top: -7px; left: 0; }
.nav-toggle span::after { position: absolute; top: 7px; left: 0; }
@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; margin: 0; background: var(--navy); padding: 8px 20px 18px; box-shadow: 0 12px 24px rgba(7, 47, 66, .3); }
	.site-nav.open { display: block; }
	.site-nav ul { flex-direction: column; align-items: stretch; }
	.site-nav .sub-menu { display: flex; position: static; background: transparent; box-shadow: none; padding: 0 0 0 14px; }
	.header-mail { width: 100%; justify-content: center; margin: 10px 0 0; }
}

/* Hero */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, #137ca8 140%); color: #fff; padding: clamp(48px, 9vw, 110px) 0; }
.hero h1 { color: #fff; max-width: 18ch; }
.hero p.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 56ch; color: rgba(255, 255, 255, .88); margin-bottom: 1.6em; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: -40px 0 40px; position: relative; }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 24px; }
.card h3 { margin: 0 0 .4em; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.card .num { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 14px; }

/* Content */
.site-main { padding: 44px 0 64px; min-height: 50vh; }
.entry, .post-card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(22px, 4vw, 44px); margin-bottom: 26px; }
.entry-title { margin-top: 0; }
.entry-title a, .post-card h2 a { color: var(--navy); text-decoration: none; }
.entry-title a:hover, .post-card h2 a:hover { color: var(--accent); }
.entry-meta { color: var(--muted); font-size: 14px; margin-bottom: 1.2em; }
.post-card h2 { margin-top: 0; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content img { border-radius: 8px; }
.entry-content blockquote { margin: 1.4em 0; padding: .2em 0 .2em 1.2em; border-left: 4px solid var(--accent); color: #324a57; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.alignwide { max-width: min(var(--wrap), 100vw - 40px); }
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-block-button__link { background: var(--accent); border-radius: 10px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { margin: 0; }
.pagination, .nav-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.page-numbers { padding: 8px 14px; background: var(--panel); border-radius: 8px; text-decoration: none; box-shadow: var(--shadow); }
.page-numbers.current { background: var(--accent); color: #fff; }
.search-form { display: flex; gap: 8px; max-width: 480px; }
.search-form input[type=search] { flex: 1; min-height: 44px; padding: 8px 12px; border: 1px solid #c6d3db; border-radius: 10px; font: inherit; }
.search-form input[type=submit] { min-height: 44px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.comments-area { margin-top: 30px; }
.comment-list { list-style: none; padding: 0; }
.comment-body { background: var(--panel); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.comment-respond input[type=text], .comment-respond input[type=email], .comment-respond input[type=url], .comment-respond textarea { width: 100%; padding: 10px 12px; border: 1px solid #c6d3db; border-radius: 10px; font: inherit; }
.comment-respond .submit { padding: 10px 20px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.not-found { text-align: center; padding: 40px 0; }

/* Footer */
.site-footer { background: var(--navy); color: rgba(255, 255, 255, .8); padding: 38px 0 30px; font-size: 15px; }
.site-footer a { color: #fff; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; justify-content: space-between; }
.footer-brand img { height: 34px; width: auto; display: block; margin-bottom: 10px; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-menu a { text-decoration: none; }
.footer-menu a:hover { text-decoration: underline; }
.footer-contact p { margin: 0 0 4px; }
.footer-legal { margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: 13.5px; color: rgba(255, 255, 255, .6); }

/* Header button: always readable (dark text on white) */
.site-header .site-nav a.btn.btn-light,
.site-header .site-nav a.btn.btn-light:visited,
.site-header a.header-mail { background: #ffffff !important; color: #072f42 !important; border: 2px solid #ffffff !important; font-weight: 700 !important; font-size: 15px !important; opacity: 1 !important; text-shadow: none !important; }
.site-header .site-nav a.btn.btn-light span,
.site-header a.header-mail span { color: #072f42 !important; display: inline !important; opacity: 1 !important; visibility: visible !important; }
.site-header .site-nav a.btn.btn-light svg,
.site-header a.header-mail svg { stroke: #072f42 !important; color: #072f42 !important; }
.site-header .site-nav a.btn.btn-light:hover,
.site-header a.header-mail:hover { background: #e5f2f8 !important; color: #072f42 !important; }
