/*
Theme Name: Common Theme Pages
Author: Common Theme Studio
Description: A reusable, content-first WordPress theme for destination authority sites that use top-level pages as pillars and child pages as guides.
Version: 1.1.0
Requires at least: 6.6
Requires PHP: 8.0
Text Domain: common-theme-pages
Tags: blog, travel, custom-logo, featured-images, one-column, two-columns, accessibility-ready
*/

:root {
	--ct-bg: #f7f3ec;
	--ct-surface: #fffdf9;
	--ct-surface-strong: #ffffff;
	--ct-ink: #1c241f;
	--ct-muted: #667068;
	--ct-line: rgba(28, 36, 31, 0.12);
	--ct-accent: #146356;
	--ct-accent-strong: #0e493f;
	--ct-accent-soft: rgba(20, 99, 86, 0.12);
	--ct-gold: #d8a23d;
	--ct-shadow: 0 18px 55px rgba(28, 36, 31, 0.12);
	--ct-radius-lg: 28px;
	--ct-radius-md: 18px;
	--ct-radius-sm: 12px;
	--ct-shell: min(1200px, calc(100vw - 48px));
	--ct-content: min(760px, calc(100vw - 48px));
	--ct-reading: min(860px, calc(100vw - 48px));
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background:
		radial-gradient(circle at top left, rgba(216, 162, 61, 0.14), transparent 30rem),
		linear-gradient(180deg, #fcfaf5 0%, var(--ct-bg) 100%);
	color: var(--ct-ink);
	font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
	line-height: 1.65;
	text-rendering: optimizeLegibility;
}

body.admin-bar .site-header {
	top: 32px;
}

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

a {
	color: var(--ct-accent);
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.18em;
}

a:hover,
a:focus {
	color: var(--ct-accent-strong);
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	z-index: 9999;
	top: 16px;
	left: 16px;
	width: auto;
	height: auto;
	padding: 12px 16px;
	border-radius: 999px;
	background: var(--ct-ink);
	color: #fff;
	clip: auto;
}

.site-shell {
	width: var(--ct-shell);
	margin: 0 auto;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 1px solid var(--ct-line);
	background: rgba(252, 250, 245, 0.86);
	backdrop-filter: blur(18px);
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 84px;
}

.branding {
	display: flex;
	align-items: center;
	gap: 14px;
}

.custom-logo-link img {
	max-height: 52px;
	width: auto;
}

.site-title {
	margin: 0;
	font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
	font-size: clamp(1.35rem, 2vw, 1.8rem);
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.1;
}

.site-title a {
	color: inherit;
	text-decoration: none;
}

.site-description {
	margin: 4px 0 0;
	color: var(--ct-muted);
	font-size: 0.88rem;
}

.primary-nav {
	display: flex;
	align-items: center;
	gap: 24px;
}

.primary-nav ul {
	display: flex;
	align-items: center;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-nav a {
	color: var(--ct-ink);
	font-weight: 600;
	text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a:focus {
	color: var(--ct-accent);
}

.header-search {
	min-width: 220px;
}

.search-form {
	position: relative;
}

.search-form label {
	display: block;
}

.search-field {
	width: 100%;
	min-height: 46px;
	border: 1px solid var(--ct-line);
	border-radius: 999px;
	background: var(--ct-surface-strong);
	padding: 0 52px 0 18px;
	color: var(--ct-ink);
}

.search-submit {
	position: absolute;
	top: 5px;
	right: 5px;
	min-height: 36px;
	border: 0;
	border-radius: 999px;
	background: var(--ct-accent);
	color: #fff;
	padding: 0 16px;
	font-weight: 700;
	cursor: pointer;
}

.menu-toggle {
	display: none;
	min-width: 44px;
	min-height: 44px;
	border: 1px solid var(--ct-line);
	border-radius: 999px;
	background: var(--ct-surface-strong);
	color: var(--ct-ink);
}

.ad-slot {
	display: grid;
	place-items: center;
	min-height: 110px;
	border: 1px dashed rgba(28, 36, 31, 0.22);
	border-radius: var(--ct-radius-md);
	background: rgba(255, 255, 255, 0.56);
	color: var(--ct-muted);
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ad-slot--leaderboard {
	width: var(--ct-shell);
	margin: 24px auto 0;
}

.ad-slot--inline {
	margin: 32px 0;
}

.ad-slot--sidebar {
	min-height: 280px;
}

.ad-slot--footer {
	width: var(--ct-shell);
	margin: 0 auto 48px;
}

.hero {
	position: relative;
	isolation: isolate;
	margin-top: 28px;
	overflow: hidden;
	border-radius: var(--ct-radius-lg);
	background:
		linear-gradient(110deg, rgba(13, 39, 34, 0.92), rgba(13, 39, 34, 0.58)),
		var(--hero-image, linear-gradient(135deg, #285d55, #8cab97));
	background-position: center;
	background-size: cover;
	box-shadow: var(--ct-shadow);
}

.hero-inner {
	display: grid;
	gap: 24px;
	max-width: 760px;
	padding: clamp(32px, 5vw, 68px);
	color: #fff;
}

.eyebrow {
	margin: 0;
	color: var(--ct-accent);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.hero .eyebrow {
	color: rgba(255, 255, 255, 0.8);
}

.hero h1 {
	margin: 0;
	font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
	font-size: clamp(2.2rem, 5vw, 4rem);
	line-height: 0.98;
	letter-spacing: -0.055em;
}

.hero p {
	max-width: 640px;
	margin: 0;
	color: rgba(255, 255, 255, 0.9);
	font-size: clamp(1rem, 2vw, 1.18rem);
}

.button-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.button,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	border-radius: 999px;
	padding: 0 22px;
	background: var(--ct-accent);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
}

.button:hover,
.button:focus,
.wp-block-button__link:hover,
.wp-block-button__link:focus {
	background: var(--ct-accent-strong);
	color: #fff;
}

.button--ghost {
	border: 1px solid rgba(255, 255, 255, 0.36);
	background: rgba(255, 255, 255, 0.08);
}

.section {
	margin-top: clamp(40px, 6vw, 76px);
}

.section-heading {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 24px;
}

.section-heading h2,
.archive-header h1,
.page-header h1 {
	margin: 0;
	font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
	font-size: clamp(1.7rem, 3vw, 2.5rem);
	line-height: 1.05;
	letter-spacing: -0.045em;
}

.section-heading p {
	max-width: 580px;
	margin: 0;
	color: var(--ct-muted);
}

.pillar-grid,
.card-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}

.pillar-card,
.post-card {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--ct-line);
	border-radius: var(--ct-radius-md);
	background: var(--ct-surface-strong);
	box-shadow: 0 14px 32px rgba(28, 36, 31, 0.08);
}

.pillar-card {
	display: grid;
	gap: 14px;
	min-height: 220px;
	padding: 24px;
}

.pillar-card h3,
.post-card h2 {
	margin: 0;
	font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
	font-size: clamp(1.25rem, 2vw, 1.6rem);
	line-height: 1.1;
	letter-spacing: -0.03em;
}

.pillar-card p,
.post-card p {
	margin: 0;
	color: var(--ct-muted);
}

.pillar-card__meta,
.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	color: var(--ct-muted);
	font-size: 0.85rem;
}

.post-card__thumb {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #e7e0d5;
}

.post-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.post-card:hover .post-card__thumb img {
	transform: scale(1.04);
}

.post-card__body {
	display: grid;
	gap: 14px;
	padding: 20px;
}

.content-shell {
	width: var(--ct-reading);
	margin: 0 auto;
}

.article-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 290px;
	gap: 34px;
	align-items: start;
	margin-top: 34px;
}

.article-main {
	min-width: 0;
}

.breadcrumb {
	margin: 28px 0 18px;
	color: var(--ct-muted);
	font-size: 0.86rem;
}

.breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.breadcrumb li:not(:last-child)::after {
	content: "/";
	margin-left: 8px;
	color: rgba(28, 36, 31, 0.34);
}

.entry-header {
	display: grid;
	gap: 18px;
	margin-bottom: 24px;
}

.entry-title {
	margin: 0;
	font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
	font-size: clamp(2rem, 4vw, 3.35rem);
	line-height: 0.98;
	letter-spacing: -0.055em;
}

.entry-dek {
	max-width: 720px;
	margin: 0;
	color: var(--ct-muted);
	font-size: clamp(1rem, 2vw, 1.15rem);
}

.entry-hero {
	overflow: hidden;
	margin: 28px 0;
	border-radius: var(--ct-radius-lg);
	background: #e7e0d5;
}

.entry-hero img {
	display: block;
	width: 100%;
}

.entry-content {
	font-size: 1.06rem;
}

.entry-content > * {
	max-width: 100%;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	scroll-margin-top: 120px;
	font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
	line-height: 1.12;
	letter-spacing: -0.035em;
}

.entry-content h2 {
	margin-top: 2.4em;
	font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.entry-content h3 {
	margin-top: 2em;
	font-size: clamp(1.25rem, 2vw, 1.55rem);
}

.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content blockquote,
.entry-content figure,
.entry-content table {
	margin-top: 1.35em;
	margin-bottom: 1.35em;
}

.entry-content blockquote {
	margin-left: 0;
	border-left: 4px solid var(--ct-gold);
	padding: 4px 0 4px 20px;
	color: var(--ct-muted);
	font-size: 1.12rem;
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	overflow: hidden;
	border-radius: var(--ct-radius-sm);
	background: var(--ct-surface-strong);
}

.entry-content th,
.entry-content td {
	border-bottom: 1px solid var(--ct-line);
	padding: 12px 14px;
	text-align: left;
}

.article-aside {
	position: sticky;
	top: 110px;
	display: grid;
	gap: 20px;
}

.toc-card,
.sidebar-card,
.author-card {
	border: 1px solid var(--ct-line);
	border-radius: var(--ct-radius-md);
	background: rgba(255, 255, 255, 0.78);
	padding: 20px;
	box-shadow: 0 10px 28px rgba(28, 36, 31, 0.06);
}

.toc-card h2,
.sidebar-card h2,
.author-card h2 {
	margin: 0 0 14px;
	font-size: 0.95rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.toc-list {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.94rem;
}

.toc-list ul {
	display: grid;
	gap: 8px;
	margin: 8px 0 0 14px;
	padding: 0;
	list-style: none;
}

.toc-list a {
	color: var(--ct-muted);
	text-decoration: none;
}

.toc-list a:hover,
.toc-list a:focus,
.toc-list a.is-active {
	color: var(--ct-accent);
}

.toc-subitem {
	margin-left: 14px;
}

.reading-progress {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 60;
	width: 100%;
	height: 4px;
	background: transparent;
}

.reading-progress span {
	display: block;
	width: 0;
	height: 100%;
	background: linear-gradient(90deg, var(--ct-gold), var(--ct-accent));
}

.archive-header,
.page-header {
	display: grid;
	gap: 14px;
	margin-top: 34px;
}

.archive-description,
.page-intro {
	max-width: 720px;
	color: var(--ct-muted);
}

.pagination,
.posts-navigation {
	margin-top: 34px;
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.page-numbers,
.post-page-numbers {
	display: inline-flex;
	min-width: 42px;
	min-height: 42px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--ct-line);
	border-radius: 999px;
	background: var(--ct-surface-strong);
	text-decoration: none;
}

.page-numbers.current {
	border-color: var(--ct-accent);
	background: var(--ct-accent);
	color: #fff;
}

.site-footer {
	margin-top: clamp(56px, 8vw, 96px);
	border-top: 1px solid var(--ct-line);
	padding: 42px 0 34px;
}

.footer-grid {
	display: grid;
	grid-template-columns: 1.2fr 1fr 1fr;
	gap: 28px;
}

.footer-title {
	margin: 0 0 12px;
	font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
	font-size: 1.35rem;
}

.footer-menu,
.footer-links {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-note {
	margin-top: 28px;
	padding-top: 18px;
	border-top: 1px solid var(--ct-line);
	color: var(--ct-muted);
	font-size: 0.9rem;
}

.comment-list {
	display: grid;
	gap: 18px;
	margin: 24px 0;
	padding: 0;
	list-style: none;
}

.comment-body {
	border: 1px solid var(--ct-line);
	border-radius: var(--ct-radius-md);
	background: var(--ct-surface-strong);
	padding: 18px;
}

.comment-form {
	display: grid;
	gap: 14px;
}

.comment-form input,
.comment-form textarea {
	width: 100%;
	border: 1px solid var(--ct-line);
	border-radius: var(--ct-radius-sm);
	padding: 12px 14px;
}

.not-found {
	margin-top: 50px;
	text-align: center;
}

@media (max-width: 1080px) {
	.header-inner {
		flex-wrap: wrap;
		padding: 18px 0;
	}

	.primary-nav {
		order: 3;
		width: 100%;
		justify-content: space-between;
	}

	.article-layout {
		grid-template-columns: 1fr;
	}

	.article-aside {
		position: static;
	}
}

@media (max-width: 860px) {
	:root {
		--ct-shell: min(100vw - 28px, 1200px);
		--ct-content: min(100vw - 28px, 760px);
		--ct-reading: min(100vw - 28px, 860px);
	}

	body.admin-bar .site-header {
		top: 46px;
	}

	.menu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.primary-nav {
		display: none;
	}

	.primary-nav.is-open {
		display: grid;
		gap: 16px;
	}

	.primary-nav ul {
		display: grid;
		gap: 12px;
	}

	.header-search {
		min-width: 100%;
	}

	.pillar-grid,
	.card-grid,
	.footer-grid {
		grid-template-columns: 1fr;
	}

	.hero-inner {
		padding: 28px;
	}

	.ad-slot--leaderboard,
	.ad-slot--footer {
		width: var(--ct-shell);
	}
}
