/*
Theme Name: Dr Jessie Hsieh
Theme URI: https://www.drjessie.ca
Author: Custom build for Dr. Jessie Hsieh
Description: Content-driven WordPress theme for Dr. Jessie Hsieh, Ottawa chiropractor. All site content is editable from the WordPress admin - no code changes required.
Version: 2.3.0
Requires at least: 6.0
Tested up to: 7.1
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: drjessie
Tags: custom-menu, featured-images, translation-ready, blog
*/

/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root {
	--cream: #f7f3e8;
	--sage:  #e4e6d7;
	--olive: #4e5c48;
	--brown: #806452;
	--ink:   #30322e;
	--white: #fff;
	--line:  #deded5;
	--max:   1160px;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
	margin: 0;
	color: var(--ink);
	font: 16px/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	background: #fff;
}

a { color: inherit; }

h1, h2, h3 { line-height: 1.12; margin-top: 0; }
h1 { font-family: Georgia, serif; font-size: clamp(46px, 6vw, 76px); font-weight: 500; margin-bottom: 20px; }
h2 { font-family: Georgia, serif; font-size: clamp(34px, 4vw, 48px); font-weight: 500; }

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

.wrap { max-width: var(--max); margin: auto; padding: 0 28px; }
.section { padding: 82px 0; }
.soft { background: #faf9f4; }
.lead { font-size: 20px; max-width: 650px; }
.notice { font-size: 13px; color: #666; }

.eyebrow {
	text-transform: uppercase;
	letter-spacing: .12em;
	font-size: 12px;
	font-weight: 800;
	color: var(--brown);
}

/* Accessibility: visible focus + skip link -------------------------------- */
:focus-visible { outline: 3px solid var(--brown); outline-offset: 2px; }

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	background: var(--olive);
	color: #fff;
	padding: 12px 20px;
	text-decoration: none;
	font-weight: 700;
}
.skip-link:focus { left: 8px; top: 8px; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; overflow: hidden;
	padding: 0; position: absolute; word-wrap: normal !important;
}

/* ==========================================================================
   3. Buttons
   ========================================================================== */
.btn {
	display: inline-block;
	background: var(--olive);
	color: #fff;
	text-decoration: none;
	padding: 10px 16px;
	border-radius: 8px;
	font-weight: 700;
	border: 0;
	cursor: pointer;
}
.btn-outline { background: transparent; color: var(--olive); border: 1px solid var(--olive); }

.text-link {
	display: inline-block;
	margin-top: 18px;
	color: var(--olive);
	font-weight: 700;
}

/* ==========================================================================
   4. Header / navigation
   ========================================================================== */
.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgba(247, 243, 232, .96);
	border-bottom: 1px solid #ddd8ca;
}

.nav { height: 72px; display: flex; align-items: center; justify-content: space-between; }

.brand { text-decoration: none; font-weight: 750; font-size: 20px; }
.brand small { font-weight: 450; }
.brand img { max-height: 46px; width: auto; display: block; }

.menu { display: flex; gap: 28px; align-items: center; }
.menu a { text-decoration: none; }
.menu ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; align-items: center; }
.menu li { position: relative; }

/* Current page indicator */
.menu .current-menu-item > a,
.menu .current_page_item > a { box-shadow: inset 0 -2px 0 var(--brown); }

/* Any menu item given the CSS class "nav-button" renders as a solid button */
.menu li.nav-button > a {
	background: var(--olive);
	color: #fff;
	padding: 9px 15px;
	border-radius: 8px;
	font-weight: 700;
}

/* Submenus */
.menu ul ul {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 8px 0;
	min-width: 210px;
	flex-direction: column;
	gap: 0;
	box-shadow: 0 10px 30px rgba(48, 50, 46, .1);
}
.menu li:hover > ul,
.menu li:focus-within > ul { display: flex; }
.menu ul ul a { display: block; padding: 8px 16px; }

/* Hamburger toggle - hidden on desktop */
.menu-toggle {
	display: none;
	background: transparent;
	border: 1px solid #c9cdbd;
	border-radius: 8px;
	padding: 9px 11px;
	cursor: pointer;
	line-height: 0;
}
.menu-toggle .bar {
	display: block;
	width: 21px;
	height: 2px;
	background: var(--ink);
	border-radius: 2px;
	transition: transform .25s ease, opacity .2s ease;
}
.menu-toggle .bar + .bar { margin-top: 5px; }
.menu-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   5. Hero
   ========================================================================== */
.hero { background: var(--cream); padding: 72px 0; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 60px; align-items: center; }

/* ==========================================================================
   6. Cards (booking / care)
   ========================================================================== */
.book-card {
	background: #fff;
	padding: 22px 24px;
	border-radius: 14px;
	margin: 14px 0;
	box-shadow: 0 8px 28px rgba(48, 50, 46, .08);
}
.book-card h3 { font-size: 18px; margin: 6px 0; }
.book-card .btn { display: block; text-align: center; margin-top: 14px; }

.address, .hours { font-size: 13px; margin: 5px 0; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.care-card {
	padding: 22px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: #fff;
}
.care-card h3 { font-size: 18px; }

/* ==========================================================================
   7. About
   ========================================================================== */
.about-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 70px; align-items: center; }
.portrait { width: 100%; max-width: 430px; border-radius: 18px; display: block; }
.stats { margin-top: 24px; }
.stat { border-left: 3px solid var(--brown); padding-left: 14px; margin: 14px 0; }
.stat strong { display: block; }

/* ==========================================================================
   8. Treatment tools
   ========================================================================== */
.tools { display: flex; flex-wrap: wrap; gap: 10px; }
.tool {
	border: 1px solid #c9cdbd;
	background: #fff;
	padding: 10px 14px;
	border-radius: 999px;
	cursor: pointer;
	font: inherit;
	color: inherit;
}
.tool.active { background: var(--olive); color: #fff; }
.tool-detail {
	margin-top: 20px;
	background: var(--sage);
	padding: 22px;
	border-radius: 12px;
	min-height: 78px;
}

/* ==========================================================================
   9. Resources / post cards
   ========================================================================== */
.resources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.resource {
	border: 1px solid var(--line);
	border-radius: 14px;
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
}
.resource img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.resource-body { padding: 20px; }
.resource-body h3 { font-size: 20px; }
.resource-body h3 a { text-decoration: none; }
.resource-body h3 a:hover { text-decoration: underline; }

.resources-more { margin-top: 32px; }

.post-meta { font-size: 13px; color: #6b6f68; margin: 0 0 10px; }

/* ==========================================================================
   10. Reviews carousel
   ========================================================================== */
.reviews { background: var(--sage); overflow: hidden; }
.review-carousel { margin-top: 30px; }
.review-viewport { overflow: hidden; }
.review-track {
	display: flex;
	transition: transform .7s cubic-bezier(.22, .61, .36, 1);
	will-change: transform;
}
.review-slide { flex: 0 0 100%; margin: 0; padding: 22px 8%; text-align: center; }
.review-slide p {
	max-width: 900px;
	margin: 0 auto 14px;
	font-family: Georgia, serif;
	font-size: clamp(18px, 2.1vw, 24px);
	line-height: 1.5;
}
.review-slide cite { font-style: normal; font-weight: 750; color: var(--brown); font-size: 14px; }

.review-dots {
	display: flex; justify-content: center; align-items: center;
	gap: 11px; margin-top: 18px; min-height: 28px;
}
.review-dot {
	width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%;
	background: rgba(78, 92, 72, .28);
	cursor: pointer;
	transition: transform .2s ease, background .2s ease;
}
.review-dot:hover, .review-dot:focus-visible { transform: scale(1.35); }
.review-dot.active { background: var(--olive); transform: scale(1.25); }

.review-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ==========================================================================
   11. Bottom booking band
   ========================================================================== */
.booking-bottom { background: var(--olive); color: #fff; }
.booking-bottom .book-card { color: var(--ink); }

/* ==========================================================================
   12. Contact form
   ========================================================================== */
.contact-form { max-width: 700px; }
.contact-form input,
.contact-form textarea {
	width: 100%;
	padding: 12px;
	margin: 6px 0 14px;
	border: 1px solid #bbb;
	border-radius: 7px;
	font: inherit;
}

/* WPForms, restyled to match the original theme form ---------------------- */
.contact-form .wpforms-container,
.contact-form .wpforms-container-full { margin: 0; max-width: 700px; }

.contact-form .wpforms-field { padding: 0; }

.contact-form .wpforms-field-label {
	font-weight: 400;
	font-size: 16px;
	margin-bottom: 0;
}

.contact-form .wpforms-container input[type="text"],
.contact-form .wpforms-container input[type="email"],
.contact-form .wpforms-container input[type="tel"],
.contact-form .wpforms-container select,
.contact-form .wpforms-container textarea {
	width: 100% !important;
	max-width: 100% !important;
	padding: 12px !important;
	margin: 6px 0 14px !important;
	border: 1px solid #bbb !important;
	border-radius: 7px !important;
	font: inherit !important;
	background: #fff;
	color: var(--ink);
}

.contact-form .wpforms-container button[type="submit"],
.contact-form .wpforms-submit {
	background: var(--olive) !important;
	color: #fff !important;
	padding: 10px 16px !important;
	border-radius: 8px !important;
	font-weight: 700 !important;
	border: 0 !important;
	cursor: pointer;
	font-size: 16px !important;
}
.contact-form .wpforms-container button[type="submit"]:hover { background: #3f4a3a !important; }

.contact-form .wpforms-confirmation-container-full {
	background: var(--sage);
	border: 1px solid var(--olive);
	border-radius: 12px;
	padding: 20px 22px;
	color: var(--ink);
}

.contact-form .wpforms-error { font-size: 14px; }

/* Shown when the form plugin is unavailable, so the section is never blank */
.contact-fallback {
	background: var(--sage);
	border-radius: 12px;
	padding: 24px;
	max-width: 700px;
}
.contact-fallback p:last-child { margin-bottom: 0; }

/* ==========================================================================
   13. Blog archive / single / search / 404
   ========================================================================== */
.page-header { margin-bottom: 42px; }
.page-header h1 { font-size: clamp(38px, 5vw, 60px); margin-bottom: 12px; }

.entry-content { max-width: 760px; }
.entry-content h2 { font-size: clamp(28px, 3vw, 36px); margin-top: 1.6em; }
.entry-content h3 { font-size: 22px; margin-top: 1.5em; }
.entry-content img { border-radius: 12px; }
.entry-content ul, .entry-content ol { padding-left: 22px; }
.entry-content blockquote {
	border-left: 3px solid var(--brown);
	margin-left: 0;
	padding-left: 18px;
	font-family: Georgia, serif;
	font-size: 19px;
}

.featured-image { margin-bottom: 28px; max-width: 760px; }
.featured-image img {
	border-radius: 14px;
	width: 100%;
	max-height: 360px;
	object-fit: cover;
	object-position: center 20%; /* keep the top, where faces usually are */
	display: block;
}
.featured-image.focus-center img { object-position: center 50%; }
.featured-image.focus-bottom img { object-position: center 85%; }

.pagination { margin-top: 48px; display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers {
	display: inline-block;
	padding: 9px 14px;
	border: 1px solid var(--line);
	border-radius: 8px;
	text-decoration: none;
	background: #fff;
}
.pagination .page-numbers.current { background: var(--olive); color: #fff; border-color: var(--olive); }

.search-form { display: flex; gap: 8px; max-width: 460px; }
.search-form input[type="search"] {
	flex: 1;
	padding: 11px 12px;
	border: 1px solid #bbb;
	border-radius: 7px;
	font: inherit;
}

.post-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 52px; flex-wrap: wrap; }
.post-nav a { font-weight: 700; color: var(--olive); text-decoration: none; }

.back-link { margin-bottom: 24px; display: inline-block; font-weight: 700; color: var(--olive); text-decoration: none; }

/* ==========================================================================
   14. Footer
   ========================================================================== */
.site-footer { background: #292b28; color: #eee; padding: 34px 0; }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: #eee; }
.footer-links ul { list-style: none; display: flex; gap: 20px; flex-wrap: wrap; margin: 0; padding: 0; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.site-footer .colophon { margin-top: 18px; font-size: 13px; color: #a8aca6; }
.site-footer .colophon a { color: #d6d9d3; }

/* ==========================================================================
   15. Responsive
   ========================================================================== */
@media (max-width: 900px) {
	.menu-toggle { display: block; }

	.menu {
		display: none;
		position: absolute;
		top: 72px;
		left: 0;
		right: 0;
		/* White, not cream: the panel overlays the cream hero and needs to
		   separate from it clearly. */
		background: #fff;
		border-bottom: 1px solid #ddd8ca;
		padding: 10px 28px 22px;
		box-shadow: 0 16px 28px rgba(48, 50, 46, .12);
	}
	.menu.is-open { display: block; }
	.menu ul { flex-direction: column; align-items: stretch; gap: 0; }
	.menu ul li { border-bottom: 1px solid #e5e0d2; }
	.menu ul li:last-child { border-bottom: 0; }
	.menu ul a { display: block; padding: 13px 0; font-size: 17px; }
	.menu li.nav-button > a { display: inline-block; margin: 12px 0 4px; }

	/* Submenus always expanded on mobile - no hover to rely on */
	.menu ul ul {
		display: flex;
		position: static;
		border: 0;
		box-shadow: none;
		padding: 0 0 6px 16px;
		min-width: 0;
		background: transparent;
	}
	.menu ul ul a { padding: 9px 0; font-size: 16px; }

	.nav { position: relative; }
}

@media (max-width: 800px) {
	.hero-grid, .about-grid { grid-template-columns: 1fr; gap: 32px; }
	.cards, .resources { grid-template-columns: 1fr; }
	.hero { padding: 48px 0; }
	.section { padding: 58px 0; }
	.review-slide { padding: 16px 4%; }
	.review-actions { justify-content: center; }
	.footer-grid { display: block; }
	.footer-links { margin-top: 18px; }
	.portrait { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.review-track { transition: none; }
	.review-dot, .menu-toggle .bar { transition: none; }
}
