/*
Theme Name: Billy
Theme URI: https://billyboen.com/
Author: Billy
Author URI: https://billyboen.com/
Description: A clean and fresh WordPress theme with dedicated category, post, and cart (WooCommerce) templates.
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: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: billy
Tags: blog, e-commerce, news, two-columns, right-sidebar, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
	--billy-color-primary: #2563eb;
	--billy-color-primary-dark: #1e40af;
	--billy-color-bg: #ffffff;
	--billy-color-surface: #f8fafc;
	--billy-color-border: #e2e8f0;
	--billy-color-text: #0f172a;
	--billy-color-muted: #64748b;
	--billy-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--billy-font-heading: inherit;
	--billy-radius: 12px;
	--billy-radius-sm: 8px;
	--billy-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
	--billy-container: 1160px;
}

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

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

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

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--billy-color-primary);
	text-decoration: none;
	transition: color 0.15s ease;
}

a:hover {
	color: var(--billy-color-primary-dark);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--billy-font-heading);
	line-height: 1.25;
	margin: 0 0 0.6em;
	color: var(--billy-color-text);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p {
	margin: 0 0 1.25em;
}

/* ---- Layout ---- */

.site-header {
	background: var(--billy-color-bg);
	border-bottom: 1px solid var(--billy-color-border);
	position: sticky;
	top: 0;
	z-index: 50;
}

.site-header__inner {
	max-width: var(--billy-container);
	margin: 0 auto;
	padding: 0 1.25rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 68px;
}

.site-branding a {
	color: var(--billy-color-text);
	font-size: 1.4rem;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.site-branding a:hover {
	color: var(--billy-color-primary);
}

.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 1.5rem;
	align-items: center;
}

.main-navigation a {
	color: var(--billy-color-text);
	font-weight: 500;
	font-size: 0.95rem;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
	color: var(--billy-color-primary);
}

.nav-toggle {
	display: none;
	background: none;
	border: 1px solid var(--billy-color-border);
	border-radius: var(--billy-radius-sm);
	padding: 0.5rem 0.75rem;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	color: var(--billy-color-text);
}

.cart-link {
	position: relative;
}

.cart-count {
	position: absolute;
	top: -8px;
	right: -10px;
	background: var(--billy-color-primary);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 1;
	padding: 3px 5px;
	border-radius: 999px;
	min-width: 16px;
	text-align: center;
}

.site-main {
	max-width: var(--billy-container);
	margin: 0 auto;
	padding: 2.5rem 1.25rem;
	min-height: 60vh;
}

.site-main--sidebar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 2.5rem;
}

.site-footer {
	background: var(--billy-color-surface);
	border-top: 1px solid var(--billy-color-border);
	margin-top: 3rem;
}

.site-footer__inner {
	max-width: var(--billy-container);
	margin: 0 auto;
	padding: 2rem 1.25rem;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
	align-items: center;
	color: var(--billy-color-muted);
	font-size: 0.9rem;
}

/* ---- Components ---- */

.entry,
.card {
	background: var(--billy-color-bg);
}

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

.entry-title {
	font-size: 2rem;
	margin-bottom: 0.35em;
}

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

.entry-title a:hover {
	color: var(--billy-color-primary);
}

.entry-meta {
	color: var(--billy-color-muted);
	font-size: 0.88rem;
	margin-bottom: 1rem;
}

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

.entry-meta a:hover {
	color: var(--billy-color-primary);
}

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

.entry-content img {
	border-radius: var(--billy-radius);
}

.entry-content .alignfull {
	width: 100vw;
	margin-left: calc(50% - 50vw);
	border-radius: 0;
}

.entry-content .alignwide {
	margin-left: calc(50% - min(48vw, 560px));
	margin-right: calc(50% - min(48vw, 560px));
	width: min(96vw, 1120px);
}

.entry-content blockquote {
	margin: 1.5em 0;
	padding: 0.25em 1.25em;
	border-left: 4px solid var(--billy-color-primary);
	background: var(--billy-color-surface);
	border-radius: 0 var(--billy-radius-sm) var(--billy-radius-sm) 0;
	color: var(--billy-color-muted);
}

.entry-content table {
	border-collapse: collapse;
	width: 100%;
	margin-bottom: 1.25em;
}

.entry-content th,
.entry-content td {
	border: 1px solid var(--billy-color-border);
	padding: 0.6em 0.9em;
	text-align: left;
}

.entry-content th {
	background: var(--billy-color-surface);
}

.entry-content code,
.entry-content kbd {
	background: var(--billy-color-surface);
	border: 1px solid var(--billy-color-border);
	border-radius: 5px;
	padding: 0.15em 0.4em;
	font-size: 0.9em;
}

.entry-content pre {
	background: #0f172a;
	color: #e2e8f0;
	padding: 1.25em;
	border-radius: var(--billy-radius);
	overflow-x: auto;
	margin-bottom: 1.25em;
}

.entry-content pre code {
	background: transparent;
	border: 0;
	padding: 0;
	color: inherit;
}

/* Page title / archive header */

.page-header,
.archive-header {
	margin-bottom: 2rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--billy-color-border);
}

.page-title,
.archive-title {
	font-size: 2rem;
	margin-bottom: 0.25em;
}

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

/* Cards / grid */

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 1.75rem;
}

.card {
	border: 1px solid var(--billy-color-border);
	border-radius: var(--billy-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: var(--billy-shadow);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.card__thumb {
	aspect-ratio: 16 / 10;
	background: var(--billy-color-surface);
}

.card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.card__body {
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.card__title {
	font-size: 1.2rem;
	margin-bottom: 0.5em;
}

.card__excerpt {
	color: var(--billy-color-muted);
	font-size: 0.95rem;
	margin-bottom: 1rem;
}

.card__meta {
	margin-top: auto;
	color: var(--billy-color-muted);
	font-size: 0.8rem;
}

/* Post navigation */

.nav-links {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--billy-color-border);
}

.nav-links a {
	font-weight: 500;
}

.post-navigation .nav-previous {
	text-align: left;
}

.post-navigation .nav-next {
	text-align: right;
	margin-left: auto;
}

/* Pagination */

.pagination .nav-links {
	justify-content: center;
}

.pagination .nav-links > * {
	padding: 0.4rem 0.85rem;
	margin: 0 0.2rem;
	border: 1px solid var(--billy-color-border);
	border-radius: var(--billy-radius-sm);
	color: var(--billy-color-text);
}

.pagination .nav-links .current {
	background: var(--billy-color-primary);
	border-color: var(--billy-color-primary);
	color: #fff;
}

/* Buttons */

.button,
button,
input[type="submit"],
input[type="button"] {
	display: inline-block;
	background: var(--billy-color-primary);
	color: #fff;
	border: 1px solid var(--billy-color-primary);
	border-radius: var(--billy-radius-sm);
	padding: 0.65rem 1.4rem;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.5;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}

.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
	background: var(--billy-color-primary-dark);
	border-color: var(--billy-color-primary-dark);
	color: #fff;
	transform: translateY(-1px);
}

.button--ghost {
	background: transparent;
	color: var(--billy-color-primary);
}

.button--ghost:hover {
	background: rgba(37, 99, 235, 0.08);
	color: var(--billy-color-primary);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
select,
textarea {
	width: 100%;
	padding: 0.6rem 0.85rem;
	border: 1px solid var(--billy-color-border);
	border-radius: var(--billy-radius-sm);
	font-family: inherit;
	font-size: 0.95rem;
	color: var(--billy-color-text);
	background: #fff;
}

input:focus,
select:focus,
textarea:focus {
	outline: 2px solid rgba(37, 99, 235, 0.35);
	outline-offset: 1px;
	border-color: var(--billy-color-primary);
}

/* Search form */

.search-form {
	display: flex;
	gap: 0.5rem;
}

.search-form .search-field {
	flex: 1;
}

/* Comments */

.comments-area {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid var(--billy-color-border);
}

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

.comment-list .children {
	list-style: none;
	margin-left: 1.5rem;
}

.comment-body {
	padding: 1rem 0;
	border-bottom: 1px solid var(--billy-color-border);
}

.comment-author {
	font-weight: 600;
}

.comment-author .avatar {
	border-radius: 50%;
	display: inline;
	margin-right: 0.5rem;
	vertical-align: middle;
}

.comment-metadata {
	font-size: 0.8rem;
	color: var(--billy-color-muted);
}

.comment-form .comment-form-cookies-consent {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.comment-form .comment-form-cookies-consent input {
	width: auto;
}

/* Sidebar / widgets */

.widget-area .widget {
	background: var(--billy-color-surface);
	border: 1px solid var(--billy-color-border);
	border-radius: var(--billy-radius);
	padding: 1.25rem;
	margin-bottom: 1.5rem;
}

.widget-title {
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 0.75em;
}

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

.widget li {
	padding: 0.4rem 0;
	border-bottom: 1px solid var(--billy-color-border);
}

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

/* WooCommerce cart */

.woocommerce table.shop_table {
	border: 1px solid var(--billy-color-border);
	border-radius: var(--billy-radius);
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	margin-bottom: 1.5rem;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
	border: 0;
	border-bottom: 1px solid var(--billy-color-border);
	padding: 0.9rem 1rem;
	text-align: left;
}

.woocommerce table.shop_table th {
	background: var(--billy-color-surface);
	font-weight: 600;
}

.woocommerce table.shop_table tr:last-child td {
	border-bottom: 0;
}

.woocommerce .cart_totals h2 {
	font-size: 1.25rem;
}

.woocommerce .wc-proceed-to-checkout {
	text-align: right;
}

.woocommerce .wc-proceed-to-checkout a.checkout-button {
	display: inline-block;
	background: var(--billy-color-primary);
	color: #fff;
	border-radius: var(--billy-radius-sm);
	padding: 0.8rem 2rem;
	font-weight: 600;
}

.woocommerce .wc-proceed-to-checkout a.checkout-button:hover {
	background: var(--billy-color-primary-dark);
}

.woocommerce .quantity .qty {
	width: 72px;
	text-align: center;
}

.woocommerce a.remove {
	color: #dc2626 !important;
	font-weight: 700;
}

.woocommerce a.remove:hover {
	background: #dc2626;
}

.woocommerce .coupon {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.woocommerce .coupon .input-text {
	width: auto;
	min-width: 200px;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	background: var(--billy-color-surface);
	border: 1px solid var(--billy-color-border);
	border-left: 4px solid var(--billy-color-primary);
	border-radius: var(--billy-radius-sm);
	padding: 1rem 1.25rem !important;
	margin-bottom: 1.5rem !important;
	list-style: none;
}

.woocommerce-message { border-left-color: #16a34a; }
.woocommerce-error { border-left-color: #dc2626; }

.woocommerce-message::before,
.woocommerce-info::before {
	color: var(--billy-color-primary) !important;
}

.woocommerce-message .button {
	margin-right: 0.5rem;
}

/* 404 */

.error-404 {
	text-align: center;
	padding: 4rem 1rem;
}

.error-404 h1 {
	font-size: 4rem;
}

.error-404 .page-title {
	font-size: 1.75rem;
}

/* Mobile nav */

@media (max-width: 860px) {
	.nav-toggle {
		display: block;
	}

	.main-navigation {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--billy-color-bg);
		border-bottom: 1px solid var(--billy-color-border);
		box-shadow: var(--billy-shadow);
		display: none;
		padding: 0.5rem 1.25rem 1.25rem;
	}

	.main-navigation.toggled {
		display: block;
	}

	.main-navigation ul {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25rem;
	}

	.main-navigation li {
		width: 100%;
	}

	.main-navigation a {
		display: block;
		padding: 0.6rem 0;
	}

	.site-main--sidebar {
		grid-template-columns: 1fr;
	}

	.entry-content .alignfull,
	.entry-content .alignwide {
		margin-left: 0;
		margin-right: 0;
		width: 100%;
	}
}
