/* 
   ==========================================================================
   BOOK THEME: PARCHMENT & ANCIENT MANUSCRIPT DESIGN FOR YEN TAP PARISH
   Designed by Antigravity for Google Advanced Agentic Coding
   ========================================================================== */

/* 1. Design System & Variables */
:root {
  --book-bg: #F5EFE0;           /* Parchment warm paper */
  --book-bg-secondary: #EDE6D6; /* Slightly darker parchment for cards/sidebars */
  --book-text: #2C241E;         /* Dark sepia/charcoal for text */
  --book-text-light: #5E534A;   /* Muted brown for meta */
  --book-primary: #5A1622;      /* Sacred Liturgical Burgundy */
  --book-accent: #9A773F;       /* Antique Aged Gold */
  --book-border: #D8CEB7;       /* Soft page border */
  --book-shadow: 0 4px 15px rgba(44, 36, 30, 0.08);
  --book-transition: all 0.3s ease;
}

/* 2. Global Resets & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #EDE6D6;
  background-image: radial-gradient(var(--book-bg) 50%, #E6DEC9 100%);
  color: var(--book-text);
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  line-height: 1.8;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
  width: 92%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Links */
a {
  color: var(--book-primary);
  text-decoration: none;
  transition: var(--book-transition);
}
a:hover {
  color: var(--book-accent);
  text-decoration: underline;
}

/* Typography styles */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--book-primary);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 20px;
}

/* 3. Header & Navigation (Book Ribbon Style) */
#book-header {
  background-color: var(--book-bg);
  border-bottom: 3px double var(--book-accent);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 15px 0;
}

#book-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.book-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.book-logo-cross {
  font-size: 1.8rem;
  color: var(--book-primary);
  font-family: Georgia, serif;
  font-weight: 400;
  border: 1px solid var(--book-accent);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--book-bg-secondary);
}

.book-logo-text {
  display: flex;
  flex-direction: column;
}

.book-logo-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--book-primary);
}

.book-logo-sub {
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
  letter-spacing: 1px;
  color: var(--book-text-light);
  text-transform: uppercase;
}

.book-nav ul {
  display: flex;
  list-style: none;
  gap: 25px;
}

.book-nav a {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--book-text);
  padding: 5px 0;
  position: relative;
}

.book-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--book-primary);
  transition: var(--book-transition);
}

.book-nav a:hover::after,
.book-nav li.active a::after {
  width: 100%;
}

.book-nav li.active a {
  color: var(--book-primary);
}

/* 4. Book Frame Sheet */
.book-sheet {
  background-color: var(--book-bg);
  border: 1px solid var(--book-border);
  box-shadow: var(--book-shadow);
  padding: 50px;
  margin: 40px auto;
  border-radius: 4px;
  position: relative;
}

/* Double border page effect */
.book-sheet::before {
  content: '';
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 15px;
  right: 15px;
  border: 1px double var(--book-accent);
  pointer-events: none;
  opacity: 0.5;
}

/* Dropcap for beautiful starts */
.dropcap::first-letter {
  font-size: 3.8rem;
  float: left;
  line-height: 0.8;
  padding-top: 6px;
  padding-right: 12px;
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--book-primary);
  font-weight: 700;
}

/* Ornament Dividers */
.ornament {
  text-align: center;
  margin: 40px 0;
  color: var(--book-accent);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.ornament::before,
.ornament::after {
  content: '';
  display: block;
  height: 1px;
  width: 100px;
  background: linear-gradient(to right, transparent, var(--book-accent), transparent);
}

/* 5. Stat Block Card */
.stats-table-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
  background: var(--book-bg-secondary);
  border: 1px solid var(--book-border);
  padding: 25px;
  border-radius: 4px;
}

.stat-item {
  text-align: center;
  border-right: 1px dashed var(--book-border);
}

.stat-item:last-child {
  border-right: none;
}

.stat-item h5 {
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--book-text-light);
  margin-bottom: 5px;
}

.stat-item p {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--book-primary);
}

/* 6. Priest Table (Historical list style) */
.priest-section {
  margin-top: 50px;
}

.priest-table-container {
  overflow-x: auto;
  margin-top: 25px;
  border: 1px solid var(--book-border);
  border-radius: 4px;
}

.priest-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
  background-color: var(--book-bg);
}

.priest-table th {
  background-color: var(--book-bg-secondary);
  color: var(--book-primary);
  font-weight: 700;
  padding: 12px 15px;
  border-bottom: 2px solid var(--book-accent);
  font-family: 'Playfair Display', Georgia, serif;
}

.priest-table td {
  padding: 10px 15px;
  border-bottom: 1px solid var(--book-border);
}

.priest-table tr:nth-child(even) {
  background-color: rgba(237, 230, 214, 0.4);
}

.priest-table tr:hover {
  background-color: rgba(154, 119, 63, 0.05);
}

/* 7. Photo Gallery Grid (Sepia & Vintage theme) */
.book-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.book-gallery-card {
  background-color: var(--book-bg);
  border: 1px solid var(--book-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/2;
  border-radius: 2px;
  transition: var(--book-transition);
  cursor: pointer;
}

.book-gallery-card .book-gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  filter: sepia(0.2) contrast(0.95);
  transition: var(--book-transition);
}

.book-gallery-card .book-gallery-overlay {
  position: absolute;
  bottom: -100%;
  left: 0;
  width: 100%;
  background: rgba(90, 22, 34, 0.93); /* Translucent Sacred Burgundy */
  border-top: 1px solid var(--book-accent);
  padding: 15px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  color: #fff;
  z-index: 10;
}

.book-gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--book-shadow);
  border-color: var(--book-accent);
}

.book-gallery-card:hover .book-gallery-img {
  filter: sepia(0);
  transform: scale(1.05);
}

.book-gallery-card:hover .book-gallery-overlay {
  bottom: 0;
}

.book-gallery-card .book-gallery-overlay span {
  font-size: 0.7rem;
  color: var(--book-accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  display: block;
}

.book-gallery-card .book-gallery-overlay h4 {
  font-size: 0.9rem;
  color: #fff;
  margin-top: 5px;
  margin-bottom: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  line-height: 1.4;
}

/* 8. Articles Grid & Cards (Book-News styling) */
.book-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.book-news-card {
  background-color: var(--book-bg);
  border: 1px solid var(--book-border);
  box-shadow: 0 4px 10px rgba(44, 36, 30, 0.03);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--book-transition);
}

.book-news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--book-shadow);
  border-color: var(--book-accent);
}

.book-news-img-box {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background-color: var(--book-bg-secondary);
  border-bottom: 1px solid var(--book-border);
  position: relative;
}

.book-news-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.15) contrast(0.98);
  transition: var(--book-transition);
}

.book-news-card:hover .book-news-img-box img {
  filter: sepia(0);
  transform: scale(1.05);
}

.book-news-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.book-news-meta {
  font-size: 0.75rem;
  color: var(--book-accent);
  display: flex;
  gap: 15px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.book-news-card-content h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--book-primary);
}

.book-news-card-content p {
  font-size: 0.9rem;
  color: var(--book-text-light);
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
  font-family: 'Inter', sans-serif;
}

.book-read-more {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--book-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
}

.book-read-more:hover {
  color: var(--book-accent);
  text-decoration: none;
}
  letter-spacing: 1px;
  font-weight: 700;
}

/* 9. Contribution Form styling */
.book-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 25px;
}

.book-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.book-form-group label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--book-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.book-form-control {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  padding: 12px 15px;
  border: 1px solid var(--book-border);
  background-color: var(--book-bg-secondary);
  color: var(--book-text);
  border-radius: 2px;
  transition: var(--book-transition);
}

.book-form-control:focus {
  outline: none;
  border-color: var(--book-accent);
  background-color: var(--book-bg);
}

.book-btn {
  background-color: var(--book-primary);
  color: #fff;
  border: 1px solid var(--book-primary);
  padding: 12px 30px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-start;
  transition: var(--book-transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.book-btn:hover {
  background-color: var(--book-accent);
  border-color: var(--book-accent);
}

/* Footer bottom pagination */
.book-footer-pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
}

.book-page-btn {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--book-border);
  background: var(--book-bg);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.book-page-btn.active,
.book-page-btn:hover {
  background: var(--book-primary);
  color: #fff;
  border-color: var(--book-primary);
}

/* Lightbox Modal */
.book-lightbox {
  background: rgba(30, 25, 22, 0.95);
  border: none;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
}

/* Responsive adjustments */
/* Hamburger Toggle Button */
.menu-toggle-btn {
  display: none;
  background: none;
  border: 1px solid var(--book-accent);
  color: var(--book-primary);
  font-size: 1.2rem;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: var(--book-transition);
}

.menu-toggle-btn:hover {
  background-color: var(--book-bg-secondary);
}

@media (max-width: 768px) {
  .container {
    width: 100%;
    padding: 0 12px;
  }
  
  #book-header .container {
    position: relative;
    padding-right: 60px; /* Space for absolute hamburger button */
    display: flex;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    text-align: left !important;
  }
  
  .book-logo {
    text-align: left;
  }
  
  .menu-toggle-btn {
    display: block;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
  }

  .book-sheet {
    padding: 25px 15px;
    margin: 15px 0;
  }
  
  .book-sheet::before {
    top: 8px;
    bottom: 8px;
    left: 8px;
    right: 8px;
  }

  .book-nav {
    display: block;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-in-out;
    margin-top: 0;
  }
  
  .book-nav.active {
    max-height: 500px;
    margin-top: 15px;
  }
  
  .book-nav ul {
    flex-direction: column;
    gap: 4px;
    align-items: center;
    background-color: var(--book-bg-secondary);
    padding: 10px;
    border: 1px dashed var(--book-accent);
    border-radius: 4px;
  }
  
  .book-nav li {
    width: 100%;
    text-align: center;
    border-bottom: 1px dashed rgba(154, 119, 63, 0.15);
    padding: 6px 0;
  }
  
  .book-nav li:last-child {
    border-bottom: none;
  }
  
  .book-nav li a {
    font-size: 0.85rem !important;
    padding: 3px 0;
    display: block;
  }
  
  .book-nav li.dropdown > a {
    justify-content: center;
  }
}

/* 10. Timeline Styles */
.timeline-controls {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-bottom: 40px;
}

.timeline-container {
  position: relative;
  padding-left: 40px;
  margin-top: 30px;
}

.timeline-line {
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  border-left: 2px dashed var(--book-accent);
}

.timeline-event {
  position: relative;
  margin-bottom: 50px;
}

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

.timeline-badge {
  position: absolute;
  left: -40px;
  top: 5px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--book-primary);
  border: 2px solid var(--book-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  z-index: 10;
}

.timeline-card {
  background-color: var(--book-bg-secondary);
  border: 1px solid var(--book-border);
  padding: 20px 25px;
  border-radius: 4px;
  position: relative;
  transition: var(--book-transition);
}

.timeline-card::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 15px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid var(--book-border);
}

.timeline-card:hover {
  transform: translateX(5px);
  border-color: var(--book-accent);
  box-shadow: var(--book-shadow);
}

.timeline-year-header {
  position: relative;
  margin: 50px 0 30px -40px; /* Aligns to left margins overlapping line */
  background-color: var(--book-primary);
  color: #fff;
  border: 1px solid var(--book-accent);
  padding: 6px 22px;
  border-radius: 20px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 4px 10px rgba(90, 22, 34, 0.25);
}

.timeline-date {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--book-primary);
  background-color: rgba(154, 119, 63, 0.1);
  border-bottom: 1px dashed var(--book-accent);
  padding: 4px 10px;
  margin-bottom: 12px;
  font-family: 'Inter', sans-serif;
  letter-spacing: 1px;
  display: inline-block;
  border-radius: 2px;
}

.timeline-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--book-primary);
}

.timeline-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--book-text-light);
  margin-bottom: 15px;
  font-family: 'Inter', sans-serif;
}

.timeline-read-btn {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--book-primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.timeline-read-btn:hover {
  color: var(--book-accent);
  text-decoration: none;
}

/* 11. Dropdown Navigation Menu */
.book-nav li.dropdown {
  position: relative;
}

.book-nav li.dropdown > a {
  display: flex;
  align-items: center;
  gap: 5px;
}

.book-nav li.dropdown > a::after {
  content: '▾';
  font-size: 0.8rem;
  transition: var(--book-transition);
}

.book-nav li.dropdown:hover > a::after {
  transform: rotate(180deg);
}

.book-nav li.dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--book-bg);
  border: 1px solid var(--book-accent);
  box-shadow: 0 6px 15px rgba(44, 36, 30, 0.15);
  list-style: none;
  padding: 8px 0;
  min-width: 180px;
  z-index: 1001;
  border-radius: 4px;
}

/* Page border effect inside dropdown */
.book-nav li.dropdown .dropdown-menu::before {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  right: 3px;
  border: 1px double var(--book-accent);
  pointer-events: none;
  opacity: 0.3;
}

.book-nav li.dropdown .dropdown-menu li {
  padding: 0;
  display: block;
  width: 100%;
  border: none;
}

.book-nav li.dropdown .dropdown-menu a {
  display: block;
  padding: 10px 18px;
  text-transform: none;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.9rem;
  color: var(--book-text);
  letter-spacing: 0.5px;
  text-align: left;
}

.book-nav li.dropdown .dropdown-menu a::after {
  display: none; /* Disable underline effect inside dropdown */
}

.book-nav li.dropdown .dropdown-menu a:hover {
  background-color: var(--book-bg-secondary);
  color: var(--book-primary);
  text-decoration: none;
}

/* Show dropdown on hover */
.book-nav li.dropdown:hover .dropdown-menu {
  display: block;
}

@media (max-width: 768px) {
  .book-nav li.dropdown .dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding-left: 0;
    display: block; /* always expand on mobile nav */
  }
  .book-nav li.dropdown .dropdown-menu::before {
    display: none;
  }
  .book-nav li.dropdown .dropdown-menu a {
    text-align: center;
    padding: 8px 0;
  }
  .book-news-grid,
  .book-gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
