@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600;700&family=Noto+Serif+Malayalam:wght@400;600&display=swap');

/* --- Brand Palette derived from the Kerala History Logo --- */
:root {
  --gold: #d49a37;          /* Bright warm amber-gold highlight */
  --gold-glow: #e8b04a;     /* Lighter gold accent */
  --bronze: #8c531d;        /* Deep rich bronze brown */
  --terracotta: #aa5c20;    /* Warm accent brown/orange */
  --dark-bg: #14100c;       /* Deep charcoal background from logo outer ring */
  --paper: #f8f3ea;         /* Light warm parchment background */
  --paper-card: #ffffff;    /* Card background */
  --white: #fff;
  --ink: #221c17;           /* Main text color */
  --muted: #665a4e;         /* Secondary/Muted text color */
  --line: #e2d6c3;          /* Warm subtle border color */
  --shadow: 0 18px 45px rgba(20, 16, 12, 0.12);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: Inter, Arial, sans-serif;
  --wrap: min(1180px, calc(100% - 48px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.65 var(--sans);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.container {
  width: var(--wrap);
  margin: auto;
}

/* --- Accessibility & Utility --- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--bronze);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.badge {
  display: inline-block;
  background: #f1e4cf;
  color: var(--bronze);
  font-size: 0.72rem;
  padding: 4px 9px;
  font-weight: 700;
}

.text-link {
  color: var(--bronze);
  font-weight: 700;
  font-size: 0.82rem;
}

.text-link:hover {
  color: var(--gold);
}

/* --- Typography & Buttons --- */

.section-title,
h1,
h2,
h3 {
  font-family: var(--serif);
  line-height: 1.02;
  margin: 0;
}

.section-title {
  font-size: clamp(2.3rem, 4vw, 3.6rem);
  max-width: 650px;
}

.lede {
  color: var(--muted);
  max-width: 610px;
  margin: 14px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--bronze);
  padding: 12px 21px;
  font-size: 0.83rem;
  font-weight: 700;
  transition: 0.2s;
}

.btn--primary {
  background: var(--bronze);
  color: #fff;
}

.btn--primary:hover {
  background: #6e3d11;
  transform: translateY(-2px);
}

.btn--outline {
  color: var(--bronze);
  background: transparent;
}

.btn--outline:hover {
  background: #fff;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* --- Layout Sections --- */

.section {
  padding: 88px 0;
}

.section--white {
  background: #fff;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 48px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.grid--four {
  grid-template-columns: repeat(4, 1fr);
}

.feature {
  padding: 34px;
  border: 1px solid var(--line);
  background: white;
}

.feature h3 {
  font-size: 2rem;
}

.brand-logo {
  height: 36px;
  width: auto;
  vertical-align: middle;
  margin-right: 10px;
  display: inline-block;
}

.brand-mark {
  display: inline-block;
  width: 36px;
  height: 36px;
  background-image: url('/assets/imgs/logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  text-indent: -9999px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 10px;
}

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

.site-header {
  height: 78px;
  background: rgba(248, 243, 234, 0.96);
  border-bottom: 1px solid transparent;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.site-header.is-sticky {
  border-color: var(--line);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 1.4rem var(--serif);
  color: var(--dark-bg);
}

/* Rounded brand mark echoing the circular amber logo */
.brand-mark {
  border: 1px solid var(--gold);
  background: radial-gradient(circle, var(--gold-glow), var(--gold), var(--bronze));
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  font: 700 1.15rem var(--serif);
  color: #110d0a;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 24px;
  padding: 0;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.nav-list a {
  padding: 28px 0;
  display: block;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--bronze);
}

.nav-list > li > a {
  position: relative;
}

.nav-list > li:not(.nav-item--has-menu) > a:after {
  content: '';
  position: absolute;
  bottom: 22px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--bronze);
  transition: width 0.24s ease;
}

.nav-list > li > a:hover:after,
.nav-list > li > a[aria-current="page"]:after {
  width: 100%;
}

.nav-toggle {
  display: none;
  border: 0;
  background: none;
  font-size: 1.35rem;
}

/* Submenu */

.nav-item--has-menu {
  position: relative;
}

.nav-item--has-menu > a:after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 0 3px 6px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}

.submenu-toggle {
  display: none;
}

.submenu {
  list-style: none;
  margin: 0;
  padding: 8px;
  min-width: 170px;
  position: absolute;
  top: 66px;
  left: -14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.submenu a {
  padding: 9px 12px;
  white-space: nowrap;
}

.submenu a:hover {
  background: var(--paper);
}

.nav-item--has-menu:hover .submenu,
.nav-item--has-menu:focus-within .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* --- Hero & Homepage Intro --- */

.hero {
  min-height: 650px;
  position: relative;
  display: grid;
  align-items: end;
  color: #fff;
  /* Dark brown / charcoal overlay matching the logo ambient background */
  background: linear-gradient(90deg, rgba(20, 16, 12, 0.9), rgba(20, 16, 12, 0.45)),
    url('/assets/imgs/hero.jpg') center/cover;
}

.hero-content {
  padding: 120px 0 105px;
  max-width: 720px;
}

.hero-content > * {
  animation: rise-in 0.7s both;
}

.hero-content .eyebrow {
  animation-delay: 0.06s;
  color: var(--gold-glow);
}

.hero-content h1 {
  animation-delay: 0.14s;
  font-size: clamp(3.4rem, 7vw, 6.8rem);
  letter-spacing: -0.04em;
}

.hero-content p {
  animation-delay: 0.22s;
  font-size: 1.07rem;
  max-width: 545px;
  margin: 22px 0 30px;
  color: #f3eedf;
}

.hero-content .btn-row {
  animation-delay: 0.3s;
}

.hero .btn--primary {
  background: var(--gold);
  color: #110d0a;
  border-color: var(--gold);
}

.hero .btn--primary:hover {
  background: var(--gold-glow);
}

.hero .btn--outline {
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}

.hero .btn--outline:hover {
  color: #110d0a;
  background: #fff;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.intro {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 80px;
  align-items: center;
}

.intro-copy h2 {
  font-size: clamp(2.5rem, 4vw, 4rem);
}

.quote {
  border-left: 2px solid var(--gold);
  padding: 15px 0 15px 24px;
  font: 600 1.65rem/1.25 var(--serif);
  color: var(--bronze);
  margin: 25px 0;
}

.intro-image {
  height: 460px;
  object-fit: cover;
}

/* --- Centered Stats Component --- */

.stats {
  background: var(--dark-bg);
  color: #fff;
  padding: 44px 0;
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  text-align: center; /* Centers inline text */
}

.stats .container {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 items for Posts, Volunteers, Events */
  gap: 30px;
  justify-content: center;
  align-items: center;
}

.stat {
  border-left: 1px solid rgba(212, 154, 55, 0.3);
  border-right: 1px solid rgba(212, 154, 55, 0.3); /* Adds balanced borders */
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center; /* Centers strong and span tags horizontally */
  justify-content: center;
}

.stat strong {
  display: block;
  font: 600 3.4rem var(--serif);
  color: var(--gold-glow);
  line-height: 1;
  margin-bottom: 8px;
}

.stat span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #d6cbba;
}

/* Responsive adjustment for mobile screens */
@media (max-width: 600px) {
  .stats .container {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .stat {
    border-left: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(212, 154, 55, 0.2);
    padding-bottom: 20px;
  }
  
  .stat:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
}
/* --- General Cards & Person Cards --- */

.card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.card-image {
  width: 100%;
  height: 240px;
  object-fit: scale-down;
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-tag {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bronze);
  font-weight: 700;
}

.card h3 {
  font-size: 1.7rem;
  margin: 8px 0 4px;
}

.card-role {
  color: var(--bronze);
  font-size: 0.85rem;
  margin: 0 0 12px;
}

.card-bio {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0;
}

.card p {
  color: var(--muted);
  margin: 0 0 17px;
}

/* --- Split CTA Component --- */

.split-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--dark-bg);
  color: #fff;
}

.split-cta > div {
  padding: 70px max(24px, calc((100vw - 1180px) / 2));
}

.split-cta h2 {
  font-size: 3.25rem;
  color: var(--paper);
}

.split-cta p {
  color: #d6cbba;
  max-width: 470px;
}

.split-cta .btn--outline {
  border-color: var(--gold);
  color: var(--gold);
}

.split-cta .btn--outline:hover {
  background: var(--gold);
  color: #110d0a;
}

.split-cta__image {
  background: url('https://images.unsplash.com/photo-1602150509157-02c1a7ee4d25?auto=format&fit=crop&w=1000&q=80') center/cover;
}

/* --- Page Heroes & Secondary Headers --- */

.page-hero {
  padding: 96px 0 78px;
  background: var(--dark-bg);
  color: #fff;
  border-bottom: 2px solid var(--gold);
}

.breadcrumbs {
  font-size: 0.75rem;
  color: #d6cbba;
  margin-bottom: 20px;
}

.page-hero h1 {
  font-size: clamp(3.5rem, 6vw, 5.8rem);
  color: var(--paper);
}

.page-hero p {
  max-width: 610px;
  color: #d6cbba;
  font-size: 1rem;
}

/* --- Department & Teams Grid --- */

.teams-overview {
  border-top: 1px solid var(--line);
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.team-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 32px;
  border-left: 3px solid var(--bronze);
  transition: transform 0.2s ease, border-color 0.2s ease;
  display:inline; justify-content:right; align-items: center; width: 100%;
}

.team-card:hover {
  border-left-color: var(--gold);
  transform: translateX(4px);
}

.team-card .card-tag {
  display: inline-block;
  margin-bottom: 8px;
}

.team-card h3 {
  font-size: 1.8rem;
  color: var(--bronze);
  margin-bottom: 12px;
}

.team-card p {
  color: var(--muted);
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

/* --- Boxed Vertical Roadmap Component --- */

.roadmap-section {
  background: var(--paper);
}

.roadmap-boxed {
  position: relative;
  max-width: 860px;
  margin: 40px auto 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.roadmap-boxed::before {
  content: '';
  position: absolute;
  top: 30px;
  bottom: 30px;
  left: 31px;
  width: 2px;
  background: var(--line);
  z-index: 1;
}

.roadmap-box {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.roadmap-marker {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bronze);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.marker-number {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--gold-glow);
}

.roadmap-box-content {
  flex: 1;
  background: var(--paper-card);
  border: 1px solid var(--line);
  padding: 28px 32px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.roadmap-box-content:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow);
  border-left-color: var(--gold);
}

.roadmap-timeframe {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bronze);
  margin-bottom: 6px;
}

.roadmap-box-content h3 {
  font-size: 1.6rem;
  color: var(--bronze);
  margin-bottom: 10px;
}

.roadmap-box-content p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
}

/* --- Map Placeholder & Detail Pages --- */

.map-placeholder {
  min-height: 340px;
  background: linear-gradient(rgba(20, 16, 12, 0.86), rgba(20, 16, 12, 0.86)),
    url('https://images.unsplash.com/photo-1590050752117-238cb0fb12b1?auto=format&fit=crop&w=1000&q=80') center/cover;
  display: grid;
  place-items: center;
  color: #fff;
  text-align: center;
}

.map-placeholder h2 {
  font-size: 3.4rem;
}

.detail-image {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  margin: 0 0 30px;
}

.detail-body {
  font-size: 1.08rem;
  color: var(--muted);
  margin: 0 0 30px;
  white-space: pre-line;
}

/* --- Filters & Search --- */

.filter-bar {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: 0 0 32px;
}

.filter {
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px 15px;
  color: var(--muted);
  font-size: 0.78rem;
}

.filter.active,
.filter:hover {
  background: var(--bronze);
  border-color: var(--bronze);
  color: #fff;
}

.search {
  display: flex;
  border: 1px solid var(--line);
  background: #fff;
  max-width: 550px;
}

.search input {
  border: 0;
  flex: 1;
  padding: 13px;
  outline: 0;
}

.search button {
  border: 0;
  background: var(--bronze);
  color: #fff;
  padding: 0 19px;
}

/* --- Events --- */

.event-date {
  float: left;
  text-align: center;
  border-right: 1px solid var(--line);
  padding-right: 17px;
  margin-right: 17px;
  color: var(--bronze);
  font-weight: 700;
}

.event-date strong {
  display: block;
  font: 600 2rem/0.85 var(--serif);
}

/* --- Gallery & Masonry --- */

.masonry {
  columns: 3 260px;
  gap: 18px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  transition: 0.35s;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-item span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 23px 16px 14px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  font-family: var(--serif);
  font-size: 1.45rem;
}

/* --- Timeline --- */

.timeline {
  border-left: 1px solid var(--line);
  margin: 25px 0 0 20%;
  padding-left: 45px;
}

.timeline-item {
  position: relative;
  padding: 0 0 45px;
}

.timeline-item:before {
  content: '';
  position: absolute;
  left: -52px;
  top: 8px;
  width: 12px;
  height: 12px;
  background: var(--gold);
  border-radius: 50%;
}

.timeline-item time {
  color: var(--bronze);
  font-weight: 700;
  font-size: 0.78rem;
}

.timeline-item h3 {
  font-size: 1.9rem;
  margin: 4px 0;
}

/* --- FAQ --- */

.faq {
  max-width: 800px;
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 21px 0;
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}

.faq-answer {
  display: none;
  color: var(--muted);
  padding: 0 0 20px;
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-item.open .faq-question span {
  transform: rotate(45deg);
}

/* --- Contact & Forms --- */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
  resize: vertical;
}

.field--full {
  grid-column: 1 / -1;
}

.contact-details {
  background: var(--dark-bg);
  color: #fff;
  padding: 45px;
  border-left: 3px solid var(--gold);
}

.contact-details h2 {
  font-size: 3rem;
  color: var(--gold-glow);
}

.contact-details p {
  color: #d6cbba;
}

/* --- Newsletter --- */

.newsletter {
  background: #e8d9c2;
  padding: 65px 0;
}

.newsletter-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

.newsletter h2 {
  font-size: 3rem;
  color: var(--dark-bg);
}

.newsletter-form {
  display: flex;
  width: min(100%, 430px);
}

.newsletter-form input {
  padding: 13px;
  border: 1px solid var(--line);
  border-right: 0;
  flex: 1;
}

.newsletter-form button {
  border: 0;
  background: var(--bronze);
  color: #fff;
  padding: 0 18px;
  font-weight: 700;
}

.newsletter-form button:hover {
  background: var(--gold);
  color: #110d0a;
}

/* --- Site Footer & Copyright --- */

.site-footer {
  background: var(--dark-bg);
  color: #e2d6c3;
  padding: 60px 0 20px;
  border-top: 3px solid var(--gold);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 35px;
  margin-bottom: 40px;
}

.footer-grid h3 {
  font: 600 1.3rem var(--serif);
  color: var(--gold-glow);
  margin-bottom: 15px;
}

.footer-grid p {
  color: #c0b3a0;
  font-size: 0.88rem;
  line-height: 1.6;
  margin-top: 10px;
  max-width: 380px;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-grid li {
  margin: 8px 0;
  font-size: 0.82rem;
  color: #c0b3a0;
}

.footer-grid a {
  color: #c0b3a0;
  transition: color 0.2s ease;
}

.footer-grid a:hover {
  color: var(--gold-glow);
}

.copyright {
  border-top: 1px solid rgba(212, 154, 55, 0.25);
  padding-top: 24px;
  margin-top: 20px;
  color: #9a8d7a;
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copyright a {
  color: #e2d6c3;
  transition: color 0.2s ease;
}

.copyright a:hover {
  color: var(--gold-glow);
}

.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  border: 0;
  background: var(--gold);
  color: #110d0a;
  font-weight: bold;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}

.back-top.show {
  opacity: 1;
  pointer-events: auto;
}

.policy {
  max-width: 800px;
}

.policy h2 {
  font-size: 2.3rem;
  margin: 38px 0 10px;
}

.policy p,
.policy li {
  color: var(--muted);
}

/* --- Responsive Adjustments --- */

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

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

  .stats .container {
    grid-template-columns: repeat(2, 1fr);
  }

  .split-cta {
    grid-template-columns: 1fr;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 650px) {
  .roadmap-boxed::before {
    left: 23px;
  }

  .roadmap-box {
    gap: 16px;
  }

  .roadmap-marker {
    width: 48px;
    height: 48px;
  }

  .marker-number {
    font-size: 1rem;
  }

  .roadmap-box-content {
    padding: 20px;
  }
}

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

  .team-card {
    padding: 24px;
  }

  .stats .container {
    grid-template-columns: 1fr;
  }

  .newsletter-inner {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .copyright {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}
/* --- Gallery Item Clickable Styling --- */

.gallery-item {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.gallery-item img {
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

/* --- Lightbox Modal --- */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(17, 13, 10, 0.92); /* Dark backdrop aligned with theme */
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 88vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.92);
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-content img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid rgba(212, 154, 55, 0.4); /* Gold accent border */
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  margin-top: 14px;
  color: #f1e7d8;
  font-family: var(--serif, serif);
  font-size: 1.1rem;
  letter-spacing: 0.03em;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 30px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 8px 14px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
  color: var(--gold-glow, #e6c892);
  transform: scale(1.15);
}