/* Basic Styles (Mobile First) */
:root {
    /* Theme Colors: British Racing Green & Tan Leather */
    --theme-green-dark: #004d40;
    /* British Racing Green */
    --theme-green-darker: #00382e;
    --theme-tan-bg: #f5f1e9;
    /* Tan Leather Beige */

    /* Brand & UI Colors */
    --primary-color: #d60039;
    /* Mazda Red for main CTA */
    --text-color: #4a4a4a;
    /* Dark Gray for readability */
    --text-color-light: #777;
    --bg-color: #ffffff;

    /* Fonts */
    --font-family-base: 'Noto Sans JP', 'Shippori Mincho', serif;
    --font-family-heading: 'M PLUS Rounded 1c', sans-serif;
}

body {
    margin: 0;
    font-family: var(--font-family-base);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.8;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.no-scroll {
    overflow: hidden;
}

.container {
    padding: 0 25px;
    margin: 0 auto;
    max-width: 980px;
}

section {
    padding: 50px 0;
}

/* --- [ワンポイント①] リンク色の変更 --- */
a {
    color: var(--theme-green-dark);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--theme-green-darker);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-family-heading);
    color: var(--primary-color);
    font-weight: 700;
}

h2 {
    text-align: center;
    font-size: 2.2em;
    margin-bottom: 1em;
}

/* --- [ワンポイント③] 見出しデザインの変更 --- */
h3 {
    font-size: 1.8em;
    border-bottom: 2px solid var(--theme-tan-bg);
    padding-bottom: 10px;
    margin-bottom: 1em;
}

p {
    margin-bottom: 1.5em;
}

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

.js-fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s, transform 0.8s;
}

.js-fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- ヘッダーの変更 --- */
.site-header {
    background-color: rgba(245, 241, 233, 0.9);
    /* Translucent Tan */
    backdrop-filter: blur(8px);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-top: 2px solid var(--primary-color);
    /* Pinstripe */
}

.site-header .container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-right: 40px;
    /* Add margin to the right of the logo */
}

.logo img {
    height: 60px;
    /* Increased logo size */
    width: auto;
}

.main-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background-color: var(--primary-color);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    transition: right 0.4s ease;
    z-index: 1001;
}

.main-nav.is-active {
    display: block;
    right: 0;
}

.main-nav ul {
    list-style: none;
    margin: 60px 0 0;
    padding: 0;
}

.main-nav a {
    display: block;
    padding: 15px 30px;
    color: var(--bg-color);
    font-family: var(--font-family-heading);
    font-size: 1.1em;
}

.main-nav a:hover {
    background-color: var(--theme-green-dark);
}

.hamburger-menu {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
    position: relative;
}

.hamburger-menu span {
    display: block;
    width: 30px;
    height: 3px;
    background-color: var(--theme-green-dark);
    /* Changed from red */
    margin: 6px 0;
    transition: all 0.4s ease;
}

.hamburger-menu.is-active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-menu.is-active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.is-active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.hero {
    background: url('../images/hero.jpg') no-repeat center center/cover;
    height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--bg-color);
    position: relative;
    padding: 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero-text {
    position: relative;
    z-index: 2;
    padding: 20px;
}

.hero h1 {
    color: var(--bg-color);
    font-size: 2.8em;
    margin-bottom: 0.5em;
    font-family: var(--font-family-base);
    font-weight: normal;
}

.hero p {
    font-size: 1.2em;
    font-family: var(--font-family-heading);
}

.content-section {
    background-color: var(--theme-tan-bg);
}

.content-box {
    background-color: var(--bg-color);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.07);
}

.cta-section {
    background-color: var(--theme-tan-bg);
    text-align: center;
}

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

.button {
    display: inline-block;
    padding: 18px 35px;
    border-radius: 50px;
    font-family: var(--font-family-heading);
    color: white;
    text-align: center;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
    border: none;
    cursor: pointer;
}

.button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

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

/* --- [ワンポイント②] ボタン色の変更 --- */
.button-secondary {
    background-color: var(--theme-green-dark);
}

.button-dark {
    background-color: #333;
}

.event-card {
    background-color: var(--bg-color);
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.07);
    margin-bottom: 40px;
    overflow: hidden;
}

.event-card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.event-card-content {
    padding: 30px;
}

.event-card h3 {
    margin-top: 0;
}

.event-info-box {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background-color: var(--theme-tan-bg);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
}

.info-item {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.info-item-icon {
    font-size: 2.5em;
}

.info-item-text h4 {
    margin: 0 0 5px 0;
    font-size: 1em;
    font-family: var(--font-family-heading);
    color: var(--text-color-light);
    font-weight: normal;
}

.info-item-text p {
    margin: 0;
    font-family: var(--font-family-heading);
    font-size: 1.2em;
    color: var(--text-color);
}

/* Gallery Page */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    aspect-ratio: 1 / 1;
    /* Maintain a square aspect ratio */
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

.gallery-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-photo img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 12px;
    margin-top: 30px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- フッターの変更 --- */
.site-footer {
    background-color: var(--theme-green-dark);
    color: var(--theme-tan-bg);
    text-align: center;
    padding: 40px 0;
    margin-top: 40px;
}

.site-footer a {
    color: #fff;
    text-decoration: underline;
    transition: color 0.3s;
}

.site-footer a:hover {
    color: var(--theme-tan-bg);
    /* Tan color for hover */
}

/* --- News Section --- */
.news-section {
    padding: 60px 0;
    background-color: var(--bg-color);
}

.news-list {
    max-width: 800px;
    margin: 0 auto;
}

.news-item {
    display: flex;
    align-items: baseline;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
}

.news-item:first-child {
    border-top: 1px solid #eee;
}

.news-item:hover {
    background-color: #fafafa;
}

.news-meta {
    display: flex;
    align-items: center;
    min-width: 200px;
    /* Ensure space for date and cat */
}

.news-date {
    font-family: var(--font-family-heading);
    color: var(--text-color-light);
    font-size: 0.95em;
    margin-right: 15px;
}

.news-category {
    font-size: 0.8em;
    padding: 3px 10px;
    border-radius: 4px;
    color: #fff;
    background-color: #999;
    white-space: nowrap;
}

.cat-event {
    background-color: var(--primary-color);
}

.cat-info {
    background-color: var(--theme-green-dark);
}

.cat-media {
    background-color: #f0ad4e;
}

.news-title {
    margin: 0;
    font-size: 1.1em;
    font-weight: normal;
    border-bottom: none;
    padding-bottom: 0;
    flex: 1;
}

.news-title a {
    color: var(--text-color);
    display: block;
    text-decoration: none;
}

.news-title a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.news-more {
    text-align: right;
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.button-outline {
    background-color: transparent;
    border: 2px solid var(--theme-green-dark);
    color: var(--theme-green-dark);
    padding: 10px 25px;
    display: inline-block;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s;
}

.button-outline:hover {
    background-color: var(--theme-green-dark);
    color: #fff;
}

/* Mobile adjustments for News */
@media (max-width: 768px) {
    .news-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-meta {
        margin-bottom: 8px;
    }
}

/* Breakpoint for Desktop */
@media (min-width: 769px) {
    .hamburger-menu {
        display: none;
    }

    .main-nav {
        display: block;
        position: static;
        width: auto;
        height: auto;
        background-color: transparent;
        box-shadow: none;
    }

    .main-nav ul {
        display: flex;
        margin: 0;
    }

    .main-nav a {
        color: var(--theme-green-dark);
        padding: 10px 18px;
        font-size: 1em;
        border-radius: 30px;
        transition: color 0.3s, background-color 0.3s;
    }

    .main-nav a:hover {
        background-color: var(--theme-green-dark);
        color: #fff;
    }

    .hero h1 {
        font-size: 4.5em;
    }

    section {
        padding: 80px 0;
    }

    .event-card {
        display: flex;
        align-items: center;
    }

    .event-card-image-container {
        flex: 0 0 40%;
    }

    .event-card-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .event-card-content {
        flex: 1;
        padding: 40px;
    }
}

/* Lightbox Styles */
.lightbox {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.4s;
}

.lightbox.is-active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    animation: zoomIn 0.4s;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: #ccc;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
    }

    to {
        transform: scale(1);
    }
}

/* Contact Form Styles */
.contact-form .form-group {
    margin-bottom: 25px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-family: var(--font-family-heading);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: var(--font-family-base);
}

.contact-form .radio-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

.contact-form .radio-group input[type="radio"] {
    margin-right: 5px;
}

.contact-form .name-group {
    display: flex;
    gap: 15px;
}

.contact-form .name-group input {
    flex: 1;
}

.contact-form .btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.contact-form .btn:hover {
    background-color: var(--theme-green-dark);
}

.form-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
}

.form-status.success {
    background-color: #e8f5e9;
    /* Light Green */
    color: #2e7d32;
    /* Dark Green */
}

.form-status.error {
    background-color: #ffebee;
    /* Light Red */
    color: #c62828;
    /* Dark Red */
}

/* Language Switcher */
.language-switcher {
    position: relative;
    margin-left: auto;
}

.language-switcher-button {
    background-color: transparent;
    border: 1px solid var(--theme-green-dark);
    color: var(--theme-green-dark);
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.language-switcher-button .flag-icon {
    margin-right: 8px;
}

.language-switcher-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    list-style: none;
    margin: 5px 0 0;
    padding: 0;
    min-width: 150px;
    z-index: 1001;
}

.language-switcher-menu.is-active {
    display: block;
}

.language-switcher-menu a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
}

.language-switcher-menu a:hover {
    background-color: var(--theme-tan-bg);
}

.language-switcher-menu .flag-icon {
    margin-right: 10px;
}

/* Team Page Styles */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.team-member-card {
    background-color: var(--bg-color);
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.07);
    text-align: center;
    padding: 30px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.team-member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.team-member-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px auto;
    border: 4px solid var(--theme-tan-bg);
}

.team-member-card h3 {
    font-size: 1.5em;
    margin-bottom: 5px;
    border-bottom: none;
}

.team-member-role {
    color: var(--text-color-light);
    font-family: var(--font-family-heading);
    margin-bottom: 15px;
}

.team-member-car {
    font-weight: bold;
    margin-bottom: 15px;
}

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

/* Team Modal Styles */
.team-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.4s;
}

.team-modal.is-active {
    display: flex;
}

.team-modal-content {
    background-color: var(--bg-color);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: zoomIn 0.4s;
    text-align: center;
}

.team-modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.team-modal-close:hover {
    color: #333;
}

.team-modal-content img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 5px solid var(--theme-tan-bg);
}

.team-modal-content h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 5px;
}

.team-modal-content p {
    line-height: 1.8;
}

/* Blog Page Styles */
.blog-index {
    margin-bottom: 50px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.blog-index h2 {
    text-align: center;
    margin-bottom: 20px;
}

.blog-index ul {
    list-style: none;
    padding: 0;
    text-align: center;
}

.blog-index li {
    margin-bottom: 10px;
}

.blog-post {
    margin-bottom: 40px;
}

.blog-post-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.blog-post-content h2 {
    text-align: left;
    font-size: 1.8em;
}

.post-meta {
    color: var(--text-color-light);
    font-size: 0.9em;
    margin-bottom: 1em;
}

.blog-separator {
    border: 0;
    height: 1px;
    background-color: #eee;
    margin: 60px 0;
}

.kana {
    font-size: 0.7em;
    color: #777;
}

/* Recommended Content Section */
.content-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.content-card {
    background-color: var(--bg-color);
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.content-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.content-card-image {
    width: 100%;
    height: 250px;
    /* Set a fixed height */
    object-fit: cover;
    /* Ensure the image covers the area without distortion */
    display: block;
}

.content-card-body {
    padding: 25px;
}

.content-card-body h3 {
    margin-top: 0;
    border-bottom: none;
    font-size: 1.6em;
}

.content-card-body p {
    margin-bottom: 0;
}

@media (min-width: 769px) {
    .content-grid {
        flex-direction: row;
        justify-content: center;
        align-items: stretch;
        /* Make cards same height */
    }

    .content-card {
        flex: 1 1 450px;
        /* Allow cards to grow and shrink */
        display: flex;
        flex-direction: column;
    }

    .content-card-body {
        flex-grow: 1;
        /* Allow body to fill available space */
    }
}