/* === CSS Variables === */
:root {
  /* Main theme colors */
  --color-bg: #f8f6f1;
  --color-text: #2c2c2c;
  --color-text-muted: #5a5a5a;
  --color-accent: #8b4513;
  --color-accent-light: #d4a574;
  --color-border: #e0dcd4;
  --color-card: #ffffff;
  --color-quote: #435691;
  --color-collapsible-bg: #f7eee8;
  --color-button-bg: #efdac5;
  --color-button-hover-bg: #f5f0eb;
  --color-highlight-light: #eb9e6b;

  /* Navigation colors */
  --nav-bg: #3d3d3d;
  --nav-copper: #b87333;
  /* --nav-copper-light: #cd853f;*/
  --nav-copper-light: #eb9e6b;
  --nav-copper-dark: #a0522d;
  --nav-text-light: #ffffff;
  --dropdown-bg: #ffffff;
  --dropdown-hover-bg: #f5f0eb;
  --dropdown-border: #e8e0d8;

  /* Typography */
  --font-display: 'Crimson Pro', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-medium: 0.2s ease;
}

/* === Reset & Base === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: 1.2;
  font-size: 17px;
  font-weight: 490;
  background-color: var(--color-bg);
  margin-left: 1rem;
  margin-right: 1rem;
}

/* === Navigation === */
.site-header {
  background: var(--nav-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  display: flex;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

/* Url Button */

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* Space between text and icon */
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 900;
  color: black;
  background: var(--color-button-bg);
  border: 2px solid var(--color-accent);
  border-radius: 4px;
  text-decoration: none;
  font-family: sans-serif;
}

.button:hover {
  background-color: var(--color-button-hover-bg);
}

.url-icon {
  width: 20px;
  height: 20px;
  margin-bottom: 2px;
}

/* Home Button */
.home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 8px 4px 8px 12px;
  border-radius: 50%;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.home-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.home-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: stretch;
  flex: 1;
  flex-wrap: wrap;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 18px 10px;
  color: var(--nav-copper-light);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--nav-copper-light);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.simple {
  color: var(--nav-text-light);
}

.nav-link.simple:hover {
  color: var(--nav-copper-light);
}

.nav-link .arrow {
  width: 12px;
  height: 12px;
  opacity: 0.8;
  transition: transform var(--transition-medium);
}

.nav-item:hover>.nav-link .arrow {
  transform: rotate(180deg);
}

/* Dropdowns */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--dropdown-bg);
  border: 1px solid var(--dropdown-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: all var(--transition-medium);
  z-index: 100;
  list-style: none;
}

.nav-item:hover>.dropdown,
.dropdown-item:hover>.dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  position: relative;
  border-bottom: 1px solid var(--dropdown-border);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  color: var(--nav-copper);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
}

.dropdown-link:hover {
  background: var(--dropdown-hover-bg);
  color: var(--nav-copper-dark);
}

.dropdown-link .arrow-right {
  width: 14px;
  height: 14px;
  opacity: 0.6;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.dropdown-item:hover>.dropdown-link .arrow-right {
  transform: translateX(3px);
  opacity: 1;
}

/* Nested dropdowns */
.dropdown .dropdown {
  top: -1px;
  left: 100%;
}

/* === Main Content === */
.site-main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Page Header */
.page-header {
  text-align: center;
  margin-bottom: 1rem;
}

.eyebrow {
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 1rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 900;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.subtitle {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-image {
  max-width: 50%;
  margin-left: auto;
  margin-right: auto;
  display: table;
  margin-bottom: 1rem;
}

.hero-image img {
  max-width: 100%;
  max-height: 700px;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.hero-image figcaption {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  text-align: center;
  display: table-caption;
  caption-side: bottom;
  background-color: var(--color-card);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Hero image without figcaption - full rounded corners */
.hero-image:not(:has(figcaption)) img {
  border-radius: 12px;
}

/*.hero-image img:only-child {
  border-radius: 12px;
}*/

/* Content Images - inline images within article text */
.content-image {
  max-width: 900px;
  margin: 1.5rem auto;
}

.content-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.content-image figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Float right for smaller inline images */
.content-image.float-right {
  float: right;
  max-width: 300px;
  margin: 0 0 1rem 1.5rem;
}

.content-image.float-right.large img {
  max-width: 550px;
  width: auto;
}

.content-image.float-right.compact img {
  max-width: 150px;
  margin: 0;
}

.content-image.float-right img {
  display: block;
  margin: 0 auto;
}

/* Float left for smaller inline images */
.content-image.float-left {
  float: left;
  max-width: 300px;
  margin: 0 1.5rem 1rem 0;
}

.content-image.float-left.large img {
  max-width: 550px;
  width: auto;
}

.content-image.float-left.compact img {
  max-width: 150px;
  margin: 0;
}

.content-image.float-left img {
  display: block;
  margin: 0 auto;
}

/* Two-column media layout */
.two-column-media {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0;
  /* added by Don */
  justify-items: center;
}

.two-column-media figure {
  margin: 0;
}

.two-column-media img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  height: 500px;
  /* removed by Don */
  /*object-fit: contain;*/
  background: var(--color-button-bg);
}

.two-column-media figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

/* Three-column media layout */
.three-column-media {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0;
  /* added by Don */
  justify-items: center;
}

.three-column-media figure {
  margin: 0;
}

.three-column-media img {
  /* modified by Don - was 100% */
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  height: 500px;
  object-fit: contain;
}

.three-column-media figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

/* Landscape variant - for horizontal/landscape images */
.three-column-media.landscape img {
  height: auto;
  max-height: 280px;
  width: 100%;
  object-fit: cover;
}

/* Compact variant - smaller images for tight spaces */
.three-column-media.compact img {
  height: 300px;
}

/* Responsive adjustments for multi-column media */
@media (max-width: 768px) {
  .two-column-media {
    grid-template-columns: 1fr;
  }

  .three-column-media {
    grid-template-columns: 1fr;
  }

  .content-image.float-right {
    float: none;
    max-width: 100%;
    margin: 1.5rem auto;
  }

  .content-image.float-left {
    float: none;
    max-width: 100%;
    margin: 1.5rem auto;
  }
}

.content-image.small-centered {
  max-width: 25%;
  margin: 1.5rem auto;
}

.content-image.medium-centered {
  max-width: 50%;
  margin: 1.5rem auto;
}

.content-image.large-centered {
  max-width: 66%;
  margin: 1.5rem auto;
}

.content-image.full-centered {
  max-width: fit-content;
}

.content-image.small-centered img {
  display: block;
  margin: 0 auto;
}

/* Article & Sections */
article {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

section {
  animation: fadeIn 0.6s ease-out both;
}

/* Section for 2 image grid */
.two-img-grid-section {
  max-width: 500px;
  margin: 0 auto;
}


section:nth-child(1) {
  animation-delay: 0.1s;
}

section:nth-child(2) {
  animation-delay: 0.2s;
}

section:nth-child(3) {
  animation-delay: 0.3s;
}

section:nth-child(4) {
  animation-delay: 0.4s;
}

section:nth-child(5) {
  animation-delay: 0.5s;
}

section:nth-child(6) {
  animation-delay: 0.6s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typography */
.section-heading {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.section-heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.25em;
  background: linear-gradient(180deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
  border-radius: 2px;
}

p {
  font-family: var(--font-body);
  margin-bottom: 1.25rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

p:last-child {
  margin-bottom: 0;
}

.lead {
  color: var(--color-text-muted);
}

.lead::first-letter {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 600;
  float: left;
  line-height: 1;
  margin-right: 0.5rem;
  margin-top: -.9rem;
  color: var(--color-accent);
}

/* Pull Quote / Blockquote */
.pull-quote,
blockquote.pull-quote {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--color-accent);
  border-left: 4px solid var(--color-accent);
  padding: 1rem 1.5rem;
  margin: 2rem 5rem 2rem 5rem;
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.05) 0%, rgba(212, 165, 116, 0.05) 100%);
  border-radius: 0 8px 8px 0;
}

.pull-quote p,
blockquote.pull-quote p {
  margin: 0;
  line-height: 1.6;
}

strong {
  color: var(--color-text);
  font-weight: 900;
}

.highlight-light {
  background-color: transparent;
  color: var(--color-highlight-light);
  font-weight: 900;
  font-style: normal;
  font-size: 1rem;
}

.highlight {
  background-color: transparent;
  color: var(--color-accent);
  font-weight: 900;
}

.highlight-large {
  background-color: transparent;
  color: var(--color-accent);
  font-weight: 900;
  font-size: 1rem;
}

.highlight-hyperlink {
  background-color: transparent;
  color: var(--color-accent);
  font-weight: 700;
  color: blue;
  text-decoration: underline;
}

.highlight-white-bg {
  background-color: var(--color-card);
  color: var(--color-accent);
  font-weight: 700;
}

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

/* Cards - Shared Styles */
.card {
  background: var(--color-card);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--color-border);
}

/* Cards containing galleries need overflow visible for overlays */
.card.multi-gallery-section,
.card:has(.photo-gallery) {
  overflow: visible;
}

/* Spellings Card */
.spellings-card h2 {
  margin-bottom: 1.5rem;
}

.spelling-group {
  margin-bottom: .75rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--color-border);
}

.spelling-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.spelling-group dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.spelling-group dd {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* Highlighted Section (Ancestry, DNA) */
.highlighted-section {
  background: linear-gradient(135deg, var(--color-accent) 0%, #6b3410 100%);
  color: white;
  border-radius: 12px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.highlighted-section::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  transform: translate(30%, -30%);
}

.highlighted-section h2 {
  color: white;
}

.highlighted-section h2::before {
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.5) 100%);
}

.highlighted-section p {
  color: rgba(255, 255, 255, 0.9);
}

figcaption {
  display: block;
  padding: 7px;
}

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

.location-group h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-accent-light);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.location-group ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.location-group li {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
}

/* DNA Highlights */
.dna-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.dna-tag {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
}

.dna-tag strong {
  color: var(--color-accent-light);
}

/* Portrait Card */
.portrait-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  margin-left: 10rem;
  margin-right: 10rem;
}

/* Portrait card image container for enlarge functionality */
.portrait-card .portrait-image-container {
  position: relative;
  flex-shrink: 0;
}

.portrait-card img {
  width: 250px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

/* Enlarge button for portrait-card */
.portrait-card .gallery-enlarge-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 2;
}

.portrait-card .gallery-enlarge-btn svg {
  width: 18px;
  height: 18px;
  color: var(--color-accent);
  transition: transform 0.2s ease;
}

.portrait-card .portrait-image-container:hover .gallery-enlarge-btn {
  opacity: 1;
  transform: scale(1);
}

.portrait-card .gallery-enlarge-btn:hover {
  background: var(--color-accent);
}

.portrait-card .gallery-enlarge-btn:hover svg {
  color: white;
  transform: scale(1.1);
}

.portrait-card figcaption {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--color-text-muted);
  text-align: center;
}

.portrait-card figcaption strong {
  display: block;
  font-style: normal;
  font-size: 1.1rem;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

/* Diary Entries */
.diary-section h2 {
  margin-bottom: 1rem;
}

.diary-intro {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.diary-entries {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.diary-entry {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}

.diary-entry .diary-quotes {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.diary-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  white-space: nowrap;
  padding-top: 0.25rem;
}

.diary-quote {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-quote);
  line-height: 1.6;
  position: relative;
  padding-left: 1rem;
  border-left: 2px solid var(--color-border);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: linear-gradient(180deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  margin-bottom: .5rem;
  clear: both;
  /* Clear floats from previous items */
  display: flow-root;
  /* Modern way to contain floats */
}

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  background: var(--color-accent);
  border-radius: 50%;
  transform: translateX(-4px);
}

.timeline-year {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.timeline-content {
  color: var(--color-text-muted);
}

/* Timeline Gallery - horizontal layout for images within timeline items */
.timeline-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
  margin-top: 0.5rem;
}

.timeline-gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 250px;
  text-align: center;
}

.timeline-gallery-item .timeline-content {
  margin-bottom: 0.25rem;
  font-weight: 500;
  text-align: center;
}

.timeline-gallery-item figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-gallery-item figure img {
  max-height: 200px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.timeline-gallery-item figcaption {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  text-align: center;
  max-width: 250px;
}

/* Collapsible Timeline */
/* Timeline Expand/Collapse All Controls */
.timeline-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

/* ========================================
   GOOGLE MAPS EMBED & LEGEND
   ======================================== */

.map-section {
  padding-bottom: 1.5rem;
}

.map-description {
  margin-bottom: 1.5rem;
  color: var(--color-text-muted);
}

.map-container {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-border);
}

.map-container iframe {
  display: block;
  width: 100%;
  min-height: 450px;
}

@media (min-width: 768px) {
  .map-container iframe {
    min-height: 500px;
  }
}

@media (min-width: 1024px) {
  .map-container iframe {
    min-height: 550px;
  }
}

/* Map Legend */
.map-legend-section {
  padding-bottom: 1.5rem;
}

.map-legend-intro {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.map-legend {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.legend-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-bg);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.legend-item img {
  max-width: 150px;
}

/* Legend item enlargeable figures */
.legend-item figure.enlargeable {
  display: inline-block;
  margin: 0.5rem 0;
  position: relative;
}

.legend-item figure.enlargeable img {
  border-radius: 4px;
  cursor: pointer;
}

/*.legend-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateX(4px);
} */

.legend-marker {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: #4285f4;
  /* Google Maps blue */
  color: white;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.4);
}

.legend-content {
  flex: 1;
  min-width: 0;
}

.legend-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.25rem;
}

.legend-description {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Numbered markers (for longer lists) */
.legend-marker.numbered {
  font-size: 0.85rem;
}

/* Color variations for different marker types */
.legend-marker.red {
  background: #c41e3a;
}

.legend-marker.blue {
  background: #2563eb;
}

.legend-marker.green {
  background: #16a34a;
}

.legend-marker.purple {
  background: #7c3aed;
}

.legend-marker.orange {
  background: #ea580c;
}

/* Responsive: 2 columns on larger screens */
@media (min-width: 768px) {
  .map-legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 1200px) {
  .map-legend {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   CEMETERY PAGE COMPONENT
   ======================================== */

.cemetery-section {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  background: var(--color-card);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

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

/* Cemetery Card (Left Side) */
.cemetery-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.cemetery-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.cemetery-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-medium);
}

.cemetery-card:hover .cemetery-card-image img {
  transform: scale(1.05);
}

/* Modifier: Shrink and center image within cemetery card */
.cemetery-card-image.image-contain {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9f7f3;
/* removed by Don */
/*  padding: 1rem; */
}

/* Modifier: Shrink and center image hero image */
.hero-image.image-contain {
  max-width: 15%;
}

.cemetery-card-image.image-contain img {
  width: auto;
  height: auto;
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

/* Disable hover zoom for contained images */
.cemetery-card:hover .cemetery-card-image.image-contain img {
  transform: none;
}

.cemetery-card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cemetery-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.cemetery-location {
  font-size: 0.9rem;
  color: var(--color-accent);
  margin: 0;
  font-weight: 500;
}

.cemetery-description {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0.25rem 0 0;
}

.cemetery-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.cemetery-link:hover {
  color: var(--color-accent-dark);
  text-decoration: underline;
}

.cemetery-link svg {
  width: 16px;
  height: 16px;
}

/* Interments Panel (Right Side) */
.interments-panel {
  padding: 0.5rem 0;
}

.interments-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-accent);
}

/* Family Group */
.family-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Children indentation 
.family-children {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-left: 2rem;
  padding-left: 1rem;
  border-left: 2px solid var(--color-border);
}*/

/* ========================================
   GENERATION-BASED INDENTATION SYSTEM
   Use data-gen="1", "2", "3", etc. on interment-person
   for consistent indentation across cemeteries
   ======================================== */

/* Generation indentation */
.interment-person[data-gen="1"] {
  margin-left: 0;
}

.interment-person[data-gen="2"] {
  margin-left: 3rem;
}

.interment-person[data-gen="3"] {
  margin-left: 6rem;
}

.interment-person[data-gen="4"] {
  margin-left: 9rem;
}

.interment-person[data-gen="5"] {
  margin-left: 12rem;
}

.interment-person[data-gen="6"] {
  margin-left: 15rem;
}

/* Generation badge - shows on all people */
.gen-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  margin-left: auto;
  white-space: nowrap;
  border: 1px dashed;
  min-width: 42px;
}

/* Generation badge colors */
.gen-badge[data-gen="1"] {
  background: rgba(139, 69, 19, 0.12);
  color: #8b4513;
  border-color: #8b4513;
}

.gen-badge[data-gen="2"] {
  /*  background: rgba(66, 133, 244, 0.12);
  color: #2563eb;
  border-color: #4285f4;*/
  background: rgba(234, 190, 47, 0.179);
  color: #ba7f07;
  border-color: #bc941c;
}

.gen-badge[data-gen="3"] {
  background: rgba(52, 168, 83, 0.12);
  color: #16a34a;
  border-color: #34a853;
}

.gen-badge[data-gen="4"] {
  background: rgba(85, 8, 98, 0.12);
  color: #6d23ed;
  border-color: #7a0d8d;
}

.gen-badge[data-gen="5"] {
  background: rgba(234, 88, 12, 0.12);
  color: #ea580c;
  border-color: #f46c22;
}

.gen-badge[data-gen="6"] {
  background: rgb(255, 255, 255);
  color: #3f3e3e;
  border-color: #787776;
}

/* Generation badge right-side indentation (reverse of person indent) */
.gen-badge[data-gen="1"] {
  margin-right: 15rem;
}

.gen-badge[data-gen="2"] {
  margin-right: 12rem;
}

.gen-badge[data-gen="3"] {
  margin-right: 9rem;
}

.gen-badge[data-gen="4"] {
  margin-right: 6rem;
}

.gen-badge[data-gen="5"] {
  margin-right: 3rem;
}

.gen-badge[data-gen="6"] {
  margin-right: 0;
}

/* Family group container */
.family-group {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  position: relative;
}

/* "Child of" indicator for cross-cemetery relationships */
.child-of-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0 0 0;
  font-size: 0.8rem;
  /*  color: var(--color-text-muted);*/
  font-style: italic;
  position: relative;
  z-index: 1;
}

.child-of-indicator .highlight {
  color: var(--color-accent);
}

.child-of-indicator .muted {
  color: var(--color-text-muted);
}

.child-of-indicator[data-gen="2"] {
  margin-left: 3.5rem;
}

.child-of-indicator[data-gen="3"] {
  margin-left: 6.5rem;
}

.child-of-indicator[data-gen="4"] {
  margin-left: 9.5rem;
}

.child-of-indicator[data-gen="5"] {
  margin-left: 12.5rem;
}

.child-of-indicator[data-gen="6"] {
  margin-left: 15.5rem;
}

/* Dashed line before the text */
.child-of-indicator::before {
  content: '';
  display: block;
  width: 24px;
  height: 0;
  border-top: 2px dashed var(--color-accent-light);
}

/* Small tree icon */
.child-of-indicator svg {
  width: 14px;
  height: 14px;
  color: var(--color-accent);
  flex-shrink: 0;
}

/* ========================================
   SPOUSE ROLE INDICATOR
   Use data-role="husband" or data-role="wife"
   Displays after the external link icon
   ======================================== */

.spouse-role {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.spouse-role.husband {
  color: #4a90d9;
  background: rgba(74, 144, 217, 0.1);
}

.spouse-role.wife {
  color: #d97ab5;
  background: rgba(217, 122, 181, 0.1);
}

/* ========================================
   PERSON DETAILS (Optional second line)
   Add .person-details span after .person-name
   for additional info like relationships
   ======================================== */

.person-details {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-top: 0.15rem;
}

.person-details strong {
  font-weight: 600;
  color: var(--color-text);
}

.person-details .highlight {
  color: var(--color-accent);
  font-weight: 500;
}

/* Responsive adjustments for generation indentation */
@media (max-width: 768px) {

  .interment-person[data-gen="2"],
  .child-of-indicator[data-gen="2"] {
    margin-left: 1rem;
  }

  .interment-person[data-gen="3"],
  .child-of-indicator[data-gen="3"] {
    margin-left: 2rem;
  }

  .interment-person[data-gen="4"],
  .child-of-indicator[data-gen="4"] {
    margin-left: 3rem;
  }

  .interment-person[data-gen="5"] {
    margin-left: 4rem;
  }

  /* Adjust badge margins for mobile */
  .gen-badge[data-gen="1"] {
    margin-right: 3rem;
  }

  .gen-badge[data-gen="2"] {
    margin-right: 2rem;
  }

  .gen-badge[data-gen="3"] {
    margin-right: 1rem;
  }

  .spouse-role {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
  }
}


/* Individual Person */
.interment-person {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background var(--transition-fast), transform var(--transition-fast);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.interment-person:hover {
  /* background: var(--color-bg);
  transform: translateX(4px);*/

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateX(4px);
}

/* Person Photo */
.person-photo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-border);
  /* border: 2px solid var(--color-border); */
}

.person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  /* Favor upper portion for faces */
  /* transform: scale(0.85);  */
}

/* Placeholder for missing photos */
.person-photo:empty::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8e0d8 0%, #d5ccc3 100%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a89a8c' stroke-width='1.5'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px;
}

/* Gender Icon */
.person-gender {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.person-gender svg {
  width: 18px;
  height: 18px;
}

.person-gender.male svg {
  color: #4a90d9;
}

.person-gender.female svg {
  color: #d97ab5;
}

/* Person Name and Info Container */
.person-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.person-name {
  font-size: 0.95rem;
  color: var(--color-text);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.person-name em {
  font-weight: 400;
  color: var(--color-text-muted);
}

/* External link after person name - matches .cemetery-link style */
.person-name .external-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
  margin-left: 0.25rem;
}

.person-name .external-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.interment-person:hover .person-name .external-link {
  color: var(--color-accent-dark);
  text-decoration: underline;
}

.interment-person:hover .person-name {
  color: var(--color-accent);
}

/* Person Details - Optional second line */
.person-details {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-top: 0.2rem;
}

.person-details strong {
  font-weight: 600;
  color: var(--color-text);
}

.person-details .highlight {
  color: var(--color-accent);
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .cemetery-section {
    padding: 1rem;
  }

  .family-children {
    margin-left: 1rem;
    padding-left: 0.75rem;
  }

  .person-photo {
    width: 42px;
    height: 42px;
  }

  .person-name {
    font-size: 0.85rem;
  }
}

.timeline-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-accent);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.timeline-toggle-btn:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.timeline-toggle-btn:hover .toggle-icon svg {
  stroke: white;
}

.timeline-toggle-btn .toggle-icon {
  width: 18px;
  height: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  transition: transform var(--transition-fast);
}

.timeline-toggle-btn .toggle-icon svg {
  width: 18px;
  height: 10px;
  stroke: var(--color-accent);
  margin: -2px 0;
}

.timeline-toggle-btn.expanded .toggle-icon {
  transform: rotate(180deg);
}

.collapsible-timeline {
  position: relative;
  padding-left: 2rem;
}

.collapsible-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 3px;
  background: linear-gradient(180deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
  border-radius: 2px;
}

.timeline-item-collapsible {
  position: relative;
  margin-bottom: 1.5rem;
}

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

.timeline-item-collapsible::before {
  content: '📅';
  position: absolute;
  left: -2.65rem;
  top: 0.1rem;
  width: 22px;
  height: 22px;
  background: var(--color-accent);
  border-radius: 50%;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

/* Non-collapsible timeline item content */
.timeline-item-collapsible>.timeline-item-content {
  color: var(--color-text-muted);
}

.timeline-item-collapsible>.timeline-item-content strong {
  color: var(--color-text);
}

/* Collapsible details within timeline */
.timeline-item-collapsible details {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-collapsible-bg);
  margin-top: 0.5rem;
}

.timeline-item-collapsible summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(color-text);
  list-style: none;
  transition: background var(--transition-fast);
}

.timeline-item-collapsible summary::-webkit-details-marker {
  display: none;
}

.timeline-item-collapsible summary:hover {
  background: var(--color-accent-light);
  border-radius: 8px;
}

.timeline-item-collapsible summary::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b4513' stroke-width='2.5'%3E%3Cpath d='M6 7l6 5 6-5'/%3E%3Cpath d='M6 12l6 5 6-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  transition: transform var(--transition-fast);
}

.timeline-item-collapsible details[open] summary::before {
  transform: rotate(180deg);
}

.timeline-item-collapsible .details-content {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--color-border);
  overflow: hidden;
  /* Contains floated elements */
}

/* Clearfix for floated content */
.timeline-item-collapsible .details-content::after {
  content: '';
  display: table;
  clear: both;
}

/* Clear floats for cards inside details-content */
.timeline-item-collapsible .details-content>.card {
  clear: both;
}

.timeline-item-collapsible .details-content p {
  margin-bottom: 0.75rem;
}

.timeline-item-collapsible .details-content p:last-child {
  margin-bottom: 0;
}

.timeline-event-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.timeline-aside {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  border-left: 4px solid var(--color-accent);
  padding: 1rem 1.5rem;
  margin-top: 1.25rem;
  background: white;
  /*  background: linear-gradient(135deg, rgba(139, 69, 19, 0.05) 0%, rgba(212, 165, 116, 0.05) 100%);*/
  border-radius: 0 8px 8px 0;
  /* display: inline-block;*/
  color: var(--color-accent);


  /* background: var(--color-card);
  border-left: 3px solid var(--color-accent-light);
  padding: 0.75rem 1rem;
  margin: 1rem 0 0 0;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--color-text-muted);*/
}

.timeline-figure {
  margin-top: 1rem;
  text-align: center;
}

.timeline-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.timeline-figure figcaption {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

/* Parish Records */
.parish-years {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.year-tag {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Anecdote Card */
.anecdote-card {
  position: relative;
  margin-left: 5rem;
  margin-right: 5rem;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.card-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.anecdote-content {
  font-family: var(--font-display);
  font-size: 1.15rem;
  /*  line-height: 1.6; */
  color: var(--color-text-muted);
  position: relative;
  z-index: 1;
}

/* For short fact lists inside anecdote cards */
p.anecdote-content.tight,
.details-content p.anecdote-content.tight {
  margin-bottom: 0;
}

p.anecdote-content.tight:last-of-type,
.details-content p.anecdote-content.tight:last-of-type {
  margin-bottom: 0;
}

.anecdote-content strong {
  color: var(--color-text);
  font-weight: 600;
}

.highlight-name {
  color: var(--color-accent);
  font-weight: 600;
}

.note {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: large;
  color: var(--nav-bg);
  font-style: italic;
  text-align: center;
}

.aside-note {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  border-left: 4px solid var(--color-accent);
  padding: 1rem 1.5rem;
  margin-top: 1.25rem;
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.05) 0%, rgba(212, 165, 116, 0.05) 100%);
  border-radius: 0 8px 8px 0;
  display: inline-block;
  color: var(--color-accent);


  /* display: inline-block;
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.08) 0%, rgba(212, 165, 116, 0.08) 100%);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  font-size: 1rem;
  color: var(--color-accent);*/
}

/* Welcome Card */
.welcome-card {
  background: linear-gradient(135deg, var(--color-accent) 0%, #6b3410 100%);
  color: white;
  border-radius: 12px;
  padding: 1rem;
  position: relative;
  overflow: hidden;
  text-align: center;
  margin-left: 15rem;
  margin-right: 15rem;
  margin-top: 1rem;
}

.welcome-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  transform: translate(30%, -30%);
}

.welcome-card h2 {
  color: white;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.welcome-card p {
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
}

/* What If List */
.what-if-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  font-size: 1.1em;
}

.what-if-list li {
  display: block;
  padding-left: 2rem;
  position: relative;
  color: var(--color-text-muted);
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.what-if-list li::before {
  content: 'If';
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  color: var(--color-accent);
  position: absolute;
  left: 0;
}

/* Ensure highlights flow naturally within text */
.what-if-list .highlight {
  display: inline;
  white-space: normal;
}

.punchline {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* Quote Section */
.quote-section {
  position: relative;
  padding: 2.75rem;
  padding-bottom: 1.5rem;
  margin: 0 5rem 1rem 5rem;
}

/* Clear floats when quote-section is inside details-content */
.details-content .quote-section {
  clear: both;
}

.quote-section::before {
  content: '"';
  font-family: var(--font-display);
  font-size: 6rem;
  color: var(--color-accent-light);
  opacity: 0.5;
  position: absolute;
  top: 0.5rem;
  left: 1.5rem;
  line-height: 1;
}

.quote-intro {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 1rem;
  margin-top: 1rem;
  display: block;
}

.quote-text {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-quote);
  position: relative;
  z-index: 1;
  font-size: 1.2rem;
}

/* Immigration Grid */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.story-card {
  background: var(--color-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--color-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  cursor: pointer;
}

/* Card click behavior is handled by JavaScript in story-card-click.js */

/* Link indicator in top-right corner */
.story-card-link-indicator {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 3;
  transition: transform var(--transition-fast), background var(--transition-fast);
  pointer-events: none;
}

.story-card-link-indicator svg {
  width: 18px;
  height: 18px;
  color: var(--color-accent);
  transition: transform var(--transition-fast);
}

.story-card:hover .story-card-link-indicator {
  background: var(--color-accent);
  transform: scale(1.05);
}

.story-card:hover .story-card-link-indicator svg {
  color: white;
  transform: translate(1px, -1px);
}

.story-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.story-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

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

.story-card figcaption {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  text-align: center;
}

.story-card-content {
  padding: 1.25rem;
}

/* Links inside story-card-content should be clickable and styled */
.story-card-content a {
  position: relative;
  z-index: 3;
  cursor: pointer;
}

.story-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.story-card p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.story-card .stat {
  display: inline-block;
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.1) 0%, rgba(212, 165, 116, 0.1) 100%);
  padding: 0.5rem 1rem;
  border-radius: 9px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* ========================================
   PHOTO GALLERY COMPONENT
   Add this to family-genealogy.css
   ======================================== */

/* Gallery Container */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 1.5rem;
  row-gap: 5rem;
  margin-top: 1.5rem;
  padding-bottom: 150px;
  /* Space for expanded overlay on last row */
  overflow: visible;
}

@media (max-width: 900px) {
  .photo-gallery {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 5rem;
  }
}

@media (max-width: 600px) {
  .photo-gallery {
    grid-template-columns: 1fr;
    row-gap: 4rem;
  }
}

/* Gallery Item */
.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: visible;
  /* Allow overlay to extend beyond */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--color-border);
  transition: transform var(--transition-medium), box-shadow var(--transition-medium);
  z-index: 1;
  background: linear-gradient(135deg, #f5f0eb 0%, #e8e0d8 100%);
  border-radius: 12px;
  /* Align content to top so gradient header is always at top */
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Gradient Header at top of gallery item */
.gallery-gradient-header {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--nav-copper) 50%, var(--color-accent-light) 100%);
  color: white;
  padding: 0.6rem 1rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  border-radius: 12px 12px 0 0;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  z-index: 100;
  /* Bring to front when hovered so overlay shows above other sections */
}

/* Image Container - maintains aspect ratio without clipping */
.gallery-image-container {
  position: relative;
  background: linear-gradient(135deg, #f5f0eb 0%, #e8e0d8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 1rem;
  cursor: pointer;
  border-radius: 0;
  overflow: hidden;
  /* Clip at container edges */
  width: 100%;
  flex: 1;
}

.gallery-image-container img {
  max-width: 100%;
  max-height: 350px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 4px;
  transition: transform var(--transition-medium);
  margin: 0 auto;
}

.gallery-item:hover .gallery-image-container img {
  transform: scale(1.02);
}

/* Enlarge Button - top right of image */
.gallery-enlarge-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
  z-index: 15;
}

.gallery-enlarge-btn svg {
  width: 18px;
  height: 18px;
  color: var(--color-accent);
}

.gallery-item:hover .gallery-enlarge-btn {
  opacity: 1;
  transform: scale(1);
}

.gallery-enlarge-btn:hover {
  background: var(--color-accent);
}

.gallery-enlarge-btn:hover svg {
  color: white;
}

/* ========================================
   ENLARGE BUTTON FOR ALL IMAGE TYPES
   All buttons positioned top-right
   ======================================== */

/* Hero images */
.hero-image {
  position: relative;
}

.hero-image .gallery-enlarge-btn {
  opacity: 0;
  transform: scale(0.8);
}

.hero-image:hover .gallery-enlarge-btn {
  opacity: 1;
  transform: scale(1);
}

/* Content images */
.content-image {
  position: relative;
}

.content-image .gallery-enlarge-btn {
  opacity: 0;
  transform: scale(0.8);
}

.content-image:hover .gallery-enlarge-btn {
  opacity: 1;
  transform: scale(1);
}

/* Two-column media figures */
.two-column-media figure {
  position: relative;
}

.two-column-media figure .gallery-enlarge-btn {
  opacity: 0;
  transform: scale(0.8);
}

.two-column-media figure:hover .gallery-enlarge-btn {
  opacity: 1;
  transform: scale(1);
}

/* Three-column media figures */
.three-column-media figure {
  position: relative;
}

.three-column-media figure .gallery-enlarge-btn {
  opacity: 0;
  transform: scale(0.8);
}

.three-column-media figure:hover .gallery-enlarge-btn {
  opacity: 1;
  transform: scale(1);
}

/* Generic enlargeable class */
.enlargeable {
  position: relative;
}

.enlargeable .gallery-enlarge-btn {
  opacity: 0;
  transform: scale(0.8);
}

.enlargeable:hover .gallery-enlarge-btn {
  opacity: 1;
  transform: scale(1);
}

/* Document gallery - enlarge button (top-right, same as galleries) */
.document-thumbnail {
  position: relative;
}

.document-thumbnail .gallery-enlarge-btn {
  opacity: 0;
  transform: scale(0.8);
}

.document-card:hover .document-thumbnail .gallery-enlarge-btn {
  opacity: 1;
  transform: scale(1);
}

/* Hide the old overlay style for image documents (keep for PDFs) */
.document-card:not(.pdf-document) .document-view-overlay {
  display: none;
}

/* Hide the old caption area - content moves to overlay */
.gallery-caption {
  display: none;
}

/* Hide old description inside image container */
.gallery-image-container>.gallery-description {
  display: none;
}

/* Info Overlay - always visible bar at bottom, expands DOWNWARD on hover */
.gallery-info-overlay {
  position: absolute;
  top: 100%;
  /* Position at bottom edge of gallery-item */
  left: 0;
  right: 0;
  background: rgba(55, 55, 55, 0.92);
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-10px);
  /* Pull up so header barely overlaps bottom of image */
}

/* Title bar - always visible */
.gallery-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  cursor: pointer;
  /* Fixed height for consistency */
  height: 60px;
  min-height: 60px;
}

/* Subtitle in header bar (title is now in gradient header) */
.gallery-info-header .gallery-subtitle {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  line-height: 1.3;
  flex: 1;
  font-style: italic;
  /* Truncate long text with ellipsis */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-info-overlay .gallery-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: white;
  margin: 0;
  line-height: 1.3;
  flex: 1;
}

/* Chevron indicator - in the header bar (now a button for better touch) */
.gallery-expand-indicator {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 0.75rem;
  padding: 0;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-medium);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.gallery-expand-indicator:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.3);
}

.gallery-expand-indicator:active {
  background: rgba(255, 255, 255, 0.4);
}

.gallery-expand-indicator svg {
  width: 12px;
  height: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin: -2px 0;
}

.gallery-item:hover .gallery-expand-indicator {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(180deg);
}

/* Also rotate when expanded via click (touch devices) */
.gallery-item.expanded .gallery-expand-indicator {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(180deg);
}

/* Expandable content - hidden by default, expands downward */
.gallery-info-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1rem;
}

.gallery-item:hover .gallery-info-content {
  max-height: 300px;
  /* Allows content to expand downward */
  padding: 0 1rem 1rem;
}

/* Also expand when expanded via click (touch devices) */
.gallery-item.expanded .gallery-info-content {
  max-height: 300px;
  padding: 0 1rem 1rem;
}

.gallery-info-overlay .gallery-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

/* Highlighted gallery subtitle - brighter text */
.gallery-info-overlay .gallery-subtitle.highlight {
  font-size: 1rem;
  color: var(--nav-copper-light);
  margin-bottom: 0.6rem;
  line-height: 1.4;
  font-weight: 900;
}

/* Highlight spans within gallery subtitle */
.gallery-info-overlay .gallery-subtitle .highlight {
  font-size: 1rem;
  color: var(--nav-copper-light);
  margin-bottom: 0.6rem;
  line-height: 1.4;
  font-weight: 900;
}

.gallery-info-overlay .gallery-description {
  position: static;
  background: none;
  padding: 0;
  transform: none;
  pointer-events: auto;
}

.gallery-info-overlay .gallery-description p {
  font-family: var(--font-display);
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  margin: 0;
  font-size: 0.88rem;
}

/* Lightbox Modal */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: lightboxFadeIn 0.25s ease;
}

.lightbox.active {
  display: flex;
}

@keyframes lightboxFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: lightboxZoomIn 0.3s ease;
}

@keyframes lightboxZoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-content img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  margin-top: .5rem;
  text-align: center;
  max-height: 30vh;
  overflow-y: auto;
  padding: 0 1rem;
}

/* Scrollbar styling for lightbox caption */
.lightbox-caption::-webkit-scrollbar {
  width: 6px;
}

.lightbox-caption::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.lightbox-caption::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.lightbox-caption::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.lightbox-caption h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.5rem;
}

.lightbox-caption p {
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.lightbox-caption .lightbox-subtitle {
  font-size: 0.9rem;
  font-style: normal;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.75rem;
}

.lightbox-caption .lightbox-description {
  margin-top: 0.5rem;
  text-align: left;
  font-style: normal;
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

.lightbox-caption .lightbox-description p {
  margin-bottom: 0.75rem;
  font-style: normal;
}

.lightbox-caption .lightbox-description p:last-child {
  margin-bottom: 0;
}

.lightbox-caption .lightbox-description strong {
  color: rgba(255, 255, 255, 1);
  font-weight: 600;
}

.lightbox-close {
  position: absolute;
  top: -3rem;
  right: 0;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-close svg {
  width: 24px;
  height: 24px;
  color: white;
}

/* Navigation arrows */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-nav svg {
  width: 24px;
  height: 24px;
  color: white;
}

.lightbox-prev {
  left: -4rem;
}

.lightbox-next {
  right: -4rem;
}

@media (max-width: 900px) {
  .lightbox-prev {
    left: 0.5rem;
  }

  .lightbox-next {
    right: 0.5rem;
  }

  .lightbox-close {
    top: 0.5rem;
    right: 0.5rem;
  }
}

/* Gallery Section Header */
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.gallery-count {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  background: var(--color-card);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--color-border);
}

.gallery-count strong {
  color: var(--color-accent);
}

/* Updates Section */
.updates-section {
  margin-top: 2em;
}

/* About Author */
.about-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-accent-light);
  flex-shrink: 0;
}

.author-info h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.author-info .role {
  font-size: 1rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 1rem;
}

.author-info p {
  font-size: 1rem;
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--color-border);
  margin-top: 2rem;
}

.site-footer p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ========================================
   COMMENTS COMPONENT
   ======================================== */

.comments-section {
  margin-top: 2rem;
  position: relative;
  z-index: 0;
  /* Keep below gallery overlays */
}

.comments-count {
  /*  align-items: center;
  display: flex;*/
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Individual Comment */
.comment {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-card);
}

.comment:last-of-type {
  border-bottom: 1px solid var(--color-border);
}

/* Reply comments - indented */
.comment.comment-reply {
  margin-left: 3rem;
  background: var(--color-bg);
}

/* Avatar */
.comment-avatar {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: var(--color-accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-accent);
  opacity: 50%;
}

.comment-avatar svg {
  width: 28px;
  height: 28px;
  color: white;
}

/* Comment Content */
.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.comment-author {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.comment-date {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.comment-body {
  margin-bottom: 0.75rem;
}

.comment-body p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

.comment-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.comment-author-name {
  color: var(--color-text-muted);
}

.comment-email {
  color: var(--color-accent);
  text-decoration: none;
}

.comment-email:hover {
  text-decoration: underline;
}

.comment-like {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--color-accent);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.comment-like svg {
  width: 14px;
  height: 14px;
  fill: var(--color-accent);
}

/* Comment Form Section */
.comment-form-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.comment-form-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.comment-form .form-textarea {
  min-height: 120px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  min-width: -webkit-fill-available;
}

.comment-form-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.comment-form .form-input {
  border-radius: 4px;
}


/* ========================================
   CONTACT FORM COMPONENT
   ======================================== */

.contact-form {
  /* max-width: 600px; */
  margin-left: 15rem;
  margin-right: 15rem;
}

.form-label {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.form-label .required {
  color: var(--color-accent);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent-light);
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.form-textarea {
  resize: vertical;
  min-height: 150px;
  line-height: 1.5;
}

.form-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: var(--color-accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.form-submit:hover {
  background: var(--color-accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.form-submit:active {
  transform: translateY(0);
}

/* Text link style */
.text-link {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast);
}

.text-link:hover {
  border-bottom-color: var(--color-accent);
}

/* Comment Submit Button */
.comment-submit {
  float: right;
  padding: 0.625rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.comment-submit:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}


/* ========================================
   DATA TABLES COMPONENT
   ======================================== */

.table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-text);
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.08) 0%, rgba(212, 165, 116, 0.08) 100%);
  position: sticky;
  top: 0;
}

.data-table td {
  color: var(--color-text-muted);
}

.data-table td:first-child {
  font-weight: 500;
  color: var(--color-text);
}

.data-table tbody tr:hover {
  background: rgba(139, 69, 19, 0.03);
}

.data-table--compact th,
.data-table--compact td {
  padding: 0.625rem 0.875rem;
  font-size: 0.9rem;
}

/* Terms Grid - for multiple small tables side by side */
.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}


/* ========================================
   SPELLING VARIATIONS COMPONENT
   ======================================== */

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

.spelling-card {
  background: var(--color-bg);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.spelling-header {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
  padding: 0.75rem 1rem;
  text-align: center;
}

.spelling-row {
  display: flex;
  align-items: center;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--color-border);
  justify-content: center;
}

.spelling-row:last-child {
  border-bottom: none;
}

.spelling-row:hover {
  background: rgba(139, 69, 19, 0.05);
}

.spelling-from {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-accent);
  width: 50px;
  text-align: center;
}

.spelling-arrow {
  color: var(--color-text-muted);
  margin: 0 0.5rem;
  font-size: 0.9rem;
}

.spelling-to {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  color: var(--color-text);
  flex: 1;
}


/* ========================================
   CONVENTION LIST COMPONENT
   ======================================== */

.convention-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Clear floats when convention-list is inside details-content */
.details-content .convention-list {
  clear: both;
}

.convention-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem;
  background: var(--color-bg);
  border-radius: 10px;
  border-left: 3px solid var(--color-accent);
}

.convention-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
  border-radius: 50%;
}

.convention-icon svg {
  width: 20px;
  height: 20px;
  color: white;
  stroke: white;
}

.convention-content p {
  margin-bottom: 0.5rem;
}

.convention-content p:last-child {
  margin-bottom: 0;
}

.convention-content .example {
  font-style: italic;
  color: var(--color-text-muted);
  padding-left: 1rem;
  border-left: 2px solid var(--color-accent-light);
  margin-top: 0.75rem;
}

/* ========================================
   RESOURCE GRID COMPONENT
   ======================================== */

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.resource-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.resource-card:hover {
  border-color: var(--color-accent-light);
  background: var(--color-card);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.resource-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.resource-type {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ========================================
   FAMILY TAGS COMPONENT
   ======================================== */

.family-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.family-tag {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
}

/* Signature style */
.signature {
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-text-muted);
}

.signature strong {
  color: var(--color-accent);
}


/* ========================================
   LATEST UPDATES CAROUSEL
   ======================================== */

.latest-updates-section {
  margin: 2rem 0 3rem;
}

.latest-updates-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.latest-updates-subtitle {
  color: var(--color-accent);
  font-weight: 900;
  margin-top: 0.25rem;
}

/* Carousel Container */
.updates-carousel-container {
  position: relative;
  overflow: hidden;
  padding: 0 1rem;
}

/* Carousel Track */
.updates-carousel-track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.5rem 0;
}

.updates-carousel-track::-webkit-scrollbar {
  display: none;
}

/* Update Card */
.update-card {
  flex: 0 0 calc((100% - 3rem) / 3);
  min-width: 300px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  display: block;
  aspect-ratio: 16 / 10;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

.update-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

/* Card Image */
.update-card-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8e4dc 0%, #d9d4c9 100%);
}

.update-card-image img {
  width: auto;
  height: auto;
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.update-card:hover .update-card-image img {
  transform: scale(1.05);
}

/* Modifier: Full cover image (for photos that should fill the card) */
.update-card-image.image-cover {
  background: none;
}

.update-card-image.image-cover img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

/* Card Overlay */
.update-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.1) 0%,
      rgba(0, 0, 0, 0.3) 40%,
      rgba(0, 0, 0, 0.85) 100%);
  padding: 1.5rem;
  /* display: flex;*/
  flex-direction: column;
  justify-content: flex-end;
  color: white;
}

/* Card Meta (category + date) */
.update-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.update-card-category {
  font-size: 0.8rem;
  color: white;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 1.4rem;
}

.update-card-date {
  font-size: 0.8rem;
  color: white;
}

/* Card Title */
.update-card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: white;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

/* Card Description */
.update-card-description {
  font-size: 0.9rem;
  color: white;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Link Indicator */
.update-card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  transition: color var(--transition-fast);
}

.update-card:hover .update-card-link {
  color: var(--color-accent-light);
}

/* Navigation Arrows */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.carousel-arrow svg {
  width: 24px;
  height: 24px;
  color: var(--color-accent);
}

.carousel-arrow-left {
  left: 0.5rem;
}

.carousel-arrow-right {
  right: 0.5rem;
}

.updates-carousel-container:hover .carousel-arrow {
  opacity: 1;
}

.carousel-arrow:hover {
  background: var(--color-accent);
  transform: translateY(-50%) scale(1.05);
}

.carousel-arrow:hover svg {
  color: white;
}

.carousel-arrow.disabled {
  opacity: 0.3 !important;
  cursor: not-allowed;
}

.carousel-arrow.disabled:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-50%);
}

.carousel-arrow.disabled:hover svg {
  color: var(--color-accent);
}

/* Pagination Dots */
.carousel-pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.carousel-dot:hover {
  background: var(--color-accent-light);
}

.carousel-dot.active {
  background: var(--color-accent);
  transform: scale(1.2);
}

/* Responsive */
@media (max-width: 900px) {
  .update-card {
    flex: 0 0 calc((100% - 1.5rem) / 2);
  }
}

@media (max-width: 600px) {
  .update-card {
    flex: 0 0 100%;
    min-width: unset;
  }

  .carousel-arrow {
    width: 40px;
    height: 40px;
  }

  .carousel-arrow svg {
    width: 20px;
    height: 20px;
  }

  .update-card-title {
    font-size: 1.15rem;
  }

  .update-card-description {
    -webkit-line-clamp: 2;
  }
}

/* Loading and Fallback States */
.updates-loading,
.updates-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 250px;
  color: var(--color-text-muted);
  font-style: italic;
}


/* ========================================
   MULTI-GALLERY TABS COMPONENT
   ======================================== */

.multi-gallery-section {
  padding: 2rem;
  overflow: visible;
  position: relative;
}

/* Gallery Tabs Header */
.gallery-tabs {
  margin-bottom: 2rem;
}

.gallery-tabs-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.gallery-tabs-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.5rem;
}

.gallery-tabs-subtitle {
  color: var(--color-text-muted);
  font-size: 1rem;
  margin: 0;
}

/* Hide the old counter - cleaner without it */
.gallery-tabs-count {
  display: none;
}

/* Tab Navigation - Pill Style */
.gallery-tabs-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--color-bg);
  border-radius: 50px;
  width: fit-content;
  margin: 0 auto;
}

.gallery-tab {
  padding: 0.625rem 1.25rem;
  background: transparent;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition-medium);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.gallery-tab:hover {
  color: var(--color-text);
  background: rgba(139, 69, 19, 0.08);
}

.gallery-tab.active {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

/* Hide icon and meta in pill style - just show name */
.gallery-tab-icon,
.gallery-tab-meta {
  display: none;
}

.gallery-tab-text {
  display: contents;
}

.gallery-tab-name {
  font-weight: 500;
}

/* Hide progress bar for cleaner look */
.gallery-tabs-progress {
  display: none;
}

/* Gallery Panels */
.gallery-panels {
  position: relative;
  overflow: visible;
}

.gallery-panel {
  display: none;
  animation: panelFadeIn 0.3s ease;
  overflow: visible;
}

.gallery-panel.active {
  display: block;
}

@keyframes panelFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Optional: Panel header - can be hidden if not needed */
.gallery-panel-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.gallery-panel-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.gallery-panel-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

/* Remove the accent bar for cleaner look */
.gallery-panel-title::before {
  display: none;
}

.gallery-panel-description {
  color: var(--color-text-muted);
  margin: 0;
  font-size: 0.95rem;
}

/* === ALTERNATIVE: Sidebar Tabs Layout === 
   Add class "gallery-tabs-sidebar" to .multi-gallery-section
   to enable vertical sidebar tabs on the left
*/

.multi-gallery-section.gallery-tabs-sidebar {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  padding: 2rem;
}

.gallery-tabs-sidebar .gallery-tabs {
  margin-bottom: 0;
}

.gallery-tabs-sidebar .gallery-tabs-header {
  text-align: left;
  margin-bottom: 1rem;
}

.gallery-tabs-sidebar .gallery-tabs-title {
  font-size: 1.1rem;
}

.gallery-tabs-sidebar .gallery-tabs-subtitle {
  display: none;
}

.gallery-tabs-sidebar .gallery-tabs-nav {
  flex-direction: column;
  width: 100%;
  border-radius: 12px;
  padding: 0.5rem;
  gap: 0.25rem;
}

.gallery-tabs-sidebar .gallery-tab {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  text-align: left;
  justify-content: flex-start;
}

.gallery-tabs-sidebar .gallery-tab.active {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
}

.gallery-tabs-sidebar .gallery-panel-header {
  text-align: left;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 1rem;
}


/* === Responsive === */
@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
  }

  .nav-list {
    width: 100%;
    justify-content: center;
  }

  .about-author {
    flex-direction: column;
    text-align: center;
  }

  .welcome-card {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .comment.comment-reply {
    margin-left: 1rem;
  }

  .comment-form-row {
    grid-template-columns: 1fr;
  }

  .convention-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .terms-grid {
    grid-template-columns: 1fr;
  }

  /* Multi-gallery responsive */
  .multi-gallery-section {
    padding: 1.25rem;
  }

  .gallery-tabs-nav {
    width: 100%;
    border-radius: 12px;
  }

  .gallery-tab {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  /* Sidebar becomes top tabs on mobile */
  .multi-gallery-section.gallery-tabs-sidebar {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .gallery-tabs-sidebar .gallery-tabs-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .gallery-tabs-sidebar .gallery-tab {
    flex: 1;
    min-width: fit-content;
    text-align: center;
  }
}

/* ========================================
   DOCUMENT GALLERY COMPONENT
   For displaying family documents (images & PDFs)
   ======================================== */

/* Hide source elements - JS builds the UI */
.document-item {
  display: none;
}

.document-gallery {
  display: grid;
  /*  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));*/
  grid-template-columns: repeat(auto-fill, minmax(30rem, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.document-gallery.small{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Compact gallery: shorter thumbnail + tighter content for denser layouts */
.document-gallery.compact {
  grid-template-columns: repeat(auto-fill, minmax(30rem, 1fr));
}

.document-gallery.compact .document-thumbnail {
  aspect-ratio: 16/7;
}

.document-gallery.compact .document-content {
  padding: 0.6rem 1rem 0.85rem;
}

.document-gallery.compact .document-title {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.document-gallery.compact .document-date {
  font-size: 0.75rem;
  margin-bottom: 0.3rem;
}

.document-gallery.compact .document-description {
  font-size: 0.82rem;
}

.document-gallery.compact .document-details-divider {
  margin: 0.5rem 0;
}

.document-gallery.compact .document-details {
  font-size: 0.82rem;
}

.document-card {
  background: var(--color-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--color-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.document-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* Document thumbnail container */
.document-thumbnail {
  position: relative;
  aspect-ratio: 4/3;
  /* added by Don 
  align-content: center;*/
  overflow: hidden;
  background: linear-gradient(135deg, #f5f0eb 0%, #e8e0d8 100%);
  cursor: pointer;
}

.document-thumbnail.thin {
  position: relative;
  aspect-ratio: 4/3;
  /* added by Don 
  align-content: center;*/
  overflow: hidden;
  background: linear-gradient(135deg, #f5f0eb 0%, #e8e0d8 100%);
  cursor: pointer;
  height: 60%;
}

.document-thumbnail img {
  width: 100%;
  height: 100%;
  /* Modified by Don, was cover */
  object-fit: contain;
  object-position: center center;
  transition: transform 0.3s ease;
}

.document-card:hover .document-thumbnail img {
  transform: scale(1.03);
}

/* Type badge (PDF, Image, etc.) */
.document-type-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.document-type-badge.pdf {
  background: #4a90d9;
  color: white;
}

.document-type-badge.image {
  background: rgba(40, 167, 69, 0.95);
  color: white;
}

.document-type-badge svg {
  width: 14px;
  height: 14px;
}

/* View indicator overlay */
.document-view-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.document-card:hover .document-view-overlay {
  opacity: 1;
}

.document-view-overlay span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.2rem;
  background: var(--color-accent);
  border-radius: 8px;
}

.document-view-overlay svg {
  width: 18px;
  height: 18px;
}

/* Document content */
.document-content {
  padding: 1rem 1.25rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.document-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.document-date {
  font-size: 0.8rem;
  color: var(--nav-copper);
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.document-description {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  flex: 1;
}

.document-description p {
  margin-bottom: 0.5rem;
}

.document-description p:last-child {
  margin-bottom: 0;
}

/* Details divider and section */
.document-details-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.75rem 0;
}

.document-details {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  /*  line-height: 1.6; */
}

.document-details p {
  margin-bottom: 0.5rem;
  padding-left: 1.5em;
/*removed by Don */
/*  text-indent: -1.5em; */
}

.document-details p:last-child {
  margin-bottom: 0;
}

.document-details strong {
  color: var(--color-text);
  font-weight: 600;
}

.document-details.centered {
  text-align: center;
}

.document-details.centered p {
  padding-left: 0;
  text-indent: 0;
}

/* Document link (wraps entire card for clickability) */
a.document-card {
  text-decoration: none;
  color: inherit;
}

a.document-card:hover .document-title {
  color: var(--color-accent);
}

/* PDF-specific styling */
.document-card.pdf-document .document-thumbnail {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f6f8f9 0%, #82b9f3 100%);
}

.document-card.pdf-document .document-thumbnail img {
  object-fit: contain;
  padding: 1rem;
  max-height: 100%;
}

/* PDF icon placeholder when no thumbnail */
.document-pdf-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #4a90d9;
}

.document-pdf-icon svg {
  width: 64px;
  height: 64px;
}

.document-pdf-icon span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Section grouping for documents */
.document-section {
  margin-bottom: 3rem;
}

.document-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-accent);
}

.document-section-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.document-section-header svg {
  width: 24px;
  height: 24px;
  color: var(--color-accent);
  flex-shrink: 0;
}

.document-section-count {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .document-gallery {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }

  .document-content {
    padding: 0.875rem 1rem 1rem;
  }

  .document-title {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .document-gallery {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   RESPONSIVE FIXES FOR LARGE MARGINS
   Elements with fixed margins that need 
   to collapse on smaller screens
   ======================================== */

/* Utility classes for centered content with margins */
/* Use these instead of inline styles */

/* Small margins (5rem on each side) */
.margin-narrow {
  margin-left: 5rem;
  margin-right: 5rem;
}

/* Medium margins (10rem on each side) */
.margin-medium {
  margin-left: 10rem;
  margin-right: 10rem;
}

/* Large margins (15rem on each side) */
.margin-wide {
  margin-left: 15rem;
  margin-right: 15rem;
}

/* Legacy class name - same as margin-medium */
.ancestor-highlight-card {
  margin-left: 10rem;
  margin-right: 10rem;
}

/* Tablet and below - reduce margins */
@media (max-width: 1024px) {
  .margin-narrow {
    margin-left: 3rem;
    margin-right: 3rem;
  }

  .margin-medium,
  .ancestor-highlight-card {
    margin-left: 5rem;
    margin-right: 5rem;
  }

  .margin-wide {
    margin-left: 8rem;
    margin-right: 8rem;
  }

  .portrait-card {
    margin-left: 5rem;
    margin-right: 5rem;
  }

  .welcome-card {
    margin-left: 8rem;
    margin-right: 8rem;
  }

  .anecdote-card {
    margin-left: 3rem;
    margin-right: 3rem;
  }

  .contact-form {
    margin-left: 8rem;
    margin-right: 8rem;
  }
}

/* Small tablets and large phones */
@media (max-width: 768px) {
  .margin-narrow {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .margin-medium,
  .ancestor-highlight-card {
    margin-left: 2rem;
    margin-right: 2rem;
  }

  .margin-wide {
    margin-left: 2rem;
    margin-right: 2rem;
  }

  .portrait-card {
    margin-left: 2rem;
    margin-right: 2rem;
  }

  .portrait-card img {
    width: 140px;
    height: 140px;
  }

  .welcome-card {
    margin-left: 2rem;
    margin-right: 2rem;
  }

  .anecdote-card {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .contact-form {
    margin-left: 2rem;
    margin-right: 2rem;
  }

  /* Convention items - stack vertically on mobile */
  .convention-item {
    flex-direction: column;
    text-align: center;
  }

  .convention-icon {
    margin-bottom: 0.75rem;
  }

  .convention-content h2 {
    font-size: 1.5rem;
  }
}

/* Mobile phones */
@media (max-width: 480px) {

  .margin-narrow,
  .margin-medium,
  .margin-wide,
  .ancestor-highlight-card {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }

  .portrait-card {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    flex-direction: column;
    text-align: center;
  }

  .portrait-card img {
    width: 120px;
    height: 120px;
    margin-bottom: 1rem;
  }

  .portrait-card figcaption {
    padding: 1rem;
  }

  .welcome-card {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    padding: 1.5rem 1rem;
  }

  .anecdote-card {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }

  .quote-section {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }

  .contact-form {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }

  /* DNA tags - wrap better on mobile */
  .dna-highlights {
    gap: 0.5rem;
  }

  .dna-tag {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }

  /* Highlighted section */
  .highlighted-section {
    padding: 1.5rem 1rem;
    margin-left: 0;
    margin-right: 0;
  }

  .highlighted-section h2 {
    font-size: 1.3rem;
  }
}

/* ========================================
   VERTICAL TABS COMPONENT
   Tabs on left side, content on right
   Similar to WordPress tabbed content
   ======================================== */

.vertical-tabs-section {
  background: var(--color-card);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  overflow: hidden;
  margin: 2rem 0;
}

.vertical-tabs-container {
  display: grid;
  grid-template-columns: 150px 1fr;
  min-height: 64rem;
}

/* Tab list on the left */
.vertical-tabs-list {
  background: var(--color-background);
  border-right: 1px solid var(--color-border);
  padding: 1rem 0;
  overflow-y: auto;
  max-height: 64rem;
}

.vertical-tab-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1.25rem;
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.vertical-tab-btn:hover {
  background: rgba(139, 69, 19, 0.05);
  color: var(--color-text);
}

.vertical-tab-btn.active {
  background: rgba(139, 69, 19, 0.1);
  border-left-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 900;
}

/* Content area on the right */
.vertical-tabs-content {
  padding: 2rem;
  overflow-y: auto;
  max-height: 64rem;
}

.vertical-tab-panel {
  display: none;
}

.vertical-tab-panel.active {
  display: block;
}

.vertical-tab-panel h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-text);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-accent);
}

.vertical-tab-panel p {
  font-size: 1.1rem;
  line-height: 1.3;
  margin-bottom: 1rem;
}

/* Images within vertical tab panels */
.vertical-tab-panel .content-image {
  margin: 1.5rem 0;
}

.vertical-tab-panel .content-image.float-right {
  float: right;
  max-width: 280px;
  margin: 0 0 1rem 1.5rem;
}

.vertical-tab-panel .content-image.float-left {
  float: left;
  max-width: 280px;
  margin: 0 1.5rem 1rem 0;
}

.vertical-tab-panel .content-image img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.vertical-tab-panel .content-image figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Two images side by side in tab panel */
.vertical-tab-panel .two-column-media {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
  clear: both;
}

.vertical-tab-panel .two-column-media img {
  /*  height: auto; */
  max-height: 250px;
  object-fit: cover;
}

/* Clear floats */
.vertical-tab-panel::after {
  content: '';
  display: table;
  clear: both;
}

/* Responsive: Stack tabs above content on mobile */
@media (max-width: 900px) {
  .vertical-tabs-container {
    grid-template-columns: 1fr;
  }

  .vertical-tabs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    max-height: none;
    overflow-y: visible;
  }

  .vertical-tab-btn {
    flex: 0 0 auto;
    padding: 0.5rem 1rem;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: 6px;
    font-size: 0.85rem;
  }

  .vertical-tab-btn.active {
    border-left: none;
    border-bottom-color: var(--color-accent);
  }

  .vertical-tabs-content {
    max-height: none;
    padding: 1.5rem;
  }

  .vertical-tab-panel .content-image.float-right,
  .vertical-tab-panel .content-image.float-left {
    float: none;
    max-width: 100%;
    margin: 1rem 0;
  }

  .vertical-tab-panel .two-column-media {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   INFO BUBBLE / TOOLTIP STYLES
   ===================================================== */

/* The tagged word/phrase */
.info-term {
  position: relative;
  color: var(--accent, #8b5e3c);
  /*  border-bottom: 1px dotted var(--accent, #8b5e3c);*/
  cursor: help;
  display: inline;
  font-weight: 900;
  background-color: transparent;
  color: var(--color-accent);
}

/* The bubble container */
.info-term .info-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);

  /* Sizing */
  width: max-content;
  max-width: 280px;
  padding: 0.75rem 1rem;

  /* Appearance */
  background: #2c2c2c;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);

  /* Hidden by default */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;

  /* Stay above other content */
  z-index: 1000;
}

/* Arrow/pointer */
.info-term .info-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #2c2c2c;
}

/* Show on hover */
.info-term:hover .info-bubble,
.info-term:focus .info-bubble {
  visibility: visible;
  opacity: 1;
}

/* === POSITION VARIANTS === */

/* Bubble appears BELOW the term */
.info-term.bubble-below .info-bubble {
  bottom: auto;
  top: calc(100% + 8px);
}

.info-term.bubble-below .info-bubble::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #2c2c2c;
}

/* Bubble appears to the LEFT */
.info-term.bubble-left .info-bubble {
  bottom: 50%;
  left: auto;
  right: calc(100% + 10px);
  transform: translateY(50%);
}

.info-term.bubble-left .info-bubble::after {
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-left-color: #2c2c2c;
}

/* Bubble appears to the RIGHT */
.info-term.bubble-right .info-bubble {
  bottom: 50%;
  left: calc(100% + 10px);
  transform: translateY(50%);
}

.info-term.bubble-right .info-bubble::after {
  top: 50%;
  right: 100%;
  left: auto;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-right-color: #2c2c2c;
}

/* === STYLE VARIANTS === */

/* Light theme bubble */
.info-term.bubble-light .info-bubble {
  background: #fffef8;
  color: #3d3d3d;
  border: 1px solid #d4c9b0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-term.bubble-light .info-bubble::after {
  border-top-color: #fffef8;
}

.info-term.bubble-light.bubble-below .info-bubble::after {
  border-top-color: transparent;
  border-bottom-color: #fffef8;
}

/* Sepia/vintage theme */
.info-term.bubble-sepia .info-bubble {
  background: linear-gradient(135deg, #f5e6d3, #e8d4be);
  color: #5c4a32;
  border: 1px solid #c9b896;
}

.info-term.bubble-sepia .info-bubble::after {
  border-top-color: #f5e6d3;
}

/* === BUBBLE CONTENT STYLING === */

.info-bubble strong {
  color: #f0c674;
  font-weight: 600;
}

.info-bubble em {
  font-style: italic;
  opacity: 0.9;
}

.info-bubble .bubble-title {
  display: block;
  font-weight: 600;
  color: #f0c674;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.info-term.bubble-light .info-bubble strong,
.info-term.bubble-light .info-bubble .bubble-title {
  color: #8b5e3c;
}

.info-term.bubble-sepia .info-bubble strong,
.info-term.bubble-sepia .info-bubble .bubble-title {
  color: #6b4423;
}

/* Small info icon (optional) */
.info-term.show-icon::after {
  content: 'i';
  font-size: 0.4em;
  margin-left: 1px;
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 100;
  color: #fff;
  background: var(--color-accent, #8b5e3c);
  padding: 0.25em 0.5em 0.15em 0.5em;
  display: inline-block;
  text-align: center;
  line-height: 1;
  border-radius: 50%;
  position: relative;
  top: -1.3em;
}

/* === MOBILE SUPPORT === */
@media (max-width: 768px) {
  .info-term .info-bubble {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 40px);
    width: auto;
  }

  .info-term .info-bubble::after {
    display: none;
  }

  /* Mobile click-to-toggle support */
  .info-term.active .info-bubble {
    visibility: visible;
    opacity: 1;
  }
}