/* ==========================================================================
   Design System & Custom Properties
   ========================================================================== */
:root {
  /* Colors */
  --primary-color: #0B3B60; /* Navy Blue */
  --primary-dark: #07263F;
  --accent-color: #B22222; /* Firebrick / Crimson for Cardiology */
  --accent-hover: #8C1A1A;
  --text-main: #333333;
  --text-muted: #666666;
  --bg-light: #F8F9FA;
  --bg-white: #FFFFFF;
  --border-color: #E2E8F0;

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Layout */
  --container-width: 1200px;
  --transition: all 0.3s ease;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  color: var(--text-main);
  background-color: var(--bg-light);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--primary-dark);
  font-weight: 600;
  line-height: 1.2;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-color);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  background-color: var(--bg-white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  max-width: var(--container-width);
  margin: 0 auto;
}

.logo a {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  color: var(--accent-color);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-color);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-color);
  cursor: pointer;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--accent-color);
  color: var(--bg-white);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: var(--bg-white);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: var(--bg-white);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  background-color: var(--primary-color);
  color: var(--bg-white);
  padding: 6rem 0;
  text-align: center;
  background-image: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.hero h1 {
  color: var(--bg-white);
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 2rem;
  opacity: 0.9;
}

/* ==========================================================================
   Generic Sections
   ========================================================================== */
.section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  font-size: 2.25rem;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background-color: var(--accent-color);
  margin: 1rem auto 0;
  border-radius: 2px;
}

.section-bg-white {
  background-color: var(--bg-white);
}

/* ==========================================================================
   Cards / Grids
   ========================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.event-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.card {
  background-color: var(--bg-white);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.card-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

/* ==========================================================================
   Trustees specific
   ========================================================================== */
.trustee-card {
  text-align: center;
}

.trustee-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  border: 4px solid var(--bg-light);
  background-color: var(--border-color); /* Placeholder bg */
}

.trustee-role {
  color: var(--accent-color);
  font-weight: 500;
  margin-bottom: 1rem;
}

/* ==========================================================================
   Events specific
   ========================================================================== */
.event-card {
  display: flex;
  flex-direction: column;
}

.event-date {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.event-featured {
  border-color: var(--accent-color);
  border-width: 2px;
  position: relative;
}

.event-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background-color: var(--accent-color);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ==========================================================================
   Tables / Lists
   ========================================================================== */
.agenda-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2rem;
}

.agenda-table th,
.agenda-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.agenda-table th {
  background-color: var(--bg-light);
  color: var(--primary-dark);
}

/* ==========================================================================
   Forms
   ========================================================================== */
.contact-form {
  display: grid;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  color: var(--primary-dark);
}

.form-control {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(11, 59, 96, 0.1);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background-color: var(--primary-dark);
  color: var(--bg-white);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-heading {
  color: var(--bg-white);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.footer-text {
  color: #CBD5E1;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
  font-size: 0.9rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
.floating-reg-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--accent-color);
  color: var(--bg-white);
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: bold;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(178, 34, 34, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.floating-reg-btn:hover {
  background-color: var(--primary-dark);
  color: var(--bg-white);
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(7, 38, 63, 0.4);
}

@media (max-width: 768px) {
  .floating-reg-btn {
    bottom: 20px;
    right: 20px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0.5rem;
    font-size: 1.8rem;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-white);
    flex-direction: column;
    padding: 1rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    gap: 0;
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .nav-links li {
    width: 100%;
  }
  
  .nav-links a {
    display: block;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .nav-links li:last-child a {
    border-bottom: none;
  }
  
  .nav-cta {
    display: none; /* Hide CTA button in header on very small screens to save space, or it could be moved into the dropdown */
  }
  
  .hero {
    padding: 3rem 1rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .section {
    padding: 3rem 1rem;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .grid, .event-layout {
    grid-template-columns: 1fr;
  }
  
  /* Make tables horizontally scrollable on mobile */
  .agenda-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Fix for table wrappers in HTML */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

/* ==========================================================================
   Gallery Masonry Animations
   ========================================================================== */
.gallery-masonry > div {
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
  animation: fadeUpIn 0.8s ease-out backwards;
}

.gallery-masonry > div:hover {
  transform: translateY(-5px);
}

.gallery-masonry > div img {
  transition: transform 0.5s ease !important;
}

.gallery-masonry > div:hover img {
  transform: scale(1.03);
}

@keyframes fadeUpIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for the first 15 images to create a cascading effect */
.gallery-masonry > div:nth-child(1) { animation-delay: 0.05s; }
.gallery-masonry > div:nth-child(2) { animation-delay: 0.1s; }
.gallery-masonry > div:nth-child(3) { animation-delay: 0.15s; }
.gallery-masonry > div:nth-child(4) { animation-delay: 0.2s; }
.gallery-masonry > div:nth-child(5) { animation-delay: 0.25s; }
.gallery-masonry > div:nth-child(6) { animation-delay: 0.3s; }
.gallery-masonry > div:nth-child(7) { animation-delay: 0.35s; }
.gallery-masonry > div:nth-child(8) { animation-delay: 0.4s; }
.gallery-masonry > div:nth-child(9) { animation-delay: 0.45s; }
.gallery-masonry > div:nth-child(10) { animation-delay: 0.5s; }
.gallery-masonry > div:nth-child(11) { animation-delay: 0.55s; }
.gallery-masonry > div:nth-child(12) { animation-delay: 0.6s; }
.gallery-masonry > div:nth-child(n+13) { animation-delay: 0.65s; }

