/* Summerstown182 Custom Styles */
/* Supplements Tailwind CDN */

/* --- Article Content Prose --- */
.article-content {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.8;
  color: #374151;
}

.article-content p {
  margin-bottom: 1.5em;
}

.article-content h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: #2C5F2D;
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.article-content h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: #556B2F;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.article-content a {
  color: #E2725B;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.article-content a:hover {
  color: #2C5F2D;
}

.article-content img {
  border-radius: 0.5rem;
  margin: 1.5em 0;
  max-width: 100%;
  height: auto;
  cursor: pointer;
}

.article-content blockquote {
  border-left: 4px solid #E2725B;
  padding-left: 1.5em;
  margin: 1.5em 0;
  font-style: italic;
  color: #556B2F;
}

.article-content ul,
.article-content ol {
  margin: 1em 0;
  padding-left: 1.5em;
}

.article-content li {
  margin-bottom: 0.5em;
}

.article-content figure {
  margin: 2em 0;
}

.article-content figcaption {
  font-size: 0.85rem;
  color: #9CA3AF;
  text-align: center;
  margin-top: 0.5em;
  font-style: italic;
}

.article-content hr {
  border: none;
  border-top: 2px solid #2C5F2D;
  margin: 2em 0;
  opacity: 0.2;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.article-content th,
.article-content td {
  padding: 0.75em;
  border: 1px solid #E5E7EB;
  text-align: left;
}

.article-content th {
  background-color: #2C5F2D;
  color: white;
  font-weight: 500;
}

/* Remove WP-specific classes styling */
.article-content .wp-image-container,
.article-content .wp-block-image,
.article-content .wp-caption {
  margin: 1.5em 0;
}

.article-content .wp-caption-text,
.article-content .wp-element-caption {
  font-size: 0.85rem;
  color: #9CA3AF;
  text-align: center;
  margin-top: 0.5em;
  font-style: italic;
}

/* --- Line Clamp --- */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Gallery Lightbox --- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.25rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Calendar Styles --- */
.calendar-day {
  background: white;
  min-height: 60px;
  padding: 0.5rem;
  position: relative;
  cursor: default;
}

.calendar-day.today {
  background: #F5F5DC;
}

.calendar-day.has-event {
  cursor: pointer;
}

.calendar-day.has-event:hover {
  background: #f0efe5;
}

.calendar-day .day-number {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  color: #374151;
}

.calendar-day.other-month .day-number {
  color: #D1D5DB;
}

.calendar-day .event-dot {
  width: 6px;
  height: 6px;
  background: #E2725B;
  border-radius: 50%;
  display: inline-block;
  margin-top: 2px;
}

/* --- Smooth Scrolling --- */
html {
  scroll-behavior: smooth;
}

/* --- Selection Color --- */
::selection {
  background: #E2725B;
  color: white;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #F5F5DC;
}

::-webkit-scrollbar-thumb {
  background: #556B2F;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2C5F2D;
}

/* ── Map Markers & Popups ── */
.s182-marker {
  background: #2C5F2D;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.s182-marker.has-portrait {
  background: #E2725B;
}
.s182-cluster {
  background: rgba(44,95,45,0.7);
  border-radius: 50%;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  text-align: center;
  line-height: 36px;
}
.s182-popup { max-height: 300px; overflow-y: auto; }
.s182-popup-entry { display: flex; gap: 10px; padding: 6px 0; }
.s182-popup-divider { border-top: 1px solid #e5e7eb; margin: 4px 0; }
.s182-popup-portrait img {
  width: 56px; height: 72px; object-fit: cover; border-radius: 4px;
  flex-shrink: 0;
}
.s182-popup-info { min-width: 0; }
.s182-popup-name {
  font-family: 'Playfair Display', serif;
  color: #2C5F2D; font-size: 0.95rem; font-weight: 600;
  margin: 0 0 2px;
}
.s182-popup-regiment { font-style: italic; color: #556B2F; font-size: 0.78rem; margin: 0; }
.s182-popup-death { color: #6B7280; font-size: 0.72rem; margin: 2px 0 0; }
.s182-popup-address { color: #374151; font-size: 0.78rem; font-weight: 500; margin: 2px 0 0; }
.s182-popup-link {
  color: #E2725B; font-size: 0.78rem; text-decoration: none;
  display: inline-block; margin-top: 3px;
}
.s182-popup-link:hover { text-decoration: underline; }

/* Override Leaflet popup defaults */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.leaflet-popup-content { margin: 10px 14px; font-family: 'Inter', sans-serif; }

/* --- Merton United Page --- */
.merton-hero {
  position: relative;
  min-height: min(680px, calc(100svh - 4rem));
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #14343a;
}

.merton-hero__image {
  position: absolute;
  inset: 0;
}

.merton-hero__image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 31, 35, 0.9) 0%, rgba(8, 31, 35, 0.58) 42%, rgba(8, 31, 35, 0.2) 100%),
    linear-gradient(0deg, rgba(8, 31, 35, 0.82) 0%, rgba(8, 31, 35, 0) 48%);
}

.merton-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 36%;
}

.merton-hero__content {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(4rem, 8vh, 6rem) 0 clamp(2.5rem, 6vh, 3.5rem);
  color: #fffef7;
}

.merton-kicker {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffca5f;
}

.merton-kicker--dark {
  color: #b34b36;
}

.merton-hero h1 {
  max-width: 640px;
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(3.25rem, 7vw, 6.6rem);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: 0;
}

.merton-standfirst {
  max-width: 600px;
  margin: 1.8rem 0 0;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.55;
  color: rgba(255, 254, 247, 0.92);
}

.merton-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.merton-hero__meta span {
  border: 1px solid rgba(255, 254, 247, 0.45);
  background: rgba(255, 254, 247, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.merton-intro,
.merton-closing,
.merton-story-grid,
.merton-band__inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.merton-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.72fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.merton-intro__lead p,
.merton-band__copy p,
.merton-closing p {
  font-size: 1.12rem;
  line-height: 1.85;
  color: #314247;
}

.merton-intro__lead h2 {
  margin: 0 0 1.4rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.2rem, 4.6vw, 4.25rem);
  line-height: 1;
  color: #173b34;
}

.merton-feature-image {
  margin: 0;
}

.merton-feature-image img,
.merton-closing img {
  width: 100%;
  display: block;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(23, 59, 52, 0.18);
}

.merton-feature-image--portrait img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.merton-feature-image figcaption {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #66777b;
}

.merton-band {
  background: #0f3c45;
  color: #fffef7;
  padding: clamp(3.2rem, 6vw, 5rem) 0;
}

.merton-band__inner {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
}

.merton-band h2,
.merton-closing h2 {
  margin: 0 0 1.15rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.1rem, 4vw, 3.7rem);
  line-height: 1.05;
  color: inherit;
}

.merton-closing h2 {
  margin-bottom: 1.45rem;
}

.merton-band__copy p {
  color: rgba(255, 254, 247, 0.86);
}

.merton-story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.merton-story-grid article {
  min-height: 330px;
  padding: clamp(1.35rem, 3vw, 2.5rem);
  background: #fffef7;
  border-top: 5px solid #e2725b;
}

.merton-story-grid article:nth-child(2) {
  border-top-color: #2c7d8f;
}

.merton-story-grid article:nth-child(3) {
  border-top-color: #f0b84b;
}

.merton-story-grid span {
  display: block;
  margin-bottom: 2.5rem;
  font-weight: 800;
  color: #7b8d38;
}

.merton-story-grid h2 {
  margin: 0 0 1rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.05;
  color: #173b34;
}

.merton-story-grid p {
  margin: 0;
  line-height: 1.75;
  color: #4b5f63;
}

.merton-closing {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: 0 0 clamp(4rem, 8vw, 7rem);
}

.merton-closing figure {
  margin: 0;
}

.merton-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 1rem;
  padding: 0.85rem 1.15rem;
  border-radius: 6px;
  background: #173b34;
  color: #fffef7;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.merton-button:hover {
  background: #b34b36;
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .merton-intro,
  .merton-band__inner,
  .merton-closing,
  .merton-story-grid {
    grid-template-columns: 1fr;
  }

  .merton-story-grid article {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .merton-hero {
    min-height: min(650px, calc(100svh - 4rem));
  }

  .merton-hero__image::after {
    background:
      linear-gradient(0deg, rgba(8, 31, 35, 0.94) 0%, rgba(8, 31, 35, 0.62) 58%, rgba(8, 31, 35, 0.2) 100%);
  }

  .merton-hero__content {
    padding-bottom: 3rem;
  }

  .merton-hero h1 {
    font-size: clamp(3rem, 16vw, 4.4rem);
  }

  .merton-hero__meta span {
    width: 100%;
  }
}

/* --- Planet Tooting Page --- */
.planet-hero {
  position: relative;
  min-height: min(780px, calc(100svh - 4rem));
  display: grid;
  align-items: center;
  overflow: hidden;
  background: #142a42;
}

.planet-hero__media {
  position: absolute;
  inset: 0;
}

.planet-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 25, 40, 0.90) 0%, rgba(10, 25, 40, 0.62) 40%, rgba(10, 25, 40, 0.12) 65%, rgba(10, 25, 40, 0) 100%),
    linear-gradient(0deg, rgba(10, 25, 40, 0.72) 0%, rgba(10, 25, 40, 0) 50%);
}

.planet-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.planet-hero__content {
  position: relative;
  margin: 0;
  padding: clamp(2rem, 4vh, 3rem) 0 clamp(2rem, 4vh, 3rem) clamp(2rem, 5vw, 5rem);
  color: #fffef7;
}

.planet-kicker {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffc857;
}

.planet-kicker--dark {
  color: #b43d52;
}

.planet-kicker--gold {
  color: #ffc857;
}

.planet-hero h1 {
  max-width: 520px;
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(3.25rem, 7vw, 6.6rem);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: 0;
}

.planet-hero p:not(.planet-kicker) {
  max-width: 480px;
  margin: 1.8rem 0 0;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.55;
  color: rgba(255, 254, 247, 0.92);
}

.planet-intro,
.planet-feature,
.planet-cards,
.planet-gallery-strip,
.planet-closing,
.planet-plaque-band__inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.planet-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.planet-intro h2,
.planet-feature h2,
.planet-plaque-band h2,
.planet-closing h2 {
  margin: 0 0 1.35rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.1rem, 4vw, 3.8rem);
  line-height: 1.05;
  color: #142a42;
  letter-spacing: 0;
}

.planet-intro p:not(.planet-kicker),
.planet-feature p,
.planet-plaque-band p:not(.planet-kicker),
.planet-closing p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #314247;
}

.planet-photo,
.planet-feature figure,
.planet-gallery-strip figure {
  margin: 0;
}

.planet-photo img,
.planet-feature img,
.planet-gallery-strip img {
  display: block;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(20, 42, 66, 0.16);
}

.planet-photo--street img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 70% 50%;
}

.planet-photo figcaption {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #66777b;
}

.planet-feature {
  display: grid;
  grid-template-columns: minmax(300px, 1.1fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: 0 0 clamp(4rem, 8vw, 7rem);
}

.planet-feature img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: 52% 54%;
}

.planet-plaque-band {
  background: #142a42;
  color: #fffef7;
  padding: clamp(3.4rem, 7vw, 5.6rem) 0;
}

.planet-plaque-band__inner {
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(3rem, 7vw, 6rem);
  align-items: center;
}

.planet-plaque-band__text {
  text-align: left;
}

.planet-plaque-band__poster {
  margin: 0;
  flex-shrink: 0;
}

.planet-plaque-band__poster img {
  width: clamp(200px, 28vw, 360px);
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}

.planet-plaque-band h2 {
  color: #fffef7;
}

.planet-plaque-band p:not(.planet-kicker) {
  color: rgba(255, 254, 247, 0.86);
}

.planet-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.planet-cards article {
  min-height: 310px;
  background: #fffef7;
  padding: clamp(1.35rem, 3vw, 2.5rem);
  border-top: 5px solid #b43d52;
}

.planet-cards article:nth-child(2) {
  border-top-color: #218780;
}

.planet-cards article:nth-child(3) {
  border-top-color: #ffc857;
}

.planet-cards span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 2rem;
  border-radius: 50%;
  background: #142a42;
  color: #fffef7;
  font-size: 1.2rem;
  line-height: 1;
}

.planet-cards h2 {
  margin: 0 0 1rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.05;
  color: #142a42;
}

.planet-cards p {
  margin: 0;
  line-height: 1.75;
  color: #4b5f63;
}

.planet-gallery-strip {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(1rem, 3vw, 2rem);
  padding: 0 0 clamp(4rem, 8vw, 7rem);
}

.planet-gallery-strip img {
  height: clamp(420px, 54vw, 680px);
  object-fit: cover;
}

.planet-gallery-strip figure:first-child img {
  object-position: 52% 45%;
}

.planet-gallery-strip figure:last-child img {
  object-position: 50% 38%;
}

.planet-closing {
  max-width: 900px;
  text-align: center;
  padding: 0 0 clamp(4rem, 8vw, 7rem);
}

.planet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 1rem;
  padding: 0.85rem 1.15rem;
  border-radius: 6px;
  background: #142a42;
  color: #fffef7;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.planet-button:hover {
  background: #b43d52;
  transform: translateY(-1px);
}

.merton-hero h1,
.merton-intro__lead h2,
.merton-band h2,
.merton-closing h2,
.planet-hero h1,
.planet-intro h2,
.planet-feature h2,
.planet-plaque-band h2,
.planet-cards h2,
.planet-closing h2 {
  overflow-wrap: normal;
  text-wrap: balance;
}

@media (max-width: 900px) {
  .planet-intro,
  .planet-feature,
  .planet-cards,
  .planet-gallery-strip {
    grid-template-columns: 1fr;
  }

  .planet-plaque-band__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .planet-plaque-band__text {
    text-align: center;
  }

  .planet-plaque-band__poster {
    justify-self: center;
  }

  .planet-plaque-band__poster img {
    width: clamp(180px, 60vw, 320px);
  }

  .planet-feature figure {
    order: 2;
  }

  .planet-cards article {
    min-height: 0;
  }

  .planet-gallery-strip img {
    height: auto;
    aspect-ratio: 4 / 5;
  }
}

@media (max-width: 640px) {
  .planet-hero {
    min-height: min(720px, calc(100svh - 4rem));
  }

  .planet-hero__media::after {
    background:
      linear-gradient(0deg, rgba(10, 25, 40, 0.94) 0%, rgba(10, 25, 40, 0.68) 58%, rgba(10, 25, 40, 0.2) 100%);
  }

  .planet-hero__content {
    padding-bottom: 3rem;
  }

  .planet-hero h1 {
    font-size: clamp(3rem, 16vw, 4.4rem);
  }

  .planet-intro p:not(.planet-kicker),
  .planet-feature p,
  .planet-plaque-band p:not(.planet-kicker),
  .planet-closing p {
    font-size: 1rem;
  }
}
