/*
Theme Name: Daily Habit Edit
Theme URI: https://dailyhabitedit.com
Author: Daily Habit Edit
Description: Lightweight editorial theme for wellness content and clearly labeled advertorials. Built for fast mobile load and ad-platform landing page requirements (Meta and Google): visible disclosures, legal footer links, advertorial page template, and tracking-parameter passthrough on offer links.
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: dhe
*/

:root {
	--bg: #fbf8f3;
	--surface: #ffffff;
	--text: #1f2a26;
	--muted: #5d6b65;
	--line: #e7e1d7;
	--brand: #2f5d50;
	--brand-soft: #e6efe9;
	--cta: #c2603f;
	--cta-hover: #a94f31;
	--note: #fff6e5;
	--note-line: #f0d9a8;
	--radius: 12px;
	--wrap: 1120px;
	--read: 720px;
	--serif: Georgia, "Times New Roman", serif;
	--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 18px/1.7 var(--sans);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
a:hover { color: var(--cta); }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.25; color: var(--text); margin: 1.6em 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); margin-top: .3em; }
h2 { font-size: clamp(1.45rem, 3.2vw, 1.85rem); }
h3 { font-size: 1.25rem; }
p, ul, ol { margin: 0 0 1.2em; }
blockquote { margin: 1.5em 0; padding: .4em 1.2em; border-left: 4px solid var(--brand); color: var(--muted); font-style: italic; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 999; width: auto; height: auto; clip: auto; background: #fff; padding: 8px 14px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.read { max-width: var(--read); margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--brand); }
.custom-logo { max-height: 44px; width: auto; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--text); }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; }
.primary-nav a { text-decoration: none; color: var(--text); font-size: .95rem; font-weight: 500; }
.primary-nav a:hover { color: var(--brand); }

@media (max-width: 760px) {
	.nav-toggle { display: inline-block; }
	.primary-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); }
	.primary-nav.is-open { display: block; }
	.primary-nav ul { flex-direction: column; gap: 0; padding: 8px 16px 16px; }
	.primary-nav li a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
}

/* Advertorial bar */
.ad-label-bar { background: var(--note); border-bottom: 1px solid var(--note-line); font-size: .78rem; text-align: center; padding: 6px 16px; color: #6b5420; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }

/* Home hero */
.hero { padding: 48px 0 24px; text-align: center; }
.hero h1 { margin: 0 0 .3em; }
.hero p { color: var(--muted); max-width: 620px; margin: 0 auto; font-size: 1.05rem; }

/* Cards */
.section-title { font-family: var(--sans); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 40px 0 16px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-media { aspect-ratio: 16/10; background: var(--brand-soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px 18px 20px; }
.card-cat { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); font-weight: 600; text-decoration: none; }
.card h2, .card h3 { font-size: 1.2rem; margin: .4em 0 .4em; }
.card h2 a, .card h3 a { color: var(--text); text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { color: var(--brand); }
.card p { color: var(--muted); font-size: .95rem; margin: 0; }

.pagination { margin: 40px 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; background: var(--surface); }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Article */
.entry { padding: 32px 0 48px; }
.entry-cat { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); font-weight: 700; text-decoration: none; }
.entry-meta { color: var(--muted); font-size: .9rem; margin-bottom: 20px; }
.entry-thumb { margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; }
.entry-content a { text-underline-offset: 2px; }
.entry-content img { border-radius: 10px; margin: 1.2em 0; }
.entry-content figure { margin: 1.5em 0; }
.entry-content figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 6px; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px; text-align: left; }
.entry-content th { background: var(--brand-soft); }

.disclosure { background: var(--note); border: 1px solid var(--note-line); border-radius: 10px; padding: 10px 14px; font-size: .82rem; line-height: 1.5; color: #5a4718; margin: 0 0 24px; }
.disclosure strong { color: #4a3a12; }

.callout { background: var(--brand-soft); border-radius: var(--radius); padding: 18px 20px; margin: 1.6em 0; }
.callout-title { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; margin: 0 0 .4em; }
.callout > :last-child { margin-bottom: 0; }

.about-box { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 20px; font-size: .85rem; color: var(--muted); line-height: 1.55; }

/* CTA */
.dhe-cta-wrap { text-align: center; margin: 2em 0; }
.dhe-cta { display: inline-block; background: var(--cta); color: #fff !important; text-decoration: none !important; font-weight: 700; font-size: 1.1rem; padding: 16px 32px; border-radius: 999px; box-shadow: 0 6px 18px rgba(194,96,63,.28); transition: background .15s ease, transform .15s ease; max-width: 100%; }
.dhe-cta:hover { background: var(--cta-hover); transform: translateY(-1px); }
.dhe-cta-note { display: block; font-size: .8rem; color: var(--muted); margin-top: 8px; }

.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; z-index: 50; transform: translateY(110%); transition: transform .25s ease; box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
.sticky-cta.is-visible { transform: translateY(0); }
.sticky-cta .dhe-cta { padding: 12px 24px; font-size: 1rem; box-shadow: none; }
.sticky-cta-text { font-size: .9rem; font-weight: 600; }
@media (max-width: 480px) { .sticky-cta-text { display: none; } .sticky-cta .dhe-cta { width: 100%; text-align: center; } }

/* Related */
.related { border-top: 1px solid var(--line); padding: 32px 0 56px; }

/* Footer */
.site-footer { background: #1f2a26; color: #cfd8d3; font-size: .88rem; padding: 40px 0 90px; margin-top: 40px; }
.site-footer a { color: #e9efe9; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-brand { font-family: var(--serif); font-size: 1.2rem; color: #fff; margin-bottom: 10px; }
.footer-nav ul { list-style: none; margin: 16px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-disclaimer { font-size: .78rem; line-height: 1.55; color: #a9b6b0; border-top: 1px solid #34413c; padding-top: 16px; margin-top: 16px; }
.footer-disclaimer p { margin: 0 0 .6em; }

/* Advertorial template */
.is-advertorial .site-footer { padding-bottom: 100px; }
.adv-head { text-align: left; }
.adv-byline { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; margin-bottom: 20px; }

/* 404 / search */
.search-form { display: flex; gap: 8px; margin: 20px 0; }
.search-form input[type=search] { flex: 1; padding: 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.search-form button { padding: 12px 18px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font: inherit; cursor: pointer; }

/* Gutenberg alignment */
.alignwide { margin-left: -60px; margin-right: -60px; max-width: none; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); max-width: none; }
.aligncenter { margin-left: auto; margin-right: auto; }
@media (max-width: 860px) { .alignwide { margin-left: 0; margin-right: 0; } }
.wp-block-button__link { background: var(--cta); border-radius: 999px; }
