/*
Theme Name: Amperlo
Theme URI: https://amperlo.com
Author: Amperlo
Author URI: https://amperlo.com
Description: A mobile-first logbook for EV drivers who want the real cost per mile — every charge, every mile, every receipt. This is the official Amperlo classic WordPress theme: dark by default, emerald accent, Instrument Sans typography.
Version: 1.0.1
Requires at least: 6.0
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: amperlo
Tags: dark, one-column, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready

Amperlo WordPress theme is distributed under the terms of the GNU GPL v2 or later.
*/

/* -----------------------------------------------------------------------
   Contents
   1. CSS custom properties (brand tokens)
   2. Reset / base
   3. Typography
   4. Layout
   5. Header
   6. Navigation
   7. Content / entry
   8. Post meta
   9. Pagination
   10. Comments
   11. Sidebar / widgets
   12. Footer
   13. Forms
   14. Utility / accessibility
   15. Responsive
   ----------------------------------------------------------------------- */

/* 1. CSS custom properties (brand tokens) ------------------------------ */

:root {
	--amperlo-emerald: #10b981;
	--amperlo-bg: #09090b;
	--amperlo-surface: #18181b;
	--amperlo-surface-hover: #202024;
	--amperlo-border: #27272a;
	--amperlo-text: #f4f4f5;
	--amperlo-text-muted: #a1a1aa;
	--amperlo-text-on-light: #09090b;

	--amperlo-font: "Instrument Sans", Helvetica, Arial, sans-serif;
	--amperlo-content-width: 720px;
	--amperlo-wide-width: 1120px;
	--amperlo-radius: 14px;
	--amperlo-radius-sm: 8px;
}

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

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

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

body {
	margin: 0;
	background: var(--amperlo-bg);
	color: var(--amperlo-text);
	font-family: var(--amperlo-font);
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: var(--amperlo-radius-sm);
}

a {
	color: var(--amperlo-emerald);
	text-decoration: none;
}

a:hover,
a:focus {
	text-decoration: underline;
}

ul,
ol {
	padding-left: 1.25em;
}

hr {
	border: none;
	border-top: 1px solid var(--amperlo-border);
	margin: 2.5em 0;
}

table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.5em 0;
}

th,
td {
	text-align: left;
	padding: 0.6em 0.8em;
	border-bottom: 1px solid var(--amperlo-border);
}

blockquote {
	margin: 1.5em 0;
	padding: 0.2em 1.25em;
	border-left: 3px solid var(--amperlo-emerald);
	color: var(--amperlo-text-muted);
	font-style: italic;
}

code,
pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	background: var(--amperlo-surface);
	border-radius: var(--amperlo-radius-sm);
}

code {
	padding: 0.15em 0.4em;
	font-size: 0.9em;
}

pre {
	padding: 1em 1.25em;
	overflow-x: auto;
	border: 1px solid var(--amperlo-border);
}

pre code {
	background: none;
	padding: 0;
}

/* 3. Typography ---------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--amperlo-font);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--amperlo-text);
	margin: 1.4em 0 0.5em;
}

h1 {
	font-size: 2.25rem;
	letter-spacing: -0.03em;
}

h2 {
	font-size: 1.75rem;
}

h3 {
	font-size: 1.375rem;
}

h4 {
	font-size: 1.125rem;
}

p {
	margin: 0 0 1.25em;
}

.amperlo-eyebrow {
	display: inline-block;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--amperlo-emerald);
	margin-bottom: 0.5em;
}

/* 4. Layout ---------------------------------------------------------------- */

.amperlo-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 10000;
	background: var(--amperlo-emerald);
	color: #09090b;
	padding: 0.75em 1.25em;
	font-weight: 700;
	border-radius: 0 0 var(--amperlo-radius-sm) 0;
}

.amperlo-skip-link:focus {
	left: 0;
}

.amperlo-site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.amperlo-container {
	width: 100%;
	max-width: var(--amperlo-wide-width);
	margin: 0 auto;
	padding: 0 24px;
}

.amperlo-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 48px;
	padding: 48px 0 80px;
}

.amperlo-layout.has-sidebar {
	grid-template-columns: minmax(0, 1fr) 300px;
}

.amperlo-main {
	min-width: 0;
	max-width: var(--amperlo-content-width);
}

.amperlo-layout:not(.has-sidebar) .amperlo-main {
	max-width: var(--amperlo-content-width);
	margin: 0 auto;
	width: 100%;
}

/* 5. Header ------------------------------------------------------------ */

.amperlo-header {
	border-bottom: 1px solid var(--amperlo-border);
	padding: 20px 0;
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(9, 9, 11, 0.92);
	backdrop-filter: blur(8px);
}

.amperlo-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.amperlo-branding {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.amperlo-branding a {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--amperlo-text);
}

.amperlo-branding a:hover,
.amperlo-branding a:focus {
	text-decoration: none;
}

.amperlo-logo-mark {
	width: 32px;
	height: 32px;
	flex-shrink: 0;
}

.amperlo-logo-mark img,
.amperlo-logo-mark svg {
	width: 100%;
	height: 100%;
	border-radius: 22%;
}

.amperlo-wordmark {
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: -0.03em;
	color: var(--amperlo-text);
	white-space: nowrap;
}

/* 6. Navigation ---------------------------------------------------------- */

.amperlo-primary-nav {
	display: flex;
	align-items: center;
}

.amperlo-primary-nav ul {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
	flex-wrap: wrap;
}

.amperlo-primary-nav li {
	position: relative;
}

.amperlo-primary-nav a {
	display: block;
	padding: 8px 14px;
	border-radius: 999px;
	color: var(--amperlo-text-muted);
	font-weight: 500;
	font-size: 0.95rem;
}

.amperlo-primary-nav a:hover,
.amperlo-primary-nav a:focus {
	color: var(--amperlo-text);
	background: var(--amperlo-surface);
	text-decoration: none;
}

.amperlo-primary-nav .current-menu-item > a,
.amperlo-primary-nav .current_page_item > a {
	color: var(--amperlo-emerald);
}

.amperlo-primary-nav ul ul {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	flex-direction: column;
	background: var(--amperlo-surface);
	border: 1px solid var(--amperlo-border);
	border-radius: var(--amperlo-radius-sm);
	padding: 6px;
	min-width: 200px;
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.amperlo-primary-nav li:hover > ul,
.amperlo-primary-nav li:focus-within > ul {
	display: flex;
}

.amperlo-menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: var(--amperlo-radius-sm);
	background: var(--amperlo-surface);
	border: 1px solid var(--amperlo-border);
	color: var(--amperlo-text);
	cursor: pointer;
}

.amperlo-menu-toggle svg {
	width: 20px;
	height: 20px;
}

/* 7. Content / entry ------------------------------------------------------ */

.amperlo-entry {
	margin-bottom: 56px;
	padding-bottom: 56px;
	border-bottom: 1px solid var(--amperlo-border);
}

.amperlo-entry:last-child {
	border-bottom: none;
}

.amperlo-entry-title {
	margin-top: 0;
	font-size: 1.9rem;
}

.amperlo-entry-title a {
	color: var(--amperlo-text);
}

.amperlo-entry-thumbnail {
	margin: 0 0 24px;
	border-radius: var(--amperlo-radius);
	overflow: hidden;
	border: 1px solid var(--amperlo-border);
}

.amperlo-entry-thumbnail img {
	border-radius: 0;
	width: 100%;
}

.amperlo-entry-summary {
	color: var(--amperlo-text-muted);
}

.amperlo-entry-content > *:first-child {
	margin-top: 0;
}

.amperlo-entry-content a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.amperlo-read-more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 700;
}

.amperlo-page-title {
	font-size: 2rem;
	margin-bottom: 0.3em;
}

.amperlo-archive-title,
.amperlo-page-header {
	margin-bottom: 40px;
}

.amperlo-archive-description {
	color: var(--amperlo-text-muted);
}

/* 8. Post meta ------------------------------------------------------------ */

.amperlo-entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	align-items: center;
	font-size: 0.85rem;
	color: var(--amperlo-text-muted);
	margin-bottom: 14px;
}

.amperlo-entry-meta a {
	color: var(--amperlo-text-muted);
}

.amperlo-entry-meta a:hover {
	color: var(--amperlo-emerald);
}

.amperlo-entry-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 18px 0;
}

.amperlo-entry-categories a {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--amperlo-surface);
	border: 1px solid var(--amperlo-border);
	color: var(--amperlo-text-muted);
	font-size: 0.8rem;
}

.amperlo-entry-categories a:hover {
	color: var(--amperlo-emerald);
	border-color: var(--amperlo-emerald);
	text-decoration: none;
}

.amperlo-author-box {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	margin-top: 40px;
	padding: 20px;
	background: var(--amperlo-surface);
	border: 1px solid var(--amperlo-border);
	border-radius: var(--amperlo-radius);
}

.amperlo-author-box img {
	border-radius: 50%;
	width: 56px;
	height: 56px;
	flex-shrink: 0;
}

.amperlo-author-box h2 {
	font-size: 1rem;
	margin: 0 0 4px;
}

.amperlo-author-box p {
	margin: 0;
	color: var(--amperlo-text-muted);
	font-size: 0.9rem;
}

.amperlo-post-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-top: 40px;
}

.amperlo-post-nav .amperlo-nav-next {
	text-align: right;
}

.amperlo-post-nav a {
	display: block;
	padding: 16px;
	border: 1px solid var(--amperlo-border);
	border-radius: var(--amperlo-radius);
	color: var(--amperlo-text);
}

.amperlo-post-nav a:hover {
	border-color: var(--amperlo-emerald);
	text-decoration: none;
}

.amperlo-post-nav span {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--amperlo-text-muted);
	margin-bottom: 4px;
}

/* 9. Pagination ------------------------------------------------------------ */

.amperlo-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 48px;
}

.amperlo-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 12px;
	border-radius: var(--amperlo-radius-sm);
	background: var(--amperlo-surface);
	border: 1px solid var(--amperlo-border);
	color: var(--amperlo-text);
	font-weight: 500;
}

.amperlo-pagination .page-numbers.current {
	background: var(--amperlo-emerald);
	border-color: var(--amperlo-emerald);
	color: #09090b;
}

.amperlo-pagination .page-numbers:hover {
	border-color: var(--amperlo-emerald);
	text-decoration: none;
}

/* 10. Comments -------------------------------------------------------------- */

.amperlo-comments {
	margin-top: 56px;
}

.amperlo-comments-title {
	margin-bottom: 24px;
}

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

.amperlo-comment-list .children {
	list-style: none;
	margin: 0 0 0 32px;
	padding: 0;
}

.amperlo-comment-body {
	display: flex;
	gap: 14px;
	padding: 20px 0;
	border-bottom: 1px solid var(--amperlo-border);
}

.amperlo-comment-avatar img {
	border-radius: 50%;
	width: 44px;
	height: 44px;
}

.amperlo-comment-meta {
	display: flex;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 6px;
}

.amperlo-comment-author {
	font-weight: 700;
}

.amperlo-comment-date {
	font-size: 0.8rem;
	color: var(--amperlo-text-muted);
}

.amperlo-comment-date a {
	color: inherit;
}

.amperlo-comment-reply-link {
	font-size: 0.8rem;
	font-weight: 700;
}

.amperlo-comment-awaiting-moderation {
	font-size: 0.85rem;
	color: var(--amperlo-text-muted);
	font-style: italic;
}

.amperlo-comment-respond {
	margin-top: 32px;
	padding: 24px;
	background: var(--amperlo-surface);
	border: 1px solid var(--amperlo-border);
	border-radius: var(--amperlo-radius);
}

/* 11. Sidebar / widgets ------------------------------------------------------ */

.amperlo-sidebar {
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.amperlo-widget {
	background: var(--amperlo-surface);
	border: 1px solid var(--amperlo-border);
	border-radius: var(--amperlo-radius);
	padding: 20px;
}

.amperlo-widget-title {
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--amperlo-text-muted);
	margin: 0 0 14px;
}

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

.amperlo-widget li {
	padding: 8px 0;
	border-bottom: 1px solid var(--amperlo-border);
}

.amperlo-widget li:last-child {
	border-bottom: none;
}

/* 12. Footer -------------------------------------------------------------- */

.amperlo-footer {
	border-top: 1px solid var(--amperlo-border);
	background: var(--amperlo-surface);
	margin-top: auto;
	padding: 48px 0 32px;
}

.amperlo-footer-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 32px;
	margin-bottom: 32px;
}

.amperlo-footer-bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-top: 24px;
	border-top: 1px solid var(--amperlo-border);
}

.amperlo-footer-branding {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--amperlo-text-muted);
	font-size: 0.85rem;
}

.amperlo-footer-branding .amperlo-logo-mark {
	width: 20px;
	height: 20px;
}

.amperlo-footer-nav ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	margin: 0;
	padding: 0;
}

.amperlo-footer-nav a {
	color: var(--amperlo-text-muted);
	font-size: 0.85rem;
}

.amperlo-footer-nav a:hover {
	color: var(--amperlo-emerald);
}

/* 13. Forms --------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
	width: 100%;
	padding: 12px 14px;
	font-family: var(--amperlo-font);
	font-size: 1rem;
	background: var(--amperlo-bg);
	color: var(--amperlo-text);
	border: 1px solid var(--amperlo-border);
	border-radius: var(--amperlo-radius-sm);
	min-height: 44px;
}

textarea {
	min-height: 120px;
}

input:focus,
textarea:focus,
select:focus {
	outline: 2px solid var(--amperlo-emerald);
	outline-offset: 1px;
}

label {
	display: block;
	font-size: 0.9rem;
	color: var(--amperlo-text-muted);
	margin-bottom: 6px;
}

.amperlo-search-form {
	display: flex;
	gap: 8px;
}

.amperlo-search-form input[type="search"] {
	flex: 1;
}

button,
input[type="submit"],
.amperlo-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 22px;
	background: var(--amperlo-emerald);
	color: #09090b;
	font-family: var(--amperlo-font);
	font-weight: 700;
	font-size: 0.95rem;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover,
input[type="submit"]:hover,
.amperlo-button:hover {
	opacity: 0.9;
	text-decoration: none;
}

button:focus-visible,
input[type="submit"]:focus-visible,
.amperlo-button:focus-visible,
a:focus-visible {
	outline: 2px solid var(--amperlo-emerald);
	outline-offset: 2px;
}

.amperlo-button-outline {
	background: transparent;
	color: var(--amperlo-text);
	border: 1px solid var(--amperlo-border);
}

/* 14. Utility / accessibility ---------------------------------------------- */

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.amperlo-empty-state {
	text-align: center;
	padding: 80px 20px;
	color: var(--amperlo-text-muted);
}

.amperlo-empty-state h1 {
	color: var(--amperlo-text);
}

.alignwide {
	max-width: var(--amperlo-wide-width);
}

.alignfull {
	max-width: none;
	width: 100vw;
	margin-left: calc(50% - 50vw);
}

.aligncenter {
	margin-left: auto;
	margin-right: auto;
}

.wp-caption,
figure {
	margin: 1.5em 0;
}

.wp-caption-text,
figcaption {
	font-size: 0.85rem;
	color: var(--amperlo-text-muted);
	margin-top: 8px;
}

/* 15. Responsive ------------------------------------------------------------ */

@media (max-width: 782px) {
	.amperlo-layout.has-sidebar {
		grid-template-columns: minmax(0, 1fr);
	}

	.amperlo-sidebar {
		order: 2;
	}
}

@media (max-width: 640px) {
	body {
		font-size: 16px;
	}

	.amperlo-container {
		padding: 0 18px;
	}

	.amperlo-menu-toggle {
		display: inline-flex;
	}

	.amperlo-primary-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--amperlo-bg);
		border-bottom: 1px solid var(--amperlo-border);
		padding: 12px 18px 20px;
	}

	.amperlo-primary-nav.is-open {
		display: block;
	}

	.amperlo-primary-nav ul {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.amperlo-primary-nav ul ul {
		position: static;
		border: none;
		box-shadow: none;
		padding-left: 12px;
	}

	.amperlo-primary-nav a {
		padding: 12px 10px;
		min-height: 44px;
	}

	.amperlo-post-nav {
		grid-template-columns: 1fr;
	}

	.amperlo-post-nav .amperlo-nav-next {
		text-align: left;
	}

	.amperlo-entry-title,
	h1 {
		font-size: 1.6rem;
	}
}
