/*
Theme Name: HealthPulse
Theme URI: https://example.com/healthpulse
Author: HealthPulse
Author URI: https://example.com
Description: A clean, fast, SEO-friendly health & wellness blog theme built to pair with the HealthPulse AI Auto-Writer plugin. Features a responsive card grid, an always-on sidebar (search, latest posts, categories), schema.org microdata, author box for E-E-A-T, and a lightweight system-font stack for excellent Core Web Vitals.
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.7
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: healthpulse
Tags: blog, health, wellness, two-columns, right-sidebar, grid-layout, featured-images, custom-logo, custom-menu, threaded-comments, translation-ready
*/

/* ==========================================================================
   Base
   ========================================================================== */

:root {
	--hp-green: #0e9f8a;
	--hp-green-dark: #0b7d6d;
	--hp-ink: #1f2d2b;
	--hp-muted: #5f7370;
	--hp-bg: #f6faf9;
	--hp-card: #ffffff;
	--hp-border: #e3eeec;
	--hp-radius: 12px;
	--hp-shadow: 0 2px 10px rgba(15, 60, 54, 0.06);
	--hp-max: 1180px;
}

* { box-sizing: border-box; }

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

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 17px;
	line-height: 1.7;
	color: var(--hp-ink);
	background: var(--hp-bg);
	word-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
	line-height: 1.25;
	color: var(--hp-ink);
	font-weight: 700;
}

a { color: var(--hp-green-dark); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

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

.wp-caption, .gallery-caption { max-width: 100%; }
.sticky { outline: 2px solid var(--hp-border); outline-offset: -2px; }
.bypostauthor { /* required class */ }

.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 !important;
	width: 1px;
	word-wrap: normal !important;
}
.screen-reader-text:focus {
	clip: auto !important;
	clip-path: none;
	display: block;
	height: auto;
	left: 6px;
	top: 6px;
	width: auto;
	z-index: 100000;
	background: #fff;
	padding: 10px 14px;
	border-radius: 4px;
	box-shadow: var(--hp-shadow);
}

.alignleft { float: left; margin: 0.4em 1.4em 1em 0; }
.alignright { float: right; margin: 0.4em 0 1em 1.4em; }
.aligncenter { display: block; margin: 1em auto; clear: both; }

/* ==========================================================================
   Layout
   ========================================================================== */

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

.hp-site-main {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 40px;
	padding: 40px 0 60px;
}

.hp-site-main.no-sidebar { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 900px) {
	.hp-site-main { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Header
   ========================================================================== */

.hp-header {
	background: var(--hp-card);
	border-bottom: 1px solid var(--hp-border);
	position: sticky;
	top: 0;
	z-index: 50;
}

body.admin-bar .hp-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .hp-header { top: 46px; } }

.hp-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 14px 0;
	position: relative;
}

.hp-branding .site-title {
	margin: 0;
	font-size: 1.6rem;
	letter-spacing: -0.02em;
}

.hp-branding .site-title a { color: var(--hp-ink); }
.hp-branding .site-title a span { color: var(--hp-green); }
.hp-branding .site-title a:hover { text-decoration: none; }

.hp-branding .site-description {
	margin: 2px 0 0;
	font-size: 0.85rem;
	color: var(--hp-muted);
}

.hp-branding img.custom-logo { max-height: 56px; width: auto; display: block; }

/* Navigation */

.hp-nav-toggle {
	display: none;
	background: none;
	border: 1px solid var(--hp-border);
	border-radius: 8px;
	padding: 8px 12px;
	font-size: 1rem;
	cursor: pointer;
	color: var(--hp-ink);
}

.hp-primary-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.hp-primary-nav a {
	display: block;
	padding: 8px 12px;
	border-radius: 8px;
	color: var(--hp-ink);
	font-weight: 500;
	font-size: 0.98rem;
}

.hp-primary-nav a:hover,
.hp-primary-nav .current-menu-item > a,
.hp-primary-nav .current_page_item > a {
	background: rgba(14, 159, 138, 0.1);
	color: var(--hp-green-dark);
	text-decoration: none;
}

.hp-primary-nav ul ul {
	display: none;
	position: absolute;
	background: #fff;
	border: 1px solid var(--hp-border);
	border-radius: 8px;
	box-shadow: var(--hp-shadow);
	min-width: 200px;
	padding: 6px;
	flex-direction: column;
}

.hp-primary-nav li { position: relative; }
.hp-primary-nav li:hover > ul,
.hp-primary-nav li.focus > ul { display: flex; }

/* Dropdown caret on top-level parents */
.hp-primary-nav > ul > li.menu-item-has-children > a::after {
	content: "\25BE";
	margin-left: 6px;
	font-size: 0.75em;
	opacity: 0.6;
}

/* Mega menu — full-width multi-column panel (auto-applied to menus with 6+ children) */
.hp-primary-nav li.hp-mega { position: static; }

.hp-primary-nav li.hp-mega > ul {
	left: 0;
	right: 0;
	width: auto;
	min-width: 0;
	padding: 18px 20px;
	border-radius: var(--hp-radius);
	border-top: 3px solid var(--hp-green);
	box-shadow: 0 18px 40px rgba(15, 60, 54, 0.12);
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 2px 24px;
}

.hp-primary-nav li.hp-mega:hover > ul,
.hp-primary-nav li.hp-mega.focus > ul { display: grid; }

.hp-primary-nav li.hp-mega > ul > li > a {
	padding: 9px 12px;
	border-radius: 8px;
	font-size: 0.95rem;
	white-space: normal;
}

/* Nested lists inside a mega panel stay stacked, never fly out */
.hp-primary-nav li.hp-mega > ul ul {
	position: static;
	display: flex;
	border: 0;
	box-shadow: none;
	min-width: 0;
	padding: 2px 0 2px 14px;
}

.hp-primary-nav li.hp-mega > ul ul a { font-weight: 400; color: var(--hp-muted); font-size: 0.9rem; }

/* Caret on column parents inside mega panel */
.hp-primary-nav li.hp-mega > ul > li.menu-item-has-children > a { font-weight: 700; }

@media (max-width: 900px) {
	.hp-nav-toggle { display: inline-block; }
	.hp-primary-nav { display: none; width: 100%; }
	.hp-primary-nav.toggled { display: block; padding-bottom: 14px; }
	.hp-primary-nav ul { flex-direction: column; }
	.hp-primary-nav ul ul { position: static; display: flex; border: 0; box-shadow: none; padding-left: 18px; }
	.hp-header-inner { flex-wrap: wrap; }
	/* Mega panel collapses to a simple stacked list on mobile */
	.hp-primary-nav li.hp-mega > ul {
		position: static;
		display: flex;
		flex-direction: column;
		border: 0;
		box-shadow: none;
		padding: 0 0 0 18px;
		border-radius: 0;
	}
	.hp-primary-nav li.hp-mega > ul > li > a { font-size: 0.98rem; }
}

/* ==========================================================================
   Post grid (home / archives)
   ========================================================================== */

.hp-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 26px;
}

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

.hp-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(15, 60, 54, 0.1);
}

.hp-card .hp-thumb a { display: block; }
.hp-card .hp-thumb img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.hp-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }

.hp-card-cats { margin-bottom: 8px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.hp-card-cats a { color: var(--hp-green); }

.hp-card h2.entry-title {
	margin: 0 0 8px;
	font-size: 1.2rem;
}

.hp-card h2.entry-title a { color: var(--hp-ink); }
.hp-card h2.entry-title a:hover { color: var(--hp-green-dark); text-decoration: none; }

.hp-entry-meta {
	font-size: 0.82rem;
	color: var(--hp-muted);
	margin-bottom: 10px;
}

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

.hp-card .entry-summary { font-size: 0.95rem; color: var(--hp-muted); flex: 1; }

.hp-read-more {
	display: inline-block;
	margin-top: 14px;
	font-weight: 600;
	font-size: 0.92rem;
	color: var(--hp-green-dark);
}

/* ==========================================================================
   Single post / page
   ========================================================================== */

.hp-article {
	background: var(--hp-card);
	border: 1px solid var(--hp-border);
	border-radius: var(--hp-radius);
	box-shadow: var(--hp-shadow);
	padding: 36px 42px;
}

@media (max-width: 640px) {
	.hp-article { padding: 24px 20px; }
}

.hp-article .entry-title {
	font-size: 2.1rem;
	margin: 0 0 12px;
	letter-spacing: -0.02em;
}

.hp-article .post-thumbnail { margin: 22px 0; }
.hp-article .post-thumbnail img { border-radius: 10px; display: block; }

.entry-content h2 { margin-top: 1.6em; font-size: 1.45rem; }
.entry-content h3 { margin-top: 1.4em; font-size: 1.15rem; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: 0.35em; }
.entry-content blockquote {
	margin: 1.6em 0;
	padding: 4px 0 4px 22px;
	border-left: 4px solid var(--hp-green);
	color: var(--hp-muted);
	font-style: italic;
}

.entry-content table { border-collapse: collapse; width: 100%; margin: 1.4em 0; }
.entry-content th, .entry-content td { border: 1px solid var(--hp-border); padding: 8px 12px; text-align: left; }
.entry-content th { background: var(--hp-bg); }

/* Plugin's disclaimer box inherits body font; nudge spacing inside theme */
.entry-content .hpw-disclaimer { border-radius: 8px; }

/* Author box (E-E-A-T) */

.hp-author-box {
	display: flex;
	gap: 18px;
	align-items: flex-start;
	margin-top: 40px;
	padding: 20px 24px;
	background: var(--hp-bg);
	border: 1px solid var(--hp-border);
	border-radius: 10px;
}

.hp-author-box img { border-radius: 50%; }
.hp-author-box .author-name { margin: 0 0 4px; font-size: 1rem; }
.hp-author-box .author-bio { margin: 0; font-size: 0.9rem; color: var(--hp-muted); }

/* Post footer */

.hp-post-footer { margin-top: 30px; font-size: 0.9rem; color: var(--hp-muted); }
.hp-post-footer a { font-weight: 500; }

.hp-post-nav {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-top: 30px;
	font-weight: 600;
	font-size: 0.95rem;
}

/* ==========================================================================
   Sidebar / widgets
   ========================================================================== */

.hp-sidebar .widget {
	background: var(--hp-card);
	border: 1px solid var(--hp-border);
	border-radius: var(--hp-radius);
	box-shadow: var(--hp-shadow);
	padding: 22px 24px;
	margin-bottom: 26px;
}

.hp-sidebar .widget-title {
	margin: 0 0 14px;
	font-size: 1.05rem;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--hp-green);
	display: inline-block;
}

.hp-sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.hp-sidebar .widget ul li { padding: 6px 0; border-bottom: 1px dashed var(--hp-border); }
.hp-sidebar .widget ul li:last-child { border-bottom: 0; }

.hp-sidebar .widget_recent_entries .post-date {
	display: block;
	font-size: 0.78rem;
	color: var(--hp-muted);
}

.hp-sidebar .widget_categories li { display: flex; justify-content: space-between; gap: 10px; }
.hp-sidebar .widget_categories .children { padding-left: 16px; margin-top: 6px; }

/* Search form */

.hp-search-form { display: flex; gap: 8px; }
.hp-search-form input[type="search"] {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid var(--hp-border);
	border-radius: 8px;
	font-size: 0.95rem;
}
.hp-search-form button {
	padding: 10px 16px;
	border: 0;
	border-radius: 8px;
	background: var(--hp-green);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}
.hp-search-form button:hover { background: var(--hp-green-dark); }

/* ==========================================================================
   Comments
   ========================================================================== */

.hp-comments {
	margin-top: 40px;
	background: var(--hp-card);
	border: 1px solid var(--hp-border);
	border-radius: var(--hp-radius);
	box-shadow: var(--hp-shadow);
	padding: 30px 36px;
}

.hp-comments .comment-list { list-style: none; padding: 0; }
.hp-comments .comment-body { padding: 14px 0; border-bottom: 1px solid var(--hp-border); }
.hp-comments .comment-author { font-weight: 600; }
.hp-comments .comment-metadata { font-size: 0.8rem; color: var(--hp-muted); }
.hp-comments .comment-respond .comment-form-comment textarea { width: 100%; }
.hp-comments input[type="text"], .hp-comments input[type="email"], .hp-comments input[type="url"], .hp-comments textarea {
	border: 1px solid var(--hp-border);
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 0.95rem;
	max-width: 100%;
}
.hp-comments .submit {
	background: var(--hp-green);
	border: 0;
	color: #fff;
	padding: 10px 22px;
	border-radius: 8px;
	font-weight: 600;
	cursor: pointer;
}
.hp-comments .submit:hover { background: var(--hp-green-dark); }

/* ==========================================================================
   Pagination / footer
   ========================================================================== */

.hp-pagination { margin: 36px 0 0; text-align: center; }
.hp-pagination .page-numbers {
	display: inline-block;
	padding: 8px 14px;
	margin: 0 3px;
	border: 1px solid var(--hp-border);
	border-radius: 8px;
	background: #fff;
	font-weight: 500;
}
.hp-pagination .page-numbers.current {
	background: var(--hp-green);
	border-color: var(--hp-green);
	color: #fff;
}

.hp-footer {
	background: #122e2a;
	color: #bcd4cf;
	margin-top: 40px;
}

.hp-footer a { color: #7fd8c9; }

.hp-footer-inner {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 30px;
	padding: 44px 0 30px;
}

.hp-footer .widget-title { color: #fff; font-size: 1rem; margin: 0 0 12px; }
.hp-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.hp-footer .widget ul li { padding: 4px 0; }

.hp-footer-bar {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding: 18px 0;
	font-size: 0.85rem;
	display: flex;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	align-items: center;
}

.hp-design-credit { color: #8fb3ac; }
.hp-design-credit a { font-weight: 600; }

.hp-footer-disclaimer {
	font-size: 0.8rem;
	color: #8fb3ac;
	padding: 0 0 18px;
	max-width: 760px;
}

/* Archive headers */

.hp-archive-header { margin-bottom: 26px; }
.hp-archive-header h1 { margin: 0 0 6px; font-size: 1.7rem; }
.hp-archive-header p { margin: 0; color: var(--hp-muted); }

/* 404 / no results */

.hp-none { text-align: center; padding: 60px 20px; }
.hp-none h1, .hp-none h2 { font-size: 1.6rem; }
