/* ============================================================
   Horsefly Historical Society — Main Stylesheet
   Colour palette:
     --green:  #2d5a27  (deep forest green)
     --cream:  #f5f0e8  (warm cream)
     --brown:  #3d2b1f  (dark brown)
     --gold:   #c4993a  (muted gold)
   ============================================================ */

/* ---- Custom Properties ---- */
:root {
  --green:        #2d5a27;
  --green-dark:   #1e3e1b;
  --green-light:  #4a7c42;
  --cream:        #f5f0e8;
  --cream-dark:   #ede6d8;
  --brown:        #3d2b1f;
  --brown-light:  #5c4232;
  --gold:         #c4993a;
  --gold-dark:    #a07c27;
  --white:        #ffffff;
  --text:         #2a1f15;
  --text-muted:   #5a4a3a;
  --border:       #cfc4b0;

  --font-body:    Georgia, 'Times New Roman', serif;
  --font-ui:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --container-max: 1100px;
  --radius:        4px;
  --shadow:        0 2px 8px rgba(61, 43, 31, 0.12);
}

/* ---- Reset / Normalize ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--green-dark);
}

/* ---- Focus Styles (keyboard nav) ---- */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* ---- Utility: visually hidden ---- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Layout: container ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn-primary {
  background-color: var(--gold);
  color: var(--brown);
  border: 2px solid var(--gold);
}

.btn-primary:hover {
  background-color: var(--gold-dark);
  border-color: var(--gold-dark);
  color: var(--white);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background-color: var(--green);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.site-branding {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.site-title {
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cream);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-title:hover {
  color: var(--gold);
}

.site-tagline {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: rgba(245, 240, 232, 0.75);
  font-style: italic;
  display: none;
}

@media (min-width: 640px) {
  .site-tagline { display: block; }
}

/* ---- Hamburger / Nav Toggle ---- */
.nav-toggle-checkbox {
  display: none;
}

.nav-toggle-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  border-radius: var(--radius);
  border: 1px solid rgba(245, 240, 232, 0.3);
}

.nav-toggle-label:hover {
  background-color: rgba(245, 240, 232, 0.12);
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 1.3rem;
  height: 2px;
  background-color: var(--cream);
  position: relative;
  transition: transform 0.2s ease;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}

.hamburger::before { top: -6px; }
.hamburger::after  { top:  6px; }

.nav-toggle-checkbox:checked ~ .nav-toggle-label .hamburger {
  background-color: transparent;
}
.nav-toggle-checkbox:checked ~ .nav-toggle-label .hamburger::before {
  transform: rotate(45deg) translate(4px, 4px);
}
.nav-toggle-checkbox:checked ~ .nav-toggle-label .hamburger::after {
  transform: rotate(-45deg) translate(4px, -4px);
}

.site-nav {
  display: none;
  width: 100%;
  order: 3;
  padding-bottom: 0.75rem;
}

.nav-toggle-checkbox:checked ~ .site-nav {
  display: block;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nav-link {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--cream);
  text-decoration: none;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius);
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(245, 240, 232, 0.15);
  color: var(--gold);
}

.nav-link.active {
  font-weight: 700;
}

@media (min-width: 768px) {
  .nav-toggle-label { display: none; }

  .site-nav {
    display: block !important;
    width: auto;
    order: 0;
    padding-bottom: 0;
  }

  .nav-list {
    flex-direction: row;
    gap: 0.15rem;
  }
}

/* ============================================================
   HERO (homepage)
   ============================================================ */
.hero {
  background-color: var(--brown);
  background-image: linear-gradient(160deg, var(--green-dark) 0%, var(--brown) 60%);
  color: var(--cream);
  padding: 5rem 0 4rem;
  text-align: center;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.hero-title {
  font-family: var(--font-body);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--cream);
}

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-style: italic;
  color: var(--gold);
  margin-bottom: 2rem;
}

/* ============================================================
   SECTION CARDS (homepage)
   ============================================================ */
.section-cards-area {
  padding: 3.5rem 0;
  background-color: var(--cream-dark);
}

.section-heading {
  font-family: var(--font-ui);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 2rem;
  text-align: center;
  letter-spacing: 0.01em;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2);
  padding: 1.5rem 1.25rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.card:hover {
  box-shadow: 0 4px 18px rgba(61, 43, 31, 0.18);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.card-title {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card-title a {
  color: var(--brown);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--green);
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 1rem;
}

.card-link {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
  margin-top: auto;
}

.card-link:hover {
  color: var(--gold-dark);
  text-decoration: underline;
}

/* ============================================================
   HOME CONTENT (below cards)
   ============================================================ */
.home-content {
  padding: 3rem 0;
  background-color: var(--cream);
}

/* ============================================================
   PAGE HEADER (list & single pages)
   ============================================================ */
.page-header {
  background-color: var(--green);
  color: var(--cream);
  padding: 2.5rem 0 2rem;
}

.page-header h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.2;
  margin-top: 0.5rem;
}

.page-description {
  font-style: italic;
  color: rgba(245, 240, 232, 0.85);
  margin-top: 0.5rem;
  font-size: 1.05rem;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: rgba(245, 240, 232, 0.7);
}

.breadcrumb a {
  color: rgba(245, 240, 232, 0.85);
}

.breadcrumb li + li::before {
  content: '/';
  margin-right: 0.25rem;
  opacity: 0.5;
}

/* ============================================================
   POST LIST
   ============================================================ */
.page-body {
  padding: 2.5rem 0 3rem;
}

.section-intro {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-item article {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}

.post-title {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.post-title a {
  color: var(--brown);
  text-decoration: none;
}

.post-title a:hover {
  color: var(--green);
}

.post-date {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.post-summary {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.read-more {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
}

.read-more:hover {
  text-decoration: underline;
}

.no-content {
  font-style: italic;
  color: var(--text-muted);
  padding: 2rem 0;
}

/* ============================================================
   SINGLE / PROSE
   ============================================================ */
.single-content {
  padding: 2.5rem 0 3rem;
}

.prose {
  max-width: 68ch;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--font-body);
  color: var(--brown);
  line-height: 1.3;
  margin-top: 1.75em;
  margin-bottom: 0.6em;
}

.prose h2 { font-size: 1.55rem; }
.prose h3 { font-size: 1.25rem; }
.prose h4 { font-size: 1.05rem; }

.prose p {
  margin-bottom: 1.1em;
}

.prose ul, .prose ol {
  margin-left: 1.5rem;
  margin-bottom: 1.1em;
}

.prose li {
  margin-bottom: 0.35em;
}

.prose blockquote {
  border-left: 4px solid var(--gold);
  margin-left: 0;
  padding: 0.75rem 1.25rem;
  background-color: var(--cream-dark);
  color: var(--text-muted);
  font-style: italic;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1.1em;
}

.prose a {
  color: var(--green);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.prose img {
  border-radius: var(--radius);
  margin: 1.5em 0;
}

/* ============================================================
   PAGE NAV (prev/next)
   ============================================================ */
.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.page-nav-prev, .page-nav-next {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
}

.page-nav-prev:hover, .page-nav-next:hover {
  color: var(--gold-dark);
  text-decoration: underline;
}

.page-nav-next {
  margin-left: auto;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin-top: 2.5rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.pagination a, .pagination span {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--green);
  text-decoration: none;
}

.pagination .active a,
.pagination .active span {
  background-color: var(--green);
  border-color: var(--green);
  color: var(--cream);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background-color: var(--brown);
  color: var(--cream);
  margin-top: auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 2.5rem;
}

@media (min-width: 600px) {
  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .footer-inner {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-heading {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.site-footer p {
  font-size: 0.875rem;
  color: rgba(245, 240, 232, 0.8);
  margin-bottom: 0.4rem;
}

.nonprofit-info {
  font-size: 0.78rem !important;
  color: rgba(245, 240, 232, 0.55) !important;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: rgba(245, 240, 232, 0.8);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--gold);
  text-decoration: underline;
}

.site-footer a {
  color: rgba(245, 240, 232, 0.85);
}

.site-footer a:hover {
  color: var(--gold);
}

.footer-bottom {
  border-top: 1px solid rgba(245, 240, 232, 0.15);
  padding: 1rem 0;
}

.footer-bottom .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-bottom p {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: rgba(245, 240, 232, 0.45);
  margin: 0;
}

.footer-cms-link a {
  color: rgba(245, 240, 232, 0.4);
  text-decoration: none;
  font-size: 0.78rem;
}

.footer-cms-link a:hover {
  color: rgba(245, 240, 232, 0.75);
}

/* ============================================================
   SKIP LINK (accessibility)
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--gold);
  color: var(--brown);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-ui);
  font-weight: 700;
  z-index: 9999;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header, .site-footer, .nav-toggle-label, .page-nav { display: none; }
  body { background: white; color: black; }
  .prose { max-width: 100%; }
}
