/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8B4513;
    --secondary-color: #D2691E;
    --accent-color: #CD853F;
    --text-dark: #2C1810;
    --text-light: #6B4423;
    --background-light: #FFF8F0;
    --background-white: #FFFFFF;
    --border-color: #E6D7C3;
    --shadow-light: rgba(139, 69, 19, 0.1);
    --shadow-medium: rgba(139, 69, 19, 0.2);
    --gradient-primary: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-white);
}

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

/* Header Styles */
.header {
    background: var(--background-white);
    box-shadow: 0 2px 10px var(--shadow-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

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

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

.temple-crest {
    width: 50px;
    height: 50px;
    color: var(--primary-color);
}

.crest-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.temple-name h1 {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.mountain-name {
    font-size: 0.9em;
    font-weight: 400;
}

.temple-main-name {
    font-size: 1.2em;
}

.temple-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 2px;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    padding: 8px 12px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
    border-bottom: 3px solid var(--primary-color) !important;
    background-color: rgba(139, 69, 19, 0.05) !important;
    border-radius: 4px !important;
}

.facebook-nav {
    background: #1877f2 !important;
    color: white !important;
    padding: 8px 15px !important;
    border-radius: 20px !important;
    border-bottom: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.facebook-nav:hover {
    background: #166fe5 !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(24, 119, 242, 0.3);
}

.nav-facebook-icon {
    width: 16px;
    height: 16px;
}

.mobile-menu-toggle {
    display: none;
}

/* Hero Section */
.hero {
    position: relative;
    height: 67vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
    text-align: center;
    color: white;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('images/temple-main-hall.jpg?v=20250907-1346') no-repeat center center/cover;
    filter: brightness(0.6);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: 'Noto Serif JP', serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.hero-description p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 40px;
}

.btn {
    display: inline-block;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--background-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

  .btn-secondary {
    background: transparent;
    color: white;
    border-color: white;
  }

/* Downloads page cards: make secondary buttons visible on white cards */
  .services-section .service-card .btn-secondary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: transparent;
  }

.services-section .service-card .btn-secondary:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.services-section .service-card .btn-secondary:focus-visible {
    outline: 3px solid rgba(212,165,116,0.4);
    outline-offset: 2px;
}

/* Improve default visibility of the secondary button on white cards */
.services-section .service-card .btn-secondary {
    background: #fffaf2; /* soft cream to stand out */
    border-color: var(--border-color);
}

/* Ensure buttons inside forms are visible */
.contact-form-section .btn {
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
}
.contact-form-section .btn-secondary {
  color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  background: #fffaf2 !important;
}
.contact-form-section .btn-secondary:hover {
  background: var(--primary-color) !important;
  color: #fff !important;
  border-color: var(--primary-color) !important;
  transform: translateY(-1px);
}

/* Explicit styles for Goma multi-item controls */
#gomaAddItem, #gomaRemoveItem {
  display: inline-block;
  min-width: 140px;
  text-align: center;
}
#gomaAddItem {
  background: var(--primary-color) !important;
  color: #fff !important;
  border-color: var(--primary-color) !important;
}
#gomaAddItem:hover {
  filter: brightness(1.05);
}
#gomaRemoveItem {
  background: #fff !important;
  color: var(--primary-color) !important;
  border: 2px solid var(--primary-color) !important;
}
#gomaRemoveItem:hover {
  background: #fffaf2 !important;
}

.btn-facebook {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-facebook:hover {
    background: #166fe5;
    border-color: #166fe5;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(24, 119, 242, 0.3);
}

.btn-facebook-icon {
    width: 18px;
    height: 18px;
}

/* Notice Section */
.notice-section {
    padding: 60px 0;
    background: var(--background-light);
}

.notice-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow-light);
    text-align: center;
    border-left: 5px solid var(--primary-color);
}

.notice-card h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.notice-card p {
    margin-bottom: 20px;
    color: var(--text-light);
}

.notice-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.notice-link:hover {
    color: var(--secondary-color);
}

/* Link-style button (blue) */
.btn-link.blue {
    color: #1877f2;
    text-decoration: none;
    font-weight: 600;
}
.btn-link.blue:hover {
    color: #166fe5;
    text-decoration: underline;
}

/* Main Content */
.main-content {
    margin-top: 80px; /* Adjust for fixed header */
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

/* Home page: center heritage item headings */
.heritage-section .heritage-item h3 {
    text-align: center;
}

.section-header h2 {
    font-family: 'Noto Serif JP', serif;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* About Section */
.about-section {
    padding: 80px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text h3 {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.8rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--text-light);
    line-height: 1.8;
}

.temple-image {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-medium);
}

/* Kannon Hall Section */
.kannon-section {
    padding: 80px 0;
    background: var(--background-light);
}

.kannon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.kannon-text h3 {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.8rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
}

.kannon-text p {
    margin-bottom: 20px;
    color: var(--text-light);
    line-height: 1.8;
}

.highlight-box {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    margin-top: 20px;
}

/* Services Section */
.services-section {
    padding: 80px 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.service-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow-light);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-medium);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.service-card h3 {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.service-card p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

.service-details {
    background: var(--background-light);
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.video-container {
    margin: 1rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.traffic-safety-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid #28a745;
}

.traffic-safety-section h4 {
    margin: 0 0 0.5rem 0;
    color: #28a745;
    font-size: 1.1em;
}

/* Heritage Section */
.heritage-section {
    padding: 80px 0;
    background: var(--background-light);
}

.heritage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.heritage-item {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow-light);
}

.heritage-item h3 {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.heritage-item p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Access Section */
.access-section {
    padding: 80px 0;
}

.access-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.access-info h3 {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    margin-top: 20px;
}

.access-info h3:first-child {
    margin-top: 0;
}

.access-info p {
    color: var(--text-light);
    line-height: 1.7;
}

.map-area {
    display: flex;
    flex-direction: column;
}

.map-container {
    width: 100%;
    height: 450px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow-light);
    margin-bottom: 20px;
}



.map-text {
    text-align: center;
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.7;
}

.access-methods {
    margin-top: 1.5rem;
}

.access-methods h4 {
    color: #8B4513;
    font-size: 1.1rem;
    margin: 1.5rem 0 0.8rem 0;
    font-weight: 600;
}

.access-methods ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, auto);
    column-gap: 24px;
    row-gap: 8px;
}

.access-methods li {
    padding: 0.8rem 0;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.6;
}

.access-methods li:last-child {
    border-bottom: none;
}

.access-methods strong {
    color: #8B4513;
    font-weight: 600;
}

/* Social Media Section */
.social-section {
    padding: 80px 0;
    background: var(--background-light);
}

.social-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.social-text h3 {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.social-text p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 30px;
}

.recent-updates {
    margin-top: 20px;
    padding: 20px;
    background: rgba(139, 69, 19, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.recent-updates h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.facebook-embed {
    background: white;
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 5px 20px var(--shadow-light);
    overflow: hidden;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.footer-info h3 {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.footer-info p {
    opacity: 0.8;
    margin-bottom: 5px;
}

.footer-links h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, auto);
    column-gap: 24px;
    row-gap: 8px;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
    text-align: center;
    opacity: 0.7;
}

/* Slideshow styles */
.slideshow-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 15px;
}

.image-slideshow {
    height: 400px;
}

/* Ensure Kannon Hall slideshow is always visible */
.kannon-section .image-slideshow {
    position: relative;
    min-height: 360px;
}
.kannon-section .slideshow-image {
    position: absolute;
    inset: 0;
    display: block;
}
.kannon-section .slideshow-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slideshow-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slideshow-image.active {
    opacity: 1;
}

.slideshow-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.memorial-tower-slideshow,
.shakyo-slideshow {
    height: 200px;
    margin: 1rem 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Home page service card slideshow height fix */
.services-section .slideshow-container {
    height: 200px;
}

/* Page Hero Section */
.page-hero {
    background: var(--gradient-primary);
    color: white;
    text-align: center;
    /* Standardized height and centering */
    height: 240px; /* fixed height to unify across pages */
    display: flex;
    align-items: center;
    margin-top: 80px; /* avoid overlap with fixed header */
    overflow: hidden; /* cut extra lines from bottom to match height */
}

.page-hero .page-hero-content {
    width: 100%;
    padding: 40px 0; /* reduced to keep content within fixed height */
}

/* Guide page: center memorial section headings */
.memorial-tower-section .memorial-details h3 {
    text-align: center;
}
.memorial-tower-section .feature-item h4 {
    text-align: center;
}
/* Guide page: center '永代供養について' heading */
.memorial-tower-section .memorial-purpose h3 {
    text-align: center;
}

/* Museum page: center '大施餓鬼会について' heading */
.museum-page-body .segaki-info h3 {
    text-align: center;
}

/* Museum page: year-by-year visual separation */
.museum-page-body .segaki-records-section .year-record {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    padding: 24px;
    margin: 28px 0;
}

.museum-page-body .segaki-records-section .year-record:nth-child(even) {
    background: #fff9f3; /* subtle tint for alternating blocks */
}

.museum-page-body .segaki-records-section .year-header {
    text-align: center;
    margin-bottom: 16px;
}

.museum-page-body .segaki-records-section .year-header h3 {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(212,165,116,0.15), rgba(193,150,83,0.15));
    border: 1px solid rgba(212,165,116,0.35);
}

.museum-page-body .segaki-records-section .year-description {
    text-align: center;
    color: var(--text-light);
}

/* NEW badge for current year */
.museum-page-body .year-badge-new {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    background: #e53935; /* red */
    border-radius: 999px;
    vertical-align: middle;
}

.page-hero-content h1 {
    font-family: 'Noto Serif JP', serif;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.page-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.page-description {
    font-size: 0.95rem;
    opacity: 0.95;
    margin-bottom: 20px;
}

.breadcrumb {
    font-size: 0.9rem;
    opacity: 0.8;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
}

/* Consistent spacing from hero to the first content section (robust even if <main> is in between) */
.page-hero + * {
    padding-top: 48px; /* apply to the next element (usually <main>) */
}
.page-hero + * > *:first-child {
    margin-top: 0; /* reset the first child (usually first <section>) margin-top */
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Memorial Tower Section */
.memorial-tower-section {
    padding: 80px 0;
    background: var(--background-light);
}

.memorial-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.memorial-text h3 {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.memorial-intro p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 30px;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 20px 0;
}

.feature-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.feature-item h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.contact-note {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
}

.memorial-tower-slideshow-detailed {
    height: 350px !important; /* compact horizontal size (increased by ~1/3) */
    max-width: 480px !important;
    width: 100%;
    margin: 0 auto 16px auto;
    border-radius: 12px;
    overflow: hidden;
}

/* Ensure the container column stretches and displays content */
.memorial-image {
    align-self: stretch;
}
.memorial-image .slideshow-container {
    display: block;
    height: 100% !important;
}
/* Fallback: show first slide if JS doesn't toggle */
.memorial-tower-slideshow-detailed .slideshow-image:first-child {
    opacity: 1;
}

/* Ensure images keep aspect ratio nicely inside the compact box */
.memorial-tower-slideshow-detailed .slideshow-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Responsive tweak for small screens */
@media (max-width: 768px) {
  .memorial-tower-slideshow-detailed {
      height: 300px;
      max-width: 100% !important;
  }
}

/* Keep description width aligned under the compact slideshow */
.memorial-image .slideshow-description {
  max-width: 480px;
  margin: 0 auto 20px auto;
}

/* Increase specificity to ensure compact size is applied in GUIDE */
.memorial-content .memorial-image .slideshow-container.memorial-tower-slideshow-detailed {
  height: 350px !important;
  max-width: 480px !important;
  width: 100% !important;
  margin: 0 auto 16px auto !important;
  border-radius: 12px;
  overflow: hidden;
}
.memorial-content .memorial-image .slideshow-container.memorial-tower-slideshow-detailed .slideshow-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Dots under memorial detailed slideshow */
.memorial-tower-slideshow-detailed .slideshow-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}
.memorial-tower-slideshow-detailed .slideshow-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(0,0,0,0.1);
}
.memorial-tower-slideshow-detailed .slideshow-dots .dot.active {
    background: var(--primary-color);
}

.slideshow-description {
    background: white;
    padding: 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-light);
}

/* Temple History Section */
.temple-history-section {
    padding: 80px 0;
}

.timeline-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.timeline-year {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: right;
}

.timeline-content h3 {
    font-family: 'Noto Serif JP', serif;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Temple Grounds Section */
.temple-grounds-section {
    padding: 80px 0;
    background: var(--background-light);
}

/* Center titles under temple grounds items */
.temple-grounds-section .ground-content h3 {
    text-align: center;
}

.grounds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.ground-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow-light);
}

.ground-image {
    height: 200px;
    overflow: hidden;
}

.ground-content {
    padding: 20px;
}

.ground-content h3 {
    font-family: 'Noto Serif JP', serif;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Temple Info Section */
.temple-info-section {
    padding: 80px 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.info-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow-light);
}

.info-card h3 {
    font-family: 'Noto Serif JP', serif;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.info-details ul {
    list-style: none;
    padding-left: 0;
}

.info-details li {
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
}

/* Events Page Styles */
/* Events Page Styles */
.events-intro-section {
    padding: 60px 0;
    background: var(--background-light);
}

.intro-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.intro-content h2 {
    font-family: 'Noto Serif JP', serif;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.intro-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 30px;
}

.intro-signature {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
}

.events-section {
    padding: 80px 0;
    background: #f8f9fa;
}

/*
  年間行事ページ (.events-page-body) に限定したスタイル
  ----------------------------------------------------------
*/

/* 年間行事ページのグリッドを2列に設定 */
.events-page-body .events-grid,
.events-section .events-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2列レイアウト */
    gap: 2.5rem;
    align-items: start; /* 伸びずに上揃えにする（隣カラムが引っ張られない） */
}

/* 年間行事ページのカードスタイル */
.events-page-body .event-gallery-card,
.events-section .event-gallery-card {
    display: grid;
    grid-template-columns: 1fr; /* カード内の画像を上、テキストを下に配置 */
    align-items: stretch; /* カード内のレイアウトは維持 */
    align-self: start; /* グリッド行の高さに合わせて伸びないようにする */
    background: var(--background-white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Center event titles within events cards */
.events-section .event-info h3 {
    text-align: center;
}

.events-page-body .event-gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px var(--shadow-medium);
}

/* カード内の画像コンテナのスタイル */
.events-page-body .event-slideshow {
    position: relative;
    height: 300px; /* 画像の高さを固定 */
    overflow: hidden;
    border-radius: 15px 15px 0 0;
}

/* レスポンシブ対応: 画面幅が992px以下の場合は1列に戻す */
@media (max-width: 992px) {
    .events-page-body .events-grid,
    .events-section .events-grid {
        grid-template-columns: 1fr;
    }
}


.slideshow-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Museum page slideshow sizing (explicit height) */
.museum-slideshow .slideshow-container {
    height: 300px; /* desktop default */
    border-radius: 12px; /* ensure rounded corners remain */
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Museum yearly record layout: video left, photos right (desktop) */
.segaki-records-section .media-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 992px) {
  .segaki-records-section .media-gallery {
      grid-template-columns: 1fr; /* stack on small screens */
      gap: 24px;
  }
}

@media (max-width: 768px) {
  .museum-slideshow .slideshow-container {
      height: 240px; /* mobile compact */
  }
}

/* Match heights between video and photo sections on museum page */
.segaki-records-section .video-section .video-container {
    height: 300px; /* match photo slideshow */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 0 !important; /* remove extra blank line under video */
}
.segaki-records-section .video-section .video-container > div {
    /* override embedded 56.25% padding box */
    padding: 0 !important;
    height: 100% !important;
}
.segaki-records-section .video-section .video-container iframe {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 768px) {
  .segaki-records-section .video-section .video-container {
      height: 240px;
  }
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slide-image {
    width: 100%;
    height: 100%;
}

.slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-prev,
.slide-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s ease;
    z-index: 10;
}

.slide-prev:hover,
.slide-next:hover {
    background: rgba(0, 0, 0, 0.7);
}

.slide-prev {
    left: 10px;
}

.slide-next {
    right: 10px;
}

.slide-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.dot.active {
    background: white;
}

.event-info {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.event-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.event-date-badge {
    background: linear-gradient(135deg, #d4a574, #c19653);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    text-align: center;
    min-width: 80px;
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
}

.event-date-badge.monthly {
    background: linear-gradient(135deg, #8B4513, #A0522D);
}

.event-date-badge .month {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
}

.event-date-badge .day {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
}

.event-info h3 {
    font-family: 'Noto Serif JP', serif;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0;
}

.event-summary {
    color: var(--text-light);
    line-height: 1.7;
    margin: 1rem 0;
    flex-grow: 1; /* Allows this element to grow and push the button down */
}

.event-quick-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--background-light);
    border-radius: 8px;
}

.event-quick-info span {
    font-size: 0.9rem;
    color: var(--text-light);
}

.details-toggle {
    background: #1877f2; /* unify to blue */
    color: white;
    border: none;
    padding: 0.75rem 1.2rem;
    border-radius: 22px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-top: 1rem;
    align-self: flex-start;
}

.details-toggle:hover {
    background: #166fe5;
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(24, 119, 242, 0.35);
}

.event-details-expanded {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
    margin-top: 1rem;
}

.event-details-expanded.show {
    max-height: 1000px; /* Adjust as needed */
}

.event-details-expanded p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.museum-link-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.museum-link-btn:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
    text-decoration: none;
    color: white;
}

.monthly-event {
    border: 2px solid #d4a574;
}

.monthly-event .event-info {
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.05), rgba(193, 150, 83, 0.05));
}

/* Responsive styles for events */
@media (max-width: 992px) {
    .event-gallery-card {
        grid-template-columns: 1fr; /* Stack on smaller screens */
    }
    .event-slideshow {
        min-height: 300px;
        border-radius: 15px 15px 0 0;
    }
}

.museum-period {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* Contact Page Styles */
.contact-form-section {
    padding: 80px 0;
}

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

.contact-form {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow-light);
}

/* Toba online form enhancements (scoped) */
#toba-online .contact-form {
    border: 2px solid rgba(193,150,83,0.25); /* gold-ish accent */
    background: linear-gradient(180deg, rgba(212,165,116,0.05), rgba(255,255,255,0.9));
}
#toba-online .contact-form h3 {
    position: relative;
    margin: 22px 0 12px;
    font-family: 'Noto Serif JP', serif;
    color: var(--primary-color);
}
#toba-online .contact-form h3::after {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    margin-top: 6px;
    background: var(--gradient-primary);
    border-radius: 3px;
}
#toba-online #tobaItems .toba-row {
    border: 1.5px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.9);
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 2px 10px var(--shadow-light);
}
#toba-online .form-submit .btn.btn-primary {
    font-size: 1.08rem;
    font-weight: 700;
    padding: 16px 46px;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(193,150,83,0.25);
}
#toba-online .form-submit .btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(193,150,83,0.32);
}

/* Contact page form styling to match Toba form */
#contact-page .contact-form {
    border: 2px solid rgba(193,150,83,0.25);
    background: linear-gradient(180deg, rgba(212,165,116,0.05), rgba(255,255,255,0.9));
}
#contact-page .contact-form h3,
#contact-page .section-header h2 {
    position: relative;
    font-family: 'Noto Serif JP', serif;
    color: var(--primary-color);
}
#contact-page .section-header h2::after {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    margin-top: 6px;
    background: var(--gradient-primary);
    border-radius: 3px;
}
#contact-page .form-submit .btn.btn-primary {
    font-size: 1.08rem;
    font-weight: 700;
    padding: 16px 46px;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(193,150,83,0.25);
}
#contact-page .form-submit .btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(193,150,83,0.32);
}

/* Toba confirmation modal */
#tobaConfirmModal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none; /* toggled by JS */
    z-index: 9999;
    padding: 20px;
    overflow: auto;
}
#tobaConfirmModal .modal-content {
    max-width: 860px;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(0,0,0,0.25);
    padding: 20px 22px;
}
#tobaConfirmModal .modal-body {
    display: grid;
    gap: 14px;
}
#tobaConfirmModal .confirm-section h4 {
    margin: 8px 0 6px;
    font-size: 1rem;
    color: var(--primary-color);
}
#tobaConfirmModal .confirm-section table.simple {
    width: 100%;
    border-collapse: collapse;
}
#tobaConfirmModal .confirm-section table.simple th,
#tobaConfirmModal .confirm-section table.simple td {
    border: 1px solid #eee;
    padding: 8px 10px;
    text-align: left;
}
#tobaConfirmModal .modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 12px;
}
@media (max-width: 640px) {
    #tobaConfirmModal .modal-content { margin: 20px auto; padding: 16px; }
    #tobaConfirmModal .modal-actions { flex-direction: column; }
}

/* Success message area (Toba) */
#toba-success {
    border: 1px solid rgba(212,165,116,0.35);
    background: linear-gradient(180deg, rgba(212,165,116,0.08), rgba(255,255,255,0.95));
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 8px 22px rgba(193,150,83,0.15);
}

/* Make the print button clearly visible even when it uses btn-secondary */
#toba-success #toba-print.btn.btn-secondary {
    background: #fff;
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 6px 16px rgba(193,150,83,0.25);
}
#toba-success #toba-print.btn.btn-secondary:hover {
    background: var(--background-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(193,150,83,0.32);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.submit-btn {
    background: var(--gradient-primary);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
}

.contact-info {
    background: var(--background-light);
    padding: 40px;
    border-radius: 15px;
}

.contact-info h3 {
    font-family: 'Noto Serif JP', serif;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* Honeypot (anti-spam) hidden field */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        padding: 10px 0;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        right: 20px;
        background: var(--background-white);
        box-shadow: 0 6px 20px var(--shadow-light);
        border-radius: 12px;
        padding: 12px 16px;
        z-index: 1001;
    }
    /* show when toggled */
    .main-nav.active {
        display: block;
    }
    .main-nav ul {
        flex-direction: column;
        gap: 10px;
    }
    .main-nav a {
        display: block;
        padding: 10px 12px;
        border-radius: 8px;
    }
    .mobile-menu-toggle {
        display: flex;
        width: 42px;
        height: 36px;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;
        background: transparent;
        border: 2px solid rgba(0,0,0,0.08);
        border-radius: 8px;
        cursor: pointer;
    }
    .mobile-menu-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--text-dark);
        transition: transform 0.25s ease, opacity 0.25s ease;
    }
    /* animated state */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    .hero-title {
        font-size: 2.2rem;
    }
    /* Smaller height for slideshows on mobile */
    .image-slideshow,
    .kannon-section .image-slideshow {
        height: 260px;
        min-height: 260px;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    .about-grid,
    .kannon-grid,
    .access-content,
    .social-content,
    .memorial-content,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .services-grid,
    .heritage-grid,
    .footer-content,
    .events-grid,
    .museum-grid,
    .grounds-grid,
    .info-grid {
        grid-template-columns: 1fr;
    }
    .footer-content {
        text-align: center;
    }
    .section-header h2 {
        font-size: 2rem;
    }
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .timeline-year {
        text-align: left;
    }
    .page-hero-content h1 {
        font-size: 2rem;
    }
}