:root {
  --color-text: #333;
  --color-heading: #222;
  --color-muted: #767676;
  --color-muted-2: #666;
  --color-border: #eee;
  --color-surface: #ffffff;
  --color-bg: #ffffff;
  --font-body: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --max-width: 1000px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.66;
}

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

a { color: var(--color-heading); text-decoration: none; }
a:hover, a:focus { color: var(--color-muted); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Hero / custom header ---------- */
.site-header { position: relative; }

.custom-header {
  position: relative;
  height: 220px;
  overflow: hidden;
}

body.is-home .custom-header { height: 300px; }

/* On the homepage the hero fills the viewport so the nav bar sits at the
   bottom edge on load and the page content only appears once the visitor
   scrolls — matching the original site. .navigation-top lives outside
   .site-header (a sibling in normal flow, not nested inside it) so its
   position: sticky has the whole page as room to stick within — nesting it
   inside a box sized to end flush with the nav would trap the sticky
   element there once scrolled past. Because of that split, the hero can't
   use flexbox to auto-absorb "100vh minus the nav's height" the way a
   shared flex column would; a tiny inline script in header.html measures
   the nav's real rendered height and sets this min-height precisely once
   the page loads. Without JS it falls back to a full 100vh, which pushes
   the nav just below the fold. */
body.is-home .custom-header {
  height: auto;
  min-height: 100vh;
}

.custom-header-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.custom-header-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.35) 75%, rgba(0,0,0,0.35) 100%);
}

.custom-header-media img {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  max-width: none;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

.site-branding {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1rem;
  z-index: 3;
}

.site-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-title a { color: #fff; }

.site-description {
  margin: 0.35em 0 0;
  color: #fff;
  opacity: 0.85;
  font-size: 0.8125rem;
}

@media (min-width: 700px) {
  body.is-home .site-title { font-size: 2.2rem; }
  body.is-home .site-description { font-size: 1rem; }
}

/* ---------- Navigation ---------- */
.navigation-top {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  font-size: 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.main-navigation { display: flex; align-items: center; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0.85em 0;
}
.nav-toggle__bar { display: block; height: 2px; width: 100%; background: var(--color-heading); }

.menu {
  display: flex;
  gap: 0;
}
.menu-item {
  position: relative;
  border-bottom: none;
}
.menu-item > a {
  display: block;
  padding: 0.9em 1.2em;
  color: var(--color-heading);
  font-weight: 600;
  transition: color 0.2s;
}
.menu-item > a:hover { color: var(--color-muted); }
.menu-item.has-children > a::after {
  content: "";
  display: inline-block;
  margin-left: 0.4em;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--color-muted);
  vertical-align: middle;
}

.sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  display: none;
  z-index: 10;
  padding: 0.4em 0;
}
.menu-item.has-children:hover .sub-menu,
.menu-item.has-children:focus-within .sub-menu {
  display: block;
}
.sub-menu li a {
  display: block;
  padding: 0.55em 1.2em;
  color: var(--color-heading);
  font-weight: 400;
  white-space: nowrap;
}
.sub-menu li a:hover { color: var(--color-muted); }

@media (max-width: 800px) {
  .nav-toggle { display: flex; }
  .site-nav .menu {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 0.5em 0 1em;
  }
  .site-nav.is-open .menu { display: flex; }
  .menu-item { width: 100%; border-bottom: 1px solid var(--color-border); }
  .menu-item:last-child { border-bottom: none; }
  .sub-menu {
    position: static;
    border: none;
    box-shadow: none;
    display: block;
    padding-left: 1rem;
  }
  .sub-menu li a { white-space: normal; }
  .menu-item.has-children .sub-menu { display: none; }
  .menu-item.has-children.is-open .sub-menu { display: block; }
}

/* ---------- Layout: content + sidebar ---------- */
.site-content { padding: 2.5rem 0 3rem; }

.content-sidebar-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem 3rem;
}
@media (min-width: 800px) {
  .content-sidebar-wrap { grid-template-columns: minmax(0, 1fr) 260px; }
}

.page-header h1 {
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-heading);
  margin: 0 0 1.75rem;
}

/* ---------- Post list ---------- */
.post-list { display: flex; flex-direction: column; gap: 0; }
.post-summary {
  position: relative;
  border-bottom: 1px solid var(--color-border);
  padding: 1.5rem 0;
}
.post-summary:first-child { padding-top: 0; }

.post-summary--sticky {
  padding-left: 1.6em;
}
.post-summary--sticky .icon-thumb-tack {
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 14px;
  height: auto;
  fill: var(--color-muted);
}
.post-summary--sticky .entry-summary {
  margin-top: 0.5em;
}

.entry-meta {
  color: var(--color-muted);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding-bottom: 0.35em;
}
.entry-meta .categories::before { content: " \00b7 "; }

.post-list .entry-title {
  margin: 0;
  color: var(--color-muted-2);
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1.4;
}
.post-list .entry-title a { color: inherit; }
.post-list .entry-title a:hover { color: var(--color-heading); }

/* ---------- Single post ---------- */
.single-post .entry-header { margin-bottom: 1.5rem; }
.single-post .entry-title {
  margin: 0.25em 0 0;
  color: var(--color-heading);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
}
.entry-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* ---------- Pages ---------- */
.single-page .page-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem 2.5rem;
}
@media (min-width: 600px) {
  .single-page .page-inner { grid-template-columns: 180px minmax(0, 1fr); }
}
.page-title {
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-heading);
}

.more-link-wrap { margin-top: 1em; }
.more-link {
  font-weight: 600;
  text-decoration: underline;
}

/* ---------- Content typography ---------- */
.entry-content p { margin: 0 0 1.1em; }
.entry-content img { max-width: 100%; height: auto; display: block; margin: 1em 0; }
.entry-content ol, .entry-content ul { list-style: revert; padding-left: 1.4rem; margin: 0 0 1.1em; }
.entry-content li { margin-bottom: 0.6em; }
.entry-content a { text-decoration: underline; }

/* ---------- PDF embed ---------- */
.pdf-embed {
  margin: 1.5rem 0;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 1rem;
}
.pdf-embed__frame {
  width: 100%;
  aspect-ratio: 1 / 1.414;
  height: auto;
  border: 1px solid var(--color-border);
  background: #fff;
}

/* ---------- Sidebar widgets ---------- */
.widget-area { min-width: 0; }
.widget { margin-bottom: 2.5rem; }
.widget-title {
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-heading);
  margin: 0 0 1rem;
}
.widget ul li {
  padding: 0.4em 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--color-text); }
.widget ul li a:hover { color: var(--color-muted); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
  color: var(--color-muted);
  font-size: 0.8rem;
}
