/*
Theme Name: GM
Description: Lean custom theme for geoffmulligan.com. No dependencies, no page builder.
Version: 1.0.5
Requires at least: 6.4
Requires PHP: 8.0
Author: Geoff Mulligan
License: GPL-2.0-or-later
Text Domain: gm
*/

:root {
	--gm-text: #2b2f36;
	--gm-muted: #6b7280;
	--gm-bg: #ffffff;
	--gm-alt: #f5f6f8;
	--gm-accent: #d65050;
	--gm-dark: #1e2329;
	--gm-line: #e5e7eb;
	--gm-width: 1170px;
	--gm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.7 var(--gm-font); color: var(--gm-text); background: var(--gm-bg); }
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--gm-accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; margin: 1.4em 0 .5em; color: var(--gm-dark); }
h1 { font-size: 2.1em; } h2 { font-size: 1.6em; } h3 { font-size: 1.25em; }
p, ul, ol, figure, blockquote, table { margin: 0 0 1.2em; }
blockquote { border-left: 3px solid var(--gm-accent); margin-left: 0; padding-left: 1em; color: var(--gm-muted); }
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid var(--gm-line); padding: .4em .6em; text-align: left; }
.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; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto; background: #fff; padding: .5em 1em; }

.gm-wrap { max-width: var(--gm-width); margin: 0 auto; padding: 0 20px; }

/* Header */
.gm-header { background: var(--gm-dark); color: #fff; }
.gm-header .gm-wrap { display: flex; align-items: center; justify-content: space-between; gap: 1em; min-height: 72px; }
.gm-brand { display: flex; align-items: center; gap: .75em; }
.gm-brand .custom-logo { max-height: 48px; width: auto; }
.gm-site-title { margin: 0; font-size: 1.5em; font-weight: 600; }
.gm-site-title a { color: #fff; }
.gm-site-title a:hover { text-decoration: none; opacity: .85; }

.gm-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25em 1.5em; }
.gm-nav a { color: #fff; font-size: .95em; }
.gm-nav .current-menu-item > a, .gm-nav .current_page_item > a, .gm-nav a:hover { color: var(--gm-accent); text-decoration: none; }
.gm-nav .sub-menu { display: none; }

.gm-menu-toggle { display: none; }
@media (max-width: 760px) {
	.gm-nav-desktop { display: none; }
	.gm-menu-toggle { display: block; }
	.gm-menu-toggle summary { list-style: none; cursor: pointer; color: #fff; font-size: 1.6em; line-height: 1; padding: .2em; }
	.gm-menu-toggle summary::-webkit-details-marker { display: none; }
	.gm-menu-toggle[open] .gm-nav { position: absolute; left: 0; right: 0; top: 72px; background: var(--gm-dark); padding: 1em 20px; z-index: 50; }
	.gm-menu-toggle .gm-nav ul { flex-direction: column; }
	.gm-header { position: sticky; }
}

/* Hero (front page) */
.gm-hero { background: var(--gm-dark) center / cover no-repeat; min-height: 280px; display: flex; align-items: flex-end; }
.gm-hero .gm-wrap { width: 100%; padding-bottom: 2em; }
.gm-hero-text { color: #fff; font-size: 1.15em; text-shadow: 0 1px 6px rgba(0,0,0,.6); margin: 0; }

/* Page title band */
.gm-page-head { background: var(--gm-alt); border-bottom: 1px solid var(--gm-line); }
.gm-page-head h1 { margin: 0; padding: 1.1em 0; font-size: 1.8em; }

/* Layout */
.gm-main { padding: 2.5em 0 3em; }
.gm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3em; }
.gm-layout.no-sidebar { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .gm-layout { grid-template-columns: minmax(0, 1fr); } }

/* Posts */
.gm-entry { margin: 0 0 3em; }
.gm-entry-title { margin-top: 0; }
.gm-entry-title a { color: var(--gm-dark); }
.gm-entry-meta { color: var(--gm-muted); font-size: .9em; margin: -.3em 0 1em; }
.gm-entry-thumb { margin: 0 0 1em; }
.gm-entry-thumb img { display: block; border-radius: 4px; }
.gm-entry-content::after { content: ""; display: table; clear: both; }
.gm-more { font-weight: 600; }
.gm-post-nav { display: flex; justify-content: space-between; gap: 1em; border-top: 1px solid var(--gm-line); padding-top: 1em; margin-top: 2em; }
.pagination .nav-links { display: flex; gap: .5em; flex-wrap: wrap; }
.pagination .page-numbers { padding: .3em .7em; border: 1px solid var(--gm-line); border-radius: 3px; }
.pagination .current { background: var(--gm-accent); border-color: var(--gm-accent); color: #fff; }

/* Patent details */
.gm-patent-facts { background: var(--gm-alt); border-radius: 4px; padding: 1em 1.25em; margin: 0 0 1.5em; }
.gm-patent-facts dl { display: grid; grid-template-columns: max-content 1fr; gap: .3em 1.2em; margin: 0; }
.gm-patent-facts dt { font-weight: 600; }
.gm-patent-facts dd { margin: 0; }

/* Sidebar & widgets */
.gm-sidebar .widget { margin: 0 0 2em; }
.gm-sidebar .widget-title, .gm-sidebar h2 { font-size: 1.1em; margin: 0 0 .6em; }
.gm-sidebar ul { list-style: none; padding: 0; }
.gm-sidebar li { padding: .3em 0; border-bottom: 1px solid var(--gm-line); }

/* Footer */
.gm-footer-widgets { background: var(--gm-dark); color: #c9ced6; padding: 2.5em 0 1em; font-size: .95em; }
.gm-footer-widgets .gm-wrap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2em; }
@media (max-width: 760px) { .gm-footer-widgets .gm-wrap { grid-template-columns: minmax(0, 1fr); } }
.gm-footer-widgets a { color: #fff; }
.gm-footer-widgets .widget-title, .gm-footer-widgets h2 { color: #fff; font-size: 1.05em; margin: 0 0 .6em; }
.gm-footer-widgets .wp-block-social-links { margin: 0; }
.gm-footer { background: #161a1f; color: #8b929c; font-size: .85em; padding: 1em 0; }

/* Block editor content */
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide, .alignfull { max-width: 100%; }
.wp-caption-text, figcaption { font-size: .85em; color: var(--gm-muted); }
.wp-block-columns { gap: 2em; }
.wp-block-button__link { background: var(--gm-accent); color: #fff; border-radius: 3px; padding: .6em 1.4em; }
.wp-block-button__link:hover { opacity: .9; text-decoration: none; }
.wp-block-latest-posts.is-grid li { margin-bottom: 1.5em; }
.wp-block-latest-posts__featured-image img { border-radius: 4px; }
.home .gm-main { padding-top: 2em; }

/* Post lists: each post is a separate card; title first, small image beside the excerpt */
.gm-card { background: #fff; border: 1px solid var(--gm-line); border-radius: 8px; padding: 1.5em 1.75em; margin: 0 0 2em;
	box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.gm-card .gm-entry-title { font-size: 1.45em; margin: 0 0 .25em; }
.gm-card .gm-entry-meta { margin: 0 0 1em; }
.gm-card-body.has-thumb { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.5em; align-items: start; }
.gm-card-thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.gm-card-text p { margin: 0 0 .8em; }
.gm-card-text .gm-card-more { margin: 0; }
@media (max-width: 600px) {
	.gm-card { padding: 1.2em; }
	.gm-card-body.has-thumb { grid-template-columns: minmax(0, 1fr); gap: 1em; }
}

/* Audio players: not wider than a comfortable reading width */
.gm-entry-content .wp-audio-shortcode, .gm-entry-content .mejs-container, .wp-block-audio { max-width: 640px; margin-bottom: 1.2em; }

/* Sticky top header (stays below the admin bar when logged in) */
.gm-header { position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 6px rgba(0,0,0,.25); }
.admin-bar .gm-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .gm-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .gm-header { top: 0; } }
/* Jump links land below the header, not under it */
html { scroll-padding-top: 90px; }
