:root {
  --primary-blue: #005bb5;
  --light-blue: #e6f2ff;
  --dark-blue: #003f7a;
  --text-main: #333333;
  --text-muted: #666666;
  --bg-color: #ffffff;
  --bg-secondary: #f8f9fa;
  --border-color: #e0e0e0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-secondary);
  line-height: 1.6;
}

/* Header & Navigation */
header {
  background-color: var(--primary-blue);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  color: white;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

nav {
  display: flex;
  gap: 15px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  color: white;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.nav-links a:hover {
  background-color: var(--dark-blue);
}

/* Dropdown Menu */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 4px;
  min-width: 200px;
  padding: 10px 0;
  z-index: 100;
}

.nav-item.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  color: var(--text-main);
  padding: 10px 20px;
  display: block;
}

.dropdown-menu a:hover {
  background-color: var(--light-blue);
  color: var(--primary-blue);
}

/* Main Content */
main {
  background-color: var(--bg-color);
  max-width: 1200px;
  margin: 40px auto;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  min-height: 60vh;
}

h1, h2, h3, h4 {
  color: var(--primary-blue);
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

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

a:hover {
  text-decoration: underline;
}

/* Images & Galleries */
img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

td, th {
  padding: 10px;
}

/* Gallery layout cleanup */
table[id^="fpGalleryTable"] {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  border: none;
}
table[id^="fpGalleryTable"] td {
  border: none !important;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  transition: transform 0.2s;
}
table[id^="fpGalleryTable"] td:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
  background-color: var(--bg-color);
}

/* =========================================
   Photo Gallery Grid & Lightbox Styles
========================================= */

/* 1. Override FrontPage Tables to act like a CSS Grid */
table[id^="fpGalleryTable"] table {
    display: inline-block;
    vertical-align: top;
    margin: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 10px;
    transition: transform 0.2s;
    border: 1px solid var(--border-color);
}
table[id^="fpGalleryTable"] table:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);
}
.gallery-thumb {
    border-radius: 6px;
    max-width: 130px;
    height: auto;
    cursor: pointer;
}

/* 2. Lightbox Overlay Styles */
#lightbox-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    flex-direction: column;
}
#lightbox-overlay.active {
    display: flex;
}
#lightbox-img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    margin-bottom: 20px;
}
#lightbox-caption {
    color: white;
    font-size: 1.2rem;
    text-align: center;
    max-width: 80%;
}
#lightbox-close {
    position: absolute;
    top: 20px; right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}
#lightbox-prev, #lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 50px;
    cursor: pointer;
    user-select: none;
    padding: 20px;
}
#lightbox-prev:hover, #lightbox-next:hover, #lightbox-close:hover {
    color: var(--primary-blue);
}
#lightbox-prev { left: 20px; }
#lightbox-next { right: 20px; }


/* Responsive Design for Mobile Devices */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  .nav-links {
    justify-content: center;
    margin-top: 10px;
  }
  /* Convert main grids to 1 column on mobile */
  .family-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Make all subpage tables responsive */
  table {
    width: 100% !important;
    max-width: 100%;
    display: block;
    overflow-x: auto;
  }
  
  /* Make gallery tables stack properly */
  table[id^="fpGalleryTable"] table {
    display: block !important;
    width: 100% !important;
    margin: 10px auto !important;
  }
  table[id^="fpGalleryTable"] img {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* Family Grid Layout */
.family-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}
.family-card {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

