/*
Theme Name: Cedar Harbor Notes
Author: Rowan Vale Studio
Description: A classic PHP WordPress theme for editorial PBN-style publishing with dynamic Customizer controls, responsive navigation, and no hard-coded category names.
Version: 1.0.3
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
Text Domain: hd-theme
*/

:root {
  --hd-bg: #faf7f3;
  --hd-text: #111111;
  --hd-muted: #6e675f;
  --hd-accent: #b6633b;
  --hd-panel: #eee5d9;
  --hd-line: rgba(17, 17, 17, 0.14);
  --hd-font: "Archivo", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--hd-bg);
  color: var(--hd-text);
  font-family: var(--hd-font);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-color: rgba(17, 17, 17, 0.35);
  text-underline-offset: 0.18em;
}

a:hover,
a:focus {
  color: var(--hd-accent);
  text-decoration-color: currentColor;
}

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

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

.hd-skip-link {
  background: var(--hd-text);
  color: var(--hd-bg);
  left: 1rem;
  padding: 0.75rem 1rem;
  position: absolute;
  top: -100px;
  z-index: 100;
}

.hd-skip-link:focus {
  top: 1rem;
}

.hd-site-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

.hd-container {
  margin-inline: auto;
  max-width: 1200px;
  padding-inline: clamp(1rem, 4vw, 3rem);
  width: 100%;
}

.hd-site-header {
  background: color-mix(in srgb, var(--hd-bg) 90%, transparent);
  border-bottom: 1px solid var(--hd-line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.hd-header-inner {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 72px;
}

.hd-brand {
  align-items: center;
  display: inline-flex;
  gap: 0.75rem;
  min-width: 0;
  text-decoration: none;
}

.hd-brand-text {
  display: grid;
  line-height: 1.1;
}

.hd-site-title {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 800;
  text-transform: uppercase;
}

.hd-site-description {
  color: var(--hd-muted);
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.hd-custom-logo {
  border-radius: 999px;
  height: 40px;
  object-fit: cover;
  width: 40px;
}

.hd-primary-nav {
  align-items: center;
  display: flex;
  justify-content: flex-end;
}

.hd-menu-checkbox {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.hd-menu-toggle {
  align-items: center;
  background: transparent;
  border: 1px solid var(--hd-line);
  border-radius: 999px;
  color: var(--hd-text);
  cursor: pointer;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  padding: 0;
  position: relative;
  width: 44px;
  z-index: 70;
}

.hd-menu-toggle span,
.hd-menu-toggle::before,
.hd-menu-toggle::after {
  background: currentColor;
  content: "";
  height: 2px;
  left: 12px;
  position: absolute;
  transition: transform 180ms ease, opacity 180ms ease;
  width: 18px;
}

.hd-menu-toggle::before {
  transform: translateY(-6px);
}

.hd-menu-toggle::after {
  transform: translateY(6px);
}

.hd-menu-checkbox:checked + .hd-menu-toggle span {
  opacity: 0;
}

.hd-menu-checkbox:checked + .hd-menu-toggle::before {
  transform: rotate(45deg);
}

.hd-menu-checkbox:checked + .hd-menu-toggle::after {
  transform: rotate(-45deg);
}

.hd-menu-panel {
  background: var(--hd-bg);
  border: 1px solid var(--hd-line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(17, 17, 17, 0.12);
  opacity: 0;
  padding: 0.75rem;
  pointer-events: none;
  position: fixed;
  right: clamp(1rem, 4vw, 3rem);
  top: 76px;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
  width: min(320px, calc(100vw - 2rem));
  z-index: 65;
}

.hd-menu-checkbox:checked ~ .hd-menu-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.hd-menu,
.hd-category-menu,
.hd-footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hd-menu {
  display: grid;
  gap: 0.25rem;
}

.hd-sub-menu {
  border-left: 1px solid var(--hd-line);
  display: grid;
  gap: 0.2rem;
  list-style: none;
  margin: 0.2rem 0 0.45rem 0.75rem;
  padding: 0 0 0 0.75rem;
}

.hd-menu a {
  border-radius: 12px;
  display: block;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.8rem 0.9rem;
  text-decoration: none;
}

.hd-menu a:hover,
.hd-menu a:focus {
  background: var(--hd-panel);
}

.hd-mobile-categories {
  border-top: 1px solid var(--hd-line);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.hd-mobile-categories-title {
  color: var(--hd-muted);
  font-size: 0.74rem;
  font-weight: 900;
  margin: 0 0 0.4rem;
  text-transform: uppercase;
}

.hd-category-menu {
  display: grid;
  gap: 0.25rem;
}

.hd-category-link {
  border-radius: 12px;
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 0.72rem 0.9rem;
  text-decoration: none;
}

.hd-category-link:hover,
.hd-category-link:focus {
  background: var(--hd-panel);
}

.hd-main {
  display: block;
}

.hd-hero {
  padding-block: clamp(3rem, 8vw, 6.5rem);
}

.hd-hero-grid {
  align-items: end;
  display: grid;
  gap: clamp(2rem, 7vw, 5rem);
}

.hd-kicker {
  color: var(--hd-muted);
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  font-weight: 800;
  margin: 0 0 1rem;
  text-transform: uppercase;
}

.hd-hero-title {
  font-size: clamp(3.1rem, 17vw, 11rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.86;
  margin: 0;
  max-width: 10ch;
  text-transform: uppercase;
}

.hd-intro {
  color: var(--hd-muted);
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  margin: clamp(1.35rem, 4vw, 2.25rem) 0 0;
  max-width: 42rem;
}

.hd-stat-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
}

.hd-stat-card {
  border-top: 1px solid var(--hd-line);
  padding-top: 0.95rem;
}

.hd-stat-icon {
  color: var(--hd-accent);
  display: block;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.55rem;
}

.hd-stat-value {
  display: block;
  font-size: clamp(1.35rem, 4vw, 2.15rem);
  font-weight: 900;
  line-height: 1;
}

.hd-stat-label {
  color: var(--hd-muted);
  display: block;
  font-size: 0.82rem;
  margin-top: 0.3rem;
}

.hd-hero-media {
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  width: min(78vw, 440px);
}

.hd-hero-media img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.hd-image-floating {
  box-shadow: 0 28px 80px rgba(17, 17, 17, 0.18);
  transform: rotate(1.4deg);
}

.hd-image-sunken {
  border: 1px solid var(--hd-line);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.hd-image-placeholder {
  align-items: center;
  background:
    radial-gradient(circle at 35% 20%, color-mix(in srgb, var(--hd-accent) 26%, transparent), transparent 32%),
    linear-gradient(135deg, var(--hd-panel), color-mix(in srgb, var(--hd-bg) 70%, var(--hd-text)));
  display: flex;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.hd-section {
  border-top: 1px solid var(--hd-line);
  padding-block: clamp(2.5rem, 7vw, 5rem);
}

.hd-section-head {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.hd-section-title {
  font-size: clamp(2rem, 7vw, 4.5rem);
  font-weight: 900;
  line-height: 0.95;
  margin: 0;
  text-transform: uppercase;
}

.hd-post-grid {
  display: grid;
  gap: 1rem;
}

.hd-post-card {
  border-top: 1px solid var(--hd-line);
  display: grid;
  gap: 1rem;
  padding-block: 1rem;
}

.hd-card-media {
  aspect-ratio: 16 / 10;
  background: var(--hd-panel);
  border-radius: 18px;
  overflow: hidden;
}

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

.hd-post-card:hover .hd-card-media img {
  transform: scale(1.035);
}

.hd-card-content {
  display: grid;
  gap: 0.65rem;
}

.hd-card-date,
.hd-entry-date,
.hd-entry-tax {
  color: var(--hd-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hd-card-title {
  font-size: clamp(1.35rem, 4vw, 2.4rem);
  font-weight: 900;
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
}

.hd-card-title a {
  text-decoration: none;
}

.hd-card-excerpt {
  color: var(--hd-muted);
  margin: 0;
}

.hd-read-link {
  align-items: center;
  display: inline-flex;
  font-weight: 900;
  gap: 0.45rem;
  text-decoration: none;
}

.hd-read-link::after {
  content: ">";
  font-weight: 900;
}

.hd-empty {
  border: 1px solid var(--hd-line);
  border-radius: 18px;
  color: var(--hd-muted);
  padding: 1.25rem;
}

.hd-pagination {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 2rem;
}

.hd-pagination a {
  border: 1px solid var(--hd-line);
  border-radius: 999px;
  font-weight: 800;
  padding: 0.7rem 1rem;
  text-decoration: none;
}

.hd-archive-head {
  padding-block: clamp(2.5rem, 8vw, 5rem);
}

.hd-archive-title {
  font-size: clamp(2.3rem, 10vw, 6rem);
  font-weight: 900;
  line-height: 0.95;
  margin: 0;
  max-width: 12ch;
  text-transform: uppercase;
}

.hd-archive-description {
  color: var(--hd-muted);
  font-size: 1.05rem;
  margin-top: 1rem;
  max-width: 46rem;
}

.hd-entry {
  margin-inline: auto;
  padding-block: clamp(2.5rem, 8vw, 6rem);
  width: min(80vw, 960px);
}

.hd-entry-header {
  border-bottom: 1px solid var(--hd-line);
  margin-bottom: clamp(1.75rem, 5vw, 3rem);
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.hd-entry-title {
  font-size: clamp(2.35rem, 11vw, 7rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.9;
  margin: 0.75rem 0 0;
  text-transform: uppercase;
}

.hd-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.hd-entry-content {
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.hd-entry-content > * {
  margin-bottom: 1.25rem;
  margin-top: 0;
}

.hd-entry-content h2,
.hd-entry-content h3,
.hd-entry-content h4 {
  line-height: 1.05;
  margin-top: 2rem;
  text-transform: uppercase;
}

.hd-entry-content h2 {
  font-size: clamp(1.8rem, 5vw, 3.1rem);
}

.hd-entry-content h3 {
  font-size: clamp(1.45rem, 4vw, 2.2rem);
}

.hd-entry-content p,
.hd-entry-content li {
  color: color-mix(in srgb, var(--hd-text) 82%, var(--hd-muted));
}

.hd-entry-content img,
.hd-entry-content video {
  border-radius: 18px;
  margin-block: 1.75rem;
}

.hd-entry-content blockquote {
  border-left: 4px solid var(--hd-accent);
  color: var(--hd-text);
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 800;
  margin-left: 0;
  padding-left: 1rem;
}

.hd-entry-footer {
  border-top: 1px solid var(--hd-line);
  margin-top: clamp(2rem, 5vw, 3.5rem);
  padding-top: 1.25rem;
}

.hd-post-nav {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-top: 2rem;
}

.hd-post-nav a {
  border: 1px solid var(--hd-line);
  border-radius: 18px;
  display: block;
  font-weight: 900;
  padding: 1rem;
  text-decoration: none;
  text-transform: uppercase;
}

.hd-site-footer {
  background: var(--hd-panel);
  border-top: 1px solid var(--hd-line);
  margin-top: clamp(3rem, 8vw, 6rem);
  padding-block: clamp(2.5rem, 7vw, 4rem);
}

.hd-footer-grid {
  display: grid;
  gap: 2rem;
}

.hd-footer-title {
  font-size: clamp(2.5rem, 12vw, 8rem);
  font-weight: 900;
  line-height: 0.82;
  margin: 0;
  text-transform: uppercase;
}

.hd-footer-text {
  color: var(--hd-muted);
  margin: 1rem 0 0;
  max-width: 34rem;
}

.hd-footer-menu {
  display: grid;
  gap: 0.45rem;
}

.hd-footer-menu a {
  font-weight: 800;
  text-decoration: none;
}

.hd-footer-meta {
  border-top: 1px solid var(--hd-line);
  color: var(--hd-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
}

@media (min-width: 680px) {
  .hd-post-card {
    grid-template-columns: minmax(190px, 0.75fr) minmax(0, 1fr);
  }

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

@media (min-width: 821px) {
  .hd-menu-toggle {
    display: none;
  }

  .hd-menu-checkbox {
    display: none;
  }

  .hd-menu-panel {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    padding: 0;
    pointer-events: auto;
    position: static;
    transform: none;
    transition: none;
    width: auto;
  }

  .hd-menu {
    align-items: center;
    display: flex;
    gap: 0.3rem;
  }

  .hd-menu a {
    font-size: 0.9rem;
    padding: 0.6rem 0.8rem;
  }

  .hd-mobile-categories {
    display: none;
  }

  .hd-hero-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  }

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

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

  .hd-post-card {
    align-content: start;
    grid-template-columns: 1fr;
    min-height: 100%;
  }

  .hd-card-media {
    aspect-ratio: 4 / 3;
  }

  .hd-footer-grid {
    align-items: start;
    grid-template-columns: minmax(0, 1fr) 260px;
  }
}

@media (min-width: 1120px) {
  .hd-post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
