/* Wombat Fauna and Rescue - site stylesheet
   Colours sampled directly from the original site's own image assets
   (background tile, nav button sprites) to stay faithful to the original. */

:root {
  --tan-bg: #e6e3c0;
  --cream: #f2ecd9;
  --white: #ffffff;
  --green-light: #7a9716;
  --green-dark: #5c7410;
  --green-darker: #3d4d0b;
  --blue-light: #3aa3bf;
  --blue-dark: #08728f;
  --text: #2b2b1f;
  --text-soft: #4a4a3a;
  --max-width: 1200px;
  --sidebar-w: 220px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--tan-bg) url("images/bg-tile.png") repeat;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  line-height: 1.25;
  color: var(--green-darker);
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }
a { color: var(--green-dark); text-decoration: underline; }
a:hover, a:focus { color: var(--green-darker); }
img { max-width: 100%; height: auto; display: block; }

.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;
}

/* ---------- Page frame: cream paper panel floating on the tan/leaf backdrop ---------- */

.page-frame {
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--cream);
  box-shadow: 0 0 0 1px rgba(61,77,11,0.15), 0 6px 24px rgba(0,0,0,0.12);
  min-height: 100vh;
}

/* ---------- Header ---------- */

.site-header { background: var(--green-darker); color: var(--white); }

.header-bar {
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  color: var(--white);
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}
.brand:hover, .brand:focus { color: var(--cream); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span { display: block; width: 20px; height: 2px; margin: 0 auto; background: var(--white); }

/* ---------- Layout: sidebar nav + main content ---------- */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}

/* ---------- Sidebar nav (desktop) ---------- */

.site-nav { background: transparent; padding: 1.25rem 0.75rem; }
.site-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.site-nav li { position: relative; }

.site-nav a {
  display: block;
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  padding: 0.65rem 0.9rem;
  border-radius: 5px;
  background: linear-gradient(180deg, var(--green-light), var(--green-dark));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 1px 2px rgba(0,0,0,0.2);
  border: 1px solid var(--green-darker);
}
.site-nav a:hover, .site-nav a:focus {
  background: linear-gradient(180deg, #8bab1c, var(--green-light));
  color: var(--white);
}
.site-nav a[aria-current="page"] {
  background: linear-gradient(180deg, var(--blue-light), var(--blue-dark));
  border-color: var(--blue-dark);
}

.site-nav .has-submenu > a::after { content: " \25BE"; font-size: 0.7em; float: right; margin-top: 0.15em; }
.site-nav .submenu {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0 0 0 0.75rem;
  display: none;
  flex-direction: column;
  gap: 0.3rem;
}
.site-nav .has-submenu.is-open .submenu,
.site-nav .has-submenu:hover .submenu,
.site-nav .has-submenu:focus-within .submenu {
  display: flex;
}
.site-nav .submenu a {
  font-weight: 400;
  font-size: 0.85rem;
  padding: 0.5rem 0.8rem;
}

/* ---------- Sections ---------- */

.section { padding: 2.5rem 1.25rem; }
.section-inner { max-width: 900px; margin: 0 auto; }
.section--cream { background: var(--cream); }
.section--white { background: var(--white); }
.section--green { background: linear-gradient(180deg, var(--green-light), var(--green-dark)); color: var(--white); }
.section--green h1, .section--green h2 { color: var(--white); }
.section--dark { background: var(--green-darker); color: var(--white); }
.section--dark h1, .section--dark h2 { color: var(--white); }
.section--center { text-align: center; }
.section--center .section-inner { display: flex; flex-direction: column; align-items: center; }
.lede { font-size: 1.05rem; max-width: 65em; }

/* ---------- Page layout: hero + content + photo grid ---------- */

.page-hero-wrap {
  max-width: 500px;
  margin: 0 auto 1.5rem;
}
.page-hero {
  display: block;
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
  border: 4px solid var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
}
.content-grid .body-text { min-width: 0; }
.content-grid .side-photos {
  display: grid;
  gap: 1rem;
}
.content-grid .side-photos figure { margin: 0; }
.content-grid .side-photos img { border-radius: 6px; width: 100%; border: 4px solid var(--white); box-shadow: 0 2px 6px rgba(0,0,0,0.12); }
.content-grid .side-photos figcaption {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-top: 0.35rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.photo-grid figure { margin: 0; }
.photo-grid img { border-radius: 6px; width: 100%; aspect-ratio: 4/3; object-fit: cover; border: 4px solid var(--white); box-shadow: 0 2px 6px rgba(0,0,0,0.12); }
.photo-grid figcaption { font-size: 0.85rem; color: var(--text-soft); margin-top: 0.3rem; }

/* ---------- Hub pages (species index cards) ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  text-decoration: none;
  color: var(--text);
  display: block;
}
.card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 0; border: none; box-shadow: none; }
.card-photo-placeholder { aspect-ratio: 4/3; background: var(--tan-bg); }
.card .card-body { padding: 0.9rem 1rem; }
.card h3 { margin: 0; color: var(--green-darker); }
.card:hover h3, .card:focus h3 { color: var(--green-dark); }

/* ---------- Buttons / contact ---------- */

.btn {
  display: inline-block;
  background: linear-gradient(180deg, var(--green-light), var(--green-dark));
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  padding: 0.7rem 1.4rem;
  border-radius: 5px;
  margin: 0.35rem 0.35rem 0.35rem 0;
  border: 1px solid var(--green-darker);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn:hover, .btn:focus { background: linear-gradient(180deg, #8bab1c, var(--green-light)); color: var(--white); }

.map-embed {
  position: relative; width: 100%; padding-bottom: 45%;
  border-radius: 6px; overflow: hidden; background: #eee;
}
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--green-darker);
  color: var(--white);
  text-align: center;
  padding: 1.75rem 1.25rem;
}
.site-footer p { margin: 0 0 0.4em; font-size: 0.9rem; }
.site-footer a { color: var(--cream); }
.site-footer p:last-child { margin-bottom: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .content-grid { grid-template-columns: 1fr; }
  .content-grid .side-photos { grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); }
}

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .nav-toggle { display: flex; }
  .site-nav { display: none; background: var(--green-darker); padding: 0.5rem; }
  .site-nav.is-open { display: block; }
  .site-nav .submenu { padding-left: 0.5rem; }
  .header-bar { flex-wrap: wrap; }
}
