:root {
  --color-body: #3c6a7c;        /* main paragraph text */
  --color-nav: #8fabae;         /* top nav links */
  --color-nav-active: #b8863f;  /* current-page highlight (warm gold, matches faerie/cottagecore aesthetic) */
  --color-date: #a9c3c5;        /* date stamp */
  --color-link: #3c6a7c;        /* inline links, underlined */
  --submenu-bg: #faf7f0;
  --submenu-border: #e3ddcd;
  --page-bg: #ffffff;
  --content-max: 1000px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page-bg);
}

body {
  font-family: 'Bitter', Georgia, 'Times New Roman', serif;
  color: var(--color-body);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 40px 24px 100px;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: nowrap;
  column-gap: 56px;
  row-gap: 20px;
  margin-bottom: 8px;
}

.logo-link {
  display: block;
  flex: 0 0 auto;
}

.logo {
  height: 180px;
  width: auto;
  max-width: 260px;
  display: block;
  object-fit: contain;
}

/* Fallback placeholder logo (used only if ficklesparrowlogo.png hasn't been added yet) */
.logo-placeholder {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: #23201c;
  display: none;
  align-items: center;
  justify-content: center;
  position: relative;
}
.logo-placeholder svg { width: 100%; height: 100%; }
.logo-placeholder text {
  font-family: 'Bitter', serif;
  font-size: 15.5px;
  letter-spacing: 3px;
  fill: #f4efe6;
}

/* ---------- Primary nav ---------- */
nav.primary-nav {
  margin-top: 44px;
}

nav.primary-nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  column-gap: clamp(14px, 2.2vw, 34px);
  row-gap: 8px;
  font-size: clamp(0.9rem, 1.5vw, 1.15rem);
  white-space: nowrap;
}

nav.primary-nav li {
  position: relative;
}

nav.primary-nav a {
  display: inline-block;
  color: var(--color-nav);
  text-decoration: none;
  padding: 4px 0;
}
nav.primary-nav a:hover { text-decoration: underline; }

/* Current page: bold + accent color */
nav.primary-nav a.nav-current {
  font-weight: 700;
  color: var(--color-nav-active);
}

/* Parent of the current page (e.g. "Faerie Facts" when viewing "Faerie Kindness Code") */
nav.primary-nav a.nav-current-parent {
  color: var(--color-nav-active);
}

/* ---------- Dropdown submenus (desktop: hover) ---------- */
nav.primary-nav .submenu {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--submenu-bg);
  border: 1px solid var(--submenu-border);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(35, 32, 28, 0.12);
  white-space: nowrap;
  z-index: 20;
  display: none;
}

nav.primary-nav .has-submenu:hover > .submenu,
nav.primary-nav .has-submenu:focus-within > .submenu {
  display: block;
}

nav.primary-nav .submenu li { position: static; }

nav.primary-nav .submenu a {
  display: block;
  padding: 8px 18px;
  font-size: 0.95rem;
}

nav.primary-nav .submenu a:hover {
  background: rgba(184, 134, 63, 0.1);
  text-decoration: none;
}

/* ---------- Homepage event banner ---------- */
.event-banner {
  margin: 30px 0 10px;
}

.event-banner img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.date-stamp {
  text-align: right;
  color: var(--color-date);
  font-size: 1.15rem;
  margin: 26px 0 34px;
}

/* ---------- Body copy ---------- */
.letter,
.page-body {
  font-size: 1.28rem;
  line-height: 1.55;
}

.letter p,
.page-body p {
  margin: 0 0 26px;
}

.letter strong,
.page-body strong {
  font-weight: 700;
}

.letter a,
.page-body a {
  color: var(--color-link);
  text-decoration: underline;
}

/* ---------- Shared "view PDF" button (used on In The News and Faerie Kindness Code) ---------- */
.pdf-download-link,
.kindness-download {
  text-align: center;
  margin: 0 0 32px;
}

.pdf-button {
  display: inline-block;
  padding: 12px 26px;
  background: var(--color-nav-active);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 6px;
  letter-spacing: 0.3px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.pdf-button:hover {
  background: #a5762f;
  color: #fff;
  text-decoration: none;
  transform: scale(1.05);
}

.kindness-poster-image-wrap {
  margin: 0;
}

.kindness-poster-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* ---------- Adopt-A-Faerie page photo ---------- */
.adopt-photo {
  margin: 32px 0 0;
}

.adopt-photo-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.page-body h1 {
  font-size: 1.9rem;
  margin: 0 0 22px;
  color: var(--color-body);
}

.page-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 24px;
  color: var(--color-body);
}

/* ---------- Faerie Facts: floated illustrations + kindness code ---------- */
.fact-block {
  overflow: hidden; /* clearfix so floated images don't collapse the block */
}

.fact-img {
  display: block;
  width: 110px;
  height: auto;
}

.fact-img--lg {
  width: 170px;
}

.fact-img--sm {
  width: 37px;
}

.fact-img--left {
  float: left;
  margin: 4px 24px 16px 0;
}

.fact-img--right {
  float: right;
  margin: 4px 0 16px 24px;
}

.kindness-code {
  margin: 32px 0 48px 56px;
  padding-left: 20px;
  border-left: 3px solid var(--color-nav-active);
  text-align: center;
}

.kindness-code p {
  font-style: italic;
  font-weight: 600;
  color: #4a87aa;
  font-size: 1.2rem;
  margin: 0 0 10px;
}

/* ---------- Gazette image + plain-text PDF link (Who We Are page) ---------- */
.gazette-pdf-link {
  text-align: right;
  margin: 0 0 56px;
}

.text-link-grow {
  color: var(--color-link);
  text-decoration: underline;
  display: inline-block;
  transition: font-size 0.15s ease, font-weight 0.15s ease;
}

.text-link-grow:hover {
  font-weight: 700;
  font-size: 1.1em;
}

.gazette-image-wrap {
  margin: 0 0 10px;
}

.gazette-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--submenu-border);
  border-radius: 8px;
}

.signoff {
  margin-top: 6px;
}

/* ---------- Blight Busters: coming-soon text + photo strip ---------- */
.coming-soon {
  text-align: center;
  margin: 0 0 40px;
}

.coming-soon p {
  margin: 0 0 14px;
}

.coming-soon p:last-child {
  margin-bottom: 0;
}

.coming-soon-title {
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.blightbusters-photos-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* ---------- Popup modal (reusable across pages) ---------- */
body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(35, 32, 28, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  padding: 44px 38px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--color-body);
  cursor: pointer;
  padding: 6px 10px;
}

.modal-close:hover {
  color: var(--color-nav-active);
}

.modal-content {
  display: flex;
  align-items: center;
  gap: 30px;
}

.modal-image {
  flex: 0 0 auto;
  display: block;
  width: 220px;
  height: auto;
}

.modal-text {
  flex: 1 1 auto;
  text-align: center;
}

.modal-text p {
  margin: 0 0 16px;
  font-size: 1.05rem;
  line-height: 1.5;
}

.modal-text p:last-child {
  margin-bottom: 0;
}

/* ---------- Reverse Sales Tax Calculator page ---------- */
.calc-intro {
  margin: 0 0 30px;
}

.calc-card {
  background: var(--submenu-bg);
  border: 1px solid var(--submenu-border);
  border-radius: 16px;
  padding: 36px 32px;
  max-width: 520px;
  margin: 0 auto 24px;
  box-shadow: 0 10px 28px rgba(35, 32, 28, 0.08);
}

.calc-field {
  margin-bottom: 24px;
}

.calc-field label {
  display: block;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--color-body);
  margin-bottom: 8px;
}

.calc-input-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid var(--submenu-border);
  border-radius: 8px;
  padding: 0 14px;
  transition: border-color 0.15s ease;
}

.calc-input-wrap:focus-within {
  border-color: var(--color-nav-active);
}

.calc-affix {
  font-weight: 700;
  color: var(--color-nav);
  flex: 0 0 auto;
}

.calc-input {
  flex: 1 1 auto;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Bitter', serif;
  font-size: 1.1rem;
  color: var(--color-body);
  padding: 12px 8px;
}

/* Remove number input spinners for a cleaner look */
.calc-input[type="number"]::-webkit-outer-spin-button,
.calc-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.calc-input[type="number"] {
  -moz-appearance: textfield;
}

.calc-location-wrap {
  padding-right: 6px;
}

.calc-lookup-btn {
  flex: 0 0 auto;
  border: none;
  background: var(--color-nav-active);
  color: #fff;
  font-family: 'Bitter', serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.calc-lookup-btn:hover {
  background: #a5762f;
  transform: scale(1.04);
}

.calc-location-status {
  margin: 8px 2px 0;
  font-size: 0.9rem;
  color: var(--color-nav);
  font-style: italic;
}

.calc-results {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px dashed var(--submenu-border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.calc-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.calc-result-label {
  font-size: 1rem;
  color: var(--color-body);
}

.calc-result-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-nav-active);
}

.calc-footnote {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-nav);
  max-width: 520px;
  margin: 0 auto;
}

.calc-choice-box .modal-text {
  text-align: center;
}

.calc-city-choice-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.calc-city-choice-btn {
  border: 2px solid var(--submenu-border);
  background: #fff;
  color: var(--color-body);
  font-family: 'Bitter', serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.calc-city-choice-btn:hover {
  border-color: var(--color-nav-active);
  background: var(--submenu-bg);
}

/* ---------- Mobile nav toggle button ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  width: 34px;
  height: 34px;
  padding: 0;
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: var(--color-body);
  transition: transform 0.2s ease, opacity 0.2s ease, width 0.2s ease;
}

.nav-toggle.is-active .nav-toggle-bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.nav-toggle.is-active .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-active .nav-toggle-bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .calc-card {
    padding: 26px 20px;
  }

  .modal-content {
    flex-direction: column;
  }

  .modal-image {
    width: 160px;
  }

  .modal-box {
    padding: 36px 24px;
  }

  .site-header {
    flex-wrap: wrap;
    align-items: center;
  }

  .nav-toggle {
    display: flex;
  }

  nav.primary-nav {
    margin-top: 0;
    flex-basis: 100%;
    order: 3;
  }

  nav.primary-nav > ul {
    display: none;
    flex-direction: column;
    flex-wrap: nowrap;
    white-space: normal;
    column-gap: 0;
    row-gap: 4px;
    font-size: 1.1rem;
    margin-top: 16px;
    padding: 16px 18px;
    background: var(--submenu-bg);
    border: 1px solid var(--submenu-border);
    border-radius: 8px;
  }

  nav.primary-nav.is-open > ul {
    display: flex;
  }

  nav.primary-nav li {
    width: 100%;
  }

  nav.primary-nav > ul > li > a {
    padding: 8px 0;
  }

  /* On small screens, skip the hover dropdown entirely and just show
     sub-items nested under their parent, always visible when the menu is open. */
  nav.primary-nav .submenu {
    display: block;
    position: static;
    box-shadow: none;
    border: none;
    background: none;
    padding: 2px 0 6px 16px;
    min-width: 0;
  }

  nav.primary-nav .submenu a {
    padding: 6px 0;
    font-size: 0.95rem;
  }
}

@media (max-width: 640px) {
  .logo { height: 130px; width: auto; max-width: 190px; }
  .logo-placeholder { width: 130px; height: 130px; }
  .letter, .page-body { font-size: 1.08rem; }
  .date-stamp { font-size: 1rem; text-align: left; }

  .fact-img--left,
  .fact-img--right {
    float: none;
    display: block;
    margin: 0 auto 16px;
  }

  .fact-img { width: 120px; }
  .fact-img--lg { width: 150px; }
  .fact-img--sm { width: 45px; }

  .kindness-code { margin-left: 0; }
}