@import url('https://fonts.googleapis.com/css2?family=Sawarabi+Mincho&family=Zen+Kaku+Gothic+New:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #4a7c59; /* Soft gentle green */
    --primary-dark: #355840;
    --background-color: #fcfcfc;
    --surface-color: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

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

body {
    background-color: var(--background-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* Headers */
h1, h2, h3, h4 {
    font-family: 'Sawarabi Mincho', serif;
    font-weight: normal;
    color: var(--primary-dark);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-dark);
}

/* Base Layout */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 0;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Navigation */
header.site-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
}

.site-logo {
    font-family: 'Sawarabi Mincho', serif;
    font-size: 1.2rem;
    line-height: 1.3;
    color: var(--primary-dark);
    display: flex;
    flex-direction: column;
}

.site-logo span {
    font-size: 1.6rem;
    font-weight: bold;
}

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

nav.main-nav a {
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
}

nav.main-nav a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 0; /* Behind header */
}

.hero-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.hero-video-wrapper iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 56.25vw; /* 16:9 aspect ratio */
    min-height: 100vh;
    min-width: 177.77vh; /* 16:9 aspect ratio */
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 10;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    margin-top: 80px;
}

.hero-content h1 {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2rem;
    font-family: 'Sawarabi Mincho', serif;
    display: inline-block;
    text-align: left;
    line-height: 2;
}

/* Sections */
.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.2rem;
}

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

@media (min-width: 768px) {
    .section-grid.two-cols {
        grid-template-columns: 1fr 1fr;
    }
    .section-grid.two-cols.img-left {
        grid-template-columns: 4fr 5fr;
    }
}

.text-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* WP News Section */
.news-list {
    list-style: none;
    max-width: 800px;
    margin: 0 auto;
}

.news-list li {
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    display: flex;
    gap: 20px;
    align-items: center;
}

@media (max-width: 600px) {
    .news-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

.news-date {
    color: var(--primary-color);
    font-weight: 500;
    white-space: nowrap;
}

.news-more {
    text-align: center;
    margin-top: 30px;
}

/* Banners */
.about-banners {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 40px 0;
}

.about-banners img {
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.about-banners a:hover img {
    transform: translateY(-3px);
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: background-color 0.3s, transform 0.3s;
    text-align: center;
}

.btn:hover {
    background-color: var(--primary-dark);
    color: #fff;
    transform: scale(1.05);
}

.btn-open-modal {
    margin-top: 20px;
    align-self: flex-start;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-color);
}

table th, table td {
    padding: 15px;
    border: 1px solid var(--border-color);
    text-align: left;
}

table th {
    background-color: #f0f5f2;
    color: var(--primary-dark);
    font-weight: bold;
    white-space: nowrap;
}

/* Modal Window */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content-wrapper {
    background: var(--background-color);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease-out;
}

.modal-overlay.active .modal-content-wrapper {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: #000;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
}

/* Hidden dynamic content containers */
.modal-html-source {
    display: none;
}

.modal-body h4 {
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    font-size: 1.3rem;
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-body p {
    margin-bottom: 15px;
}

.modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* モーダル内の複数画像を並べるレイアウト用 */
.modal-image-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.modal-image-row img {
    flex: 1;
    min-width: 0;
    margin-bottom: 0; 
}

/* Photo Modal Specific */
.photo-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1500; /* Above main modal (1000), below lightbox (2000) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.photo-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.photo-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.photo-gallery img:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Lightbox */
img.lightbox-target {
    cursor: pointer;
    transition: opacity 0.2s;
}

img.lightbox-target:hover {
    opacity: 0.8;
}

.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-img-container {
    max-width: 90%;
    max-height: 80vh;
    position: relative;
}

.lightbox-img-container img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.lightbox-caption {
    color: #fff;
    margin-top: 15px;
    font-size: 1.1rem;
    font-family: inherit;
}

/* Footer */
footer.site-footer {
    background-color: var(--primary-dark);
    color: #fff;
    padding: 40px 0 20px;
    text-align: center;
}

footer.site-footer p {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    nav.main-nav {
        display: none; /* Add a hamburger menu for real implementation, keeping simple for now */
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .btn {
        width: 100%;
        margin-top: 15px;
    }
}
