/* ========================================
   Estates of Pinewood - Site Styles
   ======================================== */

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

:root {
  --color-primary: #2c6e49;
  --color-primary-dark: #1b4332;
  --color-primary-light: #40916c;
  --color-accent: #dda15e;
  --color-text: #2d3436;
  --color-text-light: #636e72;
  --color-bg: #fafafa;
  --color-white: #ffffff;
  --color-border: #e0e0e0;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;
  --max-width: 1100px;
  --radius: 8px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-primary-dark);
  line-height: 1.3;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Navigation --- */
.site-header {
  background: var(--color-white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.nav-brand:hover {
  color: var(--color-primary);
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-menu a {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.3s ease;
}

/* --- Hero (Home Page) --- */
.hero {
  position: relative;
  height: 70vh;
  min-height: 400px;
  max-height: 650px;
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 95%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(27, 67, 50, 0.15) 0%, rgba(27, 67, 50, 0.4) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.hero-logo {
  max-width: 480px;
  width: 80%;
  height: auto;
  margin-top: 4rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.hero-overlay h1 {
  font-size: 3rem;
  color: var(--color-white);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: 0.5rem;
}

.hero-overlay p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  font-weight: 400;
}

/* --- Content Sections --- */
.content-section {
  padding: 3.5rem 0;
}

.welcome {
  background: var(--color-white);
  font-size: 1.1rem;
}

.welcome p {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  color: var(--color-text-light);
}

.welcome a {
  font-weight: 500;
  border-bottom: 1px solid var(--color-primary-light);
}

.welcome a:hover {
  border-bottom-color: var(--color-primary-dark);
}

/* --- Card Grid --- */
.highlights {
  background: var(--color-bg);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 640px;
  margin: 0 auto;
}

.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
  color: var(--color-text);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  color: var(--color-text);
}

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

.card h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary-dark);
}

.card p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* --- Page Header --- */
.page-header {
  background: var(--color-primary-dark);
  color: var(--color-white);
  padding: 3rem 0;
  text-align: center;
}

.page-header h1 {
  color: var(--color-white);
  font-size: 2.25rem;
}

/* --- Resources Page --- */
.resources-page h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
}

.resources-page h2:first-child {
  margin-top: 0;
}

.resources-page ul {
  list-style: none;
  padding: 0;
}

.resources-page li {
  padding: 0.5rem 0;
}

.resources-page li a {
  font-weight: 500;
}

.resources-page ul ul {
  padding-left: 1.5rem;
}

.resources-page ul ul li {
  padding: 0.25rem 0;
}

.resources-page li a::before {
  content: "\2192\00a0";
  color: var(--color-accent);
}

/* --- Contact Page --- */
.contact-page {
  max-width: 600px;
}

.contact-page p {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.contact-page a {
  font-weight: 500;
  border-bottom: 1px solid var(--color-primary-light);
}

.contact-page a:hover {
  border-bottom-color: var(--color-primary-dark);
}

/* --- Page Header Extras --- */
.page-header-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  margin-top: 0.25rem;
}

.page-header-breadcrumb {
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.page-header-breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.page-header-breadcrumb a:hover {
  color: var(--color-white);
}

/* --- Covenants TOC --- */
.covenants-toc > p:first-child {
  max-width: 720px;
  color: var(--color-text-light);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.toc-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-border);
  border-bottom: none;
  background: var(--color-white);
  color: var(--color-text);
  transition: background 0.15s ease, transform 0.15s ease;
}

.toc-item:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}

.toc-item:last-child {
  border-bottom: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius) var(--radius);
}

.toc-item:hover {
  background: #f0f7f4;
  color: var(--color-text);
}

.toc-item-number {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-primary);
  min-width: 5.5rem;
  white-space: nowrap;
}

.toc-item-title {
  flex: 1;
  font-weight: 500;
}

.toc-item-arrow {
  color: var(--color-primary-light);
  font-size: 1.1rem;
}

.covenants-pdf-link {
  margin-top: 2rem;
  color: var(--color-text-light);
  font-size: 0.95rem;
}

/* --- Covenants Article --- */
.covenants-article h2 {
  font-size: 1.35rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border);
}

.covenants-article h2:first-child {
  margin-top: 0;
}

.covenants-article h3 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.covenants-article p {
  margin-bottom: 1rem;
}

.covenants-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--color-border);
}

.covenants-nav-link {
  font-weight: 500;
  font-size: 0.9rem;
}

.covenants-nav-prev {
  text-align: left;
  max-width: 35%;
}

.covenants-nav-next {
  text-align: right;
  max-width: 35%;
}

.covenants-nav-toc {
  white-space: nowrap;
}

/* --- Footer --- */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 3rem 0 0;
  margin-top: auto;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.footer-col h4 {
  color: var(--color-white);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.footer-col p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  padding: 0.2rem 0;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--color-white);
}

.footer-bottom {
  text-align: center;
  padding: 1.5rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-menu li:last-child {
    border-bottom: none;
  }

  .hero-overlay h1 {
    font-size: 2rem;
  }

  .hero-overlay p {
    font-size: 1rem;
  }

  .hero {
    height: 50vh;
    min-height: 300px;
  }

  .content-section {
    padding: 2.5rem 0;
  }

  .page-header {
    padding: 2rem 0;
  }

  .page-header h1 {
    font-size: 1.75rem;
  }

  .toc-item-number {
    min-width: auto;
  }

  .covenants-nav {
    flex-direction: column;
    gap: 0.75rem;
  }

  .covenants-nav-prev,
  .covenants-nav-next {
    max-width: 100%;
    text-align: center;
  }
}
