/* ===== Oak Ridge HOA — site styles ===== */
:root {
  --brand: #2f5d50;        /* primary green — change to match your community */
  --brand-dark: #234539;
  --accent: #c8963e;       /* warm gold */
  --text: #1f2933;
  --muted: #5f6b76;
  --bg: #ffffff;
  --bg-alt: #f4f6f3;
  --border: #dfe4dd;
  --radius: 10px;
  --max: 1100px;
  font-size: 17px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
.container { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; z-index: 100; }

/* ---------- Header / nav ---------- */
.site-header { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand:hover { color: #fff; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; }
.site-nav a { color: #fff; text-decoration: none; padding: .45rem .7rem; border-radius: 6px; font-size: .95rem; }
.site-nav a:hover, .site-nav a:focus { background: rgba(255,255,255,.15); }
.nav-toggle, .nav-toggle-label { display: none; }

@media (max-width: 900px) {
  .nav-toggle-label { display: block; cursor: pointer; width: 32px; height: 24px; position: relative; }
  .nav-toggle-label span, .nav-toggle-label span::before, .nav-toggle-label span::after {
    content: ""; position: absolute; width: 100%; height: 3px; background: #fff; border-radius: 2px; left: 0;
  }
  .nav-toggle-label span { top: 10px; }
  .nav-toggle-label span::before { top: -8px; }
  .nav-toggle-label span::after { top: 8px; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--brand-dark); }
  .site-nav ul { flex-direction: column; padding: .5rem 1.25rem 1rem; }
  .nav-toggle:checked ~ .site-nav { display: block; }
}

/* ---------- Hero / headers ---------- */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; padding: 4.5rem 0 4rem; text-align: center;
}
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 .5rem; }
.lead { font-size: 1.2rem; color: inherit; opacity: .92; margin: 0 0 1.5rem; }
.hero-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.page-header { background: var(--bg-alt); border-bottom: 1px solid var(--border); padding: 2.5rem 0 2rem; margin-bottom: 2rem; }
.page-header h1 { margin: 0 0 .25rem; color: var(--brand-dark); }
.page-header .lead { color: var(--muted); margin: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; padding: .7rem 1.3rem; border-radius: 999px; font-weight: 600; text-decoration: none; border: 2px solid transparent; cursor: pointer; font-size: 1rem; }
.btn-primary { background: var(--accent); color: #1b1b1b; }
.btn-primary:hover { filter: brightness(1.07); color: #1b1b1b; }
.btn-secondary { border-color: #fff; color: #fff; }
.btn-secondary:hover { background: rgba(255,255,255,.12); color: #fff; }
.page-header .btn-secondary, .card .btn-secondary { border-color: var(--brand); color: var(--brand); }

/* ---------- Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: -2rem 0 2.5rem; }
.tile {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem;
  text-decoration: none; color: var(--text); box-shadow: 0 4px 14px rgba(0,0,0,.06); transition: transform .15s, box-shadow .15s;
  border-top: 4px solid var(--accent);
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.1); color: var(--text); }
.tile h2 { margin: 0 0 .35rem; font-size: 1.1rem; color: var(--brand-dark); }
.tile p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- Cards / lists ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin: 2rem auto 3rem; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
.section-title { color: var(--brand-dark); border-bottom: 2px solid var(--accent); padding-bottom: .3rem; }
.card-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 1rem; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.card h2, .card h3 { margin: .15rem 0 .35rem; font-size: 1.15rem; }
.card h2 a, .card h3 a { text-decoration: none; }
.card p { margin: .25rem 0; }
.card time, .meta { color: var(--muted); font-size: .9rem; }
.more { font-weight: 600; text-decoration: none; }

.event { display: flex; gap: 1rem; align-items: flex-start; }
.event-date {
  flex: 0 0 64px; text-align: center; background: var(--brand); color: #fff; border-radius: 8px; padding: .4rem 0; line-height: 1.1;
}
.event-date .month { display: block; text-transform: uppercase; font-size: .8rem; letter-spacing: .05em; }
.event-date .day { display: block; font-size: 1.6rem; font-weight: 700; }

/* ---------- Prose (Markdown content) ---------- */
.prose { max-width: 820px; margin-bottom: 3rem; }
.prose h2 { color: var(--brand-dark); margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
.prose th { background: var(--bg-alt); }
.prose code { background: var(--bg-alt); padding: .1rem .35rem; border-radius: 4px; }
.prose blockquote { border-left: 4px solid var(--accent); margin: 1rem 0; padding: .25rem 1rem; background: var(--bg-alt); }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 999px; padding: .2rem .75rem; font-size: .85rem; text-decoration: none; }
.notice { background: #fff7e6; border-left: 4px solid var(--accent); padding: .75rem 1rem; border-radius: 6px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 1.5rem; margin-bottom: 3rem; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-form { display: grid; gap: .9rem; }
.contact-form label { display: grid; gap: .3rem; font-weight: 600; font-size: .95rem; }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 6px; font-weight: 400;
}
.contact-form button { justify-self: start; }

/* ---------- Footer ---------- */
.site-footer { background: #1f2a26; color: #d7dfdb; padding: 2.5rem 0 1rem; margin-top: 2rem; }
.site-footer h3 { color: #fff; font-size: 1rem; margin: 0 0 .5rem; }
.site-footer a { color: #f0d39d; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 1.5rem; padding-top: 1rem; font-size: .85rem; }

/* ---------- Tags index (tag cloud) ---------- */
.tags-cloud .tag { font-size: 1rem; padding: .45rem 1rem; color: var(--brand-dark); }
.tags-cloud .tag:hover { background: #ecf1ec; border-color: var(--brand); }
.tag-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.4rem; height: 1.4rem; margin-left: .4rem; padding: 0 .35rem;
  background: var(--brand); color: #fff; border-radius: 999px; font-size: .75rem; font-weight: 700;
}

/* ---------- Accordion (Financials, Meeting Minutes, News, Events) ---------- */
.accordion { margin: 0 0 2rem; display: grid; gap: .6rem; }
.accordion-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.accordion-item summary {
  display: flex; align-items: center; gap: .85rem; cursor: pointer; list-style: none;
  padding: .85rem 1.1rem; font-weight: 700; color: var(--brand-dark); background: var(--bg-alt);
}
.accordion-item summary::-webkit-details-marker { display: none; }
.accordion-item summary::marker { content: ""; }
.accordion-item summary::before {
  content: "+"; display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand); color: #fff;
  font-size: 1.3rem; font-weight: 700; line-height: 1; flex: none;
}
.accordion-item[open] summary::before { content: "–"; }
.accordion-item summary:hover { background: #ecf1ec; }
.accordion-year { font-size: 1.05rem; }
.accordion-count { margin-left: auto; color: var(--muted); font-weight: 400; font-size: .85rem; }
.accordion-item > *:not(summary) { padding: .25rem 1.25rem 1.25rem; }
.accordion-item > ul:not(.card-list) { padding-left: 3.25rem; margin: .5rem 0; }
.accordion-item li { margin: .35rem 0; }
.accordion-item .card-list { margin-top: .25rem; }

/* ---------- Expanding header search ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.site-search { position: relative; display: flex; align-items: center; margin-left: .5rem; }

.search-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff; cursor: pointer; flex: none;
  transition: background .15s;
}
.search-toggle:hover, .search-toggle:focus-visible { background: rgba(255,255,255,.25); outline: none; }
.search-toggle .icon-close { display: none; }
.site-search.is-open .search-toggle .icon-search { display: none; }
.site-search.is-open .search-toggle .icon-close { display: block; }

/* Collapsed: zero width. Open: slides out to the left of the icon. */
/* Overlays the nav (doesn't push it around) and slides out left from the icon. */
.search-panel {
  position: absolute; right: 50px; top: 50%; transform: translateY(-50%);
  width: 0; opacity: 0; pointer-events: none;
  transition: width .25s ease, opacity .2s ease;
}
.site-search.is-open .search-panel { width: 340px; opacity: 1; pointer-events: auto; }
/* Fade the nav while search is open so the input doesn't sit on top of menu text. */
@media (min-width: 901px) {
  .site-nav { transition: opacity .2s ease; }
  .header-inner:has(.site-search.is-open) .site-nav { opacity: 0; pointer-events: none; }
}

.search-panel input {
  width: 100%; font: inherit; font-size: .95rem; color: var(--text);
  padding: .55rem .9rem; border: 2px solid transparent; border-radius: 999px; background: #fff;
}
.search-panel input:focus { outline: none; border-color: var(--accent); }
.search-panel input::-webkit-search-cancel-button { display: none; }

/* Dropdown */
.search-results {
  position: absolute; top: calc(100% + .6rem); right: -50px; width: 440px; z-index: 70;
  max-height: 70vh; overflow-y: auto;
  background: #fff; color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.2);
}
.search-group {
  padding: .5rem .9rem .3rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.search-item {
  display: flex; gap: .7rem; align-items: flex-start; padding: .65rem .9rem;
  text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border);
}
.search-item:last-child { border-bottom: 0; }
.search-item:hover, .search-item.is-active { background: #ecf1ec; }
.search-badge {
  flex: none; min-width: 3.4rem; text-align: center; margin-top: .1rem;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #fff; background: var(--brand); border-radius: 4px; padding: .2rem .4rem;
}
.search-item.is-tag .search-badge { background: var(--accent); min-width: 1.6rem; font-size: .85rem; padding: .05rem .4rem; }
.search-body { display: grid; gap: .1rem; min-width: 0; }
.search-title { font-weight: 700; color: var(--brand-dark); }
.search-text { font-size: .84rem; color: var(--muted); }
.search-item mark { background: #fbe7bf; color: inherit; border-radius: 2px; padding: 0 .1em; }
.search-empty { padding: 1rem; color: var(--muted); }

/* Mobile: search opens as a full-width bar under the header */
@media (max-width: 900px) {
  .site-search { position: static; margin-left: auto; margin-right: .75rem; }
  .search-panel {
    left: 0; right: 0; top: 64px; transform: none; width: auto;
    background: var(--brand-dark); padding: 0 1rem; max-height: 0;
    transition: max-height .25s ease, opacity .2s ease, padding .25s ease;
  }
  .site-search.is-open .search-panel { width: auto; max-height: 80vh; padding: .75rem 1rem; margin: 0; }
  .search-results { left: 1rem; right: 1rem; width: auto; top: calc(100% - .25rem); }
}
@media print { .site-search { display: none; } }

@media print {
  .site-header, .site-footer, .hero-actions { display: none; }
}
