/*
Theme Name: Homer Field Journal
Author: Mara Whit Studio
Description: A classic editorial WordPress theme with dynamic categories, Customizer controls, and a Citebound-inspired visual system.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: hdb-theme
*/

:root {
  --hdb-color-bg: #ffffff;
  --hdb-color-surface: #edeae3;
  --hdb-color-surface-soft: #f8f7f4;
  --hdb-color-text: #0a0a0a;
  --hdb-color-muted: #5e5e5e;
  --hdb-color-accent: #e63312;
  --hdb-color-dark: #101010;
  --hdb-color-border: #d6d1c6;
  --hdb-color-button-text: #ffffff;
  --hdb-font-heading: "Fraunces", Georgia, serif;
  --hdb-font-body: "Inter", Arial, sans-serif;
  --hdb-font-mono: "Fragment Mono", "Courier New", monospace;
  --hdb-hero-size: 56px;
  --hdb-body-size: 16px;
  --hdb-card-title-size: 25px;
  --hdb-logo-size: 24px;
  --hdb-card-image-height: 230px;
  --hdb-radius: 0px;
  --hdb-max-width: 1180px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--hdb-color-bg);
  color: var(--hdb-color-text);
  font-family: var(--hdb-font-body);
  font-size: var(--hdb-body-size);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body.hdb-lock-scroll {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--hdb-color-accent);
}

button,
input,
textarea,
select {
  font: inherit;
}

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

.hdb-skip-link:focus {
  top: 12px;
  left: 12px;
  z-index: 999;
  width: auto;
  height: auto;
  padding: 10px 14px;
  clip: auto;
  color: var(--hdb-color-button-text);
  background: var(--hdb-color-dark);
}

.hdb-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--hdb-color-border);
  backdrop-filter: blur(16px);
}

.hdb-header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 64px;
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: 0 20px;
  gap: 18px;
}

.hdb-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hdb-brand-text {
  font-family: var(--hdb-font-heading);
  font-size: var(--hdb-logo-size);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.hdb-brand-dot {
  color: var(--hdb-color-accent);
}

.hdb-brand-mark {
  display: inline-grid;
  grid-template-columns: repeat(4, 3px);
  align-items: end;
  gap: 3px;
  width: 21px;
  height: 18px;
  flex: 0 0 auto;
}

.hdb-brand-mark span {
  width: 3px;
  background: var(--hdb-color-text);
}

.hdb-brand-mark span:nth-child(1) {
  height: 9px;
}

.hdb-brand-mark span:nth-child(2) {
  height: 14px;
}

.hdb-brand-mark span:nth-child(3) {
  height: 17px;
  background: var(--hdb-color-accent);
}

.hdb-brand-mark span:nth-child(4) {
  height: 12px;
}

.hdb-desktop-nav,
.hdb-header-cta {
	display: none;
}

.hdb-category-list {
  display: flex;
  gap: 26px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hdb-category-item {
  margin: 0;
}

.hdb-category-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: var(--hdb-color-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.hdb-empty-categories {
  color: var(--hdb-color-muted);
  font-size: 13px;
}

.hdb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--hdb-radius);
  color: var(--hdb-color-button-text);
  background: var(--hdb-color-accent);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.hdb-button:hover,
.hdb-button:focus-visible {
	color: var(--hdb-color-button-text);
	background: var(--hdb-color-dark);
}

.hdb-button.hdb-header-cta {
	display: none;
}

.hdb-button--dark {
  background: var(--hdb-color-dark);
}

.hdb-button--dark:hover,
.hdb-button--dark:focus-visible {
  background: var(--hdb-color-accent);
}

.hdb-button-mark {
  display: inline-grid;
  grid-template-columns: repeat(4, 3px);
  align-items: end;
  gap: 3px;
  width: 21px;
  height: 18px;
}

.hdb-button-mark span {
  width: 3px;
  background: currentColor;
}

.hdb-button-mark span:nth-child(1) {
  height: 8px;
}

.hdb-button-mark span:nth-child(2) {
  height: 15px;
}

.hdb-button-mark span:nth-child(3) {
  height: 12px;
  background: var(--hdb-color-accent);
}

.hdb-button-mark span:nth-child(4) {
  height: 18px;
}

.hdb-menu-toggle {
  display: inline-flex;
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  color: var(--hdb-color-text);
  background: transparent;
  cursor: pointer;
}

.hdb-menu-icon,
.hdb-menu-icon::before,
.hdb-menu-icon::after {
  display: block;
  width: 19px;
  height: 1.5px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.hdb-menu-icon {
  position: relative;
}

.hdb-menu-icon::before,
.hdb-menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.hdb-menu-icon::before {
  top: -7px;
}

.hdb-menu-icon::after {
  top: 7px;
}

.hdb-menu-toggle[aria-expanded="true"] .hdb-menu-icon {
  background: transparent;
}

.hdb-menu-toggle[aria-expanded="true"] .hdb-menu-icon::before {
  transform: translateY(7px) rotate(45deg);
}

.hdb-menu-toggle[aria-expanded="true"] .hdb-menu-icon::after {
  transform: translateY(-7px) rotate(-45deg);
}

.hdb-mobile-panel {
  border-top: 1px solid var(--hdb-color-border);
  background: var(--hdb-color-bg);
}

.hdb-mobile-panel[hidden] {
  display: none;
}

.hdb-mobile-panel-inner {
  display: grid;
  gap: 22px;
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: 22px 20px 26px;
}

.hdb-category-list--mobile {
  display: grid;
  gap: 0;
  justify-content: stretch;
}

.hdb-category-list--mobile .hdb-category-link {
	display: flex;
	justify-content: space-between;
	width: 100%;
	min-height: 48px;
	border-bottom: 1px solid var(--hdb-color-border);
}

.hdb-category-list--mobile .hdb-category-link::after {
  content: "";
  width: 7px;
  height: 7px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.hdb-main {
  min-height: 60vh;
}

.hdb-wrap {
  width: min(100% - 40px, var(--hdb-max-width));
  margin: 0 auto;
}

.hdb-hero {
	position: relative;
	overflow: hidden;
	min-height: 0;
	padding: 64px 0 84px;
	text-align: center;
	isolation: isolate;
}

.hdb-hero::before,
.hdb-hero::after {
  content: "";
  position: absolute;
  z-index: -2;
  pointer-events: none;
}

.hdb-hero::before {
  width: 1280px;
  height: 1280px;
  top: -460px;
  left: 50%;
  border: 1px solid rgba(214, 209, 198, 0.72);
  border-radius: 50%;
  transform: translateX(-50%);
}

.hdb-hero::after {
  inset: 0;
  background-image: var(--hdb-hero-image);
  background-size: cover;
  background-position: center;
  opacity: 0;
  filter: grayscale(1);
}

.hdb-hero--has-image::after {
  opacity: 0.12;
}

.hdb-hero-ring {
  position: absolute;
  z-index: -1;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--hdb-color-surface);
  box-shadow: 0 0 0 14px rgba(237, 234, 227, 0.65);
}

.hdb-hero-ring--one {
  top: 20%;
  left: 8%;
}

.hdb-hero-ring--two {
  right: 9%;
  top: 37%;
}

.hdb-hero-ring--three {
  left: 24%;
  bottom: 30%;
}

.hdb-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 28px;
  color: var(--hdb-color-text);
  font-family: var(--hdb-font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hdb-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--hdb-color-accent);
}

.hdb-hero-title {
  max-width: 860px;
  margin: 0 auto 24px;
  font-family: var(--hdb-font-heading);
  font-size: var(--hdb-hero-size);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0;
}

.hdb-hero-copy {
  max-width: 680px;
  margin: 0 auto 34px;
  color: var(--hdb-color-text);
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.65;
}

.hdb-hero-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 62px;
}

.hdb-score-card {
  width: min(100%, 500px);
  margin: 0 auto;
  padding: 24px;
  text-align: left;
  background: var(--hdb-color-surface);
  border: 1px solid var(--hdb-color-border);
}

.hdb-score-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  font-family: var(--hdb-font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hdb-score-delta {
  color: var(--hdb-color-accent);
}

.hdb-score-number {
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin-bottom: 24px;
  font-family: var(--hdb-font-heading);
  font-size: clamp(70px, 12vw, 96px);
  line-height: 0.9;
}

.hdb-score-number span {
  color: var(--hdb-color-muted);
  font-size: 28px;
}

.hdb-score-rows {
  display: grid;
  gap: 0;
}

.hdb-score-row {
  display: grid;
  grid-template-columns: 92px 1fr 42px;
  align-items: center;
  gap: 14px;
  min-height: 38px;
  border-top: 1px solid var(--hdb-color-border);
  font-size: 12px;
}

.hdb-score-label {
  overflow: hidden;
  font-family: var(--hdb-font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.hdb-score-track {
  height: 5px;
  background: var(--hdb-color-bg);
}

.hdb-score-fill {
  height: 100%;
  width: var(--hdb-score-value);
  background: var(--hdb-color-text);
}

.hdb-score-row:nth-child(3n) .hdb-score-fill {
  background: var(--hdb-color-accent);
}

.hdb-score-value {
  color: var(--hdb-color-text);
  font-size: 12px;
  text-align: right;
}

.hdb-divider {
  display: flex;
  gap: 5px;
  width: 100%;
  margin: 0 0 68px;
  overflow: hidden;
}

.hdb-divider span {
  flex: 1 0 74px;
  height: 6px;
  background: var(--hdb-color-text);
}

.hdb-divider span:nth-child(4n) {
  background: var(--hdb-color-accent);
}

.hdb-section {
  padding: 72px 0;
}

.hdb-section--soft {
  background: var(--hdb-color-surface-soft);
}

.hdb-section--dark {
  color: var(--hdb-color-surface-soft);
  background: var(--hdb-color-dark);
}

.hdb-section-head {
  max-width: 760px;
  margin: 0 auto 46px;
  text-align: center;
}

.hdb-section-title {
  margin: 0 0 18px;
  font-family: var(--hdb-font-heading);
  font-size: clamp(40px, 9vw, 72px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: 0;
}

.hdb-section-copy {
  margin: 0;
  color: var(--hdb-color-muted);
  font-size: clamp(16px, 2vw, 18px);
}

.hdb-section--dark .hdb-section-copy {
  color: var(--hdb-color-surface);
}

.hdb-post-grid {
  display: grid;
  gap: 24px;
}

.hdb-post-card {
  display: grid;
  min-width: 0;
  color: var(--hdb-color-text);
  background: var(--hdb-color-bg);
  border: 1px solid var(--hdb-color-border);
}

.hdb-post-card:hover,
.hdb-post-card:focus-within {
  border-color: var(--hdb-color-accent);
}

.hdb-post-card-media {
  display: block;
  overflow: hidden;
  height: var(--hdb-card-image-height);
  background: var(--hdb-color-surface);
}

.hdb-post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.hdb-post-card:hover .hdb-post-card-media img,
.hdb-post-card:focus-within .hdb-post-card-media img {
  transform: scale(1.035);
}

.hdb-post-card-placeholder {
  display: grid;
  height: 100%;
  place-items: center;
  background:
    linear-gradient(90deg, transparent 49%, rgba(10, 10, 10, 0.08) 50%, transparent 51%),
    var(--hdb-color-surface);
}

.hdb-post-card-placeholder span {
  width: 56px;
  height: 56px;
  border: 1px solid var(--hdb-color-border);
  border-radius: 50%;
}

.hdb-post-card-body {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.hdb-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--hdb-color-muted);
  font-family: var(--hdb-font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hdb-post-meta a {
  color: var(--hdb-color-muted);
}

.hdb-post-title {
  margin: 0;
  font-family: var(--hdb-font-heading);
  font-size: var(--hdb-card-title-size);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0;
}

.hdb-post-excerpt {
  margin: 0;
  color: var(--hdb-color-muted);
}

.hdb-read-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  color: var(--hdb-color-text);
  font-weight: 800;
}

.hdb-read-more::after {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.hdb-about-panel {
  display: grid;
  gap: 28px;
  padding: 32px;
  color: var(--hdb-color-surface-soft);
  background: var(--hdb-color-dark);
}

.hdb-about-title {
  margin: 0;
  font-family: var(--hdb-font-heading);
  font-size: clamp(36px, 8vw, 74px);
  font-weight: 400;
  line-height: 1;
}

.hdb-about-copy {
  max-width: 700px;
  color: var(--hdb-color-surface);
  font-size: 18px;
}

.hdb-archive-head {
  padding: 70px 0 42px;
  border-bottom: 1px solid var(--hdb-color-border);
}

.hdb-archive-title,
.hdb-single-title {
  max-width: 920px;
  margin: 0;
  font-family: var(--hdb-font-heading);
  font-size: clamp(44px, 9vw, 86px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0;
}

.hdb-archive-description {
  max-width: 700px;
  margin-top: 18px;
  color: var(--hdb-color-muted);
  font-size: 18px;
}

.hdb-loop {
  padding: 54px 0 76px;
}

.hdb-pagination {
  margin-top: 42px;
  font-weight: 700;
}

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

.hdb-pagination a,
.hdb-pagination span {
  display: inline-flex;
  min-width: 38px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hdb-color-border);
}

.hdb-pagination .current {
  color: var(--hdb-color-button-text);
  background: var(--hdb-color-dark);
  border-color: var(--hdb-color-dark);
}

.hdb-single {
  padding: 70px 0 90px;
}

.hdb-single-inner {
  width: min(100% - 40px, 860px);
  margin: 0 auto;
}

.hdb-single-head {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--hdb-color-border);
}

.hdb-single-title {
  margin-top: 14px;
}

.hdb-single-content {
  color: var(--hdb-color-text);
  font-size: clamp(17px, 2vw, 19px);
}

.hdb-single-content > * {
  margin-top: 0;
  margin-bottom: 1.35em;
}

.hdb-single-content h2,
.hdb-single-content h3,
.hdb-single-content h4 {
  margin-top: 1.5em;
  margin-bottom: 0.55em;
  font-family: var(--hdb-font-heading);
  font-weight: 400;
  line-height: 1.08;
}

.hdb-single-content h2 {
  font-size: clamp(34px, 6vw, 54px);
}

.hdb-single-content h3 {
  font-size: clamp(28px, 5vw, 42px);
}

.hdb-single-content a {
  color: var(--hdb-color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hdb-single-content blockquote {
  margin-left: 0;
  padding-left: 22px;
  border-left: 4px solid var(--hdb-color-accent);
  color: var(--hdb-color-muted);
  font-family: var(--hdb-font-heading);
  font-size: 1.35em;
  line-height: 1.35;
}

.hdb-single-content img {
  margin: 34px auto;
}

.hdb-single-footer {
  margin-top: 46px;
  padding-top: 28px;
  border-top: 1px solid var(--hdb-color-border);
}

.hdb-post-nav {
  display: grid;
  gap: 14px;
  margin-top: 44px;
}

.hdb-post-nav a {
  display: block;
  padding: 18px;
  border: 1px solid var(--hdb-color-border);
  font-weight: 700;
}

.hdb-no-posts {
  padding: 60px 0;
  color: var(--hdb-color-muted);
  text-align: center;
}

.hdb-site-footer {
  color: var(--hdb-color-surface-soft);
  background: var(--hdb-color-dark);
}

.hdb-footer-main {
  display: grid;
  gap: 42px;
  padding: 64px 0 40px;
}

.hdb-footer-lead {
  display: grid;
  gap: 22px;
  max-width: 620px;
}

.hdb-footer-title {
  margin: 0;
  font-family: var(--hdb-font-heading);
  font-size: clamp(42px, 8vw, 78px);
  font-weight: 400;
  line-height: 1;
}

.hdb-footer-copy {
  margin: 0;
  color: var(--hdb-color-surface);
  font-size: 18px;
}

.hdb-footer-grid {
  display: grid;
  gap: 32px;
}

.hdb-footer-column-title {
  margin: 0 0 14px;
  color: var(--hdb-color-muted);
  font-family: var(--hdb-font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

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

.hdb-footer-list a {
  color: var(--hdb-color-surface-soft);
}

.hdb-footer-list a:hover,
.hdb-footer-list a:focus-visible {
  color: var(--hdb-color-accent);
}

.hdb-footer-contact {
  display: grid;
  gap: 8px;
  color: var(--hdb-color-surface);
}

.hdb-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-top: 1px solid rgba(214, 209, 198, 0.24);
  color: var(--hdb-color-surface);
  font-family: var(--hdb-font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hdb-footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hdb-footer-wordmark {
  overflow: hidden;
  padding: 12px 0 24px;
  color: var(--hdb-color-muted);
  font-family: var(--hdb-font-heading);
  font-size: clamp(64px, 18vw, 160px);
  line-height: 0.86;
  text-align: center;
  white-space: nowrap;
}

.hdb-alignwide {
  width: min(100% - 40px, 1120px);
  margin-left: auto;
  margin-right: auto;
}

.hdb-alignfull {
  width: 100%;
}

@media (min-width: 700px) {
  .hdb-post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hdb-about-panel {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    align-items: end;
    padding: 46px;
  }

  .hdb-footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hdb-post-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 920px) {
  :root {
    --hdb-hero-size: 84px;
  }

  .hdb-header-inner {
    grid-template-columns: minmax(180px, 1fr) minmax(420px, auto) minmax(180px, 1fr);
    min-height: 72px;
    padding: 0 38px;
  }

  .hdb-desktop-nav {
    display: block;
  }

	.hdb-button.hdb-header-cta {
		display: inline-flex;
		justify-self: end;
		min-height: 46px;
    padding: 0 20px;
    color: var(--hdb-color-button-text);
    background: var(--hdb-color-dark);
  }

  .hdb-menu-toggle,
  .hdb-mobile-panel {
    display: none;
  }

	.hdb-hero {
		padding-top: 62px;
	}

  .hdb-hero::before {
    top: -530px;
    width: 1580px;
    height: 1580px;
  }

  .hdb-hero-title {
    max-width: 780px;
  }

  .hdb-score-card {
    width: 500px;
  }

  .hdb-section {
    padding: 96px 0;
  }

  .hdb-post-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hdb-post-grid--archive {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hdb-footer-main {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.35fr);
    align-items: start;
    padding-top: 82px;
  }
}

@media (max-width: 480px) {
  .hdb-wrap,
  .hdb-single-inner {
    width: min(100% - 32px, var(--hdb-max-width));
  }

  .hdb-hero {
    padding-top: 62px;
  }

  .hdb-hero-title {
    font-size: clamp(44px, 14vw, var(--hdb-hero-size));
  }

  .hdb-score-card {
    padding: 22px;
  }

  .hdb-score-row {
    grid-template-columns: 94px 1fr 40px;
    gap: 9px;
  }

  .hdb-button {
    width: 100%;
    padding-left: 18px;
    padding-right: 18px;
  }

  .hdb-hero-actions .hdb-button {
    width: auto;
  }
}
