/* Silchester Association theme – matches the current Joomla / Megastar look */

:root {
  --teal: #003b46;
  --teal-deep: #002c34;
  --olive: #6d8f28;
  --olive-dark: #5c7a22;
  --grey-bar: #6b6b6b;
  --text: #666666;
  --heading: #003b46;
  --muted: #888888;
  --line: #dddddd;
  --panel: #ececec;
  --crumb: #efefef;
  --footer: #111111;
  --white: #ffffff;
  --box-width: 1170px;
  --serif: "Libre Baskerville", "Droid Serif", Georgia, "Times New Roman", serif;
  --sans: Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: #f4f4f4;
}

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

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  color: var(--olive);
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--heading);
  line-height: 1.25;
}

.screen-reader-text,
.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 1000;
  background: #fff;
  padding: 8px 12px;
}

.site-canvas {
  position: relative;
}

.site-box {
  max-width: var(--box-width);
  margin: 0 auto;
  background: var(--white);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.08);
}

/* Header */

.site-header {
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px 16px;
}

.brand-link img {
  height: 64px;
  width: auto;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.primary-nav .menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2px;
}

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

.primary-nav .menu > li > a {
  display: block;
  padding: 10px 11px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4a4a4a;
  font-weight: 500;
  white-space: nowrap;
}

.primary-nav .menu > li > a:hover,
.primary-nav .menu > li.current-menu-item > a,
.primary-nav .menu > li.current-menu-ancestor > a {
  color: var(--teal);
}

.primary-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  list-style: none;
  margin: 0;
  padding: 8px 0;
  z-index: 40;
}

.primary-nav .menu > li:hover > .sub-menu,
.primary-nav .menu > li:focus-within > .sub-menu {
  display: block;
}

.primary-nav .sub-menu a {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  color: #555;
}

.primary-nav .sub-menu a:hover {
  background: #f6f6f6;
  color: var(--teal);
}

.search-toggle {
  background: none;
  border: 0;
  cursor: pointer;
  color: #555;
  padding: 8px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 40px;
  height: 36px;
  padding: 6px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--teal);
  margin: 6px 0;
}

.header-search {
  padding: 0 28px 16px;
}

.header-search .search-form {
  display: flex;
  gap: 8px;
}

.search-form input[type="search"] {
  flex: 1;
  border: 1px solid #ccc;
  padding: 10px 12px;
  font: inherit;
}

.search-form button,
.newsletter-fallback button,
.contact-form button {
  font: inherit;
}

/* News ticker */

.news-ticker {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-bottom: 1px solid #eee;
  min-height: 42px;
}

.news-ticker__label {
  background: #7a8f3a;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 10px 18px;
  position: relative;
  white-space: nowrap;
}

.news-ticker__label::after {
  content: "";
  position: absolute;
  right: -12px;
  top: 0;
  border-top: 21px solid transparent;
  border-bottom: 21px solid transparent;
  border-left: 12px solid #7a8f3a;
}

.news-ticker__track {
  overflow: hidden;
  flex: 1;
  display: flex;
  align-items: center;
  padding-left: 22px;
}

.news-ticker__items {
  display: flex;
  gap: 36px;
  white-space: nowrap;
  animation: ticker 28s linear infinite;
}

.news-ticker__items a,
.news-ticker__items span {
  color: #666;
  font-size: 13px;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Hero */

.hero-slider {
  position: relative;
  height: 360px;
  overflow: hidden;
  background: #000;
}

.hero-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.hero-slide.is-active {
  opacity: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.hero-slide figcaption {
  position: absolute;
  left: 40px;
  bottom: 36px;
  color: #fff;
  font-family: var(--serif);
  font-size: 32px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.hero-nav {
  position: absolute;
  top: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

.hero-nav--prev { right: 56px; }
.hero-nav--next { right: 16px; }

/* Events panel */

.events-panel {
  background: var(--panel);
  padding: 48px 28px 56px;
}

.events-panel-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: start;
}

.events-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.event-card {
  background: #fff;
  box-shadow: 0 1px 0 #c5d4a0;
}

.event-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.event-card h3 {
  margin: 0;
  padding: 16px 12px 18px;
  text-align: center;
  font-size: 18px;
  color: #555;
}

.events-cta h2 {
  font-size: 42px;
  margin: 8px 0 16px;
}

.events-cta p {
  margin: 0 0 22px;
  color: #777;
}

.btn {
  display: block;
  text-align: center;
  padding: 14px 12px;
  letter-spacing: 0.12em;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}

.btn-solid {
  background: var(--teal);
  color: #fff;
  border: 1px solid var(--teal);
}

.btn-solid:hover {
  background: var(--teal-deep);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: #444;
  border: 1px solid var(--teal);
}

.btn-outline:hover {
  background: var(--teal);
  color: #fff;
}

/* Objectives */

.objectives {
  padding: 64px 28px 28px;
  text-align: center;
}

.objectives h2,
.directory h2 {
  font-size: 42px;
  margin: 0 0 28px;
}

.objectives-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.objective .check {
  display: inline-block;
  color: var(--olive);
  font-size: 28px;
  margin-bottom: 10px;
}

.objective p {
  margin: 0;
  font-size: 14px;
  color: #666;
}

.objective strong {
  color: #333;
  font-weight: 500;
}

/* Directory */

.directory {
  padding: 36px 28px 56px;
  text-align: center;
}

.section-lead {
  color: #888;
  margin: -12px 0 32px;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  text-align: left;
}

.directory-card {
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.directory-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.directory-card h3 {
  margin: 0;
  padding: 16px 10px 18px;
  text-align: center;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #555;
}

.card-meta {
  text-align: center;
  margin: -10px 0 16px;
  font-size: 13px;
  color: #888;
}

/* CTA bands + newsletter + email */

.cta-bands {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.cta-band {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  color: #fff;
  font-size: 22px;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.cta-band:hover {
  color: #fff;
  filter: brightness(1.08);
}

.cta-band--grey { background: var(--grey-bar); }
.cta-band--green { background: var(--olive); }
.cta-band--teal {
  background: var(--teal);
  grid-column: 1 / -1;
}

.newsletter {
  background: #5a6a28 url("../images/newsletter.jpg") center / cover no-repeat;
  position: relative;
}

.newsletter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(0, 0, 0, 0.08) 0 2px,
    transparent 2px 6px
  );
}

.newsletter-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 54px 48px;
}

.newsletter h2 {
  color: #fff;
  font-size: 32px;
  margin: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

.newsletter-fallback {
  display: flex;
  gap: 8px;
}

.newsletter-fallback input,
.newsletter-fallback button {
  border: 0;
  padding: 12px 14px;
  min-width: 160px;
  font: inherit;
}

.newsletter-fallback button {
  background: #fff;
  cursor: pointer;
  color: #555;
}

.email-cta {
  display: block;
  background: var(--teal);
  color: #fff;
  text-align: center;
  padding: 28px 16px;
  font-size: 24px;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.email-cta:hover {
  color: #fff;
  background: var(--teal-deep);
}

/* Footer */

.site-footer {
  background: var(--footer);
  color: #cfcfcf;
  padding: 28px 28px 36px;
  font-size: 13px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.footer-copy { margin: 0; }
.footer-credit { margin: 0; text-align: right; }
.footer-email {
  margin: 0;
  text-align: center;
}

.footer-email a {
  display: inline-block;
  border: 1px solid #666;
  color: #ddd;
  padding: 8px 18px;
  letter-spacing: 0.12em;
  font-size: 12px;
}

.footer-nav .menu {
  display: flex;
  justify-content: center;
  gap: 16px;
  list-style: none;
  padding: 16px 0 0;
  margin: 0;
}

.footer-nav a { color: #aaa; }

/* Inner pages */

.page-banner {
  height: 260px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.page-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent 55%);
}

.page-banner-inner {
  position: relative;
  z-index: 1;
  padding: 0 48px 36px;
}

.page-banner h1 {
  margin: 0;
  color: #fff;
  font-size: 48px;
  font-weight: 400;
}

.breadcrumbs {
  background: var(--crumb);
  padding: 12px 48px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #888;
}

.breadcrumbs a { color: #7a8f3a; }
.breadcrumbs .sep { margin: 0 8px; color: #bbb; }
.breadcrumbs-label { margin-right: 10px; color: #666; font-weight: 600; }

.page-main {
  padding: 40px 48px 64px;
}

.page-article {
  max-width: 100%;
}

.entry-content h2,
.entry-content h3 {
  margin-top: 1.6em;
}

.entry-content p {
  margin: 0 0 1.1em;
}

.entry-content .alignright {
  float: right;
  margin: 0 0 1.2em 1.6em;
  max-width: 46%;
}

.entry-content .alignleft {
  float: left;
  margin: 0 1.6em 1.2em 0;
  max-width: 46%;
}

.listing-hero {
  margin-bottom: 24px;
}

.listing-hero img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.post-list {
  display: grid;
  gap: 28px;
}

.post-tease {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
}

.post-tease h2 {
  margin: 0 0 6px;
  font-size: 26px;
}

.meta,
.event-when {
  color: #888;
  font-size: 14px;
}

.events-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 520px;
  margin: 0 0 32px;
}

.contact-form label {
  display: block;
  margin-bottom: 4px;
  color: #444;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  max-width: 560px;
  border: 1px solid #ccc;
  padding: 10px 12px;
  font: inherit;
  margin-bottom: 14px;
}

.home-extra {
  padding: 0 48px 48px;
}

/* Social rail */

.social-rail {
  position: fixed;
  left: 0;
  top: 42%;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.social-rail__btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
}

.social-rail__btn--fb { background: var(--teal); }
.social-rail__btn--x { background: var(--teal-deep); }
.social-rail__btn:hover { color: #fff; filter: brightness(1.15); }

/* Pagination */

.pagination {
  margin-top: 32px;
}

.pagination .nav-links {
  display: flex;
  gap: 8px;
}

.pagination a,
.pagination span {
  padding: 6px 10px;
  border: 1px solid #ddd;
}

/* Mobile */

@media (max-width: 980px) {
  .header-inner { padding: 12px 16px; }
  .brand-link img { height: 48px; }
  .nav-toggle { display: block; }
  .primary-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 76px;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 20px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    z-index: 30;
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav .menu { flex-direction: column; align-items: stretch; }
  .primary-nav .sub-menu {
    position: static;
    display: block;
    box-shadow: none;
    padding-left: 12px;
  }
  .events-panel-inner,
  .events-cards,
  .objectives-grid,
  .directory-grid,
  .newsletter-inner,
  .footer-inner,
  .post-tease {
    grid-template-columns: 1fr;
  }
  .newsletter-inner { flex-direction: column; align-items: stretch; padding: 36px 20px; }
  .newsletter-fallback { flex-direction: column; }
  .hero-slider { height: 220px; }
  .hero-slide figcaption { font-size: 22px; left: 16px; bottom: 16px; }
  .page-banner { height: 180px; }
  .page-banner h1 { font-size: 32px; }
  .page-banner-inner,
  .breadcrumbs,
  .page-main { padding-left: 18px; padding-right: 18px; }
  .objectives h2,
  .directory h2,
  .events-cta h2 { font-size: 32px; }
  .cta-band { font-size: 16px; min-height: 72px; }
  .email-cta { font-size: 16px; }
  .social-rail { display: none; }
}
