/* /assets/css/style.css */

/* Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=Lato:wght@400;700&display=swap");

/* Base Setup, Box Model Reset & ANTI-WIGGLE */
html {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden; /* Kills horizontal scroll at the root */
}
*,
*::before,
*::after {
  box-sizing: inherit;
}

/* CSS Variables for Elemore Collective Theme */
:root {
  --primary-color: #1a1a1a;
  --secondary-color: #f7931e;
  --accent-brown: #a47c48;
  --accent-orange: #f4a261;
  --accent-yellow: #e9c46a;
  --light-cream: #f8f7f4;
  --dark-text: #212529;
  --light-text: #ffffff;
  --border-radius: 8px;
  --box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  --font-header: "Montserrat", sans-serif;
  --font-body: "Lato", sans-serif;
  --border-grey: #dee2e6;
  --light-grey: #f8f9fa;
}

/* General Body & Typography */
body {
  font-family: var(--font-body);
  color: var(--dark-text);
  background-color: var(--light-cream);
  margin: 0;
  padding-top: 80px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  
  /* Mobile Anti-Wiggle Constraints */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-wrap: break-word; 
  word-wrap: break-word;
}
body.nav-open {
  overflow: hidden;
}

/* Ensure main content pushes footer down */
main, 
.main-content-wrapper {
  flex: 1; 
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-header);
  color: var(--primary-color);
}
a {
  color: var(--secondary-color);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  color: var(--primary-color);
}
.container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.intro-section,
.vision-section {
  max-width: 800px;
  margin: 4rem auto;
  text-align: center;
  line-height: 1.8;
}

/* --- Admin Tables & Overflows --- */
table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
}

img, picture, video, iframe, figure {
  max-width: 100%;
  height: auto;
}

/* --- Main Header & Navigation Bar --- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  height: 80px;
  background-color: #fff;
  border-bottom: 2px solid var(--secondary-color);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1001;
}
.nav-logo {
  font-family: var(--font-header);
  font-size: 1.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
  z-index: 2000;
}
.nav-logo:hover {
  text-decoration: none;
}
.navbar-desktop {
  flex-grow: 1;
  display: flex;
  justify-content: center;
}
.navbar-desktop .nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1rem;
}
.navbar-desktop .nav-item {
  display: flex;
  align-items: center;
}
.nav-link {
  text-decoration: none;
  color: var(--dark-text);
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
  white-space: nowrap;
}
.nav-link:hover {
  background-color: var(--light-grey);
  text-decoration: none;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-user-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-left: 2px solid #eee;
  margin-left: 1.5rem;
  padding-left: 1.5rem;
}
.user-profile-link i {
  margin-right: 0.5rem;
}
.navbar-mobile {
  display: none;
}
.nav-toggle {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  width: 25px;
  height: 21px;
  z-index: 2000;
  position: relative;
}
.hamburger {
  display: block;
  position: absolute;
  width: 25px;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 2px;
  transition: all 0.25s ease-in-out;
}
.hamburger:nth-child(1) { top: 0; }
.hamburger:nth-child(2) { top: 9px; }
.hamburger:nth-child(3) { top: 18px; }

/* --- Hero Section --- */
.hero {
  background: linear-gradient(rgba(26, 26, 26, 0.7), rgba(26, 26, 26, 0.7)),
    url("https://via.placeholder.com/1920x600.png?text=Elemore+Nature+Reserve")
      no-repeat center center/cover;
  color: var(--light-text);
  text-align: center;
  padding: 6rem 1rem;
}
.hero h1 {
  font-size: 3.5rem;
  color: var(--light-text);
  margin-bottom: 1rem;
}
.hero p {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto;
}
.small-hero {
  padding: 3rem 1rem;
  background-size: cover;
  background-position: center;
}
.small-hero h1 {
  font-size: 2.5rem;
}

/* --- Glass Panel Utility Class --- */
.glass-panel {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}
body.dark-mode .glass-panel {
  background: rgba(30, 30, 30, 0.95) !important;
}

/* --- News Section & Cards --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}
.news-card {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  transition: transform 0.3s ease;
  display: grid;
  grid-template-rows: auto 1fr;
}
.news-card:hover {
  transform: translateY(-5px);
}
.news-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  background-color: #f0f0f0;
}
.news-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  word-break: break-word;
  overflow: hidden;
}
.news-card-content h3 {
  margin-top: 0;
}
.news-card-content .post-meta {
  font-size: 0.9em;
  color: #6c757d;
  margin-bottom: 1rem;
}
.news-card-content p {
  color: #6c757d;
  flex-grow: 1;
}
.news-card-content a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 700;
}
.news-card-content .read-more {
  margin-top: 1rem;
}
.section-link {
  text-align: center;
  margin-top: 2rem;
}
.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 1rem;
}
.filter-menu {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.filter-menu a {
  text-decoration: none;
  color: var(--dark-text);
  background-color: var(--light-grey);
  border: 1px solid var(--border-grey);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 700;
  transition: all 0.3s ease;
}
.filter-menu a:hover {
  background-color: var(--accent-yellow);
  border-color: var(--accent-yellow);
  text-decoration: none;
}
.filter-menu a.active {
  background-color: var(--primary-color);
  color: var(--light-text);
  border-color: var(--primary-color);
}

/* --- Search Bar (Used on News & Events) --- */
.search-bar {
  margin-bottom: 2rem;
}
.search-bar form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}
.search-bar input[type="search"],
.search-bar select {
  flex-grow: 1;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border-grey);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: "Lato", sans-serif;
  min-width: 200px;
}
.search-bar .btn-primary,
.search-bar .btn-secondary,
.search-bar .btn {
  flex-shrink: 0;
  padding: 0.6rem 1.2rem;
}

/* --- Forms & Buttons --- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--accent-orange);
  color: #ffffff;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.btn:hover {
  background-color: #d88c4b;
  text-decoration: none;
  color: #ffffff;
}
.btn-primary {
  background-color: var(--secondary-color);
  color: var(--light-text);
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 700;
  transition: background-color: 0.2s ease;
  border: none;
  cursor: pointer;
}
.btn-primary:hover {
  background-color: var(--primary-color);
}
.btn-secondary {
  display: inline-block;
  padding: calc(0.6rem - 1px) calc(1.2rem - 1px);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  background-color: transparent;
  border: 1px solid var(--border-grey);
  color: var(--dark-text);
  border-radius: var(--border-radius);
  transition: all 0.2s ease-in-out;
}
.btn-secondary:hover {
  background-color: var(--light-grey);
  border-color: #adb5bd;
  text-decoration: none;
  color: var(--dark-text);
}
.btn-small {
  padding: 0.4rem 1rem;
  font-size: 0.9em;
}
.form-container {
  background: #fff;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  max-width: 500px;
  margin: 2rem auto;
}
.form-group {
  margin-bottom: 1.5rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: "Lato", sans-serif;
}
.form-group textarea {
  resize: vertical;
  min-height: 120px;
}
.message {
  text-align: left;
  padding: 1rem;
  margin-bottom: 2rem;
  border-radius: var(--border-radius);
  border: 1px solid transparent;
}
.message.success {
  background-color: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}
.message.error {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}
.message.info {
  background-color: #eaf4ff;
  color: #0277bd;
  border-color: #b1d9ff;
}

/* Custom File Upload Button */
input[type="file"] {
  color: #888;
}
input[type="file"]::file-selector-button {
  padding: 0.75rem 1.5rem;
  background-color: var(--secondary-color);
  color: #ffffff;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-right: 1rem;
}
input[type="file"]::file-selector-button:hover {
  background-color: var(--primary-color);
}

/* --- Page Specific Layouts --- */
.main-layout-single-column {
    display: block;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Fixed to prevent mobile overflow */
  gap: 3rem;
  align-items: flex-start;
}

/* Constrain map wrapper and force iframe bounds */
.contact-map {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--border-radius);
}
.contact-map iframe {
  width: 100% !important;
  max-width: 100% !important;
  height: 450px;
  display: block;
  border: 0;
}

/* --- About Page Director Section --- */
.directors-section {
  display: grid;
  gap: 5rem;
}

.director-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

/* Reverse layout for even-numbered items */
.director-item:nth-child(even) .director-image {
  grid-column: 2;
}

.director-item:nth-child(even) .director-text {
  grid-column: 1;
  grid-row: 1;
}

.director-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain; /* Prevents awkward cropping of headshots */
  background-color: #f0f0f0; /* Fills empty space seamlessly */
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.director-text {
  background-color: #fff;
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.director-text h2 {
  margin-top: 0;
}

.director-text p {
  line-height: 1.7;
}

/* --- Post Page & Component Styles --- */
.post-main-image,
.image-carousel img {
  cursor: pointer;
  transition: opacity 0.3s ease-in-out;
}
.post-main-image:hover,
.image-carousel img:hover {
  opacity: 0.85;
}
.post-main-image {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  background-color: #f0f0f0;
}
.post-content {
  line-height: 1.8;
  font-size: 1.1rem;
}
.post-content + .reaction-bar {
  margin: 2rem 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border-grey);
}
.post-meta {
  font-size: 0.9em;
  color: #6c757d;
  margin-bottom: 2rem;
  display: block;
}
.comments-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #eee;
}
.comments-section > .form-container {
  max-width: none;
  margin: 0 0 2rem 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}
.comment-thread {
  list-style: none;
  padding-left: 0;
}
.comment-item {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  border: 1px solid var(--border-grey);
}
.reply-thread {
  padding-left: 20px;
  border-left: 2px solid #eee;
  margin-top: 1.5rem;
  margin-left: 20px;
}
.comment-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.comment-body {
  padding: 0.5rem 0 1rem 0;
  margin-left: calc(40px + 0.75rem);
}
.reaction-bar {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.comment-item .reaction-bar {
  margin-left: calc(40px + 0.75rem);
}
.comment-actions {
  font-size: 0.9em;
  margin-left: calc(40px + 0.75rem);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dotted var(--border-grey);
}
.reply-btn {
  font-weight: bold;
}
.reply-form-container {
  margin-left: 0;
  margin-top: 1rem;
  padding: 1.5rem;
  background: var(--light-cream);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-grey);
}
.reply-form-container form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.reply-form-container textarea {
  min-height: 80px;
}
.reply-form-container textarea::placeholder {
  color: #999;
  font-style: italic;
  font-family: var(--font-body);
}
.reaction-btn {
  position: relative;
  background: #fff;
  border: 1px solid var(--border-grey);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
}
.reaction-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.reaction-btn.active {
  background-color: var(--accent-yellow);
  border-color: var(--accent-orange);
}
.reaction-count {
  font-size: 0.8em;
  font-weight: bold;
}
.image-carousel-container {
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}
.image-carousel-container h3 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 2rem;
}
.image-carousel .slick-slide {
  padding: 0 10px;
}
.image-carousel img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: var(--border-radius);
}
.slick-prev::before,
.slick-next::before {
  color: var(--primary-color);
  opacity: 0.85;
}
.slick-prev:hover::before,
.slick-next:hover::before {
  opacity: 1;
}

/* Tooltip Styles */
.reaction-btn[data-tooltip]:hover::before,
.reaction-btn[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) translateX(-50%);
}
.reaction-btn[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background-color: var(--dark-text);
  color: var(--light-text);
  padding: 0.3rem 0.6rem;
  border-radius: var(--border-radius);
  font-size: 0.85em;
  font-weight: bold;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease-in-out;
  pointer-events: none;
}
.reaction-btn[data-tooltip]::after {
  content: "";
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  margin-bottom: -5px;
  border: 5px solid transparent;
  border-top-color: var(--dark-text);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease-in-out;
  pointer-events: none;
}

/* Notification Dropdown Styles */
.notification-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}
.notification-bell-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 1.2rem;
  cursor: pointer;
  position: relative;
  padding: 0.5rem;
}
.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: #d32f2f;
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: bold;
  line-height: 1;
}
.notification-content {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 15px);
  background-color: #ffffff;
  min-width: 320px;
  max-width: calc(100vw - 2rem);
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  border-radius: var(--border-radius);
}
.notification-content.show {
  display: block;
}
.notification-header {
  padding: 1rem;
  font-weight: bold;
  border-bottom: 1px solid var(--border-grey);
}
.notification-item,
.notification-item-static {
  display: block;
  padding: 1rem;
  text-decoration: none;
  color: var(--dark-text);
  border-bottom: 1px solid var(--border-grey);
}
.notification-item:last-of-type {
  border-bottom: none;
}
.notification-item-static {
  color: #6c757d;
}
.notification-item:hover {
  background-color: var(--light-cream);
  text-decoration: none;
}
.notification-item.unread {
  background-color: #eaf4ff;
}
.notification-item p {
  margin: 0 0 0.25rem 0;
  font-size: 0.9rem;
  white-space: normal;
}
.notification-item small {
  color: #6c757d;
  font-size: 0.8rem;
}
.notification-footer {
  padding: 0.75rem;
  text-align: center;
  border-top: 1px solid var(--border-grey);
  background-color: var(--light-cream);
}
.btn-link {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  text-decoration: underline;
  font-weight: bold;
  font-size: 0.9em;
  padding: 0;
}
.btn-link:hover {
  color: var(--secondary-color);
}

/* --- Cafe Page Specific Styles --- */
.cafe-intro {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem auto;
}
.opening-hours {
  background: #fff;
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  margin-top: 2rem;
  border-left: 5px solid var(--primary-color);
  box-shadow: var(--box-shadow);
}
.opening-hours h3 {
  margin-top: 0;
}
.cafe-gallery-section,
.menu-section,
.reviews-section,
.review-form-section {
  margin-top: 3rem;
  margin-bottom: 3rem;
}
.cafe-gallery-section h2,
.menu-section h2,
.reviews-section h2,
.review-form-section h2 {
  text-align: center;
  margin-bottom: 2rem;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  justify-content: center;
}
.gallery-grid a img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--border-radius);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-grid a img:hover {
  transform: scale(1.05);
  box-shadow: var(--box-shadow);
}
.cafe-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.menu-category {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}
.menu-category h3 {
  margin-top: 0;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 0.75rem;
}
.menu-category ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.menu-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px dotted #ccc;
}
.menu-item:last-child {
  border-bottom: none;
}
.menu-item-name strong {
  display: block;
  margin-bottom: 0.25rem;
}
.menu-item-name small {
  color: #6c757d;
  font-style: italic;
}
.menu-item-price {
  font-weight: 700;
  color: var(--primary-color);
  white-space: nowrap;
}
.dietary-tags {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.dietary-tag {
  font-size: 0.7em;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--dark-text);
  border: 1px solid;
}
.tag-v { border-color: #2e7d32; color: #2e7d32; } 
.tag-ve { border-color: #1b5e20; color: #1b5e20; } 
.tag-gf { border-color: #f57f17; color: #f57f17; } 
.tag-df { border-color: #0277bd; color: #0277bd; }
.reviews-section {
  margin-top: 3rem;
  background: #fff;
  padding: 2rem;
  border-radius: var(--border-radius);
}
.review-slide {
  text-align: center;
  padding: 1rem 3rem;
}
.review-rating {
  color: var(--accent-yellow);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
.review-text {
  font-size: 1.1rem;
  font-style: italic;
  color: #555;
  line-height: 1.6;
}
.review-author {
  display: block;
  margin-top: 1rem;
  font-weight: bold;
  color: var(--primary-color);
}
.review-summary {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
  color: #6c757d;
}
.rating-group {
  display: inline-flex;
  flex-direction: row-reverse;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
}
.rating-group > input { display: none; }
.rating-group > label {
  position: relative;
  width: 2em;
  font-size: 2rem;
  color: var(--accent-yellow);
  cursor: pointer;
  text-align: center;
  transition: color 0.2s;
}
.rating-group > label:hover,
.rating-group > label:hover ~ label,
.rating-group > input:checked ~ label {
  color: var(--accent-orange);
}

/* --- Events Page --- */
.view-switcher {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.view-switch-btn {
  background: #fff;
  border: 1px solid var(--border-grey);
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  font-weight: 700;
  border-radius: 20px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.view-switch-btn:hover { background: var(--light-cream); }
.view-switch-btn.active {
  background: var(--primary-color);
  color: var(--light-text);
  border-color: var(--primary-color);
}
.event-month-header {
  margin-top: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--secondary-color);
}
.event-list {
  list-style: none;
  padding: 0;
}
.event-list-item {
  display: flex;
  gap: 1.5rem;
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  box-shadow: var(--box-shadow);
}
.event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  color: var(--light-text);
  padding: 1rem;
  border-radius: var(--border-radius);
  text-align: center;
  min-width: 90px;
}
.event-date .month {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
}
.event-date .day {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
}
.event-date .year {
  font-size: 1rem;
  opacity: 0.8;
}
.event-details h3 {
  margin-top: 0;
}
.event-meta {
  color: #6c757d;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.event-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.event-description {
  line-height: 1.6;
}
.add-to-calendar-wrapper {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px dotted var(--border-grey);
}
add-to-calendar-button {
  --btn-background: var(--secondary-color);
  --btn-text: #fff;
  --btn-border-radius: var(--border-radius);
  --btn-font-weight: 700;
  --btn-hover-background: var(--primary-color);
  --btn-font-family: var(--font-body);
  --dropdown-background: #fff;
  --dropdown-text: var(--dark-text);
  --dropdown-border-radius: var(--border-radius);
  --dropdown-box-shadow: var(--box-shadow);
  --list-item-hover-background: var(--light-cream);
}
#calendarView { min-height: 650px; }
#calendar {
  --fc-border-color: var(--border-grey);
  --fc-today-bg-color: rgba(233, 196, 106, 0.15);
  --fc-button-bg-color: var(--secondary-color);
  --fc-button-border-color: var(--secondary-color);
  --fc-button-hover-bg-color: var(--primary-color);
  --fc-button-hover-border-color: var(--primary-color);
  --fc-button-active-bg-color: var(--primary-color);
  --fc-button-active-border-color: var(--primary-color);
  --fc-event-bg-color: var(--secondary-color);
  --fc-event-border-color: var(--secondary-color);
}
.event-category-tag {
  color: white;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.8em;
  font-weight: 700;
}
.notification-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
}
.notification-list-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-grey);
  align-items: center;
  text-decoration: none;
  color: var(--dark-text);
  transition: background-color 0.2s ease-in-out;
}
.notification-list-item:last-child {
  border-bottom: none;
}
.notification-list-item:hover {
  background-color: var(--light-cream);
}
.notification-list-item.unread {
  background-color: #eaf4ff;
  font-weight: 700;
}
.notification-list-item .icon {
  font-size: 1.5rem;
  color: var(--secondary-color);
  flex-shrink: 0;
}
.notification-list-item .content {
  flex-grow: 1;
}
.notification-list-item .content p { margin: 0 0 0.25rem 0; }
.notification-list-item .content small {
  color: #6c757d;
  font-weight: normal;
}
.notification-list-item .indicator { flex-shrink: 0; }
.unread-dot {
  display: block;
  width: 10px;
  height: 10px;
  background-color: var(--primary-color);
  border-radius: 50%;
}

/* --- Footer --- */
.footer {
  background-color: var(--primary-color);
  color: var(--light-text);
  padding: 3rem 5%;
  margin-top: auto; 
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-nav a {
  color: var(--light-text);
  text-decoration: none;
  margin-left: 1.5rem;
}

/* --- RESPONSIVE AMENDMENTS --- */
@media (max-width: 1150px) {
  .navbar-desktop { display: none; }
  .header-actions .desktop-only { display: none; }
  .nav-toggle { display: block; }

  .navbar-mobile {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    transform: translateX(100%);
    transition: transform 350ms ease-out;
    z-index: 999;
  }
  .navbar-mobile[data-visible="true"] { transform: translateX(0); }

  .mobile-nav-menu {
    list-style: none;
    padding: min(20vh, 8rem) 2rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }
  .mobile-nav-menu .nav-link { font-size: 1.25rem; }
  .nav-separator {
    display: block;
    width: 80%;
    border-bottom: 1px solid var(--border-grey);
  }

  .nav-toggle[aria-expanded="true"] .hamburger:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .hamburger:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .hamburger:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .notification-content { right: 1rem; left: auto; }
  
  .director-item { grid-template-columns: 1fr; }
  .director-item:nth-child(even) .director-image,
  .director-item:nth-child(even) .director-text {
    grid-column: 1;
    grid-row: auto;
  }

  .sidebar-widget,
  .director-item .director-text {
    position: static;
    width: 100%;
    margin: 2rem 0 0 0;
    grid-column: auto;
    grid-row: auto;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  .footer-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  .footer-nav a { margin-left: 0; }
  
  .profile-grid { 
    display: flex; 
    flex-direction: column; 
    gap: 1.5rem;
  }
  .profile-sidebar,
  .profile-main {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .profile-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
  }
  
  .rating-group > label { font-size: 1.6rem; }
}

@media (max-width: 992px) {
  .main-layout-grid {
    grid-template-columns: 1fr;
  }
  .home-news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* THE ULTIMATE ADMIN TABLE FIX */
  table, .admin-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap; 
  }

  .home-news-grid {
    grid-template-columns: 1fr;
  }
  
  /* Mobile Spacing Fixes */
  .header {
    padding: 0 1rem; /* Stop header contents from squeezing edge-to-edge */
  }

  .container {
    width: 100%; /* Switch to 100% instead of 95% + margins for tighter control */
    padding: 1.5rem 1rem;
  }
  
  .glass-panel {
    padding: 1.25rem;
  }

  .search-bar form {
    flex-direction: column;
    align-items: stretch;
  }
  .search-bar input[type="search"],
  .search-bar select {
    width: 100%;
    min-width: 100%; 
  }
  
  /* Give the filter buttons margin on mobile so they wrap nicely */
  .filter-menu {
      justify-content: center;
  }
  .filter-menu a {
      margin-bottom: 0.5rem;
  }
  
  /* Ensure contact elements don't get squished */
  .contact-details,
  .contact-form-container {
      padding: 1.5rem;
  }
}

/* Added for custom file upload button styling */
.file-input-hidden { display: none; }

/* --- Contact Page Specific Styles --- */
.contact-details,
.contact-form-container {
  background-color: #fff;
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.contact-details-item {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}
.contact-details-item i {
  font-size: 1.2rem;
  color: var(--primary-color);
  width: 20px;
  text-align: center;
}
.contact-details-item p {
  word-break: break-word;
  margin: 0;
}

/* --- Bookmark Button Styles --- */
.news-card-content,
.post-header {
  position: relative;
}

.bookmark-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--dark-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  z-index: 10;
}

.bookmark-btn .fa-bookmark { display: none; }
.bookmark-btn .far.fa-bookmark { display: block; }
.bookmark-btn.bookmarked .fas.fa-bookmark {
  display: block;
  color: var(--accent-orange);
}
.bookmark-btn.bookmarked .far.fa-bookmark { display: none; }
body.dark-mode .bookmark-btn { color: var(--dm-text-secondary); }
body.dark-mode .bookmark-btn.bookmarked .fas.fa-bookmark { color: var(--dm-orange); }

/* --- Event List Item --- */
.event-list-item .event-details {
  position: relative;
  width: 100%;
}

/* --- Comment Edit Form Styles --- */
.edit-form-container {
  margin-left: calc(40px + 0.75rem);
  margin-top: 1rem;
  padding: 1.5rem;
  background: #e9ecef;
  border-radius: var(--border-radius);
  display: none; 
}
.edit-form-container form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.edit-form-container textarea { min-height: 100px; }

/* --- Edited Indicator Styles --- */
.edited-indicator,
.edited-link {
  font-style: italic;
  color: #6c757d;
  font-size: 0.9em;
}
.edited-link { text-decoration: underline; }
body.dark-mode .edited-indicator,
body.dark-mode .edited-link { color: var(--dm-text-secondary); }

/* --- Image Management on Edit Post Page --- */
.image-management-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  padding: 1rem;
  background-color: var(--light-cream);
  border: 1px solid var(--border-grey);
  border-radius: var(--border-radius);
}

.image-thumbnail {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
}
.image-thumbnail img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}
.image-thumbnail .delete-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  font-weight: bold;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.image-thumbnail:hover .delete-btn { opacity: 1; }
body.dark-mode .image-management-grid {
  background-color: var(--dm-bg-primary);
  border-color: var(--dm-border);
}

/* --- Follow Button Styles --- */
.follow-btn {
  width: 100%;
  transition: all 0.2s ease-in-out;
}
.follow-btn .following-text,
.follow-btn .unfollow-text { display: none; }
.follow-btn.following {
  background-color: var(--secondary-color);
  color: #fff;
  border: 1px solid var(--secondary-color);
}
.follow-btn.following .follow-text { display: none; }
.follow-btn.following .following-text { display: inline; }
.follow-btn.following:hover {
  background-color: #c0392b; 
  border-color: #c0392b;
}
.follow-btn.following:hover .following-text { display: none; }
.follow-btn.following:hover .unfollow-text { display: inline; }

/* --- Profile Page Styles --- */
.profile-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: flex-start;
}
.profile-sidebar { text-align: center; }
.profile-picture {
  width: 150px;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: contain;
  background-color: #f0f0f0;
  border: 4px solid var(--secondary-color);
  margin: 0 auto 1rem auto;
}
.profile-main {
  background-color: #fff;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}
.profile-main h2 { margin-top: 0; }
.user-posts-list {
  list-style: none;
  padding: 0;
  margin-top: 2rem;
}
.user-posts-list li {
  background-color: var(--light-cream);
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.post-status {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 700;
  color: white;
  text-transform: capitalize;
}
.status-approved { background-color: var(--secondary-color); }
.status-pending { background-color: var(--accent-orange); }
.status-rejected { background-color: #c0392b; }

/* --- Badges & Achievements --- */
.badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}
.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100px;
  height: 100px;
  background-color: var(--light-cream);
  border: 1px solid var(--border-grey);
  border-radius: var(--border-radius);
  padding: 0.5rem;
  cursor: help; 
  transition: all 0.2s ease-in-out;
}
.badge-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--box-shadow);
}
.badge-item i {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.badge-item span {
  font-size: 0.8em;
  font-weight: bold;
  line-height: 1.2;
}
body.dark-mode .badge-item {
  background-color: var(--dm-bg-secondary);
  border-color: var(--dm-border);
}

/* --- Report Modal Styles --- */
.report-btn {
  font-size: 0.9em !important;
  padding: 0.4rem 0.8rem !important;
}
.btn-link.report-btn {
  font-size: 1em !important;
  padding: 0 !important;
}
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}
.modal-container {
  background: #fff;
  padding: 2rem;
  border-radius: var(--border-radius);
  max-width: 500px;
  width: 90%;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
}
body.dark-mode .modal-container { background-color: var(--dm-bg-secondary); }

.event-slide-item { padding: 0 10px; }
.event-slide-link {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background-color: #fff;
  border-radius: var(--border-radius);
  text-decoration: none;
  color: var(--dark-text);
  border: 1px solid var(--border-grey);
  transition: all 0.2s ease-in-out;
  min-height: 120px;
}
.event-slide-link:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow);
  border-color: var(--secondary-color);
}
.event-slide-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  color: var(--light-text);
  padding: 1rem;
  border-radius: var(--border-radius);
  text-align: center;
  flex-shrink: 0;
}
.event-slide-date .month {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
}
.event-slide-date .day {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}
.event-slide-details h3 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem 0;
  color: var(--primary-color);
}
.event-slide-details p {
  margin: 0;
  color: #6c757d;
}
body.dark-mode .event-slide-link {
  background-color: var(--dm-bg-secondary);
  border-color: var(--dm-border);
  color: var(--dm-text-primary);
}

.main-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: flex-start;
}
.home-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
  gap: 2rem;
}

/* =========================================
   DARK MODE GLOBAL OVERRIDES (UPDATED)
   ========================================= */

/* Core Typography & Backgrounds */
body.dark-mode {
  background-color: #121212 !important;
  --light-cream: var(--dm-bg-primary);
  --light-grey: var(--dm-bg-secondary); /* Restores dark grey backgrounds for standard panels */
  --dark-text: var(--dm-text-primary);
  --primary-color: #ffffff; /* Prevents text elements using primary-color from going black */
  --secondary-color: var(--dm-brand-hover);
  --accent-orange: var(--dm-orange);
  --accent-yellow: var(--dm-yellow);
  --border-grey: var(--dm-border);
  --box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
  color: #e0e0e0 !important;
  color-scheme: dark; 
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: #ffffff !important;
}

body.dark-mode p, 
body.dark-mode span,
body.dark-mode div {
  color: #cccccc;
}

/* Fix Header & Notification Bell Visibility */
body.dark-mode .header {
  background-color: #1a1a1a !important;
  border-bottom-color: var(--secondary-color) !important;
}

body.dark-mode .nav-link,
body.dark-mode .notification-bell-btn,
body.dark-mode .nav-logo {
  color: #ffffff !important;
}

body.dark-mode .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

/* * Cards, Containers, and Panels 
 * This uses attribute selectors to forcefully catch inline white backgrounds 
 * on index.php, alongside your standard classes.
 */
body.dark-mode .news-card,
body.dark-mode .form-container,
body.dark-mode .contact-details,
body.dark-mode .director-text,
body.dark-mode .profile-main,
body.dark-mode .profile-sidebar,
body.dark-mode .menu-category,
body.dark-mode .reviews-section,
body.dark-mode .glass-panel,
body.dark-mode .opening-hours,
body.dark-mode .comment-item,
body.dark-mode .reply-form-container,
body.dark-mode .notification-list,
body.dark-mode .event-list-item,
body.dark-mode .event-slide-link,
body.dark-mode .events-wrapper,
body.dark-mode .events-container,
body.dark-mode .calendar-panel,
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background-color: #fff"],
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background-color: white"],
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background-color: #ffffff"],
body.dark-mode [style*="background-color:#fff"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background-color:#ffffff"],
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background: #f8f9fa"],
body.dark-mode [style*="background-color: #f8f9fa"],
body.dark-mode [style*="background:#f8f9fa"],
body.dark-mode [style*="background-color:#f8f9fa"],
body.dark-mode [style*="background: rgba(255, 255, 255"],
body.dark-mode [style*="background-color: rgba(255, 255, 255"],
body.dark-mode [style*="background: rgba(255,255,255"],
body.dark-mode [style*="background-color: rgba(255,255,255"],
body.dark-mode [style*="background: var(--light-cream)"],
body.dark-mode [style*="background-color: var(--light-cream)"],
body.dark-mode [style*="background: var(--light-grey)"],
body.dark-mode [style*="background-color: var(--light-grey)"] {
  background-color: var(--dm-bg-secondary) !important;
  color: var(--dm-text-primary) !important;
  border-color: var(--dm-border) !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4) !important;
}

/* Ensure text inside these panels adapts properly */
body.dark-mode .glass-panel p,
body.dark-mode [style*="background:"] p,
body.dark-mode [style*="background-color:"] p {
  color: var(--dm-text-secondary) !important;
}

/* Protect Buttons from text overrides */
body.dark-mode .btn,
body.dark-mode .btn-primary {
  background-color: #1a1a1a !important;
  color: #ffffff !important;
  font-weight: bold;
}

/* Fix Links */
body.dark-mode a {
  color: var(--secondary-color);
}
body.dark-mode a:hover {
  color: var(--accent-orange);
}

/* Ensure Notification Dropdown is readable in Dark Mode */
body.dark-mode .notification-content {
  background-color: #1e1e1e !important;
  border: 1px solid #333 !important;
}

body.dark-mode .notification-header,
body.dark-mode .notification-footer {
  background-color: #1a1a1a !important;
  color: #fff !important;
  border-color: #333 !important;
}

body.dark-mode .notification-item {
  color: #e0e0e0 !important;
  border-color: #333 !important;
}

body.dark-mode .notification-item:hover {
  background-color: #2a2a2a !important;
}

body.dark-mode .notification-item.unread {
  background-color: rgba(247, 147, 30, 0.15) !important;
}