/*
Theme Name: Heritage Guru
Theme URI: https://example.com/heritage-guru
Author: Your Name
Description: A one-page memorial / heritage theme with a fixed dark header, glowing dark sections, warm pattern sections, photo galleries with captions, a video section and an intro with portrait. Odia + English ready. Every homepage section is editable from Appearance → Customize → Homepage Sections.
Version: 1.0.0
Requires at least: 5.8
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: heritage-guru
Tags: one-column, custom-menu, custom-logo, custom-colors, featured-images, translation-ready
*/

:root {
	--hg-dark: #292c2e;
	--hg-accent: #ffb792;
	--hg-tan: #d2b6a0;
	--hg-btn: #3a3941;
	--hg-light: #f7f7f7;
	--hg-text: #626262;
	--hg-header-h: 74px;
	--hg-font: "Work Sans", "Noto Sans Oriya", sans-serif;
	--hg-font-body: "Lato", "Noto Sans Oriya", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--hg-font-body);
	font-size: 16px;
	line-height: 1.75;
	color: var(--hg-text);
	background: var(--hg-light);
	padding-top: var(--hg-header-h);
	-webkit-font-smoothing: antialiased;
}
body.admin-bar .site-header { top: 32px; }
body.hg-no-scroll { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--hg-accent); color: var(--hg-dark); }

.screen-reader-text, .skip-link {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}
.skip-link:focus { width: auto; height: auto; clip: auto; z-index: 999; background: #fff; padding: 8px 14px; left: 8px; top: 8px; }

.container { width: 100%; max-width: 1220px; margin: 0 auto; padding: 0 20px; }
.hg-narrow { max-width: 860px; }
.align-center { text-align: center; }
.align-right { text-align: right; }
.light { color: #fff; }
.dark-text { color: #292b2e; }
.accent { color: var(--hg-accent); }

/* ---------- Header ---------- */
.site-header {
	position: fixed; top: 0; left: 0; right: 0; z-index: 100;
	height: var(--hg-header-h);
	background: var(--hg-dark);
	box-shadow: 0 0 0 rgba(0,0,0,0);
	transition: box-shadow .3s ease, background-color .3s ease;
}
.site-header.is-scrolled { box-shadow: 0 4px 18px rgba(0,0,0,.25); background-color: rgba(41,44,46,.97); }
.header-inner {
	height: 100%; display: flex; align-items: center; justify-content: space-between;
	padding: 0 40px;
}
.site-title { font-family: var(--hg-font); font-weight: 700; font-size: 20px; color: #fff; text-decoration: none; letter-spacing: .3px; }
.custom-logo { max-height: 56px; width: auto; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; align-items: center; gap: 6px; }
.site-nav li { position: relative; }
.site-nav a {
	display: block; position: relative;
	padding: 10px 16px;
	font-family: var(--hg-font); font-size: 15px; font-weight: 500;
	color: #fff; text-decoration: none;
	transition: color .2s ease;
}
.site-nav > ul > li > a::after {
	content: ""; position: absolute; left: 10%; right: 10%; bottom: 2px; height: 1px;
	background: #fff; transform: scaleX(0); transition: transform .25s ease;
}
.site-nav > ul > li:hover > a::after,
.site-nav > ul > li.current-menu-item > a::after { transform: scaleX(1); }
.site-nav > ul > li:last-child > a { font-weight: 700; }
.site-nav a:hover { color: var(--hg-accent); }
.site-nav .sub-menu {
	position: absolute; top: 100%; right: 0; min-width: 210px;
	background: var(--hg-dark); padding: 8px 0;
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.site-nav li:hover > .sub-menu { opacity: 1; visibility: visible; transform: none; }

.menu-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 10px; }
.menu-toggle span:not(.screen-reader-text) { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; transition: transform .25s ease, opacity .25s ease; }
.menu-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Sections ---------- */
.hg-section { padding: 110px 0 100px; position: relative; }
.hg-dark { background-color: var(--hg-dark); color: #fff; }
.hg-glow {
	background-image:
		radial-gradient(ellipse 60% 45% at 50% 0%, rgba(255,183,146,.22), rgba(255,183,146,0) 70%),
		radial-gradient(ellipse 40% 30% at 85% 40%, rgba(255,183,146,.07), rgba(255,183,146,0) 70%);
	background-repeat: no-repeat;
}
.hg-pattern {
	background-color: var(--hg-tan);
	background-image: url("images/pattern.svg");
	background-repeat: repeat;
	background-size: 120px;
	padding: 100px 0;
}
.hg-light { background: var(--hg-light); }

.hg-heading {
	font-family: var(--hg-font);
	font-weight: 500;
	font-size: clamp(28px, 3.4vw, 46px);
	line-height: 1.25;
	margin: 0 0 40px;
	letter-spacing: -.3px;
}
.hg-heading-italic { font-style: italic; margin-top: 80px; }

/* Intro */
.hg-intro { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; align-items: center; }
.hg-intro-text { color: #fff; padding-left: 20px; }
.hg-richtext p { margin: 0 0 1.2em; }
.hg-richtext strong { color: #fff; }

.hg-button {
	display: inline-block;
	padding: 14px 32px;
	background: var(--hg-btn);
	color: var(--hg-accent);
	font-family: var(--hg-font); font-weight: 500; font-size: 15px;
	text-decoration: none;
	transition: background-color .25s ease, color .25s ease, transform .25s ease;
}
.hg-button:hover { background: var(--hg-accent); color: var(--hg-dark); transform: translateY(-2px); }
.hg-button-small { padding: 9px 20px; font-size: 14px; }

/* Grids */
.hg-grid { display: grid; gap: 30px; margin-bottom: 30px; }
.hg-grid-3 { grid-template-columns: repeat(3, 1fr); }
.hg-grid-1-2 { grid-template-columns: 1fr 2fr; }
.hg-masonry { align-items: start; }
.hg-col { display: flex; flex-direction: column; gap: 30px; }

/* Photos */
.hg-photo { margin: 0; }
.hg-photo-link, .hg-photo-static { display: block; position: relative; overflow: hidden; border: 8px solid rgba(255,255,255,.08); }
.hg-pattern .hg-photo-link { border-color: rgba(255,255,255,.45); }
.hg-photo-link img { width: 100%; transition: transform .6s ease; }
.hg-photo.stretch .hg-photo-link img { aspect-ratio: 4 / 3; object-fit: cover; }
.hg-photo.stretch.wide .hg-photo-link img { aspect-ratio: 8 / 3; }
.hg-photo-link::before {
	content: ""; position: absolute; inset: 0; z-index: 1;
	background: rgba(0,0,0,.45); opacity: 0; transition: opacity .3s ease;
}
.hg-zoom {
	position: absolute; z-index: 2; left: 50%; top: 50%;
	width: 52px; height: 52px; margin: -26px 0 0 -26px;
	display: flex; align-items: center; justify-content: center;
	background: #fff; color: var(--hg-dark); border-radius: 50%;
	opacity: 0; transform: scale(.6); transition: opacity .3s ease, transform .3s ease;
}
.hg-photo-link:hover img { transform: scale(1.06); }
.hg-photo-link:hover::before { opacity: 1; }
.hg-photo-link:hover .hg-zoom { opacity: 1; transform: scale(1); }
.hg-photo figcaption {
	font-size: 14px; line-height: 1.6; padding: 12px 2px 0; font-style: italic;
}
.hg-dark .hg-photo figcaption { color: rgba(255,255,255,.75); }
.hg-pattern .hg-photo figcaption { color: #292b2e; }

/* Reveal animation */
.hg-reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.hg-reveal.is-in { opacity: 1; transform: none; }

/* Video */
.hg-video { position: relative; aspect-ratio: 16 / 9; background: #1d1f21; border: 8px solid rgba(255,255,255,.45); }
.hg-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.hg-video-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--hg-accent); text-align: center; padding: 20px; }
.hg-video-empty p { color: rgba(255,255,255,.7); margin-top: 16px; }

/* Inner pages */
.hg-page-header { padding: 90px 0 60px; }
.hg-page-header .hg-heading { margin: 0; }
.hg-meta { color: rgba(255,255,255,.6); margin: 0 0 8px; }
.hg-feature { margin-bottom: 32px; }
.entry-content { color: #444; font-size: 17px; }
.entry-content h2, .entry-content h3 { font-family: var(--hg-font); color: var(--hg-dark); font-weight: 500; }
.entry-content a { color: #c46a3c; }
.entry-content blockquote { border-left: 3px solid var(--hg-accent); margin: 1.5em 0; padding: 4px 0 4px 20px; font-style: italic; }
.hg-post-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 50px; padding-top: 20px; border-top: 1px solid #e3e3e3; }
.hg-post-nav a { text-decoration: none; color: var(--hg-dark); font-weight: 700; }

.hg-post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.hg-card { background: #fff; transition: transform .3s ease, box-shadow .3s ease; }
.hg-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.08); }
.hg-card-thumb img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.hg-card-body { padding: 24px; }
.hg-card-date { font-size: 13px; color: #999; margin: 0; }
.hg-card-title { font-family: var(--hg-font); font-size: 21px; font-weight: 500; margin: 6px 0 10px; }
.hg-card-title a { text-decoration: none; color: var(--hg-dark); }
.hg-pagination { margin-top: 40px; }
.hg-pagination .page-numbers { display: inline-block; padding: 6px 12px; background: #fff; margin-right: 4px; text-decoration: none; }
.hg-pagination .current { background: var(--hg-dark); color: #fff; }
.hg-404 { min-height: 60vh; display: flex; align-items: center; }

/* Comments */
.comment-list { list-style: none; padding: 0; }
.comment-body { background: #fff; padding: 18px 22px; margin-bottom: 16px; }
.comment-form input:not([type=submit]):not([type=checkbox]), .comment-form textarea { width: 100%; padding: 10px; border: 1px solid #ddd; font: inherit; }
.comment-form .submit { background: var(--hg-btn); color: var(--hg-accent); border: 0; padding: 12px 28px; cursor: pointer; font-family: var(--hg-font); }

/* WordPress 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, .wp-element-caption { font-size: 14px; font-style: italic; color: #777; }
.sticky, .gallery-caption, .bypostauthor { display: block; }

/* Footer */
.site-footer { background: #1f2123; color: rgba(255,255,255,.6); padding: 40px 0; font-size: 14px; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: center; }
.footer-menu a { text-decoration: none; color: #fff; transition: color .2s ease; }
.footer-menu a:hover { color: var(--hg-accent); }
.footer-copy { margin: 0; }
.footer-widget-title { color: #fff; font-family: var(--hg-font); }

.back-to-top {
	position: fixed; right: 24px; bottom: 24px; z-index: 90;
	width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
	background: var(--hg-accent); color: var(--hg-dark);
	opacity: 0; transform: translateY(12px); pointer-events: none;
	transition: opacity .3s ease, transform .3s ease;
}
.back-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }

/* Lightbox */
.hg-lightbox {
	position: fixed; inset: 0; z-index: 1000; background: rgba(15,16,17,.94);
	display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px;
}
.hg-lightbox[hidden] { display: none; }
.hg-lightbox img { max-height: 82vh; max-width: 92vw; width: auto; border: 6px solid #fff; }
.hg-lightbox-caption { color: #fff; margin-top: 16px; max-width: 760px; text-align: center; }
.hg-lightbox-close { position: absolute; top: 18px; right: 26px; font-size: 40px; color: #fff; background: none; border: 0; cursor: pointer; line-height: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.site-nav a { padding: 10px 10px; font-size: 14px; }
}
@media (max-width: 960px) {
	.header-inner { padding: 0 20px; }
	.menu-toggle { display: block; }
	.site-nav {
		position: fixed; top: var(--hg-header-h); right: 0; bottom: 0; width: 270px;
		background: var(--hg-dark); padding: 20px 0; overflow-y: auto;
		transform: translateX(100%); transition: transform .3s ease;
	}
	.site-nav.is-open { transform: none; }
	.site-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
	.site-nav a { padding: 12px 26px; font-size: 16px; }
	.site-nav > ul > li > a::after { display: none; }
	.site-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; padding-left: 14px; }
	.hg-intro, .hg-grid-1-2 { grid-template-columns: 1fr; }
	.hg-intro-photo { max-width: 380px; margin: 0 auto; }
	.hg-intro-text { padding-left: 0; }
	.hg-grid-3, .hg-post-grid { grid-template-columns: repeat(2, 1fr); }
	.hg-photo.stretch.wide .hg-photo-link img { aspect-ratio: 4 / 3; }
}
@media (max-width: 600px) {
	.hg-section { padding: 70px 0; }
	.hg-grid-3, .hg-post-grid { grid-template-columns: 1fr; }
	.align-right { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
	.hg-reveal { opacity: 1; transform: none; }
}
