/*
Theme Name: TriStateSeek
Theme URI: https://tristateseek.com
Author: Jason Taylor
Author URI: https://tristateseek.com
Description: A custom events theme for the Tri-State Area — Tennessee, Kentucky, and Virginia. Built for finding what's happening around the mountains: a custom events calendar with no plugins, town and event-type filters, and a clean mountain look. Events are a custom post type, so adding one is just like writing a post.
Version: 1.7.82
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tristateseek
Tags: events, calendar, mountains, community, custom-post-type, responsive
*/

/* ------------------------------------------------------------------
   TriStateSeek — mountain palette
   Deep pine, moss green, warm stone, sunset gold. Colors live here
   in :root so the whole look can be retuned in one place.
------------------------------------------------------------------- */
:root {
  --pine: #1e3a2c;
  --pine-deep: #142a1f;
  --moss: #4a7c59;
  --moss-light: #8fae9b;
  --sage: #dfe8dd;
  --stone: #faf8f2;
  --stone-dark: #f1ede1;
  --ink: #22302a;
  --ink-soft: #5a6b62;
  --gold: #d9a441;
  --gold-dark: #b98427;
  --sky: #7fa8c9;
  --white: #ffffff;
  --line: #ddd6c4;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(20, 42, 31, 0.10);
  --font-head: Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ------------------------------------------------------------------
   Base
------------------------------------------------------------------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  /* Sticky-footer layout: the page is a flex column at least as tall
     as the viewport, and #main grows to fill the space, so the footer
     sits at the bottom of the screen on short pages. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; }

a { color: var(--moss); text-decoration: underline; }
a:hover { color: var(--pine); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  color: var(--pine);
  line-height: 1.25;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; text-wrap: pretty; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* The main content area grows to fill the viewport, pinning the
   footer to the bottom on short pages. (Replaces the earlier
   50vh min-height nudge.) */
#main { flex: 1 0 auto; }

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.button,
button,
input[type="submit"] {
  display: inline-block;
  background: var(--gold);
  color: var(--pine-deep);
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button:hover,
button:hover,
input[type="submit"]:hover { background: var(--gold-dark); color: var(--white); }

.button-outline {
  background: transparent;
  color: var(--pine);
  border: 2px solid var(--pine);
}
.button-outline:hover { background: var(--pine); color: var(--white); }

/* ------------------------------------------------------------------
   Header
------------------------------------------------------------------- */
.site-header {
  background: var(--pine-deep);
  color: var(--white);
  /* Sticky header: stays at the top while the page scrolls, so the
     navigation is always one tap away. The solid background keeps
     page content from showing through, and the shadow separates the
     bar from whatever scrolls underneath it. */
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
/* When the WordPress admin bar is showing (logged-in view), sit
   below it instead of sliding underneath it. */
body.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.site-brand a {
  color: var(--white);
  text-decoration: none;
}
.site-title {
  font-family: var(--font-head);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0;
  line-height: 1.1;
}
.site-title span { color: var(--gold); }
.site-tagline {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--moss-light);
}
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
}
.main-nav a:hover,
.main-nav .current-menu-item a { background: rgba(255, 255, 255, 0.14); }

.menu-toggle { display: none; }
/* Narrow phones: once the Menu button wraps onto its own line
   (around 538px), let it span the full width of the header instead
   of sitting left-aligned on a row by itself, which made the
   header read as left-side heavy. Text centered. */
@media (max-width: 538px) {
  .menu-toggle {
    flex: 1 1 100%;
    text-align: center;
  }
}

/* Weather strip: part of the header, under the main bar, on every
   page. It sits on the page's own stone colour so the green stops
   at the header bar, with dark text and a gold-dark temperature.
   Centered, with a hairline underneath to mark its lower edge
   on pages where the background matches. It rides along with
   the sticky header. */
.weather-strip {
  background: var(--stone);
  color: var(--pine-deep);
  font-size: 0.85rem;
  padding: 8px 0;
  text-align: center;
  border-bottom: 1px solid var(--stone-dark);
  position: relative;
  overflow: hidden;
  /* The strip collapses smoothly instead of snapping away: the
     grid row animates from its full height to nothing, so the
     header shrinks gently as the strip goes. */
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .25s ease, padding .25s ease, opacity .2s ease, border-color .25s ease;
}
.weather-strip strong { color: var(--gold-dark); }
/* The header's own .wrap is a flex row (space-between), and this
   strip lives inside the header — without this, its wrap inherits
   that flex and the three text chunks get spread across the width.
   Plain block here, so the line centers as one piece. The overflow
   and min-height are what let the grid row collapse to nothing
   without the text poking out. */
.weather-strip .wrap {
  display: block;
  text-align: center;
  overflow: hidden;
  min-height: 0;
}
/* Once the page is scrolled far enough for the back-to-top button,
   the strip gets out of the way (theme.js toggles this class on
   <body>), and comes back at the top. */
body.hide-weather .weather-strip {
  grid-template-rows: 0fr;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  border-bottom-color: transparent;
}
@media (prefers-reduced-motion: reduce) {
  .weather-strip { transition: none; }
  .weather-particle { display: none; }
}

/* Weather themes: the strip dresses itself to the conditions — a
   gradient background, and (for rain and snow) a few drops or
   flakes drifting across. The gradients stay light enough that the
   dark text keeps its contrast. */
.weather-strip .weather-icon { width: 18px; height: 18px; vertical-align: -4px; margin-right: 6px; }
.weather-particle { position: absolute; top: -10px; pointer-events: none; }
.weather-rain .weather-particle {
  width: 2px;
  height: 12px;
  background: rgba(79, 122, 143, 0.55);
  border-radius: 2px;
  animation: ts-rain-fall 1s linear infinite;
}
.weather-snow .weather-particle {
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: ts-snow-fall 7s linear infinite;
}
@keyframes ts-rain-fall {
  from { transform: translateY(-12px) rotate(12deg); }
  to { transform: translateY(52px) rotate(12deg); }
}
@keyframes ts-snow-fall {
  0% { transform: translate(0, -8px); }
  50% { transform: translate(6px, 22px); }
  100% { transform: translate(-3px, 52px); }
}
.weather-strip.weather-clear { background: linear-gradient(90deg, #fbeecd, #f7dc9a); }
.weather-strip.weather-partly { background: linear-gradient(90deg, #f8ecd2, #e9e2cf); }
.weather-strip.weather-overcast { background: linear-gradient(90deg, #e9e4d6, #dbd3bf); }
.weather-strip.weather-fog { background: linear-gradient(90deg, #ececea, #dbdbd6); }
.weather-strip.weather-drizzle { background: linear-gradient(90deg, #e2eaec, #cbd9de); }
.weather-strip.weather-rain { background: linear-gradient(90deg, #cfe0e8, #aec9d8); }
.weather-strip.weather-snow { background: linear-gradient(90deg, #e9f1f7, #d2e3ef); }
.weather-strip.weather-storm { background: linear-gradient(90deg, #b9c4cd, #93a3b0); }
.weather-strip.weather-clear .weather-icon,
.weather-strip.weather-partly .weather-icon { color: #b98427; }
.weather-strip.weather-overcast .weather-icon { color: #8a8272; }
.weather-strip.weather-fog .weather-icon { color: #8a8d90; }
.weather-strip.weather-drizzle .weather-icon { color: #6b8a97; }
.weather-strip.weather-rain .weather-icon { color: #4f7a8f; }
.weather-strip.weather-snow .weather-icon { color: #6b8aa5; }
.weather-strip.weather-storm .weather-icon { color: #5a6b7a; }

/* Night: after sunset the strip turns to a dark sky with light text,
   and clear / partly cloudy get a moon instead of the sun. Open-Meteo
   reports is_day (1 day, 0 night) for Cumberland Gap, and the strip
   flips within one 15-minute weather refresh. Each condition keeps
   its own darker gradient so the theming carries over after dark. */
.weather-strip.weather-night { color: #eef0ea; border-bottom-color: #16233a; }
.weather-strip.weather-night strong { color: #e8c87a; }
.weather-strip.weather-night.weather-clear { background: linear-gradient(90deg, #2c3e5d, #1c2b44); }
.weather-strip.weather-night.weather-partly { background: linear-gradient(90deg, #33415e, #22304a); }
.weather-strip.weather-night.weather-overcast { background: linear-gradient(90deg, #3a3f47, #2a2e35); }
.weather-strip.weather-night.weather-fog { background: linear-gradient(90deg, #3d4148, #2d3036); }
.weather-strip.weather-night.weather-drizzle { background: linear-gradient(90deg, #2e3d47, #223039); }
.weather-strip.weather-night.weather-rain { background: linear-gradient(90deg, #2b3e4d, #1f2f3c); }
.weather-strip.weather-night.weather-snow { background: linear-gradient(90deg, #33454f, #253540); }
.weather-strip.weather-night.weather-storm { background: linear-gradient(90deg, #2b3240, #1e2530); }
.weather-strip.weather-night.weather-clear .weather-icon,
.weather-strip.weather-night.weather-partly .weather-icon { color: #e8c87a; }
.weather-strip.weather-night.weather-overcast .weather-icon,
.weather-strip.weather-night.weather-fog .weather-icon,
.weather-strip.weather-night.weather-drizzle .weather-icon,
.weather-strip.weather-night.weather-rain .weather-icon,
.weather-strip.weather-night.weather-snow .weather-icon,
.weather-strip.weather-night.weather-storm .weather-icon { color: #c8d0d8; }
.weather-strip.weather-night.weather-rain .weather-particle { background: rgba(180, 205, 225, 0.6); }

/* ------------------------------------------------------------------
   Hero (front page)
------------------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--pine-deep) url("images/hero.jpg") center 42% / cover no-repeat;
  color: var(--white);
  text-align: center;
  padding: 96px 20px 110px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(rgba(20, 42, 31, 0.55), rgba(20, 42, 31, 0.35) 55%, rgba(20, 42, 31, 0.65));
}
/* Optional looping video behind the headline (picked in
   Customize > Hero). Sits above the background image and below
   the dark overlay, so the text stays readable over moving
   footage. Removed by script for reduced-motion visitors. */
.hero-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-inner { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; }

/* Place video (single place page) — a 16:9 player that scales
   with the content column. */
.place-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin-top: 28px;
  margin-bottom: 28px;
}
.place-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Place gallery (single place page) — a grid of extra photos right
   below the main image. Thumbnails crop to a tidy 4:3, and clicking
   one opens the large photo in a lightbox. The columns are capped
   at 160px so the thumbnails stay small and never stretch to fill
   the row the way 1fr tracks do; on phones the grid is three
   across so it stays compact instead of stacking big images.
   The main image's own 20px bottom margin is the gap above the
   grid; the 20px below it keeps the facts box clear of the
   thumbnails. */
.place-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 160px));
  gap: 10px;
  margin: 0 0 20px;
}
@media (max-width: 600px) {
  .place-gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}
.place-gallery-item { display: block; }
.place-gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.place-gallery-item:hover img,
.place-gallery-item:focus-visible img {
  transform: scale(1.02);
  box-shadow: 0 0 0 2px var(--gold);
}

/* Lightbox overlay for the place gallery. */
.place-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(16, 24, 20, 0.88);
  padding: 24px;
}
.place-lightbox.is-open { display: flex; }
.place-lightbox-img {
  max-width: min(92vw, 1100px);
  max-height: 86vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
/* The buttons are flex containers so each SVG icon sits exactly in
   the middle of its circle. (Text chevrons were dropped: the ‹ and
   › glyphs sit low in their line box and dropped to the bottom of
   the circle.) The arrows sit at the edges of the screen, out from
   the photo. */
.place-lightbox-close,
.place-lightbox-prev,
.place-lightbox-next {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
}
.place-lightbox-close { top: 16px; right: 16px; width: 42px; height: 42px; font-size: 26px; }
.place-lightbox-prev { left: 14px; top: 50%; margin-top: -22px; width: 44px; height: 44px; font-size: 30px; }
.place-lightbox-next { right: 14px; top: 50%; margin-top: -22px; width: 44px; height: 44px; font-size: 30px; }
/* The icon itself: a block that never shrinks, so it cannot be
   squeezed away if the button's box is ever constrained again. */
.place-lightbox-close svg,
.place-lightbox-prev svg,
.place-lightbox-next svg { display: block; flex-shrink: 0; }
.place-lightbox-close:hover,
.place-lightbox-prev:hover,
.place-lightbox-next:hover { background: rgba(0, 0, 0, 0.7); }
.hero h1 {
  color: var(--white);
  font-size: 2.7rem;
  margin-bottom: 0.3em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}
.hero p.lede {
  font-size: 1.2rem;
  color: #f0ead9;
  margin-bottom: 1.4em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}
.hero .button { margin: 0 6px 8px; }
.hero .button-outline { border-color: var(--white); color: var(--white); }
.hero .button-outline:hover { background: var(--white); color: var(--pine-deep); }

/* ------------------------------------------------------------------
   Sections
------------------------------------------------------------------- */
.section { padding: 44px 0; }
/* White panel with breathing room: the old version had no side padding,
   so content sat flush against the edge of the white box. */
.section-alt {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 28px;
}
/* Full-width band behind From the blog: a step deeper than the page
   background, so the blog reads as its own block. It butts right
   up against the Things to do band above it — no margin, so no
   strip of page background shows between the two bands. */
.section-blog {
  background: var(--stone-dark);
}
/* Full-width white band behind the homepage calendar — same idea as
   the blog band, so the page reads as alternating blocks. */
.section-calendar { background: var(--white); }
/* Full-width white band behind Things to do, with the trail sketch
   faintly behind the cards (images/trail-sketch.jpg). The sketch
   lives on a pseudo-element so the cards sit above it, and its
   white background melts into the white band. */
.section-things {
  background: var(--white);
  position: relative;
  overflow: hidden;
}
.section-things::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("images/trail-sketch.jpg") center / cover no-repeat;
  opacity: 0.2;
  pointer-events: none;
}
.section-things .wrap { position: relative; }
/* Full-width white band behind the About page, with the
   hiker-and-dog sketch faintly behind the text
   (images/about-sketch.jpg), the same treatment as Things to do
   above. The sketch lives on a pseudo-element so the text sits
   above it, and its cream background melts into the white band. */
.section-about {
  background: var(--white);
  position: relative;
  overflow: hidden;
}
.section-about::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("images/about-sketch.jpg") center / cover no-repeat;
  opacity: 0.2;
  pointer-events: none;
}
.section-about .wrap { position: relative; }
/* Featured badge: a small gold pill marking a paid featured
   listing, shown on its cards wherever they appear. */
.featured-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--pine-deep);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
/* Featured section on the homepage: a pale gold band so the
   premium spot reads as distinct from the other sections. It only
   renders when at least one place or event is ticked Featured. */
.section-featured {
  background: #fbf2dc;
}

/* ------------------------------------------------------------------
   Back to top
   Round gold button, fixed bottom-right, hidden until the page is
   scrolled a way down. Fades and lifts in; while hidden it is out
   of the tab order too.
------------------------------------------------------------------- */
.ts-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--gold);
  color: var(--pine-deep);
  box-shadow: 0 4px 14px rgba(20, 42, 31, 0.28);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease;
}
.ts-to-top svg { width: 22px; height: 22px; }
.ts-to-top:hover { background: var(--gold-dark); color: var(--white); }
.ts-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; white-space: nowrap; }

/* ------------------------------------------------------------------
   Event cards and lists
------------------------------------------------------------------- */
/* Card rows are flexbox, not grid, on purpose: a grid fixes its
   column tracks for the whole grid, so a last row with two cards
   leaves the third column as dead space. Flex hands out the
   leftover space per row instead — two cards on the last row each
   take half the row, and a lone last card stretches full width. */
.event-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
/* This Week (homepage): two cards per row, so four events read as
   two rows of two instead of three on the first row and one lone
   full-width card on the second. Scoped to #this-week so Things to
   do and the blog keep their three-across layout. The 50%-minus-
   half-the-gap basis holds two per row at any width above the phone
   breakpoint; phones keep the base 300px basis and stack one per
   row, and a lone last card still stretches full width. */
@media (min-width: 761px) {
  #this-week .event-card {
    flex-basis: calc(50% - 10px);
  }
}
.event-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1 1 300px;
  transition: box-shadow 0.25s ease;
}
/* Card hover: a deeper shadow that fades in on hover and fades
   back out when the mouse leaves. Mouse-only, like the other
   hover styles — on touch screens a tap would leave the shadow
   stuck on the card. */
@media (hover: hover) {
  .event-card:hover { box-shadow: 0 10px 28px rgba(20, 42, 31, 0.20); }
}
.event-card-thumb { display: block; }
.event-card-thumb img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
}
.event-list-thumb { flex: 0 0 110px; }
.event-list-thumb a { display: block; }
.event-list-thumb img {
  display: block;
  width: 110px;
  height: 82px;
  object-fit: cover;
  border-radius: 8px;
}
.event-featured { margin: 0 0 20px; }
.event-featured img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.event-card-date {
  background: var(--pine);
  color: var(--white);
  padding: 10px 16px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.event-card-date .day {
  font-family: var(--font-head);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
}
.event-card-date .month-year {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--moss-light);
}
.event-card-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.event-card-body h3 { margin: 0 0 6px; font-size: 1.2rem; }
.event-card-body h3 a { color: var(--pine); text-decoration: none; }
.event-card-body h3 a:hover { color: var(--moss); text-decoration: underline; }
.event-meta { font-size: 0.92rem; color: var(--ink-soft); margin: 0 0 8px; }
.event-meta strong { color: var(--ink); }
.event-card-body p { flex: 1; }
.event-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag {
  display: inline-block;
  background: var(--sage);
  color: var(--pine);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}
.tag:hover { background: var(--moss-light); color: var(--pine-deep); }

/* Share row on single event and place pages: small outline pills,
   quieter than the gold call-to-action buttons. The native Share
   button is hidden by the hidden attribute until JavaScript shows
   it on browsers that support the Web Share API. */
.share-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.share-label { font-weight: 700; color: var(--pine); margin-right: 4px; }
/* On phones the row is too narrow for the label and the buttons
   to share a line cleanly, so the label takes a line of its own
   and the share options start on the line below. */
@media (max-width: 600px) {
  .share-label { flex: 1 1 100%; margin-right: 0; }
}
.share-btn {
  display: inline-block;
  flex: 0 0 auto;
  background: transparent;
  color: var(--pine);
  border: 2px solid var(--pine);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.share-btn:hover { background: var(--pine); color: var(--white); }

.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 14px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.event-list .event-when {
  flex: 0 0 74px;
  text-align: center;
  background: var(--stone-dark);
  border-radius: 8px;
  padding: 8px 4px;
}
.event-list .event-when .day {
  display: block;
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--pine);
  line-height: 1;
}
.event-list .event-when .mon {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-soft);
}
.event-list h3 { margin: 0 0 4px; }
.event-list h3 a { color: var(--pine); text-decoration: none; }
.event-list h3 a:hover { text-decoration: underline; }

/* Blog listing: no date box (the full date already sits in the meta
   line under the title), and the thumbnail takes the whole left
   side of the card, edge to edge and full height. The negative
   margins pull it into the card's padding, and the card's overflow
   clips it to the rounded corners. Desktop only — phones keep the
   stacked layout from the mobile rules below. */
@media screen and (min-width: 761px) {
  body.blog .event-list li { overflow: hidden; }
  body.blog .event-list-thumb {
    flex: 0 0 200px;
    align-self: stretch;
    margin: -16px 0 -16px -18px;
  }
  body.blog .event-list-thumb img {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

/* Places list: same full-height left thumbnail as the blog listing,
   so the photo fills the whole left side of the card instead of
   sitting small in the padding. Applies everywhere the place list
   item is used (places archive, town pages, [ts_places] shortcode).
   Desktop only — phones keep the stacked layout. The thumbnail is
   positioned, and the photo is absolutely positioned inside it, so
   a portrait photo cannot stretch the card: the card height comes
   from the text, and the photo just crops to fill. */
@media screen and (min-width: 761px) {
  .place-list-item { overflow: hidden; }
  .place-list-item .event-list-thumb {
    flex: 0 0 200px;
    align-self: stretch;
    margin: -16px 0 -16px -18px;
    position: relative;
  }
  .place-list-item .event-list-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
  }
}

/* ------------------------------------------------------------------
   Calendar (month grid)
------------------------------------------------------------------- */
.ts-calendar { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ts-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--pine);
  color: var(--white);
  padding: 12px 16px;
}
.ts-cal-head h3 { color: var(--white); margin: 0; font-size: 1.25rem; }
.ts-cal-head a { color: var(--white); text-decoration: none; font-weight: 700; padding: 4px 10px; border-radius: 6px; }
.ts-cal-head a:hover { background: rgba(255, 255, 255, 0.16); }
/* minmax(0, 1fr): columns may shrink below their content, so long words
   in event titles can't force the grid wider than the screen. */
.ts-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ts-cal-dow {
  background: var(--stone-dark);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  padding: 8px 4px;
  color: var(--ink-soft);
}
.ts-cal-day {
  min-height: 92px;
  min-width: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  padding: 6px;
  font-size: 0.85rem;
  overflow-wrap: break-word;
}
.ts-cal-day:nth-child(7n+1) { border-left: none; }
.ts-cal-day.other-month { background: var(--stone); color: #a9a48f; }
.ts-cal-day.today { background: #fdf6e3; box-shadow: inset 0 0 0 2px var(--gold); }
.ts-cal-day .day-num { font-weight: 700; color: var(--pine); display: block; margin-bottom: 4px; }
.ts-cal-day ul { list-style: none; margin: 0; padding: 0; }
.ts-cal-day li { margin-bottom: 4px; line-height: 1.3; }
.ts-cal-day li a {
  display: block;
  background: var(--sage);
  color: var(--pine);
  border-radius: 4px;
  padding: 2px 6px;
  text-decoration: none;
  font-weight: 600;
  overflow-wrap: break-word;
}
/* Hover style only where a mouse exists — on touch screens a tap
   leaves the dark hover state stuck on the event afterwards. */
@media (hover: hover) {
  .ts-cal-day li a:hover { background: var(--moss); color: var(--white); }
}
.ts-cal-day .more { color: var(--ink-soft); font-size: 0.8rem; }
/* "+N more" is a link to the month's full list on the Calendar page.
   Keep it looking like a plain text link, not an event pill. */
.ts-cal-day .more a {
  display: inline;
  background: none;
  color: var(--pine);
  padding: 0;
  font-weight: 600;
  text-decoration: underline;
}
@media (hover: hover) {
  .ts-cal-day .more a:hover { background: none; color: var(--moss); }
}

/* Month list shown on phones instead of the grid. Hidden on desktop. */
.ts-calendar-mobile-list { display: none; }

/* ------------------------------------------------------------------
   Filters (archive)
------------------------------------------------------------------- */
.event-filters {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.event-filters label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; }
.event-filters select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--stone);
  color: var(--ink);
  min-width: 170px;
}

/* ------------------------------------------------------------------
   Single event
------------------------------------------------------------------- */
.event-detail {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
}
.event-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 24px;
  background: var(--stone);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 0 0 20px;
}
.event-facts dt { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); }
.event-facts dd { margin: 2px 0 0; font-weight: 600; color: var(--ink); }
/* Keep long unbroken values (a website URL, a long address) inside
   their own column. The grid already has a 24px gutter, but a long
   URL is one unbreakable word: without these rules it forces its
   column wider and runs straight into the next column's text.
   min-width lets the cell shrink; overflow-wrap lets the word
   break. Applies to event and place pages alike, since both use
   this same facts box. */
.event-facts > div { min-width: 0; }
.event-facts dd,
.event-facts dd a { overflow-wrap: anywhere; }
.event-note {
  background: #fdf6e3;
  border-left: 4px solid var(--gold);
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  font-size: 0.95rem;
}
.event-map { margin: 0 0 20px; }
.event-map iframe {
  display: block;
  width: 100%;
  height: 320px;
  border: 0;
  border-radius: var(--radius);
}
.event-map p { margin: 8px 0 0; font-size: 0.92rem; }

/* ------------------------------------------------------------------
   Pages, posts, comments
------------------------------------------------------------------- */
.page-content, .post-content {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  margin: 28px 0;
}
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { margin-bottom: 26px; }

/* ------------------------------------------------------------------
   Contact form
------------------------------------------------------------------- */
.ts-contact-form { margin-top: 8px; }
.ts-contact-form p { margin-bottom: 16px; }
.ts-contact-form label { display: block; font-weight: 700; font-size: 0.95rem; color: var(--pine); margin-bottom: 5px; }
.ts-contact-form input[type="text"],
.ts-contact-form input[type="email"],
.ts-contact-form select,
.ts-contact-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--stone);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}
.ts-contact-form input:focus,
.ts-contact-form select:focus,
.ts-contact-form textarea:focus {
  outline: 2px solid var(--moss);
  outline-offset: 1px;
  background: var(--white);
}
.ts-contact-form textarea { resize: vertical; }
/* Honeypot: kept off-screen so people never see it; bots still fill it in. */
.ts-honeypot {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: 0;
  padding: 0;
}
.ts-form-note { font-size: 0.9rem; color: var(--ink-soft); }
.ts-notice {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 0 0 20px;
}
.ts-notice p { margin: 0 0 6px; }
.ts-notice p:last-child { margin-bottom: 0; }
.ts-notice-success { background: var(--sage); border: 1px solid var(--moss); }
.ts-notice-error { background: #fdf6e3; border: 1px solid var(--gold); }

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------- */
.site-footer {
  background: var(--pine-deep);
  color: #cfd8cf;
  margin-top: 48px;
}
/* Front page: the blog band runs right into the footer, no gap. */
body.home .site-footer { margin-top: 0; }
.site-footer .wrap { padding-top: 30px; padding-bottom: 30px; }
.site-footer a { color: var(--white); }
.site-footer h3 { color: var(--white); }
.site-footer h3 span { color: var(--gold); }
.footer-cols { display: flex; gap: 32px; flex-wrap: wrap; justify-content: space-between; }
.footer-cols > div { flex: 1 1 220px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 16px;
  margin-top: 24px;
  font-size: 0.88rem;
  color: #9fb3a4;
  display: flex;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
}
.footer-bottom p { margin: 0; }

/* ------------------------------------------------------------------
   Town banner
   A town's own photo across the top of its page, with the town name
   over it. Only rendered when a banner was picked on the town's
   edit screen — towns without one keep the plain heading.
------------------------------------------------------------------- */
.town-banner {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.town-banner img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
}
.town-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 42, 31, 0.65), rgba(20, 42, 31, 0.05) 60%);
}
.town-banner h1 {
  position: absolute;
  left: 24px;
  bottom: 16px;
  z-index: 1;
  margin: 0;
  color: var(--white);
}

/* ------------------------------------------------------------------
   Responsive
------------------------------------------------------------------- */
@media (max-width: 760px) {
  .menu-toggle {
    display: inline-block;
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
  }
  .main-nav { display: none; width: 100%; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav a { display: block; padding: 10px 4px; }
  .hero { padding: 64px 16px 76px; background-position: center 38%; }
  .hero h1 { font-size: 2rem; }
  .town-banner img { height: 180px; }
  .town-banner h1 { left: 16px; bottom: 12px; }
  .event-list-thumb { flex-basis: auto; width: 100%; }
  .event-list-thumb img { width: 100%; height: 170px; }
  .ts-cal-day { min-height: 64px; padding: 4px; }
  .ts-cal-head a { white-space: nowrap; }
  /* Phones: the grid becomes tappable rows instead. The day cells are
     hidden; the dark header bar stays so Prev/Next keep working, and
     the month title is hidden here because the section heading above
     already shows it. The sideways-scroll attempt is gone — a grid
     that needs scrolling is worse than a list. */
  .ts-cal-grid { display: none; }
  .ts-cal-head h3 { display: none; }
  .ts-calendar-mobile-list { display: block; }
  /* Phones: the homepage calendar goes away — its month list leads
     with past events, so This Week (today onward) is the first
     thing a visitor sees instead. The calendar itself stays on
     the Calendar page, linked from the menu. The old rule hid
     This Weekend here; the choice is now flipped. */
  #home-calendar { display: none; }
  /* Mobile calendar: event text smaller and not bold, so long titles
     fit the narrow cells instead of squishing. Events are links, so
     the details live on the event page. */
  .ts-cal-day li a { font-size: 0.72rem; font-weight: 400; padding: 2px 4px; }
  .event-list li { flex-direction: column; gap: 10px; }
  /* Phones: the gray date box goes away. The date already shows in
     the meta line under the title, right after the image, so the
     box is redundant on a narrow screen. Desktop keeps it. */
  .event-list .event-when { display: none; }
  .ts-to-top { right: 16px; bottom: 16px; }
  .event-detail, .page-content, .post-content { padding: 20px; }
  .section-alt { padding: 24px 18px; }
  .section-blog { padding: 32px 0; }
}
