/*
Theme Name: Tips Handy
Theme URI: https://www.tipshandyman.com/
Author: Alex Demayo
Author URI: https://www.tipshandyman.com/about-us/
Description: A fast, SEO-first WordPress theme for TipsHandyman.com. Semantic HTML5, zero JavaScript files, system fonts, breadcrumb schema, automatic table of contents, author E-E-A-T box, and related-post internal linking.
Version: 2.0.1
Requires at least: 6.0
Tested up to: 7.0
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: tipshandy
Tags: blog, one-column, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 1.0625rem;
	line-height: 1.7;
	color: #23282d;
	background: #fff;
	-webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #b45309; }
a:hover { color: #92400e; }
h1, h2, h3, h4 { line-height: 1.25; color: #1a1e23; }
h1 { font-size: 1.9rem; margin: .4em 0 .5em; }
h2 { font-size: 1.5rem; margin-top: 1.6em; }
h3 { font-size: 1.2rem; }
table { border-collapse: collapse; width: 100%; margin: 1.2em 0; }
th, td { border: 1px solid #e2e2e2; padding: .55em .7em; text-align: left; }
th { background: #f7f5f2; }
figure { margin: 1.2em 0; }
figcaption { font-size: .85rem; color: #666; margin-top: .4em; }
blockquote { border-left: 4px solid #f59e0b; margin: 1.2em 0; padding: .3em 1em; background: #fffbeb; }
code { background: #f4f4f4; padding: .1em .35em; border-radius: 3px; font-size: .92em; }

.skip-link {
	position: absolute; left: -9999px; top: 0;
	background: #1a1e23; color: #fff; padding: .6em 1em; z-index: 100;
}
.skip-link:focus { left: 0; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.content-narrow { max-width: 740px; margin: 0 auto; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid #eee; background: #fff; }
.site-header .wrap { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.5rem; padding-top: .8rem; padding-bottom: .8rem; }
.site-branding { display: flex; align-items: center; gap: .7rem; }
.site-title { font-size: 1.35rem; font-weight: 700; margin: 0; }
.site-title a { color: #1a1e23; text-decoration: none; }
.site-title a:hover { color: #b45309; }
.custom-logo { max-height: 48px; width: auto; }

.nav-toggle { display: none; }
.nav-toggle-label { display: none; cursor: pointer; padding: .4em .8em; border: 1px solid #ddd; border-radius: 6px; font-weight: 600; margin-left: auto; }
.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem; }
.main-nav a { display: block; padding: .45em .8em; text-decoration: none; color: #23282d; font-weight: 600; border-radius: 6px; }
.main-nav a:hover, .main-nav .current-menu-item > a { background: #fef3c7; color: #92400e; }

@media (max-width: 760px) {
	.nav-toggle-label { display: block; }
	.main-nav { display: none; width: 100%; margin-left: 0; }
	.nav-toggle:checked ~ .main-nav { display: block; }
	.main-nav ul { flex-direction: column; }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: .85rem; color: #777; margin: 1rem 0 0; }
.breadcrumbs a { color: #777; text-decoration: none; }
.breadcrumbs a:hover { color: #b45309; text-decoration: underline; }
.breadcrumbs .sep { margin: 0 .4em; color: #bbb; }

/* ---------- Post cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin: 1.5rem 0 2.5rem; padding: 0; list-style: none; }
.post-card { border: 1px solid #eee; border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; transition: box-shadow .15s ease; }
.post-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.post-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.post-card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.post-card-cat { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.post-card-cat a { color: #b45309; text-decoration: none; }
.post-card h2, .post-card h3 { font-size: 1.08rem; margin: 0; }
.post-card h2 a, .post-card h3 a { color: #1a1e23; text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { color: #b45309; }
.post-card-excerpt { font-size: .92rem; color: #555; margin: 0; }
.post-card-date { font-size: .8rem; color: #999; margin-top: auto; }

/* ---------- Single post ---------- */
.entry-meta { display: flex; flex-wrap: wrap; gap: .3em 1em; font-size: .88rem; color: #666; margin-bottom: 1.2rem; }
.entry-meta a { color: #666; }
.entry-meta .updated-date { font-weight: 600; color: #444; }
.featured-image img { border-radius: 10px; }
.entry-content { font-size: 1.0625rem; }
.entry-content > * + * { margin-top: 1em; }
.entry-content h2 { padding-bottom: .25em; border-bottom: 2px solid #fde68a; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content img { border-radius: 8px; margin: 1.2em auto; }

/* Table of contents */
.th-toc { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 1rem 1.3rem; margin: 1.5rem 0; font-size: .95rem; }
.th-toc strong { display: block; margin-bottom: .4em; }
.th-toc ol { margin: 0; padding-left: 1.3em; }
.th-toc a { text-decoration: none; }
.th-toc a:hover { text-decoration: underline; }

/* Author box */
.author-box { display: flex; gap: 1.1rem; align-items: flex-start; background: #f8f7f5; border: 1px solid #eee; border-radius: 10px; padding: 1.2rem; margin: 2.5rem 0; }
.author-box img { border-radius: 50%; flex-shrink: 0; }
.author-box-name { font-weight: 700; margin: 0 0 .3em; font-size: 1.05rem; }
.author-box-name a { color: #1a1e23; text-decoration: none; }
.author-box p { margin: 0; font-size: .92rem; color: #555; }

/* Related posts */
.related-posts { margin: 2.5rem 0; }
.related-posts > h2 { font-size: 1.3rem; }

/* Post navigation */
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin: 2rem 0; font-size: .92rem; }
.post-nav a { text-decoration: none; max-width: 48%; }
.post-nav .nav-label { display: block; font-size: .78rem; color: #999; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Front page ---------- */
.hero { background: linear-gradient(180deg, #fffbeb 0%, #fff 100%); padding: 3rem 0 2.5rem; text-align: center; }
.hero h1 { font-size: 2.2rem; margin: 0 0 .4em; }
.hero p { max-width: 620px; margin: 0 auto 1.4em; color: #555; font-size: 1.1rem; }
.hero form { max-width: 480px; margin: 0 auto; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 0; }
.section-title h2 { margin: 0; }
.section-title a { font-size: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap; }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin: 1.2rem 0 1.8rem; padding: 0; list-style: none; }
.topic-card { border: 1px solid #eee; border-radius: 10px; text-decoration: none; display: flex; flex-direction: column; overflow: hidden; height: 100%; background: #fff; transition: box-shadow .15s ease, transform .15s ease; }
.topic-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-2px); }
.topic-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.topic-card-body { display: block; padding: .9rem 1.2rem 1rem; }
.topic-card strong { color: #1a1e23; font-size: 1.05rem; display: block; }
.topic-card-body > span { color: #777; font-size: .85rem; }

/* ---------- Archive ---------- */
.archive-header { margin: 1.5rem 0 .5rem; }
.archive-description { color: #555; max-width: 740px; }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: .5rem; }
.search-form input[type=search] { flex: 1; padding: .6em .9em; border: 1px solid #ccc; border-radius: 8px; font-size: 1rem; }
.search-form button { padding: .6em 1.2em; border: 0; border-radius: 8px; background: #b45309; color: #fff; font-weight: 700; cursor: pointer; font-size: 1rem; }
.search-form button:hover { background: #92400e; }

/* ---------- Pagination ---------- */
.pagination { margin: 2rem 0; text-align: center; }
.pagination .page-numbers { display: inline-block; padding: .45em .85em; margin: 0 .15em; border: 1px solid #ddd; border-radius: 6px; text-decoration: none; color: #23282d; }
.pagination .page-numbers.current { background: #b45309; border-color: #b45309; color: #fff; }
.pagination a.page-numbers:hover { background: #fef3c7; }

/* ---------- Comments ---------- */
.comments-area { margin: 2.5rem 0; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { border-top: 1px solid #eee; padding: 1rem 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid #eee; margin-top: 3rem; padding: 2rem 0; font-size: .9rem; color: #666; background: #f8f7f5; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.footer-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.2rem; margin: 0; padding: 0; }
.footer-nav a { color: #666; text-decoration: none; }
.footer-nav a:hover { color: #b45309; }

/* ---------- WP core alignment classes ---------- */
.alignleft { float: left; margin: .4em 1.2em .8em 0; }
.alignright { float: right; margin: .4em 0 .8em 1.2em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.alignwide { max-width: 1000px; margin-left: auto; margin-right: auto; }
.alignfull { max-width: none; }
.wp-caption { max-width: 100%; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

@media print {
	.site-header, .site-footer, .related-posts, .post-nav, .th-toc { display: none; }
}
