:root {
    --sakura: #EDACA6;
    --gold: #AD844E;
    --navy: #122436;
    --cherry-light: #FFDDD6;
    --header-height: 80px;
    --mincho: 'Zen Old Mincho', serif;
    --gothic: 'Zen Kaku Gothic New', sans-serif;
}

body {
    margin: 0;
    font-family: var(--gothic);
    color: var(--dark-brown);
    line-height: 1.6;
    background-color: var(--cherry-light);
}

/* 見出しに明朝体を適用 */
h1, h2, h3, .section-title {
    font-family: var(--mincho);
}

/* Header Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.header-logo {
    height: 30px;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--dark-brown);
    text-decoration: none;
    font-size: 0.9rem;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--cherry-blossom);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* モバイルナビゲーション用のスタイル */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--sakura); /* 白から桜色に変更 */
    margin: 5px 0;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* モバイルナビゲーション */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: right 0.3s ease-in-out;
    padding: 5rem 2rem 2rem;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-nav-link {
    color: var(--navy);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    transition: color 0.3s ease; /* ホバーエフェクトのアニメーション */
}

.mobile-nav-link:hover {
    color: var(--sakura); /* ホバー時の色を桜色に */
}

/* オーバーレイの透明度も若干調整 */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.3);
    z-index: 900;  /* z-indexを調整 */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none; /* 初期状態ではクリックを通過 */
}

.overlay.active {
    opacity: 1;
    pointer-events: auto; /* アクティブ時のみクリックを有効に */
}

.mobile-nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.mobile-nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    overflow: hidden;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
                url('../img/back1.jpg') no-repeat center center;
    background-size: cover;
    margin-top: var(--header-height);
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 80%;
    max-width: 1200px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-logo {
    width: 200px;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

/* Common Section Styles */
.section {
   padding: 6rem 1rem;
}

.section:nth-child(even) {
    background-color: white;
}

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

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--cherry-blossom);
}

/* About Section */
#about {
    padding: 4rem 0;
    background-color: var(--cherry-light);
}

.about-content {
    background: white;
    padding: 4rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 1000px;
    margin: 0 auto;
}

.name-origin,
div[style*="max-width:650px"] {
    max-width: 800px;
    margin: 0 auto;
}

.about-label {
    text-align: center;
    color: var(--navy);
    font-family: var(--mincho);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
}

.company-name {
    color: var(--navy);
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    text-align: center;
    font-family: var(--mincho);
    letter-spacing: 0.1em;
    line-height: 1.8;
}

.company-name-en {
    text-align: center;
    color: var(--gold);
    font-size: 0.9rem;
    margin-bottom: 3rem;
    letter-spacing: 0.05em;
}

.name-origin {
    text-align: justify;
    line-height: 2;
    font-size: 0.95rem;
    margin-bottom: 3.5rem;
    padding: 0 1rem;
}

.highlight {
    color: var(--sakura);
    font-weight: 500;
}

.company-info-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2.5rem;
    margin-bottom: 1.5rem;
}

.office-photo {
    border-radius: 4px;
    overflow: hidden;
    width: 300px;
}

.office-photo img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.company-info {
    font-size: 0.9rem;
    line-height: 1.8;
}

.info-row {
    display: grid;
    grid-template-columns: 70px 1fr;
    margin-bottom: 0.7rem;
    align-items: start;
    padding: 0.7rem 0;
    border-bottom: 1px solid #eee;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row dt {
    font-weight: 500;
    color: var(--navy);
}

.info-row dd {
    margin: 0;
    line-height: 1.8;
}

.map {
    height: 180px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}

.map iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Mission Section */
#mission {
    position: relative;
    background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
                url('../img/fa02.jpg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
}

.mission-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    z-index: 2;
}

/* Vision Content */
.vision-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
}

.vision-content h3,
.mission-content h3 {
    color: var(--navy);
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
    font-weight: bold;
    font-family: var(--mincho);
}

.vision-flex {
    display: flex;
    gap: 3rem;
    margin: 2rem 0;
    align-items: start;
}

.vision-text {
    flex: 1;
    line-height: 2;
}

.vision-image {
    flex: 1;
}

.vision-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.vision-main {
    font-family: var(--mincho);
    font-size: 1.4rem;
    color: var(--sakura);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.vision-sub {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--navy);
}

/* Mission Content */
.mission-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.mission-flex {
    display: flex;
    flex-direction: row-reverse;
    gap: 3rem;
    margin: 2rem 0;
    align-items: start;
}

.mission-text {
    flex: 1;
}

.mission-image {
    flex: 1;
}

.mission-photo {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.mission-item {
    margin-bottom: 2rem;
}

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

.mission-item h4 {
    color: var(--gold);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.mission-item p {
    margin: 0;
    line-height: 1.6;
    color: var(--navy);
}

/* Premium Service */
.premium-service {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(237, 172, 166, 0.1);
    border-radius: 4px;
    border-left: 4px solid var(--sakura);
}

.premium-service h4 {
    color: var(--gold);
    margin-top: 0;
    margin-bottom: 1rem;
}


/* Services Section */
#services {
    background-color: var(--cherry-light);
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 基本は2カラム */
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card h3 {
    color: var(--navy);
    margin-bottom: 1rem;
    font-family: var(--mincho);
}

.service-icon {
    margin-bottom: 1.5rem;
}

.custom-icon {
    width: 80px; /* アイコンのサイズ調整 */
    height: 80px;
    object-fit: contain;
}

.publications {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.publications h4 {
    color: var(--navy);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.publications-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.publication-item {
    display: flex;
    gap: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.publication-item:hover {
    transform: translateY(-5px);
}

.publication-item img {
    width: 120px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.publication-info h5 {
    font-size: 1rem;
    color: var(--navy);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.publication-info p {
    font-size: 0.9rem;
    color: #666;
}

.media-card {
    grid-column: 1 / -1; /* カードを横幅いっぱいに */
}

.publications {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.publications h4 {
    color: var(--navy);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    font-family: var(--mincho);
}

.publications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    align-items: start;
}

.publication-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.publication-item img {
    width: 140px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.publication-info {
    flex: 1;
}

.publication-info h5 {
    font-size: 1.1rem;
    color: var(--navy);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.publication-info p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.8rem;
}

.publication-link {
    display: inline-block;
    color: var(--sakura);
    text-decoration: none;
    font-size: 0.9rem;
    position: relative;
}

.publication-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .publications-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .publication-item img {
        width: 100px;
    }

    .custom-icon {
        width: 60px; /* モバイルでのアイコンサイズ */
        height: 60px;
    }

    .services-grid {
        grid-template-columns: 1fr; /* モバイルでは1カラム */
    }

    .media-card {
        grid-column: auto; /* モバイルでは通常の幅に戻す */
    }

    .publication-item {
        gap: 1rem;
    }
}

/* Contact Section */
.contact-section {
    background: white;
    padding: 4rem 2rem;
    text-align: center;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.qr-code {
    width: 200px;
    height: 200px;
    margin: 2rem auto;
}

.contact-text {
    font-size: 1.1rem;
    margin: 1rem 0;
    color: var(--dark-brown);
}

.line-id {
    font-size: 1.2rem;
    font-weight: bold;
    color: #06C755;
    margin: 1rem 0;
}

/* Footer Styles */
.footer {
    background-color: var(--cherry-light);
    padding: 2rem 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.footer-content {
    text-align: center;
}

.footer-logo {
    height: 40px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.footer-text {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--dark-brown);
}

.footer-copyright {
    margin: 0.5rem 0;
    font-size: 0.8rem;
    color: #555;
}

.scroll-down {
    position: absolute;
    bottom: 3rem; /* PCでの位置をやや下に調整（元は 2rem + header-height） */
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: bounce 2s infinite;
    cursor: pointer;
    z-index: 2; /* 確実に見えるように */
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-20px) translateX(-50%);
    }
    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

/* Media Queries */
@media (max-width: 768px) {
    /* Header & Navigation */
    .section {
      position: relative;
      z-index: 1;
    }

    .header {
        display: none;
    }

    .hero {
         margin-top: 0;
         background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
                     url('../img/back1_mb.jpg') no-repeat center center;
         background-size: cover;
     }

    /* Mobile Navigation */
    .mobile-nav-toggle {
        display: block;
        z-index: 1001; /* 最前面 */
    }

    .mobile-nav {
        display: block;
        z-index: 1000; /* ハンバーガーメニューの下 */
    }

    .overlay {
        display: block;
        z-index: 900; /* ナビゲーションの下 */
    }
    /* コンテンツ要素がオーバーレイの下に */
    .hero,
    .about-content,
    .vision-content,
    .mission-content,
    .services-grid,
    .contact-content,
    .footer {
        position: relative;
        z-index: 1;
    }

    /* スクロールダウン矢印 */
    .scroll-down {
        position: absolute;
        bottom: 7rem;
        z-index: 2;
    }

    /* Hero Section */
    .hero-logo {
        width: 150px;
    }
    .hero-content h1 {
        font-size: 1.5rem;
        line-height: 1.8;
    }
    .scroll-down {
        bottom: 7rem; /* モバイルでの位置を上に調整（元は 1rem） */
        font-size: 1.5rem;
    }

    /* About Section */
    .about-content {
        padding: 2rem;
        margin: 0 1rem;
    }

    .name-origin {
        padding: 0;
        font-size: 0.9rem;
    }

    .company-name {
        font-size: 1.4rem;
    }

    .company-info-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .office-photo {
        width: 100%;
    }

    .map {
        height: 150px;
    }

    /* Mission Section */
    #mission {
        position: relative;
        background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
                    url('../img/fa02_mb.jpg') no-repeat center center fixed; /* モバイル用画像のパスを修正 */
        background-size: cover;
        background-attachment: scroll; /* モバイルでは fixed を scroll に変更 */
    }

    .mission-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .vision-flex,
    .mission-flex {
        flex-direction: column;
        gap: 2rem;
    }

    .mission-image {
        order: -1;
    }

    .vision-content,
    .mission-content {
        padding: 2rem;
    }

    .vision-main {
        font-size: 1.2rem;
    }

    .mission-content h3 {
        font-size: 1.4rem;
    }
    /* コンテンツ要素のz-indexを上げる */
    .mission-content,
    .vision-content {
      position: relative;
      z-index: 1;
    }

    /* Services Section */
    .services-grid {
        grid-template-columns: 1fr;
    }

    .media-card {
        grid-column: auto;
    }

    .custom-icon {
        width: 60px;
        height: 60px;
    }

    /* Publications */
    .publications-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .publication-item {
        gap: 1rem;
    }

    .publication-item img {
        width: 120px;
    }

    /* Footer */
    .footer-logo {
        height: 30px;
    }
}

/* PC表示時の改行制御 */
.pc {
  display: inline; /* モバイル用を表示 */
}
.mb {
    display: none; /* モバイル用を非表示 */
}

/* モバイル表示時の改行制御 */
@media (max-width: 768px) {
    .pc {
        display: none; /* PC用の非表示 */
    }

    .mb {
        display: inline; /* モバイル用を表示 */
    }
}

/* ブロックごとのフェードイン */
/* フェードイン用の基本スタイル */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* アニメーション実行時のスタイル */
.fade-in.active {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}

/* ディレイを付けたバリエーション */
.fade-in-delay-1 {
    transition-delay: 0.2s;
}

.fade-in-delay-2 {
    transition-delay: 0.8s;
}

.fade-in-delay-3 {
    transition-delay: 1.6s;
}
