:root {
    --primary-color: #e60012;
    --secondary-color: #c5a059;
    /* ゴールド系のアクセント */
    --text-color: #333333;
    --light-bg: #f9fbfd;
    --white: #ffffff;
    --font-base: 'Noto Sans JP', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-base);
    color: var(--text-color);
    line-height: 1.8;
    background-color: var(--white);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

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

/* Header */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    /* 初期状態は透明 */
    /* backdrop-filter: blur(10px); はスクロール時のみ適用 */
    box-shadow: none;
    /* 初期状態は影なし */
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--white);
    /* 初期状態は白 */
    display: flex;
    flex-direction: column;
    line-height: 1;
    transition: color 0.3s ease;
}

#header.scrolled .logo {
    color: var(--primary-color);
}

.logo span {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    margin-top: 2px;
}

nav ul {
    display: flex;
    gap: 30px;
    align-items: center;
}

nav ul li a {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--white);
    /* 初期状態は白 */
    letter-spacing: 0.05em;
    position: relative;
    transition: color 0.3s ease;
}

#header.scrolled nav ul li a {
    color: var(--primary-color);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s;
}

nav ul li a:hover::after {
    width: 100%;
}

.btn-nav {
    background-color: var(--white);
    /* 初期状態は白背景 */
    color: var(--primary-color) !important;
    /* 文字はネイビー */
    padding: 8px 20px;
    border-radius: 50px;
    transition: all 0.3s ease;
}

#header.scrolled .btn-nav {
    background-color: var(--primary-color);
    color: var(--white) !important;
}

.btn-blog {
    background-color: var(--secondary-color);
    color: var(--white) !important;
    padding: 8px 20px;
    border-radius: 50px;
    transition: all 0.3s ease;
    /* Contactボタンとの余白調整: gapがあるが、さらに詰めるためにネガティブマージンを使用 */
    margin-left: -17px;
}

#header.scrolled .btn-blog {
    background-color: var(--secondary-color);
    opacity: 0.9;
}

.btn-blog:hover {
    background-color: #d4b069;
    transform: translateY(-2px);
}

.btn-blog::after {
    display: none;
}

.btn-nav:hover {
    background-color: var(--secondary-color);
    color: var(--white) !important;
    transform: translateY(-2px);
}

.btn-nav::after {
    display: none;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

#header.scrolled .menu-toggle span,
#header.menu-open .menu-toggle span {
    /* menu-open時もネイビーにする */
    background-color: var(--primary-color);
}

/* Menu Open Header Style */
#header.menu-open {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#header.menu-open .logo {
    color: var(--primary-color);
}

#header.menu-open .btn-nav {
    background-color: var(--primary-color);
    color: var(--white) !important;
}

/* Menu Toggle Animation */
.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--white);
    border-radius: 2px;
    transition: all 0.3s ease;
    /* アニメーション用にallに変更 */
    transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

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

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: var(--white);
    padding: 20px 0;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-150%);
    transition: transform 0.4s ease;
    z-index: 999;
    text-align: center;
}

.mobile-menu.active {
    transform: translateY(0);
}

.mobile-menu ul li {
    margin: 20px 0;
}

.mobile-menu ul li:nth-of-type(5),
.mobile-menu ul li:last-of-type {
    margin: 5px 0;
}

.mobile-menu ul li a {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

/* Mobile Menu Buttons */
.mobile-menu .btn-nav,
.mobile-menu .btn-blog {
    width: 70%;
    max-width: 300px;
    padding: 12px 0;
    margin: 5px 0;
    border-radius: 50px;
    text-align: center;
}

.mobile-menu .btn-nav {
    border: 2px solid var(--primary-color);
    background-color: var(--white);
    /* White background for Contact */
    color: var(--primary-color) !important;
}

.mobile-menu .btn-blog {
    border: 2px solid var(--secondary-color);
    background-color: var(--secondary-color);
    /* Keep Gold background */
    color: var(--white) !important;
    margin-left: 0;
    /* Reset negative margin from PC */
}

/* Mobile Hover/Tap Adjustments */
.mobile-menu .btn-nav:hover,
.mobile-menu .btn-nav:active {
    background-color: var(--primary-color);
    /* Fill with Navy on tap */
    color: var(--white) !important;
    transform: none;
    /* Disable shift on mobile */
}

.mobile-menu .btn-blog:hover,
.mobile-menu .btn-blog:active {
    background-color: #d4b069;
    transform: none;
}

/* Hero Section */
#hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    color: var(--white);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/hero-image.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
    animation: zoomOut 20s infinite alternate;
}

@keyframes zoomOut {
    from {
        transform: scale(1.1);
    }

    to {
        transform: scale(1.0);
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /*background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3));*/
    z-index: -1;
}

.hero-content {
    padding: 20px;
    margin-left: 23%;
    max-width: 600px;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-title {
    font-size: 2.7rem;
    font-weight: 900;
    margin-bottom: 30px;
    letter-spacing: 0.1em;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
}

.hero-name {
    font-size: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.7);
    display: inline-block;
    padding-top: 15px;
    margin-top: 10px;
    letter-spacing: 0.3em;
}

/* Section Common */
section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 60px;
    font-weight: 900;
    letter-spacing: 0.1em;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-title span {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-top: 10px;
    font-weight: 500;
    letter-spacing: 0.2em;
    display: block;
}

.section-title::after {
    content: '';
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
    margin-top: 20px;
}

/* Message Section */
#message {
    background-color: var(--light-bg);
    text-align: center;
}

.message-body {
    max-width: 800px;
    margin: 0 auto;
}

.message-body h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 40px;
}

.message-body p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-align: justify;
    text-align-last: center;
}

.signature {
    margin-top: 40px;
    font-size: 1.5rem;
    font-family: serif;
    /* 手書き風の演出のため明朝体またはセリフ体 */
    font-weight: bold;
    text-align: right;
}

/* Policy Section */
#policy {
    background-color: var(--white);
}

.policy-item {
    display: flex;
    align-items: center;
    gap: 50px;
    margin-bottom: 80px;
}

.policy-item:last-child {
    margin-bottom: 0;
}

.policy-item.reverse {
    flex-direction: row-reverse;
}

.policy-image {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.policy-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.policy-image:hover img {
    transform: scale(1.05);
}

.placeholder-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-image.education {
    background-image: url('https://images.unsplash.com/photo-1503676260728-1c00da094a0b?q=80&w=2022&auto=format&fit=crop');
    /* Unsplash placeholder as fallback */
    background-size: cover;
    background-position: center;
}

.policy-content {
    flex: 1;
    padding: 20px;
}

.policy-number {
    font-size: 4rem;
    font-weight: 900;
    color: rgba(230, 0, 18, 0.1);
    line-height: 1;
    display: block;
    margin-bottom: -20px;
    position: relative;
    z-index: -1;
}

.policy-content h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.policy-content h3 span {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-top: 5px;
}

/* Profile Section */
#profile {
    background-color: var(--light-bg);
}

.profile-wrapper {
    display: flex;
    gap: 50px;
    align-items: flex-start;
    background-color: var(--white);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.profile-image img {
    width: 300px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.profile-info h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 30px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    display: inline-block;
}

.profile-info h3 span {
    font-size: 1rem;
    color: #999;
    margin-left: 15px;
    font-weight: 400;
}

.history-list li {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px dotted #ddd;
    padding-bottom: 15px;
}

.history-list .year {
    width: 100px;
    font-weight: 700;
    color: var(--primary-color);
    flex-shrink: 0;
}

.badges {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

.badges span,
.badge-item {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

.badge-item:hover,
.badge-item.active {
    background-color: var(--secondary-color);
}

/* Tooltip Style */
.badge-item::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: normal;
    width: 250px;
    text-align: left;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 10;
    pointer-events: none;
    line-height: 1.5;
}

/* Tooltip Arrow */
.badge-item::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 10;
}

.badge-item:hover::after,
.badge-item.active::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

.badge-item:hover::before,
.badge-item.active::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

.badge-item.no-tooltip::after,
.badge-item.no-tooltip::before {
    display: none !important;
}

/* Mobile adjustments to prevent tooltip overflow */
@media (max-width: 768px) {
    .badge-item::after {
        width: 200px;
        left: 50%;
        margin-left: 0;
    }
}

/* Support Section */
#support {
    padding: 80px 0;
    text-align: center;
}

.support-box {
    background: linear-gradient(rgba(230, 0, 18, 0.9), rgba(230, 0, 18, 0.9)), url('images/hero.png');
    background-size: cover;
    background-attachment: fixed;
    color: var(--white);
    padding: 80px 20px;
    border-radius: 20px;
}

.support-box h3 {
    font-size: 1.7rem;
    margin-bottom: 20px;
}

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

.btn {
    padding: 15px 40px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
}

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

.btn-primary:hover {
    background-color: #d4b069;
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

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

/* Contact Section */
#contact {
    background-color: var(--white);
}

.contact-wrapper {
    display: flex;
    gap: 50px;
}

.contact-info {
    flex: 1;
}

.contact-info h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.contact-info p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-info i {
    color: var(--secondary-color);
    width: 20px;
    text-align: center;
}

.social-links {
    margin-top: 30px;
    display: flex;
    gap: 20px;
}

.social-links a {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
}

.social-links a i {
    color: var(--white);
}

.social-links a:hover {
    background-color: var(--secondary-color);
    transform: translateY(-5px);
}

.contact-map {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    min-height: 300px;
}

/* Footer */
footer {
    background-color: #e60012;
    color: rgb(255, 255, 255);
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--secondary-color);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform: translateY(20px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--primary-color);
    transform: translateY(-5px);
}

/* Animation Utilities */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}

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

/* Mobile only line break */
.br-sp {
    display: none;
}

/* Responsive */
@media (max-width: 1536px) {
    .hero-content {
        margin-left: 16%;
    }
}

@media (max-width: 1440px) {
    .hero-content {
        margin-left: 15%;
    }
}

@media (max-width: 1366px) {
    .hero-content {
        margin-left: 13%;
    }
}

@media (max-width: 1024px) {
    .menu-toggle {
        display: flex;
    }

    .br-sp {
        display: inline;
    }

    .br-pc {
        display: none;
    }

    .logo {
        font-size: 2.5rem;
    }


    nav {
        display: none;
    }

    #hero {
        align-items: flex-end;
        padding-bottom: 10vh;
    }

    .hero-bg {
        background-position: 65% center;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .hero-name {
        font-size: 1.5rem;
    }

    .hero-content {
        margin-left: 20px;
        max-width: 100%;
        padding-right: 20px;
    }

    section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 40px;
    }

    .policy-item,
    .policy-item.reverse {
        flex-direction: column;
        gap: 20px;
    }

    .profile-wrapper {
        flex-direction: column;
        padding: 30px;
    }

    .profile-image img {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        display: block;
    }

    .contact-wrapper {
        flex-direction: column;
    }

    .message-body p {
        text-align: left;
        text-align-last: left;
    }

    .cta-buttons {
        flex-direction: column;
    }
}

@media (max-width: 768px) {

    .logo {
        font-size: 1.5rem;
    }

    .hero-title {
        font-size: 1.7rem;
        margin-bottom: 15px;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .hero-name {
        font-size: 1.2rem;
    }

}