:root {
  --gap: 0rem;
  --bg: #fff;
  --ink: #0f172a;
  --ink-muted: #334155;
  --card: #ffffff;
  --accent: #000;
  --radius: 0;
  --brand-color-1: #dc0000;
  --brand-color-2: #b00203;
}
html {-webkit-text-size-adjust: 100%;}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 "Trebuchet MS", Arial;
  color: var(--ink);
  background: url("../img/TreeTown_Background.gif");
  padding: 0.75em 0;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h2, .caption {
  font-family: "Fredoka", sans-serif;
  font-optical-sizing: auto;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  text-align: center;
  font-weight: 300;
  font-style: normal;
  font-variation-settings: "wdth" 100;
  line-height: 1;
  text-wrap: balance;
  margin-bottom: 1.5em;
}
.tight-top {margin-top: 0 !important;}
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: var(--gap);
  top: var(--gap);
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  background: #111827;
  color: #fff;
  border-radius: 8px;
  z-index: 1000;
  outline: 2px solid #fff;
  outline-offset: 2px;
  text-decoration: none;
}
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.page {
  display: grid;
  grid-template-areas:
    "header"
    "nav"
    "main"
    "footer";
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr auto;
  gap: var(--gap);
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  min-height: calc(100vh - 1.5em); /* match body padding x2 */
  min-height: calc(100dvh - 1.5em); /* match body padding x2 */
  background-color: #fff;
  border-radius: 1em;
}

header { 
  grid-area: header;
  border-top-left-radius: 1em;
  border-top-right-radius: 1em;
  padding-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0 !important;
}
nav    { grid-area: nav; }
main   { grid-area: main;}
footer { grid-area: footer; } 

header, nav, main, footer {
  background: var(--card);
  padding: clamp(0.75rem, 1.2vw, 0.75rem);
}
h1 {
  margin-top: 0;
  font-weight: normal;
  letter-spacing: -0.02em;
  font-size: 1.5rem;
}
header h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  line-height: 1.2;
}
header p { margin: 0; color: var(--ink-muted); }
header img {width: 100%;}
.red {color: var(--brand-color-1);}
.green {color: #008000;}
.black {color: #000;}
.centered {text-align: center;}
section p, section ul {font-size: 0.95rem;}

nav {
  position: relative; 
  border-top: none;
  border-bottom: none;
  padding: 0.5em 1em; 
  margin: 0.5em 0 1.5em ;
}
p.emphasis {
  font-weight: bold;
  color: var(--brand-color-2);
  text-wrap: balance;
  text-align: center;
}
.menu-toggle {
  display: block; 
  position: absolute;
  top: 0;
  right: 0.5rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10;
}
.menu-toggle .hamburger-icon {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--ink);
  position: relative;
  transition: background 0.2s ease-in-out;
}
.menu-toggle .hamburger-icon::before,
.menu-toggle .hamburger-icon::after {
  content: '';
  display: block;
  width: 24px;
  height: 3px;
  background: var(--ink);
  position: absolute;
  transition: all 0.2s ease-in-out;
}
.menu-toggle .hamburger-icon::before { top: -8px; }
.menu-toggle .hamburger-icon::after { top: 8px; }

.menu-toggle[aria-expanded="true"] .hamburger-icon {
  background: transparent;
}
.menu-toggle[aria-expanded="true"] .hamburger-icon::before {
  transform: rotate(45deg) translate(5px, 6px);
}
.menu-toggle[aria-expanded="true"] .hamburger-icon::after {
  transform: rotate(-45deg) translate(5px, -6px);
}
.menu {
  display: none; 
  list-style: none;
  font-size: 0.95em;
  margin: 0;
  padding: 0;
  width: 100%;
  margin-top: 0.75rem; 
}
.menu.is-open {
  display: block;
  padding-top: 0.75rem;
}
.menu li {
  border-top: 1px solid #eee;
}
.menu a {
  display: block; /* Full-width links */
  padding: 0.75rem 0.5rem;
  text-align: center;
}
.menu a[aria-current="page"] {
  background: var(--brand-color-1);
  font-weight: 600;
  color: #fff;
}
.menu a:hover {
  background: var(--brand-color-1);
  color: #fff;
  text-decoration: none;
}
#home-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 2em;
  width: 90%;
  max-width: 500px;
  margin: 0 auto;
}
#home-grid h2 {
  text-align: left;
  font-size: 1.5rem;
  margin: 0;
}
#home-grid section {
  border-bottom: 1px solid var(--brand-color-1);
}
#home-grid section img {
  width: 100%;
  max-width: 300px;
}


@media (min-width: 751px) {
  nav {
    padding: 0.5em 0em;
    position: static;
    border-top: 2px solid #e8e8e8;
    border-bottom: 2px solid #e8e8e8;
  }
  nav#nav-1 {
    width: calc(100% - 2em);
    margin: 0.5em auto 1em;
  }
  h1 {
    margin-top: 0.25em;
  }
  .menu-toggle {
    display: none; /* Hide hamburger on desktop */
  }

  .menu {
    display: flex !important;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0 auto;
    width: auto;
    justify-content: center;
    margin-top: 0;
    padding-top: 0;
  }
  .menu li {
    border-top: none;
  }
  .menu a {
    display: inline-block;
    padding: 0.25rem 1em;
  }
  .menu a[aria-current="page"] {
    border-radius: 0.25em;
  }
  .menu a:hover {
    border-radius: 0.25em;
  }
  #home-grid {
    grid-template-columns: 1fr 1fr 1fr;
    max-width: none;
  }
  #home-grid section {
    border-bottom: none;
  }
}

main#main {
  padding: 0 2rem 1rem;
}

footer {
  padding: 0;
  background-color: transparent;
}
footer p {
  padding: 1em;
  text-align: left;
}
footer p.intro {
  text-align: center;
  font-weight: bold;
  font-size: 0.9em;
  margin: 1em 0 0;
}

.footer-main {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background-color: var(--brand-color-1);
  border-top: 1em solid var(--brand-color-2);
  color: #fff;
  font-size: 0.85rem;
  border-bottom-left-radius: 1em;
  border-bottom-right-radius: 1em;
}
.footer-main p {
  margin-top: 0;
  margin-bottom: 0;
  text-wrap: balance;
  line-height: 1.15;
}
.nobreak {white-space: nowrap;}

.footer-main nav {
  background-color: transparent;
  border: none;
  margin: 0 1em;
}
footer .small {font-size: 0.9em;}

.slideshow-container {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
}
.slide {
  display: none;
}
.slide img {
  width: 100%;
  vertical-align: middle; 
}
.caption {
  position: absolute;
  bottom: 20%;
  width: max-content;
  left: 0;
  background-color: rgba(255,255,255,0.7);
  color: #000;
  padding: 0.5em 0.75em 0.5em 0.5em;
  font-size: 1.6rem;
  font-weight: 400;
  text-align: center;
  border-right: 8px solid var(--brand-color-2);
 }
.dots-container {
  text-align: center;
  padding: 10px 0;
  position: relative;
  bottom: 0;
  width: 100%;
  z-index: 5;
}
.dot {
  cursor: pointer;
  height: 1.25em;
  width: 1.25em;
  margin: 0 0.5em;
  background-color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.6s ease;
}
.active-dot, .dot:hover {
  border-color: var(--brand-color-1);
  background-color: #e8e8e8;
}

.fade {
  animation-name: fade;
  animation-duration: 1.0s;
}
@keyframes fade {
  from {opacity: .4}
  to {opacity: 1}
}

@media (max-width: 600px) {
  .caption {
    padding: 8px;
    bottom: 10%
  }
  .dots-container {
    margin-top: 0.5em;
  }
  .dot {
    height: 1.2em;
    width: 1.2em;
  }
  main#main {
    padding: 0 1rem 1rem;
  }
}

footer .social-block {
  display: flex;
  gap: 0.5rem;
  align-items: center; /* Vertically align icons with text */
  flex-shrink: 0; /* Prevent icons from being squished */
}