/*
Theme Name: Addition Journal
Theme URI: https://home-additions.site
Author: Home Additions Site
Description: A fast, readable editorial theme for home improvement and home addition publications. Built for long-form guides: automatic table of contents, configurable ad placements, selectable homepage sections and full Customizer controls. Works alongside Rank Math and Yoast SEO.
Version: 1.1.0
Requires at least: 6.3
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: addition-journal
Tags: blog, news, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, accessibility-ready
*/

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
	--aj-bg: #FAF9F6;
	--aj-surface: #FFFFFF;
	--aj-text: #292D2B;
	--aj-muted: #6B716D;
	--aj-border: #E8E6E0;
	--aj-sage: #718576;
	--aj-sage-dark: #556458;
	--aj-tint: #E7E9E4;
	--aj-terra: #B97961;
	--aj-terra-dark: #8B5B49;
	--aj-font-head: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--aj-font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--aj-article-size: 18px;
	--aj-radius: 6px;
	--aj-shadow: 0 1px 2px rgba(41, 45, 43, .06), 0 6px 18px rgba(41, 45, 43, .05);
	--aj-header-h: 72px;
	--aj-container: 1180px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
	margin: 0;
	background: var(--aj-bg);
	color: var(--aj-text);
	font-family: var(--aj-font-body);
	font-size: 1rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, h6 {
	font-family: var(--aj-font-head);
	line-height: 1.2;
	letter-spacing: -.01em;
	margin: 0 0 .5em;
}
p { margin: 0 0 1em; }
a { color: var(--aj-sage-dark); text-underline-offset: .2em; }
a:hover { color: var(--aj-text); }
:focus-visible { outline: 3px solid var(--aj-sage-dark); outline-offset: 2px; }
.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; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus {
	background: var(--aj-surface); clip: auto; clip-path: none; color: var(--aj-text);
	display: block; height: auto; width: auto; padding: 12px 20px; left: 8px; top: 8px; z-index: 100000; font-weight: 700;
}
.skip-link:focus { box-shadow: var(--aj-shadow); }
.container { width: 100%; max-width: var(--aj-container); margin-inline: auto; padding-inline: 20px; }
@media (min-width: 768px) { .container { padding-inline: 32px; } }

/* Forms and buttons */
input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], textarea, select {
	width: 100%; max-width: 100%; padding: .7rem .9rem; font: inherit; color: var(--aj-text);
	background: var(--aj-surface); border: 1px solid #b9b7af; border-radius: var(--aj-radius); min-height: 44px;
}
textarea { min-height: 140px; }
.btn, .search-submit, .comment-form .submit, .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px;
	padding: .75rem 1.25rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
	color: #fff; background: var(--aj-sage-dark); border: 0; border-radius: var(--aj-radius);
}
.btn:hover, .search-submit:hover, .comment-form .submit:hover { background: var(--aj-text); color: #fff; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header { position: relative; z-index: 50; background: var(--aj-bg); border-bottom: 1px solid var(--aj-border); }
.sticky-header .site-header { position: sticky; top: 0; }
.admin-bar.sticky-header .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar.sticky-header .site-header { top: 46px; } }
.header-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; min-height: var(--aj-header-h); }
.site-title { margin: 0; font-family: var(--aj-font-head); font-weight: 700; font-size: 1.4rem; letter-spacing: -.02em; line-height: 1.1; }
.site-title a { color: var(--aj-text); text-decoration: none; }
.custom-logo-link { display: block; line-height: 0; }
.custom-logo { max-height: 48px; width: auto; }
.primary-nav { margin-inline-start: auto; }
.header-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn, .nav-toggle {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-width: 44px; min-height: 44px;
	padding: 0 12px; background: transparent; color: var(--aj-text); border: 0; border-radius: var(--aj-radius); font: inherit; font-weight: 600; cursor: pointer;
}
.icon-btn:hover, .nav-toggle:hover { background: var(--aj-tint); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search-toggle, .nav-toggle { display: none; }
.js .search-toggle { display: inline-flex; }

.menu, .menu ul { list-style: none; margin: 0; padding: 0; }
.menu { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.menu li { position: relative; }
.menu a { display: block; padding: .65rem .8rem; color: var(--aj-text); text-decoration: none; font-weight: 500; font-size: .97rem; border-radius: 4px; }
.menu a:hover { background: var(--aj-tint); color: var(--aj-text); }
.menu .current-menu-item > a, .menu .current-cat > a, .menu .current-menu-ancestor > a { color: var(--aj-sage-dark); font-weight: 700; }
.menu li.menu-item-has-children, .menu li.cat-parent { display: flex; align-items: center; }
.menu li.menu-item-has-children > a, .menu li.cat-parent > a { padding-inline-end: .2rem; }
.sub-toggle {
	width: 32px; height: 40px; padding: 0; background: transparent; border: 0; cursor: pointer; color: var(--aj-text); border-radius: 4px;
}
.sub-toggle::after { content: ""; display: block; width: 7px; height: 7px; margin: -3px auto 0; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.menu .sub-menu, .menu .children {
	display: none; position: absolute; top: 100%; left: 0; z-index: 60; min-width: 240px; padding: 8px;
	background: var(--aj-surface); border: 1px solid var(--aj-border); border-radius: var(--aj-radius); box-shadow: var(--aj-shadow);
}
.menu li:hover > .sub-menu, .menu li:hover > .children, .menu li:focus-within > .sub-menu, .menu li:focus-within > .children, .menu li.is-open > .sub-menu, .menu li.is-open > .children { display: block; }
.menu .sub-menu li, .menu .children li { display: block; }

.search-panel { background: var(--aj-surface); border-top: 1px solid var(--aj-border); padding: 16px 0; }
.js .search-panel { display: none; }
.js .search-panel.is-open { display: block; }
.search-form { display: flex; gap: 8px; max-width: 640px; }
.search-form .search-field { flex: 1; }
.search-form label { flex: 1; display: block; }

@media (max-width: 899px) {
	.js .nav-toggle { display: inline-flex; }
	.header-actions { margin-inline-start: auto; }
	.primary-nav { order: 3; width: 100%; margin: 0; }
	.js .primary-nav { display: none; padding: 4px 0 16px; border-top: 1px solid var(--aj-border); }
	.js .primary-nav.is-open { display: block; }
	.menu { flex-direction: column; align-items: stretch; }
	.menu a { padding: .8rem .5rem; }
	.menu li.menu-item-has-children, .menu li.cat-parent { flex-wrap: wrap; }
	.menu li.menu-item-has-children > a, .menu li.cat-parent > a { flex: 1; }
	.menu .sub-menu, .menu .children { position: static; width: 100%; min-width: 0; border: 0; box-shadow: none; padding: 0 0 0 16px; background: transparent; }
	.menu li:hover > .sub-menu, .menu li:hover > .children { display: none; }
	.menu li.is-open > .sub-menu, .menu li.is-open > .children { display: block; }
}
@media (min-width: 900px) { .primary-nav { margin-inline-start: auto; } }

/* ==========================================================================
   Layout
   ========================================================================== */
.site-main { display: block; min-height: 50vh; }
.aj-layout { display: grid; gap: 48px; }
.aj-primary { min-width: 0; }
.aj-layout:not(.has-sidebar) .aj-primary { max-width: 800px; width: 100%; margin-inline: auto; }
@media (min-width: 1000px) { .aj-layout.has-sidebar { grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; } }
.card-grid { display: grid; gap: 28px 24px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) {
	.card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.card-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.has-sidebar .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card { display: flex; flex-direction: column; overflow: hidden; background: var(--aj-surface); border: 1px solid var(--aj-border); border-radius: var(--aj-radius); box-shadow: var(--aj-shadow); }
.card__media { display: block; position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--aj-tint); }
.card__media img, .card__media .placeholder { display: block; width: 100%; height: 100%; object-fit: cover; }
.placeholder rect { fill: var(--aj-tint); }
.placeholder path { fill: none; stroke: var(--aj-sage); stroke-width: 2; stroke-linejoin: round; }
.card__body { display: flex; flex-direction: column; flex: 1; gap: 8px; padding: 18px 20px 20px; }
.card__title { margin: 0; font-size: 1.2rem; line-height: 1.25; }
.card__title a { color: var(--aj-text); text-decoration: none; }
.card__title a:hover { color: var(--aj-sage-dark); text-decoration: underline; }
.card__excerpt { margin: 0; color: var(--aj-muted); font-size: .95rem; }
.card__meta, .byline__list { display: flex; flex-wrap: wrap; gap: 4px 0; margin: auto 0 0; padding-top: 6px; color: var(--aj-muted); font-size: .85rem; }
.card__meta > span + span { margin-inline-start: 12px; padding-inline-start: 12px; border-inline-start: 1px solid var(--aj-border); }
.chip { align-self: flex-start; color: var(--aj-terra-dark); font-size: .85rem; font-weight: 700; text-decoration: none; }
.chip:hover { text-decoration: underline; color: var(--aj-terra-dark); }
.card--lead .card__title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.15; }
.card--lead .card__body { padding: 22px 24px 26px; gap: 10px; }
.card--horizontal { flex-direction: row; }
.card--horizontal .card__media { flex: 0 0 36%; aspect-ratio: auto; min-height: 112px; }
.card--horizontal .card__media img, .card--horizontal .card__media .placeholder { position: absolute; inset: 0; }
.card--horizontal .card__body { padding: 14px 16px; }
.card--horizontal .card__title { font-size: 1.05rem; }

/* ==========================================================================
   Home
   ========================================================================== */
.hero { padding: 40px 0 56px; }
.hero-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; } }
.hero-title { margin: 0 0 16px; font-size: clamp(2.1rem, 4.6vw, 3.5rem); line-height: 1.05; letter-spacing: -.03em; }
.hero-intro { max-width: 34em; margin: 0 0 24px; font-size: 1.15rem; color: var(--aj-muted); }
.hero-second { margin-top: 32px; max-width: 520px; }
.hero-figure { display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--aj-radius); background: var(--aj-tint); }
.hero-figure img, .hero-figure .placeholder { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-caption { display: flex; flex-direction: column; gap: 4px; padding-top: 16px; }
.hero-caption__title { margin: 0; font-size: 1.4rem; }
.hero-caption__title a { color: var(--aj-text); text-decoration: none; }
.hero-caption__title a:hover { text-decoration: underline; }
.home-section { padding: 56px 0; border-top: 1px solid var(--aj-border); }
.home-section--types, .home-section--popular { background: var(--aj-surface); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-bottom: 28px; }
.section-title { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.02em; }
.section-desc { max-width: 40em; margin: 8px 0 0; color: var(--aj-muted); }
.section-link { font-weight: 600; }
.section-more { margin: 32px 0 0; text-align: center; }
.featured-grid { display: grid; gap: 24px; }
@media (min-width: 900px) { .featured-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.featured-side { display: grid; gap: 16px; align-content: start; }
.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 700px) { .type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.type-tile { display: block; color: var(--aj-text); text-decoration: none; }
.type-tile__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--aj-tint); border-radius: var(--aj-radius); }
.type-tile__media img, .type-tile__media .placeholder { display: block; width: 100%; height: 100%; object-fit: cover; }
.type-tile__name { display: block; margin-top: 10px; font-family: var(--aj-font-head); font-weight: 700; }
.type-tile:hover .type-tile__name { color: var(--aj-sage-dark); text-decoration: underline; }
.type-tile__count { display: block; color: var(--aj-muted); font-size: .875rem; }
.newsletter { background: var(--aj-tint); border-top: 1px solid var(--aj-border); }
.newsletter-inner { max-width: 680px; text-align: center; }
.newsletter-inner .section-desc { margin-inline: auto; }
.newsletter-form { margin-top: 24px; text-align: start; }

/* ==========================================================================
   Archive headers, breadcrumbs, pagination
   ========================================================================== */
.breadcrumbs { padding: 20px 0 0; font-size: .875rem; color: var(--aj-muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li + li::before { content: "/"; margin-inline-end: 8px; color: #a7a49b; }
.breadcrumbs a { color: var(--aj-muted); }
.breadcrumbs a:hover { color: var(--aj-text); }
.archive-header { padding: 24px 0 32px; }
.archive-header--media { display: grid; gap: 24px; align-items: center; }
@media (min-width: 800px) { .archive-header--media { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; } }
.archive-title { margin: 0 0 12px; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.025em; }
.archive-description { max-width: 40em; color: var(--aj-muted); font-size: 1.1rem; }
.archive-description > :last-child { margin-bottom: 0; }
.archive-image { margin: 0; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--aj-radius); background: var(--aj-tint); }
.archive-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.chip-list a { display: inline-block; padding: .45rem .9rem; min-height: 36px; color: var(--aj-text); text-decoration: none; background: var(--aj-surface); border: 1px solid var(--aj-border); border-radius: 999px; font-size: .9rem; }
.chip-list a:hover { border-color: var(--aj-sage-dark); color: var(--aj-sage-dark); }
.archive-lead { margin-bottom: 28px; }
.archive-lead .card { flex-direction: column; }
@media (min-width: 800px) {
	.archive-lead .card { flex-direction: row; }
	.archive-lead .card__media { flex: 0 0 55%; aspect-ratio: auto; min-height: 340px; }
	.archive-lead .card__media img, .archive-lead .card__media .placeholder { position: absolute; inset: 0; }
	.archive-lead .card__body { justify-content: center; }
}
.archive-section { padding-bottom: 64px; }
.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px; color: var(--aj-text); text-decoration: none; background: var(--aj-surface); border: 1px solid var(--aj-border); border-radius: var(--aj-radius); }
a.page-numbers:hover { border-color: var(--aj-sage-dark); }
.page-numbers.current { color: #fff; background: var(--aj-sage-dark); border-color: var(--aj-sage-dark); }
.page-empty { max-width: 640px; padding: 48px 0 80px; }

/* ==========================================================================
   Single article
   ========================================================================== */
.article-header { max-width: 860px; margin: 20px 0 32px; }
.aj-no-sidebar .article-header { margin-inline: auto; }
.entry-title { margin: 10px 0 14px; font-size: clamp(2rem, 4.4vw, 3.3rem); line-height: 1.08; letter-spacing: -.03em; }
.entry-subtitle { margin: 0 0 20px; color: var(--aj-muted); font-size: 1.25rem; line-height: 1.5; }
.entry-subtitle > :last-child { margin-bottom: 0; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; color: var(--aj-muted); font-size: .9rem; }
.byline__author { display: inline-flex; align-items: center; gap: 10px; color: var(--aj-text); font-weight: 600; }
.byline__author img { border-radius: 50%; }
.byline__author a { color: inherit; text-decoration: none; }
.byline__author a:hover { text-decoration: underline; }
.article-figure { margin: 0 0 40px; }
.article-figure img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--aj-radius); }
.article-figure figcaption { margin-top: 10px; color: var(--aj-muted); font-size: .875rem; }

.entry-content { max-width: 720px; font-size: var(--aj-article-size); line-height: 1.75; }
.aj-layout:not(.has-sidebar) .entry-content { max-width: none; }
.entry-content > * { margin-top: 0; margin-bottom: 1.4em; }
.entry-content h2 { margin: 2.2em 0 .6em; font-size: 1.75em; line-height: 1.2; letter-spacing: -.02em; scroll-margin-top: calc(var(--aj-header-h) + 24px); }
.entry-content h2::before { content: ""; display: block; width: 40px; height: 3px; margin-bottom: .55em; background: var(--aj-terra); }
.entry-content h3 { margin: 1.8em 0 .4em; font-size: 1.3em; scroll-margin-top: calc(var(--aj-header-h) + 24px); }
.entry-content h4 { margin: 1.6em 0 .4em; font-size: 1.1em; }
.entry-content a { text-decoration: underline; }
.entry-content ul, .entry-content ol { padding-inline-start: 1.4em; }
.entry-content li { margin-bottom: .45em; }
.entry-content li::marker { color: var(--aj-sage-dark); font-weight: 700; }
.entry-content ol > li { padding-inline-start: .2em; }
.entry-content blockquote { margin: 2em 0; padding: .2em 0 .2em 1.4em; border-inline-start: 3px solid var(--aj-terra); font-size: 1.1em; }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content figure, .entry-content .wp-caption { max-width: 100%; margin: 2em 0; }
.entry-content img { display: block; border-radius: 4px; }
.entry-content figcaption, .entry-content .wp-caption-text { margin-top: .6em; color: var(--aj-muted); font-size: .875rem; line-height: 1.5; }
.entry-content hr { margin: 2.5em 0; border: 0; border-top: 1px solid var(--aj-border); }
.entry-content code { padding: .1em .35em; background: var(--aj-tint); border-radius: 3px; font-size: .9em; }
.entry-content pre { overflow-x: auto; padding: 1em; background: var(--aj-surface); border: 1px solid var(--aj-border); border-radius: var(--aj-radius); }
.alignleft { float: left; margin: .3em 1.5em 1em 0; max-width: 50%; }
.alignright { float: right; margin: .3em 0 1em 1.5em; max-width: 50%; }
.aligncenter { display: block; margin-inline: auto; }
.aj-table-wrap { overflow-x: auto; margin: 2em 0; border: 1px solid var(--aj-border); border-radius: var(--aj-radius); background: var(--aj-surface); }
.aj-table-wrap table { width: 100%; min-width: 520px; margin: 0; border-collapse: collapse; font-size: .92em; line-height: 1.5; }
.aj-table-wrap figure, .entry-content .wp-block-table { margin: 0; }
.entry-content th, .entry-content td { padding: .7em 1em; text-align: left; vertical-align: top; border-bottom: 1px solid var(--aj-border); }
.entry-content th { background: var(--aj-tint); font-weight: 700; }
.entry-content tbody tr:last-child td { border-bottom: 0; }
.entry-content tbody tr:nth-child(even) td { background: rgba(41, 45, 43, .025); }

/* Table of contents */
.entry-content > .aj-toc { margin-bottom: 2em; }
.aj-toc { padding: 6px 22px 12px; font-size: 1rem; line-height: 1.4; background: var(--aj-surface); border: 1px solid var(--aj-border); border-inline-start: 4px solid var(--aj-sage); border-radius: var(--aj-radius); }
.aj-toc summary, .aj-toc__title { display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin: 0; font-family: var(--aj-font-head); font-weight: 700; font-size: 1.05rem; cursor: pointer; list-style: none; }
.aj-toc summary::-webkit-details-marker { display: none; }
.aj-toc summary::after { content: ""; width: 8px; height: 8px; margin-inline-end: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.aj-toc details[open] > summary::after { transform: rotate(-135deg); }
.aj-toc ul { margin: 0; padding: 0; list-style: none; }
.aj-toc li { margin: 0; padding: 0; }
.aj-toc li::marker { content: none; }
.aj-toc a { display: block; padding: 6px 0; color: var(--aj-text); text-decoration: none; }
.aj-toc a:hover { color: var(--aj-sage-dark); text-decoration: underline; }
.aj-toc a.is-current { color: var(--aj-sage-dark); font-weight: 700; }
.aj-toc__sub { padding-inline-start: 18px !important; font-size: .94em; }

/* Advertising */
.aj-ad { clear: both; max-width: 100%; margin: 2.4em 0; text-align: center; }
.aj-ad__label { display: block; margin-bottom: 6px; color: var(--aj-muted); font-size: .75rem; }
.aj-ad__slot { display: block; width: 100%; min-height: var(--aj-ad-min, 280px); }
.aj-ad--preview .aj-ad__slot { display: flex; align-items: center; justify-content: center; color: var(--aj-muted); border: 1px dashed #b9b7af; font-size: .85rem; }
.sidebar .aj-ad { margin: 1.8em 0; }

/* After-article blocks */
.article-footer { max-width: 720px; margin-top: 40px; }
.aj-layout:not(.has-sidebar) .article-footer { max-width: none; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; padding: 0; list-style: none; }
.tag-list a { display: inline-block; padding: .35rem .8rem; color: var(--aj-text); text-decoration: none; border: 1px solid var(--aj-border); border-radius: 999px; font-size: .875rem; background: var(--aj-surface); }
.tag-list a:hover { border-color: var(--aj-sage-dark); }
.article-note { margin: 0 0 24px; padding: 20px 22px; background: var(--aj-surface); border: 1px solid var(--aj-border); border-radius: var(--aj-radius); font-size: .95rem; }
.article-note h2 { margin: 0 0 8px; font-size: 1.1rem; }
.article-note p:last-child, .article-note ol:last-child { margin-bottom: 0; }
.references ol { margin: 0; padding-inline-start: 1.3em; }
.references li { margin-bottom: .5em; overflow-wrap: anywhere; }
.author-box { display: flex; gap: 18px; margin: 0 0 24px; padding: 22px; background: var(--aj-tint); border-radius: var(--aj-radius); }
.author-box img { flex: none; border-radius: 50%; }
.author-box__name { margin: 0 0 4px; font-size: 1.1rem; }
.author-box__name a { color: var(--aj-text); text-decoration: none; }
.author-box__bio { margin: 0; font-size: .95rem; }
.related { margin-top: 56px; padding: 56px 0 64px; background: var(--aj-surface); border-top: 1px solid var(--aj-border); }

/* Sidebar */
.sidebar { font-size: .95rem; }
.sidebar-block { margin-bottom: 32px; }
.sidebar-title, .widget-title { margin: 0 0 12px; padding-bottom: 10px; font-size: 1.1rem; border-bottom: 2px solid var(--aj-sage); }
.sidebar ul { margin: 0; padding: 0; list-style: none; }
.sidebar li { padding: 8px 0; border-bottom: 1px solid var(--aj-border); }
.sidebar li a { color: var(--aj-text); text-decoration: none; font-weight: 600; }
.sidebar li a:hover { color: var(--aj-sage-dark); text-decoration: underline; }
.sidebar .post-date { display: block; margin-top: 2px; color: var(--aj-muted); font-size: .82rem; font-weight: 400; }
.sidebar .widget { margin-bottom: 32px; }

/* ==========================================================================
   Pages, comments
   ========================================================================== */
.page-article { max-width: 820px; padding: 8px 0 72px; }
.page-article .entry-title { margin-top: 24px; }
.comments-area { max-width: 720px; margin: 56px 0 72px; }
.comments-title, .comment-reply-title { font-size: 1.5rem; }
.comment-list { margin: 0 0 32px; padding: 0; list-style: none; }
.comment-list .children { margin: 0; padding-inline-start: 24px; list-style: none; }
.comment-body { padding: 20px 0; border-bottom: 1px solid var(--aj-border); }
.comment-author img { float: left; margin-inline-end: 12px; border-radius: 50%; }
.comment-metadata { margin-bottom: 8px; color: var(--aj-muted); font-size: .85rem; }
.comment-metadata a { color: inherit; }
.comment-form label { display: block; margin-bottom: 4px; font-weight: 600; }
.comment-form p { margin-bottom: 16px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { margin-top: 0; padding: 56px 0 0; color: var(--aj-bg); background: var(--aj-text); }
.site-footer a { color: var(--aj-bg); }
.footer-grid { display: grid; gap: 36px; padding-bottom: 40px; }
@media (min-width: 600px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.footer-brand .site-title a { color: var(--aj-bg); }
.footer-brand .custom-logo-link { display: inline-block; padding: 8px; background: var(--aj-bg); border-radius: var(--aj-radius); }
.footer-text { max-width: 30em; margin-top: 14px; color: rgba(250, 249, 246, .78); font-size: .95rem; }
.footer-title { margin: 0 0 14px; color: var(--aj-bg); font-size: 1rem; }
.footer-list { margin: 0; padding: 0; list-style: none; }
.footer-list li { margin-bottom: 8px; }
.footer-list a { font-size: .95rem; }
.footer-bottom { padding: 20px 0 28px; border-top: 1px solid rgba(250, 249, 246, .18); color: rgba(250, 249, 246, .78); font-size: .875rem; }
.footer-bottom p { margin: 0; }
.footer-social { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 18px 0 0; padding: 0; list-style: none; }
.footer-social a { font-size: .95rem; }

@media print {
	.site-header, .site-footer, .sidebar, .aj-ad, .related, .comments-area, .search-panel { display: none !important; }
	body { background: #fff; }
}

/* Editable homepage content (page editor) */
.home-page-content { padding: 40px 0 24px; }
.entry-content--wide { max-width: none; }
.entry-content--wide > * { max-width: 100%; }
.entry-content--wide > h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); letter-spacing: -.03em; }
.entry-content--wide .wp-block-columns { gap: 32px; }

/* Setup mode samples (visible only to logged-in site editors) */
.setup-note { padding: 12px 0; color: var(--aj-text); background: var(--aj-tint); border-bottom: 1px dashed var(--aj-sage); font-size: .9rem; }
.is-sample { outline: 2px dashed var(--aj-sage); outline-offset: -2px; }
.is-sample .card__title { font-size: 1.1rem; }
.type-tile.is-sample { cursor: default; }
.newsletter.is-sample { outline-offset: -8px; }
