/*
Theme Name: Heal From Cheating
Theme URI: https://healfromcheating.com
Author: Heal From Cheating
Description: A fast, calm, AdSense-ready blog theme for healfromcheating.com. Built-in ad slots, reading time, table of contents, related posts, schema markup and a mobile-first layout.
Version: 1.0.0
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: healfromcheating
Tags: blog, one-column, two-columns, right-sidebar, custom-menu, custom-logo, featured-images, threaded-comments
*/

:root {
	--bg: #fbf8f4;
	--surface: #ffffff;
	--ink: #24302e;
	--muted: #5f6b69;
	--line: #e7e1d8;
	--brand: #2f6f68;
	--brand-dark: #22524d;
	--brand-soft: #e5f0ee;
	--accent: #c9826b;
	--radius: 12px;
	--max: 1160px;
	--content: 720px;
	--serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
	--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 18px;
	line-height: 1.7;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.25; color: var(--ink); margin: 1.6em 0 .6em; }
h1 { font-size: clamp(2rem, 4.5vw, 2.75rem); margin-top: 0; }
h2 { font-size: clamp(1.5rem, 3vw, 1.85rem); }
h3 { font-size: 1.3rem; }
p, ul, ol, blockquote { margin: 0 0 1.25em; }
blockquote {
	border-left: 4px solid var(--accent);
	background: var(--surface);
	padding: 1em 1.25em;
	border-radius: 0 var(--radius) var(--radius) 0;
	font-family: var(--serif);
	font-size: 1.1em;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; left: 1rem; top: 1rem; z-index: 999;
	background: #fff; padding: .5rem 1rem; border-radius: 6px;
}
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
	background: var(--surface);
	border-bottom: 1px solid var(--line);
	position: sticky; top: 0; z-index: 50;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.site-branding { display: flex; align-items: center; gap: .6rem; }
.site-branding img { max-height: 44px; width: auto; }
.site-title { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; margin: 0; line-height: 1.2; }
.site-title a { color: var(--ink); text-decoration: none; }
.site-title a span { color: var(--brand); }
.site-description { margin: 0; font-size: .8rem; color: var(--muted); }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.4rem; }
.main-nav a { color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 500; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--brand); }
.main-nav li { position: relative; }
.main-nav .sub-menu {
	display: none; position: absolute; top: 100%; left: 0; min-width: 220px;
	background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
	padding: .5rem 0; flex-direction: column; gap: 0; box-shadow: 0 8px 24px rgba(0,0,0,.06);
}
.main-nav .sub-menu a { display: block; padding: .4rem 1rem; }
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { display: flex; }
.menu-toggle {
	display: none; background: none; border: 1px solid var(--line); border-radius: 8px;
	padding: .45rem .7rem; font-size: 1rem; cursor: pointer; color: var(--ink);
}
@media (max-width: 860px) {
	.menu-toggle { display: block; }
	.main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); }
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; gap: 0; padding: .5rem 20px 1rem; }
	.main-nav a { display: block; padding: .6rem 0; border-bottom: 1px solid var(--line); }
	.main-nav .sub-menu { display: block; position: static; border: 0; box-shadow: none; padding-left: 1rem; }
}

/* Hero */
.hero { background: linear-gradient(180deg, var(--brand-soft), var(--bg)); padding: 64px 0 48px; text-align: center; }
.hero h1 { max-width: 780px; margin: 0 auto .5em; }
.hero p { max-width: 640px; margin: 0 auto 1.5em; color: var(--muted); font-size: 1.1rem; }
.btn {
	display: inline-block; background: var(--brand); color: #fff; text-decoration: none;
	padding: .75rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: .95rem; border: 0; cursor: pointer;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; }
.hero-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.topic-pills { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 2rem; }
.topic-pills a {
	background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
	padding: .4rem 1rem; font-size: .9rem; text-decoration: none; color: var(--ink);
}
.topic-pills a:hover { border-color: var(--brand); color: var(--brand); }

/* Layout */
.site-content { padding: 40px 0 64px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; }
.layout.no-sidebar { grid-template-columns: minmax(0, 1fr); max-width: var(--content); margin: 0 auto; }
@media (max-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.section-title { font-size: 1.5rem; margin: 0 0 1.25rem; padding-bottom: .5rem; border-bottom: 2px solid var(--line); }

/* Cards */
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 640px) { .post-grid { grid-template-columns: minmax(0, 1fr); } }
.card {
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
	overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: 0 10px 30px rgba(36,48,46,.08); transform: translateY(-2px); }
.card-thumb { display: block; text-decoration: none; aspect-ratio: 16/9; background: var(--brand-soft); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb .placeholder {
	width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
	font-family: var(--serif); font-size: 2.4rem; color: var(--brand);
	background: linear-gradient(135deg, var(--brand-soft), #f6e9e3);
}
.card-body { padding: 1.1rem 1.25rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.card-cat { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--accent); text-decoration: none; }
.card-title { font-size: 1.25rem; margin: .35rem 0 .5rem; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--brand); }
.card-excerpt { color: var(--muted); font-size: .95rem; margin: 0 0 .9rem; flex: 1; }
.card-meta, .entry-meta { font-size: .85rem; color: var(--muted); }

/* Single */
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumbs a { color: var(--muted); }
.entry-header { margin-bottom: 1.5rem; }
.entry-header .card-cat { display: inline-block; margin-bottom: .5rem; }
.entry-meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; align-items: center; }
.entry-thumb { border-radius: var(--radius); overflow: hidden; margin: 0 0 2rem; }
.entry-content { font-size: 1.08rem; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content ul li, .entry-content ol li { margin-bottom: .4em; }
.entry-content img { border-radius: var(--radius); }
.entry-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.5em; font-size: .95rem; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: .6rem .8rem; text-align: left; }
.entry-content th { background: var(--brand-soft); }
.entry-content .callout, .callout {
	background: var(--brand-soft); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 0 0 1.5em;
}
.callout p:last-child { margin-bottom: 0; }

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.3rem; margin: 0 0 2rem; }
.toc summary { font-weight: 700; cursor: pointer; font-family: var(--serif); font-size: 1.1rem; }
.toc ol { margin: .75rem 0 0; padding-left: 1.2rem; font-size: .95rem; }
.toc li { margin-bottom: .3rem; }

.author-box {
	display: flex; gap: 1rem; align-items: flex-start; background: var(--surface);
	border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin: 2.5rem 0;
}
.author-box img { border-radius: 50%; flex-shrink: 0; }
.author-box h3 { margin: 0 0 .3rem; font-size: 1.1rem; }
.author-box p { margin: 0; font-size: .95rem; color: var(--muted); }

.disclaimer-note { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 2rem; }

.share { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 2rem 0; font-size: .9rem; }
.share a {
	border: 1px solid var(--line); border-radius: 999px; padding: .35rem .9rem;
	text-decoration: none; color: var(--ink); background: var(--surface);
}
.share a:hover { border-color: var(--brand); color: var(--brand); }

.related { margin-top: 3rem; }
.related .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 760px) { .related .post-grid { grid-template-columns: minmax(0, 1fr); } }
.related .card-title { font-size: 1.05rem; }

.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; font-size: .95rem; }

/* Ads */
.hfc-ad { margin: 2rem auto; text-align: center; min-height: 100px; clear: both; }
.hfc-ad-label { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: #9aa3a1; margin-bottom: .3rem; }
.sidebar .hfc-ad { margin: 0 0 2rem; }

/* Sidebar */
.sidebar .widget {
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
	padding: 1.25rem; margin-bottom: 2rem; font-size: .95rem;
}
.sidebar .widget-title { font-size: 1.1rem; margin: 0 0 .8rem; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { text-decoration: none; color: var(--ink); }
.sidebar a:hover { color: var(--brand); }
.sticky-side { position: sticky; top: 96px; }

/* Forms */
input[type=text], input[type=email], input[type=search], input[type=url], textarea {
	width: 100%; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 8px;
	font: inherit; font-size: 1rem; background: #fff; color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.search-form { display: flex; gap: .5rem; }
.search-form label { flex: 1; }
.search-form .btn { padding: .6rem 1rem; }

/* Comments */
.comments-area { margin-top: 3rem; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; }
.comment-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.comment-meta { font-size: .85rem; color: var(--muted); }
.comment-author img { border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: .4rem; }
.comment-form p { margin-bottom: 1rem; }

/* Pagination */
.pagination { margin-top: 2.5rem; display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers {
	padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 8px;
	text-decoration: none; background: var(--surface); color: var(--ink);
}
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Newsletter / CTA */
.cta-box {
	background: var(--brand); color: #fff; border-radius: var(--radius); padding: 2rem; margin: 3rem 0; text-align: center;
}
.cta-box h2, .cta-box h3 { color: #fff; margin-top: 0; }
.cta-box p { color: rgba(255,255,255,.9); }
.cta-box .btn { background: #fff; color: var(--brand); }

/* Help banner */
.help-banner { background: #fff4ef; border: 1px solid #f1d5ca; border-radius: var(--radius); padding: 1rem 1.25rem; font-size: .92rem; margin: 2rem 0; }

/* Footer */
.site-footer { background: #1f2a28; color: #c8d1cf; padding: 56px 0 24px; font-size: .95rem; }
.site-footer a { color: #e7efed; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
.site-footer h3 { color: #fff; font-size: 1.05rem; margin: 0 0 .8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .45rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-top: 20px; font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* WP core */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: .4rem; }
.sticky .card { border-color: var(--brand); }
.bypostauthor > .comment-body { border-color: var(--brand); }
.gallery-caption { font-size: .85rem; }

/* 404 */
.not-found { text-align: center; padding: 40px 0; }
