/* 0) Let the page fill the full viewport */
html, body {
  height: 100%;
  margin: 0;
}

body {
  padding: 1rem;
  background-color: white;
  color: black;
  transition: background-color 0.3s, color 0.3s;
  line-height: 1.6;
}

/* === Dark Mode Overrides === */
html.dark-mode,
html.dark-mode body {
  background-color: #202124;
  color: #dddddd;
}
html.dark-mode a,
html.dark-mode .sidebar-menu a,
html.dark-mode .social-links a {
  color: #AECBFA;
}

html.dark-mode #search-input,
html.dark-mode .contact-form input,
html.dark-mode .contact-form textarea {
  border-color: #4a4f58;
  background: #2b2d31;
  color: #f1f3f4;
}

html.dark-mode .button-link.secondary {
  border-color: #AECBFA;
  color: #AECBFA !important;
}

html.dark-mode #search-input:focus {
  border-color: #8fd19e;
  box-shadow: 0 0 0 3px rgba(143, 209, 158, 0.16);
}

html.dark-mode header ul#search-results li {
  border-left-color: #8fd19e;
}

html.dark-mode header ul#search-results small {
  color: #aeb6c2;
}

html.dark-mode figcaption {
  color: #dddddd !important;
}

/* === Day Mode Base & Link Colors === */
html:not(.dark-mode),
html:not(.dark-mode) body {
  background-color: #FAFAFA;
  color: #333333;
}
html:not(.dark-mode) a,
html:not(.dark-mode) .sidebar-menu a,
html:not(.dark-mode) .social-links a {
  color: #1D4ED8;
}

/* === Dark Mode Toggle Button === */
.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s ease;
  color: inherit;
}
.theme-toggle:hover {
  transform: rotate(15deg);
}

.theme-toggle i {
  font-size: 1.2rem;
}

/* === Base (mobile-first): simple block layout === */
.wrapper {
  max-width: 100%;
  margin: 0 auto;
}

/* Sidebar appears first in DOM order on mobile */
.sidebar {
  position: static;
  margin-bottom: 1.5rem;
}

.content {
  /* main content follows below */
  max-width: 820px;
}

/* Sidebar internals */
.sidebar-menu h2,
.social-links h2 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}
.sidebar-menu ul,
.social-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-menu li + li,
.social-links li + li {
  margin-top: 0.5rem;
}
.sidebar-menu a,
.social-links a {
  text-decoration: none;
  color: inherit;
}

.sidebar header img {
  max-width: 160px;
  border-radius: 8px;
}

#search-input,
.contact-form input,
.contact-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
  color: #222;
}

.contact-form textarea {
  min-height: 12rem;
  resize: vertical;
}

.contact-form button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  border: 1px solid #2f6f4e;
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  background: #2f6f4e;
  color: #fff !important;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button-link.secondary {
  background: transparent;
  color: #2f6f4e !important;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* Small-phone tweak */
@media screen and (max-width: 600px) {
  body {
    padding: 0.5rem;
  }
  .sidebar {
    margin-bottom: 1rem;
  }
}

/* === Desktop enhancements (tablet and up) === */
@media screen and (min-width: 768px) {
  .wrapper {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
  }

  .sidebar {
    flex: 0 0 300px;
    position: sticky;
    top: 1rem;
    align-self: flex-start;
    margin-bottom: 0;
  }

  .content {
    flex: 1;
  }
  /* Let the whole page scroll instead of inner section */
  .content section {
    overflow: visible;
    max-height: none;
  }
}

/* === Social Links: horizontal icons only === */
.social-links {
  margin-top: 2rem;
}

.social-links h2 {
  margin-bottom: 0.25rem;
}

.social-links ul {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0;
  margin: 0;
}
.social-links a.icon-only {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0;
  line-height: 0;
}
.social-links a.icon-only .fab,
.social-links a.icon-only .ai {
  font-size: 1.5rem;
  line-height: 1;
}
.social-links a:hover {
  text-decoration: underline;
}

/* === Responsive image gallery using CSS Grid with 1:1 square tiles === */
.gallery {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0;
}

.gallery:has(> a:nth-child(6):last-child) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media screen and (max-width: 640px) {
  .gallery,
  .gallery:has(> a:nth-child(6):last-child) {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}
.gallery a {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}

/* numbered-circle markers for waypoints */
.number-marker {
  background: #333;
  color: #fff;
  font-weight: bold;
  font-size: 12px;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border: 2px solid #fff;
  border-radius: 50%;
}

/* ─── Sidebar Search Spacing ───────────────── */
header form#search-form {
  margin: 0.85rem 0 0.4rem;
}

#search-input {
  max-width: 100%;
  min-height: 2.35rem;
  border-radius: 999px;
}

#search-input:focus {
  border-color: #2f6f4e;
  box-shadow: 0 0 0 3px rgba(47, 111, 78, 0.14);
  outline: none;
}

header ul#search-results {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

header ul#search-results:empty {
  display: none;
}

header ul#search-results li {
  border-left: 3px solid #2f6f4e;
  padding: 0.25rem 0 0.25rem 0.55rem;
  font-size: 0.92rem;
  line-height: 1.35;
}

header ul#search-results small {
  display: block;
  margin-top: 0.1rem;
  color: #667085;
}
/* ──────────────────────────────────────────── */

/* === Icon baseline adjustment === */
.social-links a.icon-only .fa-instagram {
  transform: translateY(4px);
}

.social-links a.icon-only .fa-linkedin {
  transform: translateY(0px);
}

.social-links a.icon-only .ai-inaturalist {
  transform: translateY(1px);
}

/* ─── Mobile separator under the social links ─── */
@media screen and (max-width: 767px) {
  .social-links {
    margin-bottom: 1.5rem;             /* space below the icons */
    padding-bottom: 1.5rem;            /* space above the line */
    border-bottom: 4px double #888;    /* a nice double line */
  }
}

/* === Global heading normalization === */
h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.50rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

/* === Improve heading sizes inside blog posts === */
.post-header h1 {
  font-size: 1.75rem;  /* blog post title */
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.post-body h2 {
  font-size: 1.25rem;  /* section headings inside posts */
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

/* === Tame headings inside blog excerpts on homepage === */
.post-excerpt h2 {
  font-size: 1.15rem; /* match h3 or slightly smaller */
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

/* === Font type === */

body {
  font-family: 'Inter', sans-serif;
}

h1, h2, h3 {
  font-family: 'Merriweather', serif;
}

/* === Homepage === */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #d8dee4;
}

.home-hero h1 {
  margin-top: 0;
}

.home-hero img {
  width: min(220px, 70vw);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.eyebrow {
  margin-bottom: 0.3rem;
  color: #2f6f4e;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lede {
  font-size: 1.08rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0 2rem;
}

.feature-card {
  display: block;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  padding: 0.9rem;
  color: inherit !important;
  text-decoration: none;
}

.feature-card span {
  display: block;
  margin-bottom: 0.35rem;
  color: #2f6f4e;
  font-weight: 700;
}

.post-excerpt {
  border-top: 1px solid #d8dee4;
  padding: 1rem 0;
}

.post-excerpt h3 {
  margin-top: 0;
}

.post-excerpt footer {
  margin-top: 0.5rem;
}

.read-more {
  font-weight: 600;
}

html.dark-mode .home-hero,
html.dark-mode .feature-card,
html.dark-mode .post-excerpt {
  border-color: #4a4f58;
}

html.dark-mode .eyebrow,
html.dark-mode .feature-card span {
  color: #8fd19e;
}

html.dark-mode .button-link.secondary {
  border-color: #AECBFA;
  color: #AECBFA !important;
}

@media screen and (min-width: 900px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr) 220px;
  }
}


/* === Tags === */
.post-tag {
  font-weight: 600;
}

.tag-post-list {
  margin-top: 0.35rem;
  padding-left: 1.2rem;
}

.tag-post-list small {
  display: block;
  color: #667085;
}

html.dark-mode .tag-post-list small {
  color: #aeb6c2;
}
