/* ============================================================================
   Durham City Freemen – Theme CSS (cleaned)
   Visual parity with your current build. Responsive rules live near sections.
   ============================================================================ */

/* ---------------------------------------------------------------------------
   Design tokens
   --------------------------------------------------------------------------- */

:root {
  --df-accent: #9bb2bd;
  /* soft blue */
  --df-cream: #ede9e6;
  /* background cream */
  --df-deep: #6d696a;
  /* header/footer slate */
  --df-green: #7d8b3f;
  --df-red: #ff0000;
  /* crest red */
  --df-text: #2b2b2b;
  /* body text */
  --maxw: 1600px;
}

/* ---------------------------------------------------------------------------
   Base / Resets
   --------------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html, body {
  height: auto;
  scroll-snap-stop: normal;
}

/* Only apply snap on the homepage */
body.home html,
body.home {
  height: 100%;
}

body.home .scroll-snap-wrapper {
  scroll-snap-type: y proximity;
}

body.home .section {
  scroll-snap-align: start;
}

/* Let the main site content stretch */
main {
  flex: 1 0 auto;
}

body {
  background-attachment: fixed;
  /* Changed to relative path to allow easy domain moves */
  background-image: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)), url('assets/bg.png');
  background-position: center top;
  background-repeat: repeat;
  background-size: auto;
  color: var(--df-text);
  display: flex;
  flex-direction: column;
  font: normal 18px/1.5625 "Source Sans Pro", "Proxima Nova", Helvetica Neue, Helvetica, Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

.page-content {
  background: var(--df-cream);
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 1.25rem;
}

/* ---------------------------------------------------------------------------
   Typography
   --------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "PT Serif", "Merriweather", Georgia, sans-serif;
  font-weight: 500;
}

.lead {
  color: #222;
  font-size: 1.1rem;
}

h2.section-title {
  font-size: clamp(1.2rem, 1vw + 1rem, 1.8rem);
  margin: 0 0 1rem;
}

/* ---------------------------------------------------------------------------
   Containers & Utilities
   --------------------------------------------------------------------------- */

.container {
  margin: 0 auto;
  max-width: var(--maxw);
  padding: 1.25rem;
  z-index: 1;
}

.grid {
  display: grid;
  gap: 1rem;
}

.flex {
  display: flex;
  gap: 1rem;
}

.mt-1 {
  margin-top: 1rem;
}

.mt-2 {
  margin-top: 2rem;
}

.mb-0 {
  margin-bottom: 0;
}

.badge {
  background: var(--df-accent);
  border-radius: 0.4rem;
  color: #102;
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
}

.highlight {
  color: var(--df-red);
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */

.btn {
  background: var(--df-deep);
  border: 1px solid transparent;
  border-radius: 0.5rem;
  color: #fff;
  display: inline-block;
  padding: 0.6rem 1rem;
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  border-color: #fff;
  color: #fff;
}

.btn:hover {
  opacity: 0.9;
}

/* ---------------------------------------------------------------------------
   Global links
   --------------------------------------------------------------------------- */

a {
  color: inherit;
  position: relative;
  text-decoration: none;
  word-wrap: normal;
}

/* ---------------------------------------------------------------------------
   Header & Primary Navigation
   --------------------------------------------------------------------------- */

.site-header {
  backdrop-filter: saturate(120%) blur(6px);
  background: rgba(109, 105, 106, 0.92);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
}

.site-header .branding {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

.site-header .branding img {
  height: 50px;
  margin: 0.5em;
  width: auto;
}

/* WP menu base (hidden on mobile by default, opened via .open) */
.site-header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header nav a {
  color: #fff;
  padding: 0.75rem 0.9rem;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav .current-menu-item > a {
  background: rgba(255, 255, 255, 0.12);
}

.menu-toggle {
  background: none;
  border: none;
  color: #fff;
  display: none;
  font-size: 1.2rem;
}

/* Mobile header menu */
@media (max-width: 900px) {
  .site-header nav ul {
    display: none;
    flex-direction: column;
    padding: 0.75rem;
  }

  .site-header nav ul.open {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }
}

/* ---------------------------------------------------------------------------
   Custom Dropdown Menu (main-menu)
   --------------------------------------------------------------------------- */

.main-menu,
.main-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-menu {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.main-menu > li {
  position: relative;
}

/* top-level */
.main-menu > li > a {
  color: #fff;
  display: block;
  font-family: "PT Serif", "Merriweather", Georgia, sans-serif;
  padding: 0.8rem 1rem;
  transition: background 0.25s ease, color 0.25s ease;
}

.main-menu > li > a:hover,
.main-menu > li.current-menu-item > a {
  background: #fdfdfd;
  color: var(--df-red);
}

/* submenu container */
.main-menu li ul {
  background: #fdfdfd;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  left: 0;
  min-width: 220px;
  opacity: 0;
  padding: 0.25rem 0;
  position: absolute;
  top: 100%;
  transform: translateY(10px);
  transition: all 0.25s ease;
  visibility: hidden;
  z-index: 9999;
}

/* show submenu on hover/focus */
.main-menu li:hover > ul,
.main-menu li:focus-within > ul {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

/* short delay before hiding */
.main-menu li ul {
  transition-delay: 0s;
}

.main-menu li:not(:hover) > ul {
  transition-delay: 0.3s;
}

/* submenu links (full width) */
.main-menu li ul li {
  width: 100%;
}

.main-menu li ul a {
  background: transparent;
  border-left: 3px solid transparent;
  box-sizing: border-box;
  color: var(--df-text);
  display: block;
  font: 500 0.93rem "Open Sans", Arial, sans-serif;
  padding: 0.55rem 1rem;
  text-align: left;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
  width: 100%;
}

.main-menu li ul a:hover {
  background: #f0f0f0;
  border-left-color: var(--df-red);
  color: var(--df-red);
}

/* separators between submenu items */
.main-menu li ul li + li a {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

/* nested submenus */
.main-menu li ul li ul {
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
  left: 100%;
  margin-left: 1px;
  top: 0;
}

/* mobile: flatten menus */
@media (max-width: 900px) {
  .main-menu {
    background: rgba(109, 105, 106, 0.95);
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .main-menu ul {
    background: none;
    border: none;
    box-shadow: none;
    opacity: 1;
    position: static;
    transform: none;
    transition: none;
    visibility: visible;
  }

  .main-menu a {
    color: #fff;
    padding: 0.7rem 1rem;
  }
}

/* ---------------------------------------------------------------------------
   Desktop Search Button Match (mobile style)
   --------------------------------------------------------------------------- */

@media (min-width: 901px) {
  .search-form {
    align-items: center;
    display: flex;
    gap: 0.5rem;
  }

  .search-field {
    border: 1px solid #ccc;
    border-radius: 4px;
    flex: 1;
    font-size: 1rem;
    padding: 0.4rem 0.6rem;
  }

  .search-submit {
    background: #8a0707 !important;
    border: none !important;
    border-radius: 4px !important;
    color: #fff !important;
    cursor: pointer;
    padding: 0.45rem 0.75rem !important;
    transition: background 0.2s ease;
  }

  .search-submit:hover {
    background: #a10a0a !important;
  }
}

/* ---------------------------------------------------------------------------
   Scroll-snap sections (home)
   --------------------------------------------------------------------------- */

.scroll-snap-wrapper {
  height: auto;
  overflow-y: visible;
  scroll-snap-type: y proximity;
}

.section {
  align-items: center;
  display: flex;
  padding: 0;
  scroll-snap-align: start;
}

/* Footer section is not forced tall */
.section.footer {
  display: block;
  height: auto;
  min-height: auto;
  scroll-snap-align: none;
}

.section .container {
  width: 100%;
}

/* ---------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------- */

.hero {
  align-items: flex-end;
  background: #000;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: #fff;
  display: flex;
  height: 60vh;
  justify-content: flex-start;
  padding-bottom: 4rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  position: relative;
}

.hero .content {
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

.hero .bg {
  background-position: center top;
  background-size: cover;
  filter: brightness(0.75);
  inset: 0;
  position: absolute;
}

.hero .overlay {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 40%, rgba(0, 0, 0, 0.6) 100%);
  inset: 0;
  position: absolute;
}

.hero .crest {
  height: 60px;
  margin-bottom: 0.5rem;
  width: auto;
}

.hero h1 {
  font-size: clamp(1.6rem, 2.5vw + 1rem, 3rem);
  font-weight: 500;
  margin: 0.25rem 0 1rem;
}

.hero p {
  font-size: clamp(1rem, 1vw + 0.6rem, 1.25rem);
}

.hero video.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  filter: brightness(0.75);
}

/* ---------------------------------------------------------------------------
   Homepage “info” section (News + Events)
   --------------------------------------------------------------------------- */

.home-info-layout {
  align-items: stretch;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr 2fr;
}

@media (max-width: 1000px) {
  .home-info-layout {
    grid-template-columns: 1fr;
  }
}

.info-panel h4 {
  color: var(--df-red);
  font-weight: 500;
  margin: 0.5rem 0 0.25rem;
}

.news-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-main img {
  border-radius: 0.3rem;
  height: auto;
  width: 100%;
}

.news-main ul {
  list-style: disc;
  margin: 0;
  padding-left: 1.5rem;
}

.news-main li a {
  color: var(--df-text);
  text-decoration: none;
}

.right-column {
  display: grid;
  gap: 2rem;
  grid-template-rows: 1fr 1fr;
}

/* Events block – layout handled by unified .event-panel below */

/* Calendar widget */
.event-panel .event-calendar {
  max-width: none;
}

.event-calendar {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
  max-width: 280px;
  overflow: hidden;
  width: 100%;
}

.event-calendar table {
  border-collapse: collapse;
  text-align: center;
  width: 100%;
}

.event-calendar thead th {
  background: #2e3b55;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem;
  text-transform: uppercase;
}

.event-calendar caption {
  background: #4c5974;
  color: #fff;
  font-weight: bold;
  padding: 0.5rem;
  text-transform: capitalize;
}

.event-calendar th,
.event-calendar td {
  border: 1px solid #ddd;
  height: 2.2rem;
  padding: 0.4rem;
  width: 14.2%;
}

.event-calendar td.empty {
  background: #f7f7f7;
}

.event-calendar td.today {
  background: #cfd5e2;
  border: 2px solid #2e3b55;
}

.event-calendar td.has-event {
  background: #ba2c2c;
  border: 1px solid #a22323;
  color: #fff;
  font-weight: 600;
}

.event-calendar td.has-event:hover {
  background: #8e1f1f;
  cursor: pointer;
}

/* Announcements list */
.announcement-item {
  margin-bottom: 1rem;
}

.announcement-item:last-child {
  margin-bottom: 0;
}

.announcement-item h4 {
  margin-bottom: 0.25rem;
}

/* --- Home Info Layout – refined visual parity --- */

/* Panel structure, header bar and body are unified in the Refined home info section below. */
/* News panel tweaks */
.news-main img {
  border-radius: 3px;
  margin-bottom: 0.75rem;
}

.news-main h4 a {
  color: var(--df-deep);
  font-weight: 600;
  text-decoration: none;
}

.news-main h4 a:hover {
  color: var(--df-red);
}

.news-main small {
  color: #666;
  display: block;
  margin-bottom: 0.5rem;
}

/* Recent news list */
.news-main ul {
  list-style: none;
  padding-left: 0;
}

.news-main li {
  border-top: 1px solid #eee;
  padding: 0.4rem 0;
}

.news-main li:first-child {
  border-top: none;
}

.news-main li a {
  color: var(--df-deep);
  display: inline-block;
  text-decoration: none;
}

.news-main li a:hover {
  color: var(--df-red);
}

/* Events panel content */
.event-panel h4 {
  color: var(--df-red);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.event-panel ul {
  list-style: none;
  margin-top: 0.5rem;
  padding-left: 0;
}

.event-panel li {
  border-bottom: 1px solid #eee;
  padding: 0.25rem 0;
}

.event-panel li:last-child {
  border-bottom: none;
}

/* Calendar column */
.calendar-header h4 {
  background: var(--df-accent);
  border-radius: 3px 3px 0 0;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  padding: 0.4rem 0.6rem;
}

/* ✅ Responsive fixes for event panel layout */
@media (max-width: 900px) {
  .event-panel {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem;
  }

  .event-panel > div {
    width: 100% !important;
  }

  .calendar-container,
  .calendar-box,
  .event-calendar {
    max-width: 100% !important;
    width: 100% !important;
  }

  .calendar-container {
    order: 2;
  }

  .event-details {
    order: 1;
  }

  .calendar-box {
    border-radius: 4px;
    overflow-x: auto;
  }

  .calendar-box table {
    min-width: 320px;
    width: 100%;
  }
}

/* Announcements */
.info-panel h3 + p,
.announcement-item {
  font-size: 0.95rem;
  line-height: 1.5;
}

.announcement-item h4 a {
  color: var(--df-red);
  font-weight: 600;
  text-decoration: none;
}

.announcement-item h4 a:hover {
  color: var(--df-deep);
}

/* Right column grid ratio */
.right-column {
  display: grid;
  gap: 2rem;
  grid-template-rows: 2fr 1fr;
}

/* Responsive behavior */
@media (max-width: 1000px) {
  .event-panel {
    grid-template-columns: 1fr;
  }
}

/* Announcements panel styling */
.announcements-panel .announcement-item {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  transition: box-shadow 0.2s ease;
}

.announcements-panel .announcement-item:hover {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.announcements-panel .announcement-title a {
  color: var(--text-dark, #333);
  text-decoration: none;
}

.announcements-panel .announcement-title a:hover {
  color: var(--accent, #9b1c1c);
}

.announcements-panel .announcement-body {
  color: #444;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 0.5rem;
}

.announcements-panel .announcement-footer {
  margin-top: 0.75rem;
  text-align: right;
}

.announcements-panel .announcement-footer .read-more {
  color: var(--accent, #9b1c1c);
  font-size: 0.875rem;
  text-decoration: none;
}

.announcements-panel .announcement-footer .read-more:hover {
  text-decoration: underline;
}

/* --- Refined home info section --- */

/* Softer card panels / Panel structure */
.info-panel {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  height: 100%;
  overflow: hidden;
  padding: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.info-panel:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* Distinct header bars / Header bar */
.info-panel > h3 {
  background: var(--df-deep);
  border: none;
  border-bottom: 3px solid var(--df-accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  padding: 0.9rem 1.2rem;
}

/* Unique color headers per type */
.info-panel:nth-of-type(1) > h3 {
  background: #4d3a40;
}

.right-column > .info-panel:first-child > h3 {
  background: #545f7f;
}

.right-column > .info-panel:last-child > h3 {
  background: #b6b0a3;
  color: #222;
}

/* Panel body */
.info-panel > *:not(h3) {
  padding: 1.25rem 1.5rem;
}

/* --- Event Panel --- */
.event-panel {
  align-items: start;
  display: grid;
  gap: 2rem;
  grid-template-columns: 2fr 1fr;
}

/* Calendar header */
.calendar-header {
  align-items: center;
  background: var(--df-accent);
  color: #fff;
  display: flex;
  font-size: 0.9rem;
  font-weight: 600;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
}

/* Calendar table */
.event-calendar {
  background: #fff;
  border-top: none;
  border-radius: 0 0 4px 4px;
  font-size: 0.85rem;
  overflow: hidden;
  width: 100%;
}

/* Month controls */
.calendar-header .nav {
  display: flex;
  gap: 0.4rem;
}

.calendar-header button {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.15rem 0.4rem;
}

.calendar-header button:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Shared text tweaks */
.news-main h4 a,
.announcement-item h4 a {
  color: var(--df-deep);
  font-weight: 600;
  text-decoration: none;
}

.news-main h4 a:hover,
.announcement-item h4 a:hover {
  color: var(--df-red);
}

/* ---------------------------------------------------------------------------
   Cards / Galleries / People
   --------------------------------------------------------------------------- */

.home-sections .cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  .home-sections .cards {
    grid-template-columns: 1fr;
  }
}

.card-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 2rem;
}

.card-item {
  align-items: flex-end;
  aspect-ratio: 1/1;
  background-color: #ccc;
  background-position: center;
  background-size: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  overflow: hidden;
  position: relative;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Dark overlay (behind text) */
.card-item::before {
  background: rgba(0, 0, 0, 0.35);
  content: "";
  inset: 0;
  position: absolute;
  transition: background 0.3s ease;
  z-index: 0;
}

.card-item:hover::before {
  background: rgba(0, 0, 0, 0.5);
}

.card-item:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

/* Overlay text container */
.card-item .overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
  box-sizing: border-box;
  padding: 0.75rem;
  position: relative;
  width: 100%;
  z-index: 1;
}

.card-item h3 {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

/* Featured contact + Recently admitted */
.featured-contact {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 300px 1fr;
}

@media (max-width: 1000px) {
  .featured-contact {
    grid-template-columns: 1fr;
  }
}

.recently-admitted {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(7, 1fr);
}

@media (max-width: 1000px) {
  .recently-admitted {
    grid-template-columns: repeat(2, 1fr);
  }
}

.recently-admitted .person {
  align-items: center;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  max-width: 180px;
  overflow: hidden;
  padding: 0.5rem;
  text-align: center;
}

.recently-admitted .person img {
  display: block;
  height: 180px;
  margin: 0 auto;
  object-fit: cover;
  object-position: center top;
  width: 100%;
}

.recently-admitted .person h4,
.recently-admitted .person p {
  margin: 0.25rem 0;
}
.year-filter {
  margin: 1.5rem 0;
  text-align: center;
}

.year-filter a {
  margin: 0 0.35rem;
  text-decoration: none;
  color: #555;
  font-size: 0.95rem;
}

.year-filter a.active {
  font-weight: 700;
  color: #000;
  text-decoration: underline;
}

/* Galleries */
.gallery-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(6, 1fr);
}

.gallery-grid img {
  display: block;
  height: auto;
  width: 100%;
}

@media (max-width: 1000px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------------------------------------------------------------------------
   Downloads banner (optional on pages)
   --------------------------------------------------------------------------- */

.downloads-banner {
  background: #fff;
  border-bottom: 1px solid #fff;
  border-top: 1px solid #fff;
  font-size: 0.95rem;
  padding: 0.75rem 0;
}

.downloads-banner .container {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-start;
}

.downloads-banner strong {
  color: var(--df-deep);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.download-links a {
  align-items: center;
  color: var(--df-red);
  display: flex;
  font-weight: 600;
  gap: 0.3rem;
  text-decoration: none;
}

.download-links a:hover {
  color: var(--df-deep);
}

/* ---------------------------------------------------------------------------
   Page layouts (detail pages): left nav + content + optional right sidebar
   --------------------------------------------------------------------------- */

.page-layout.two-column {
  align-items: start;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr 3fr;
  margin: 3rem auto;
  max-width: var(--maxw);
}

.page-layout.three-column {
  align-items: start;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr 2fr 1fr;
  margin: 3rem auto;
  max-width: var(--maxw);
}

@media (max-width: 900px) {
  .page-layout.two-column,
  .page-layout.three-column {
    grid-template-columns: 1fr;
  }
}

/* Left navigation box */
.page-nav {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  max-width: 100%;
  overflow-x: hidden;
  padding: 1.25rem;
}

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

.page-nav li {
  margin-bottom: 0.5rem;
}

.page-nav a {
  color: var(--df-text);
  display: inline-block;
  padding-left: 1.1em;
  position: relative;
  text-decoration: none;
}

.page-nav a::before {
  color: var(--df-red);
  content: "›";
  font-weight: bold;
  left: 0;
  position: absolute;
}

.page-nav a:hover {
  color: var(--df-red);
}

.page-nav .current_page_item > a {
  color: var(--df-red);
  font-weight: 700;
}

/* Content */
.page-content h1 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.page-content p {
  margin-bottom: 1rem;
}

/* Right sidebar */
.page-sidebar {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 100%;
  overflow-wrap: break-word;
  overflow-x: hidden;
  word-wrap: break-word;
}

.page-sidebar img {
  display: block;
  height: 180px;
  object-fit: contain;
  margin: 0;
  width: 100%;
}

.page-sidebar p {
  margin: 0.5rem 0;
}

.page-sidebar h4,
.page-sidebar h5,
.page-sidebar h6 {
  color: var(--df-deep);
  font-weight: 600;
  margin: 0.5rem 0 0.25rem;
}

/* mobile-safe overflow guards */
@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .page-layout {
    display: block;
    margin: 0 auto;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 1.5rem 1rem;
    width: 100%;
  }

  .page-nav,
  .page-sidebar,
  .page-content {
    max-width: 100%;
    overflow-x: hidden;
  }

  .page-sidebar img {
    height: 160px;
  }
}

/* ---------------------------------------------------------------------------
   Apprentice Award – application form
   --------------------------------------------------------------------------- */

.award-form {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  color: var(--df-text);
  font-size: 0.95rem;
  margin: 3rem auto;
  max-width: 1000px;
  padding: 2rem 2.5rem;
}

.award-form h1,
.award-form h2 {
  border-bottom: 2px solid var(--df-accent);
  color: var(--df-deep);
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight: 700;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
  padding-bottom: 0.25rem;
}

.award-form h1 {
  border: none;
  font-size: 1.8rem;
  margin-top: 0;
}

.award-form p {
  line-height: 1.6;
  margin-bottom: 1rem;
}

.award-form label {
  color: var(--df-deep);
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.award-form input[type="text"],
.award-form input[type="email"],
.award-form input[type="tel"],
.award-form input[type="file"],
.award-form input[type="number"],
.award-form textarea {
  background: #fafafa;
  border: 1px solid #ccc;
  border-radius: 0.4rem;
  box-sizing: border-box;
  font: inherit;
  padding: 0.6rem 0.8rem;
  width: 100%;
}

.award-form input:focus,
.award-form textarea:focus {
  background: #fff;
  border-color: var(--df-red);
  outline: none;
}

/* grid rows */
.award-form .form-row {
  display: grid;
  gap: 1rem 2rem;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 1.25rem;
}

@media (max-width: 800px) {
  .award-form .form-row {
    grid-template-columns: 1fr;
  }
}

/* areas */
.award-form textarea {
  min-height: 160px;
  resize: vertical;
}

/* file input */
.award-form input[type="file"] {
  background: #fdfdfd;
  border: 1px dashed #bbb;
  padding: 0.4rem;
}

.award-form input[type="file"]:hover {
  border-color: var(--df-accent);
}

/* submit */
.award-form button,
.award-form input[type="submit"] {
  background: var(--df-deep);
  border: none;
  border-radius: 0.4rem;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  transition: background 0.2s ease-in-out;
}

.award-form button:hover,
.award-form input[type="submit"]:hover {
  background: var(--df-red);
}

.award-form label .required {
  color: red;
  margin-left: 0.25rem;
}

.award-form section {
  margin-bottom: 2rem;
}

.award-form .note {
  background: #f7f7f7;
  border-left: 4px solid var(--df-accent);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
}

.award-form input[type="checkbox"],
.award-form input[type="radio"] {
  margin-right: 0.5rem;
  width: auto;
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */

.site-footer {
  background: var(--df-deep);
  color: #fff;
  flex-shrink: 0;
  margin-top: auto;
  padding: 3rem 0 1.5rem;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.site-footer .columns {
  display: grid;
  gap: 1rem;
  grid-template-columns: 2fr 1fr 1fr 1fr;
}

.site-footer a {
  color: #fff;
  opacity: 0.9;
  text-decoration: none;
}

.site-footer a:hover {
  opacity: 1;
}

.site-footer .legal {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
}

@media (max-width: 1000px) {
  .site-footer .columns {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Footer Polish --- */
.site-footer {
  background: var(--df-deep);
  color: #fff;
  margin: 0;
  padding: 3rem 0 1.5rem;
}

.site-footer .columns {
  align-items: start;
  display: grid;
  gap: 2rem;
  grid-template-columns: 2fr 1fr 1fr 1fr;
}

.footer-about img {
  margin-top: 1rem;
  max-height: 50px;
  width: auto;
}

.footer-links ul,
.footer-news ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li,
.footer-news li {
  margin-bottom: 0.4rem;
}

.footer-links a,
.footer-news a {
  color: #fff;
  opacity: 0.9;
  text-decoration: none;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.footer-links a:hover,
.footer-news a:hover {
  color: var(--df-accent);
  opacity: 1;
}

/* Social icons */
.footer-social .social-icons {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.footer-social .social-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  transition: background 0.25s ease, color 0.25s ease;
  width: 36px;
}

.footer-social .social-icon:hover {
  background: var(--df-accent);
  color: var(--df-deep);
}

.footer-social svg {
  height: 18px;
  width: 18px;
}

/* Legal line */
.site-footer .legal {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  font-size: 0.85rem;
  justify-content: space-between;
  margin-top: 2rem;
  opacity: 0.8;
  padding-top: 1rem;
}

@media (max-width: 900px) {
  .site-footer .columns {
    gap: 1.5rem;
    grid-template-columns: 1fr 1fr;
  }

  .site-footer .legal {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* --- Footer Cleanup + Logo + No Chevrons --- */
.site-footer {
  background: var(--df-deep);
  color: #fff;
  margin: 0;
  padding: 3rem 0 1.5rem;
}

.site-footer .columns {
  align-items: start;
  display: grid;
  gap: 2rem;
  grid-template-columns: 2fr 1fr 1fr 1fr;
}

.footer-logo img {
  display: block;
  margin-bottom: 1rem;
  max-height: 60px;
  width: auto;
}

/* kill inherited chevrons globally for footer */
.site-footer a::before {
  content: none !important;
}

/* links */
.footer-links ul,
.footer-news ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a,
.footer-news a {
  color: #fff;
  opacity: 0.9;
  text-decoration: none;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.footer-links a:hover,
.footer-news a:hover {
  color: var(--df-accent);
  opacity: 1;
}

/* socials */
.footer-social .social-icons {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

@media (max-width: 768px){
    .footer-social .social-icons {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.5rem;
    justify-content: center;
  }
}

.footer-social .social-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  transition: background 0.25s ease, color 0.25s ease;
  width: 36px;
}

.footer-social .social-icon:hover {
  background: var(--df-accent);
  color: var(--df-deep);
}

.footer-social svg {
  height: 18px;
  width: 18px;
}

/* legal bar */
.site-footer .legal {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  font-size: 0.85rem;
  justify-content: space-between;
  margin-top: 2rem;
  opacity: 0.8;
  padding-top: 1rem;
}

/* responsiveness */
@media (max-width: 900px) {
  .site-footer .columns {
    gap: 1.5rem;
    grid-template-columns: 1fr 1fr;
  }

  .site-footer .legal {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

.three-column-updates .updates-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  margin-top: 1.5rem;
}

/* Base panel styling */
.updates-panel {
  background: #e5f2ef;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* === PANEL COLORS (match original) === */
.news-panel {
  background: #4b3832;
  color: #fff;
}

.news-panel .updates-header {
  background: #4b3832;
  color: #fff;
  padding: 0.75rem 1rem;
}

.news-panel .updates-body {
  background: #f2eeec;
  color: #333;
  padding: 1rem;
}

/* CONTACTS (minty green) */
.contacts-panel .updates-header {
  background: #a7cbc3;
  color: #000;
  padding: 0.75rem 1rem;
}

.contacts-panel .updates-body {
  background: #e5f2ef;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem;
}

/* RECENTLY ADMITTED (pale blue) */
.admitted-panel .updates-header {
  background: #7ab5d6;
  color: #fff;
  padding: 0.75rem 1rem;
}

.admitted-panel .updates-body {
  background: #e4f0f7;
  padding: 1rem;
}

/* Panel headers (for News, Events, Announcements) */
.panel-header {
  align-items: center;
  background-color: var(--header-bg, #565a70);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}

.panel-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.panel-header .view-all {
  border: 1px solid #fff;
  border-radius: 4px;
  color: #fff;
  font-size: 0.85rem;
  padding: 0.25rem 0.75rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.panel-header .view-all:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Individual colours */
.info-panel.news > .panel-header {
  background-color: #453738;
  color: #fff;
}

.info-panel.events > .panel-header {
  background-color: #565a70;
  color: #fff;
}

.info-panel.announcements > .panel-header {
  background-color: #adada3;
  color: #fff;
}

.updates-panel.contacts-panel > .panel-header {
  background-color: #7ba59c;
  color: #fff;
}

.updates-panel.admitted-panel > .panel-header {
  background-color: #6fa8dc;
  color: #fff;
}

/* Shared header styles */
.updates-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.updates-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.updates-header .view-all {
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.news-panel .view-all {
  border-color: #fff;
  color: #fff;
}

.news-panel .view-all:hover {
  background: #fff;
  color: #4b3832;
}

.contacts-panel .view-all:hover,
.admitted-panel .view-all:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* News Items */
.news-item + .news-item {
  margin-top: 0.5rem;
}

.news-item a {
  color: #333;
  display: block;
  font-weight: 600;
  text-decoration: none;
}

.news-item .meta {
  color: #666;
  font-size: 0.85rem;
}

/* Contacts Layout Fix */
.contact-item {
  align-items: center;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem;
}

.contact-item img {
  border-radius: 4px;
  flex-shrink: 0;
  height: auto;
  max-width: 80px;
}

.contact-details strong {
  display: block;
}

.contact-details .meta {
  color: #555;
  font-size: 0.85rem;
}

/* Recently Admitted */
.grid-recently-admitted {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.admitted-person {
  flex: 1 1 45%;
  text-align: center;
}

.admitted-person img {
  border-radius: 4px;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.admitted-person .name {
  color: #222;
  font-weight: 600;
  margin-top: 0.4rem;
}

@media (max-width: 900px) {
  .home-updates .updates-grid {
    grid-template-columns: 1fr;
  }

  .home-updates .updates-panel.contacts-panel {
    margin-bottom: 1.5rem;
  }
}

/* === HOMEPAGE FIX — STACK PANELS, 2-COLUMN RECENTLY ADMITTED === */

/* Stack the two panels (Contacts + Recently Admitted) */
.home-updates .updates-grid {
  display: grid !important;
  gap: 1.5rem;
  grid-template-columns: 1fr !important;
}

/* Desktop: put them side-by-side again */
@media (min-width: 900px) {
  .home-updates .updates-grid {
    grid-template-columns: 1fr 2fr !important;
  }
}

/* ---- Recently Admitted inner layout ---- */
.home-updates .grid-recently-admitted {
  display: grid !important;
  gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
  justify-items: center;
}

/* Optional: make it expand nicely on wide screens */
@media (min-width: 900px) {
  .home-updates .grid-recently-admitted {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* Tidy the people cards */
.home-updates .admitted-person {
  margin: 0 auto;
  max-width: 220px;
  text-align: center;
}

.home-updates .admitted-person img {
  aspect-ratio: 3/4;
  display: block;
  margin: 0 auto;
  object-fit: cover;
  width: 75%;
}

.home-updates .admitted-person .name {
  font-weight: 600;
  margin-top: 0.4rem;
}

.home-updates .admitted-person .meta {
  color: #555;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .section.three-column-updates.home-updates {
    padding: 0 !important;
  }
}

/* ---------------------------------------------------------------------------
   Events Page / Archive Styling
   --------------------------------------------------------------------------- */

.events-archive {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-top: 2rem;
}

.event-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 0.4rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
}

.event-card h2 {
  color: var(--df-deep);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.event-card a {
  color: inherit;
  text-decoration: none;
}

.event-card a:hover {
  color: var(--df-red);
}

.event-card .meta {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.event-card p {
  line-height: 1.5;
  margin: 0;
}

/* ---------------------------------------------------------------------------
   Content background texture
   Applies only to the inner site content
   --------------------------------------------------------------------------- */

main {
  background-attachment: fixed;
  background-image: url('assets/bg.png');
  background-position: top center;
  background-repeat: repeat;
  background-size: auto;
}

/* ---------------------------------------------------------------------------
   Homepage Custom Carousel Section
   --------------------------------------------------------------------------- */

.homepage-carousel {
  background: rgba(255, 255, 255, 0.9);
  padding: 4rem 0;
}

.carousel-wrapper {
  margin: 0 auto;
  max-width: 1200px;
  text-align: center;
}

.carousel-wrapper img,
.carousel-wrapper iframe {
  border-radius: 8px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15);
  height: auto;
  max-width: 100%;
}

/* ---------------------------------------------------------------------------
   Swiper Gallery Carousel
   --------------------------------------------------------------------------- */

.gallery-swiper {
  overflow: hidden;
  padding: 2rem 0;
  width: 100%;
}

.gallery-swiper .swiper-slide img {
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  height: auto;
  object-fit: cover;
  width: 100%;
}

.swiper-button-next,
.swiper-button-prev {
  color: #222;
  transition: opacity 0.3s;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  opacity: 0.7;
}

/* Prevent page overflow */
body {
  overflow-x: hidden;
}

/* ---------------------------------------------------------------------------
   Carousel Mobile Fix
   --------------------------------------------------------------------------- */

.gallery-swiper {
  margin: 0 auto;
  overflow: hidden;
  width: 100% !important;
}

.gallery-swiper .swiper-wrapper {
  display: flex;
  flex-wrap: nowrap;
}

.gallery-swiper .swiper-slide {
  box-sizing: border-box;
  flex: 0 0 auto;
  max-width: 100%;
  width: auto;
}

/* Make sure images scale down properly */
.gallery-swiper img {
  border-radius: 8px;
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

/* Prevent page overflow */
body {
  overflow-x: hidden;
}

/* ---------------------------------------------------------------------------
   Uniform Carousel Image Height
   --------------------------------------------------------------------------- */

.gallery-swiper .swiper-slide {
  display: flex;
  height: 320px;
  justify-content: center;
  overflow: hidden;
  align-items: center;
}

.gallery-swiper .swiper-slide img {
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  width: 100%;
}

.gallery-swiper .swiper-slide img:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* Hide Swiper pagination and navigation elements */
.gallery-swiper .swiper-pagination,
.gallery-swiper .swiper-button-prev,
.gallery-swiper .swiper-button-next {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   News Carousel (background-image based slides)
--------------------------------------------------------------------------- */

.gallery-swiper .swiper-slide {
  position: relative;
}

/* Ensure link fills slide */
.carousel-slide-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

/* THIS IS THE CRITICAL BIT */
.carousel-slide-bg {
  width: 100%;
  height: 100%;
  min-height: 320px; /* must match swiper-slide height */
  background-size: cover;
  background-position: center;
  border-radius: 10px;
}

/* Title overlay */
.carousel-slide-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.25rem;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.7),
    rgba(0,0,0,0)
  );
}

.carousel-slide-title {
  color: #fff;
  font-size: 1.2rem;
  margin: 0;
  line-height: 1.3;
}

/* ---------------------------------------------------------------------------
   Search Toggle + Form
   --------------------------------------------------------------------------- */

.search-toggle {
  background: none;
  border: none;
  color: var(--df-text);
  cursor: pointer;
  font-size: 1.3rem;
  margin-left: 1rem;
  transition: color 0.3s;
}

.search-toggle:hover {
  color: var(--df-accent, #900);
}

.search-form-wrap {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  display: none;
  padding: 0.5rem 1rem;
  position: absolute;
  right: 1rem;
  top: 100%;
  z-index: 999;
}

.search-form {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.search-field {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  width: 180px;
}

.search-submit {
  background: var(--df-accent, #900);
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  padding: 0.4rem 0.8rem;
}

.search-submit:hover {
  opacity: 0.85;
}

/* ---------------------------------------------------------------------------
   Search Icon Alignment (Nav Bar)
   --------------------------------------------------------------------------- */

.site-nav {
  align-items: center;
  display: flex;
  gap: 1rem;
  position: relative;
}

.main-menu {
  align-items: center;
  display: flex;
  gap: 1rem;
}

.search-toggle {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  margin: 0;
  padding: 0;
  transition: color 0.3s ease;
  vertical-align: middle;
}

.search-toggle:hover {
  color: var(--df-accent, #c6b29f);
}

.search-form-wrap {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  display: none;
  padding: 0.5rem 1rem;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 999;
}

.galleries-panel {
  background: #e8efe9;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.galleries-panel .panel-header {
  align-items: center;
  background-color: #667a5f;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.galleries-panel .gallery-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin: 0 1em 1em 1em;
}

.galleries-panel .gallery-grid img {
  border-radius: 4px;
  display: block;
  height: 180px;
  object-fit: cover;
  transition: transform 0.3s;
  width: 100%;
}

.galleries-panel .gallery-grid a:hover img {
  transform: scale(1.03);
}

@media (max-width: 900px) {
  /* Full-width dropdown, solid background */
  .site-header nav ul {
    background: #6d696a;
    display: none;
    flex-direction: column;
    left: 0;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 100%;
    width: 100%;
    z-index: 99;
  }

  .site-header nav ul.active {
    display: flex;
  }

  /* Menu links */
  .site-header nav li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  .site-header nav a {
    color: #fff;
    display: block;
    font-size: 1rem;
    padding: 1rem;
    text-decoration: none;
  }

  .site-header nav a:hover,
  .site-header nav .current-menu-item > a {
    background: rgba(0, 0, 0, 0.15);
  }

  /* Search form inside menu */
  .mobile-search-item {
    background: #5a5657;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.75rem 1rem;
  }

  .mobile-search-item form {
    display: flex;
  }

  .mobile-search-item input[type="search"] {
    border: none;
    border-radius: 4px;
    flex: 1;
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
  }

  .mobile-search-item button {
    background: #8a0707;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    margin-left: 0.5rem;
    padding: 0.5rem 0.75rem;
  }

  .mobile-search-item button:hover {
    background: #a10a0a;
  }
}

/* ======================================================
   CLEAN MOBILE MENU OVERRIDE (FULL WIDTH + SEARCH INSIDE)
   ====================================================== */
@media (max-width: 900px) {
  /* Reset previous conflicting versions */
  .site-header nav ul,
  .main-menu {
    all: unset;
    background: #6d696a;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    left: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 100%;
    width: 100vw;
    z-index: 999;
  }

  .site-header nav ul.active {
    display: flex;
  }

  /* Menu links */
  .site-header nav li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  .site-header nav a {
    color: #fff;
    display: block;
    font-size: 1rem;
    padding: 1rem;
    text-decoration: none;
  }

  .site-header nav a:hover,
  .site-header nav .current-menu-item > a {
    background: rgba(0, 0, 0, 0.15);
  }

  /* Search form INSIDE dropdown */
  .mobile-search-item {
    background: #5a5657;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.75rem 1rem;
    width: 100%;
  }

  .mobile-search-item form {
    align-items: center;
    display: flex;
    gap: 0.5rem;
  }

  .mobile-search-item input[type="search"] {
    border: none;
    border-radius: 4px;
    flex: 1;
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
  }

  .mobile-search-item button {
    background: #8a0707;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
  }

  .mobile-search-item button:hover {
    background: #a10a0a;
  }

  /* Ensure body doesn't shift horizontally */
  body {
    overflow-x: hidden;
  }
}

/* ======================================================
   🔧 FINAL OVERRIDE: MOBILE MENU WIDTH + SEARCH ALIGNMENT
   ====================================================== */
@media (max-width: 900px) {
  /* Ensure full width, flush left */
  .site-header nav ul,
  .main-menu {
    background: #6d696a !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    right: 0 !important;
    top: 100% !important;
    width: 100% !important;
  }

  /* Show dropdown cleanly when active */
  .site-header nav ul.active {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Menu links full width */
  .site-header nav li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .site-header nav a {
    color: #fff;
    display: block;
    font-size: 1rem;
    padding: 1rem;
    text-decoration: none;
  }

  .site-header nav a:hover {
    background: rgba(0, 0, 0, 0.2);
  }

  /* Search bar inside dropdown */
  .mobile-search-item {
    background: #5a5657;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    width: 100%;
  }

  .mobile-search-item form {
    display: flex;
    gap: 0.5rem;
  }

  .mobile-search-item input[type="search"] {
    border: none;
    border-radius: 4px;
    flex: 1;
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
  }

  .mobile-search-item button {
    background: #8a0707;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
  }

  .mobile-search-item button:hover {
    background: #a10a0a;
  }

  /* Prevent any page scroll shift */
  body {
    overflow-x: hidden !important;
  }
}

@media (max-width: 900px) {
  /* Keep header layout intact */
  .site-header {
    margin: 0;
    position: relative;
    width: 100%;
  }

  /* Only fix the *top-level* menu */
  .site-header nav > ul {
    background: #6d696a !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: fixed !important;
    right: 0 !important;
    top: 60px !important;
    width: 100% !important;
    z-index: 9999;
  }

  /* All nested submenus follow normal flow (so they push down other items) */
  .site-header nav ul ul {
    position: static !important;
  }

  .site-header nav ul.active {
    display: flex !important;
    flex-direction: column !important;
  }

  .site-header nav a {
    color: #fff;
    display: block;
    font-size: 1rem;
    padding: 1rem;
    text-decoration: none;
  }

  .site-header nav a:hover {
    background: rgba(0, 0, 0, 0.2);
  }

  /* Search bar inside menu */
  .mobile-search-item {
    background: #5a5657;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    width: 100%;
  }

  .mobile-search-item form {
    display: flex;
    gap: 0.5rem;
  }

  .mobile-search-item input[type="search"] {
    border: none;
    border-radius: 4px;
    flex: 1;
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
  }

  .mobile-search-item button {
    background: #8a0707;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
  }

  .mobile-search-item button:hover {
    background: #a10a0a;
  }

  /* Submenu styling inside mobile nav */
  .site-header nav ul ul {
    background: #5f5b5c;
    border-top: 1px solid rgb(255, 255, 255);
    display: none;
    margin: 0;
    overflow: hidden;
    padding-left: 0;
    position: static;
  }

  .site-header nav ul ul li a {
    background: #5f5b5c;
    color: #fff;
    font-size: 0.95rem;
    padding-left: 2rem;
  }

  .site-header nav ul ul.open {
    display: block;
  }

  /* Show visual cue for expandable parents */
  .site-header nav li.menu-item-has-children > a::after {
    content: '▸';
    float: right;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: transform 0.2s;
  }

  .site-header nav li.menu-item-has-children.open > a::after {
    transform: rotate(90deg);
  }

  /* Add spacing so multiple open sections don’t overlap visually */
  .site-header nav li.menu-item-has-children.open {
    margin-bottom: 0.25rem;
  }

  /* --- Submenu toggle styling for mobile --- */
  .site-header nav li.menu-item-has-children {
    position: relative;
  }

  .site-header nav li.menu-item-has-children > a {
    position: relative;
    z-index: 2;
  }

  /* Make submenus appear *below* their parent, not overlap */
  .site-header nav li.menu-item-has-children ul {
    background: #5f5b5c;
    border-top: 1px solid rgb(255, 255, 255);
    display: none;
    margin: 0;
    overflow: hidden;
    padding: 0;
    position: static;
  }

  .site-header nav li.menu-item-has-children ul.open {
    display: block;
  }

  .site-header nav li.menu-item-has-children ul li a {
    background: #5f5b5c;
    color: #fff;
    font-size: 0.95rem;
    padding-left: 2rem;
  }

  /* Arrow indicator for toggle */
  .site-header nav li.menu-item-has-children > a::after {
    content: '▸';
    float: right;
    opacity: 0.7;
    transition: transform 0.2s ease;
  }

  .site-header nav li.menu-item-has-children.open > a::after {
    transform: rotate(90deg);
  }

  /* Ensure it centers horizontally */
  .site-header nav li.menu-item-has-children.open {
    margin-bottom: 0.25rem;
  }
}

/* ---------------------------------------------------------------------------
   Footer Layout & Sticky Behavior
   --------------------------------------------------------------------------- */

/* Footer styling */
.site-footer {
  background: #6d696a;
  color: #fff;
  flex-shrink: 0;
  font-size: 0.95rem;
  padding: 2rem 0;
  text-align: left;
}

/* Footer inner container */
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 1rem;
}

/* Footer columns */
.site-footer .footer-column {
  flex: 1;
  min-width: 200px;
}

/* Footer titles */
.site-footer h4 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

/* Footer links */
.site-footer a {
  color: #d8d8d8;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

/* Bottom copyright bar */
.site-footer .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #ccc;
  font-size: 0.85rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  text-align: center;
}

/* Mobile layout */
@media (max-width: 768px) {
  .site-footer .container {
    flex-direction: column;
    text-align: center;
  }
}

/* ---------------------------------------------------------------------------
   Member Profile Page
   --------------------------------------------------------------------------- */

.member-profile {
  margin: 3rem auto;
  max-width: 1000px;
  padding: 0 1rem;
}

.member-card {
  background: #f7f9f8;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: grid;
  gap: 2rem;
  grid-template-columns: 300px 1fr;
  padding: 2rem;
}

.member-image img {
  border-radius: 6px;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.member-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.member-name {
  color: #333;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.member-meta {
  color: #666;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.member-bio {
  color: #333;
  font-size: 1.05rem;
  line-height: 1.6;
  margin-top: 1rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .member-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .member-image {
    margin-bottom: 1rem;
  }

  .member-info {
    align-items: center;
  }
}

.badges {
  display: flex;
  gap: 0.5rem;
}

.badge {
  border-radius: 4px;
  color: #fff;
  display: inline-block;
  font-size: 0.85em;
  font-weight: 600;
  padding: 0.3em 0.6em;
}

.badge-warden {
  background-color: #2b6cb0;
}

.badge-trustee {
  background-color: #6b46c1;
}

/* --- Members Grid Layout --- */
.members-grid-page {
  margin: 0 auto;
  max-width: 1300px;
  padding: 2rem 1rem 4rem;
}

.member-grid {
  display: grid;
  gap: 2.5rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  justify-items: center;
  margin-top: 2rem;
}

/* --- Card --- */
.member-card {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  text-align: left;
}

/* --- Thumbnail --- */
.member-thumb {
  border-radius: 3px;
  display: block;
  overflow: hidden;
}

.member-thumb img {
  height: 260px;
  object-fit: cover;
  transition: transform 0.25s ease;
  width: 100%;
}

.member-thumb:hover img {
  transform: scale(1.03);
}

/* --- Info --- */
.member-info {
  margin-top: 0.6rem;
}

.member-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.member-info .meta {
  color: #444;
  font-size: 0.9rem;
  line-height: 1.3;
}

/* --- Actions --- */
.member-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.btn.small {
  background: transparent;
  border: 1px solid #cfcfcf;
  border-radius: 2px;
  color: #2f2f2f;
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.25em 0.7em;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn.small:hover {
  background: #e6f0ee;
  border-color: #a5c5c0;
}

/* Footer sits naturally at bottom */
.site-footer {
  margin-top: auto;
}

/* Trustees & Wardens Grid Layout */
.members-grid-page {
  padding: 2rem 0;
  width: 90%;
}

.member-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  justify-items: center;
  margin-top: 2rem;
}

.member-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  max-width: 260px;
  padding: 1rem;
  text-align: center;
  transition: box-shadow 0.2s ease;
}

.member-card:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.member-card img {
  border-radius: 3px;
  height: 250px;
  object-fit: cover;
  width: 100%;
}

.member-card h3.member-name {
  color: #222;
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 0.75rem;
}

.member-card .meta {
  color: #555;
  font-size: 0.9rem;
  margin: 0.25rem 0;
}

.member-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.member-actions .btn.small {
  background: transparent;
  border: 1px solid #ccc;
  border-radius: 3px;
  color: #333;
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.member-actions .btn.small:hover {
  background: #333;
  border-color: #333;
  color: #fff;
}

/* Enquiries Page */
.enquiries-page {
  padding: 2rem 0 3rem;
  width: 90%;
}

.enquiries-grid {
  align-items: start;
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr 1fr;
  margin-top: 2rem;
}

.enquiries-intro h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.enquiries-intro h2 span {
  background: #333;
  color: #fff;
  padding: 0 0.4rem;
}

.enquiries-intro p {
  color: #444;
  font-size: 1rem;
  line-height: 1.6;
}

.enquiries-form {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  padding: 2rem;
}

.update-contact-form .form-group {
  margin-bottom: 1rem;
}

.update-contact-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.update-contact-form input,
.update-contact-form textarea {
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.9rem;
  padding: 0.5rem;
  width: 100%;
}

.update-contact-form textarea {
  resize: vertical;
}

.btn-submit {
  background: linear-gradient(to bottom, #687091, #444b69);
  border: none;
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.6rem 1.5rem;
  transition: background 0.2s ease;
}

.btn-submit:hover {
  background: #333850;
}

@media (max-width: 900px) {
  .enquiries-grid {
    grid-template-columns: 1fr;
  }
}

/* Wardens Admin Page */
.wardens-admin-page {
  padding: 2rem 0 3rem;
  width: 90%;
}

.admin-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.pdf-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 1.5rem;
}

.pdf-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 1rem;
  text-align: center;
}

.pdf-icon {
  height: auto;
  margin-bottom: 0.5rem;
  width: 40px;
}

.pdf-name {
  color: #333;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
}

.pdf-card .btn.small {
  background: transparent;
  border: 1px solid #aaa;
  border-radius: 3px;
  color: #333;
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.pdf-card .btn.small:hover {
  background: #333;
  border-color: #333;
  color: #fff;
}

.single-member .member-profile img {
  border-radius: 4px;
  height: auto;
  margin-bottom: 1rem;
  max-width: 300px;
  object-fit: cover;
  width: 80%;
}
/* === Responsive Member Profile Fix === */
@media (max-width: 768px) {
  .single-member .member-profile {
    align-items: center;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    text-align: center;
  }



  .single-member .member-details {
    text-align: center;
    width: 100%;
  }

  .single-member .member-details h1,
  .single-member .member-details p {
    margin: 0.4rem 0;
  }

  .single-member .meta {
    color: #555;
    font-size: 0.9rem;
  }

  .single-member .member-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
  }

  .single-member .member-actions .btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }
}

.single-member .member-badge {
  background-color: #1e73be;
  border-radius: 4px;
  color: #fff;
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.5rem auto 1rem auto;
  padding: 0.4rem 1rem;
  text-align: center;
}

/* Ensure it centers horizontally */
.single-member .member-badge-wrapper {
  display: flex;
  justify-content: left;
}

@media (max-width: 768px){
  .single-member .member-badge-wrapper {
    display: flex;
    justify-content: center;
  } 
}

.contact-section {
    margin-top: 3rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

@media(max-width: 1000px) {
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.contact-card {
    text-align: center;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
    padding: 1rem;
}

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

.contact-info strong {
    font-size: 1.1rem;
    display: block;
    margin-top: 0.5rem;
}

.contact-buttons {
    margin-top: 0.5rem;
}

.contact-buttons .btn {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    margin: 0.25rem;
    background: #e3f2f9;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
}
.dcf-archive--date {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}

.dcf-archive__header {
  margin-bottom: 18px;
}

.dcf-archive__title {
  margin: 0 0 6px;
  font-size: 28px;
}

.dcf-archive__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.dcf-card {
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.dcf-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.dcf-card__thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.dcf-card__body {
  padding: 12px;
}

.dcf-card__title {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.2;
}

.dcf-card__meta {
  display: block;
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .dcf-archive__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .dcf-archive__grid { grid-template-columns: 1fr; }
}

/* Fix calendar clipping on very small phones */
@media (max-width: 420px) {
  .calendar-box {
    overflow-x: auto;               /* allow scroll if needed */
    -webkit-overflow-scrolling: touch;
  }

  .calendar-box table {
    min-width: 0 !important;        /* <- this is the key */
    width: 100% !important;
    table-layout: fixed;            /* 7 equal columns */
  }

  .event-calendar {                 /* stop clipping the overflow */
    overflow: visible !important;
  }

  .event-calendar th,
  .event-calendar td {
    width: calc(100% / 7);
    padding: 0.2rem 0.1rem;         /* optional: helps it fit */
  }
}
