:root {
    --main-bg: #000000;
    --text-color: #ffffff;
    --accent-color: #FFD700; /* Warm Gold */
    --header-footer-bg: rgba(255, 255, 255, 0.5);
    --box-bg: rgba(255, 255, 255, 0.1);
    --box-border-color: rgba(255, 255, 255, 0.2);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sawarabi Gothic', sans-serif;
    background-color: var(--main-bg);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden; /* Prevent vertical scroll on desktop */
}

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

a:hover {
    color: var(--accent-color);
}

ul {
    list-style: none;
}

/* Header and Footer */
header, footer {
    position: fixed;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: var(--header-footer-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0 5%;
    z-index: 100;
    display: flex;
    align-items: center;
}

header {
    top: 0;
    justify-content: space-between;
}

footer {
    bottom: 0;
    justify-content: center;
    font-size: 0.9rem;
}

.site-title {
    font-family: 'Sawarabi Gothic', sans-serif;
    font-size: 1.8rem;
    font-weight: normal;
    color: #c5040c; /* Keep header title red */
    margin: 0; /* Reset margin for flex alignment */
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between logo and title */
}

.logo-img {
    height: 40px;
    width: 40px;
    /* Placeholder styles */
    background-color: rgba(255, 255, 255, 0);
    border-radius: 8px;
}

.desktop-nav ul li {
    display: inline-block;
    margin-left: 30px;
    position: relative; /* For underline pseudo-element */
}

.desktop-nav ul li a {
    font-size: 1rem;
    padding: 5px 0;
    position: relative;
}

/* Smooth Underline Effect */
.desktop-nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px; /* Position just below the link */
    left: 0;
    background-color: #c5040c; /* Keep underline red */
    transition: width 0.4s ease;
}

.desktop-nav ul li a:hover::after,
.desktop-nav ul li a.active::after {
    width: 100%;
}


.desktop-nav ul li a i {
    margin-right: 8px;
    color: #c5040c; /* Keep icon red */
}

/* Active Nav Link Style */
.desktop-nav ul li a.active {
    color: #000000; /* Active text is black */
    font-weight: bold;
}

.mobile-nav ul li a.active {
    color: #c5040c; /* Active mobile text is red */
    font-weight: bold;
}

/* Keep icon color red on active link */
.desktop-nav ul li a.active i,
.mobile-nav ul li a.active i {
    color: #c5040c; /* Keep icon red */
}



/* Main Content & Scrolling */
main {
    height: 100%;
    width: 100%;
    position: relative;
}

.scroll-container {
    display: flex;
    width: 400%; /* 4 sections */
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.scroll-section {
    width: 25%; /* 100% / 4 sections */
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 100px 2%;
    /* background-size and background-position moved to ::before */
}

.scroll-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(5px) brightness(0.7);
    z-index: -1;
}

/* Content Box */
.content-box-container {
    display: flex;
    justify-content: space-around;
    gap: 30px; /* Reduced gap */
    width: 100%;
    max-width: 1800px;
}

.content-box {
    background-color: var(--box-bg);
    border: 1px solid var(--box-border-color);
    border-radius: 15px;
    padding: 30px;
    width: calc((100% - 60px) / 3); /* Adjusted for new gap */
    text-align: center;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Adjust width for sections with 2 boxes */
#contact .content-box {
    width: calc((100% - 30px) / 2); /* Adjusted for new gap */
}

/* Animation for content boxes */
.content-box {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.content-box.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delay */
.content-box:nth-child(1) { transition-delay: 0.1s; }
.content-box:nth-child(2) { transition-delay: 0.2s; }
.content-box:nth-child(3) { transition-delay: 0.3s; }
.content-box:nth-child(4) { transition-delay: 0.4s; } /* Just in case */



.content-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

.content-box-highlight {
    background-color: rgba(255, 255, 255, 0.15);
}

.content-box h2, .content-box h3 {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 20px; /* 少しマージンを広げる */
    font-size: 1.7rem;
}

/* Override for box icons */
.content-box h2 i, .content-box h3 i, .station-info span i, .form-group i {
    color: #f6e6c1; /* Light Steel Blue */
}

.content-box p {
    font-size: 1.2rem;
    line-height: 1.8;
}

/* 会社概要リストのスタイル */
.profile-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
    text-align: left;
}

.profile-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    border-bottom: 1px solid var(--box-border-color);
    transition: background-color 0.3s ease;
}

.profile-list li:last-child {
    border-bottom: none;
}

.profile-list li:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.profile-key {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    color: var(--accent-color);
    flex-shrink: 0; /* キーが縮まないようにする */
    margin-right: 20px;
    font-size: 1.1rem; /* 少し小さめにしてバランスを取る */
}

.profile-value {
    text-align: right;
    line-height: 1.8;
    font-size: 1.2rem;
}

.profile-list .profile-value a {
    color: var(--text-color);
    text-decoration: none;
}

.profile-list .profile-value a:hover {
    color: var(--accent-color);
}

/* Philosophy Section (Mission/Vision/Value) */
.philosophy-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
    text-align: left;
}

.philosophy-list > li {
    padding: 20px 10px;
    border-bottom: 1px solid var(--box-border-color);
    transition: background-color 0.3s ease;
}

.philosophy-list > li:last-child {
    border-bottom: none;
}

.philosophy-list > li:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.philosophy-list h3 {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    color: var(--accent-color);
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.philosophy-list h3 i {
    margin-right: 12px;
    color: #f6e6c1; /* Light Steel Blue, same as other icons */
    width: 20px; /* Align icons */
    text-align: center;
}

.philosophy-list p {
    font-size: 1.1rem;
    line-height: 1.8;
    padding-left: 32px; /* Indent text to align with title text */
}

/* Value List Specifics */
.value-list {
    list-style: none;
    padding-left: 32px; /* Indent list to align with title text */
    font-size: 1.1rem;
    line-height: 1.8;
}

.value-list li {
    padding: 8px 0;
    border-bottom: none;
}

.value-list li:hover {
    background-color: transparent; /* Disable hover on sub-items */
}

.value-list li strong {
    color: var(--text-color);
    margin-right: 8px;
}

/* Google Mapボックスのスタイル */
.content-box-map {
    padding: 0; /* ボックスの余白をなくす */
    overflow: hidden; /* 中のiframeに角丸を適用させるため */
}

.content-box-map iframe {
    display: block; /* iframe下の余分な隙間を消す */
    width: 100%;
    height: 100%;
}

/* accessセクションの幅広マップ（PC表示のみ） */
@media (min-width: 769px) {
    .content-box-map-wide {
        width: calc((100% - 30px) / 3 * 2 + 30px);
    }
}

/* 駅からのアクセス情報 */
.access-info {
    text-align: left;
    margin-top: 20px;
}

.station-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--box-border-color);
}

.station-info strong {
    font-size: 1.25rem;
    color: var(--accent-color);
}

.station-info span {
    display: inline-block;
    margin-top: 10px;
    font-size: 1.2rem;
}

.station-info span i {
    margin-right: 8px;
}

.directions {
    padding-left: 20px;
    line-height: 1.9;
    font-size: 1.2rem;
}

.directions li {
    margin-bottom: 1em;
}

/* 装飾されたボックス内のテキスト調整 */
.content-box-highlight p,
.content-box-highlight .styled-list {
    text-align: left;
}

.content-box-highlight .styled-list {
    margin-top: 20px;
    padding-left: 10px;
}

.content-box-highlight .styled-list li {
    margin-bottom: 1.2em;
    line-height: 1.7;
}

/* リスト内のタイトル（太字）のスタイル */
.content-box-highlight .styled-list li strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color);
    font-size: 1.05rem;
}

/* 冒頭のリード文（太字）のスタイル */
.content-box-highlight > p > strong {
    display: block;
    text-align: center; /* リード文のみ中央揃えを維持 */
    font-size: 1.1rem;
    margin-bottom: 1em;
}

@media (min-width: 769px) {
    /* #home .content-box の固定高さを削除し、flexboxの自動高さ調整に任せる */
}

/* スクロール可能なボックスのスタイル */
.content-box-scrollable {
    position: relative; /* 子要素を絶対配置するための基準点 */
    padding: 0; /* 内側のpaddingはscroll-innerに任せる */
}

.scroll-inner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto; /* この要素の中身だけをスクロールさせる */
    padding: 30px; /* 元のcontent-boxのpaddingをこちらに移動 */
}

/* Webkit系ブラウザのスクロールバーのスタイル */
.scroll-inner::-webkit-scrollbar {
    width: 8px;
}

.scroll-inner::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.scroll-inner::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.scroll-inner::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Focus styles for accessibility */
:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Focus styles for specific elements */
.desktop-nav ul li a:focus,
.mobile-nav ul li a:focus,
.desktop-nav ul li a:active,
.mobile-nav ul li a:active {
    outline: none;
}

.hamburger-menu:focus {
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.submit-button:focus {
    outline: 2px solid var(--text-color);
    outline-offset: 2px;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--accent-color);
    color: var(--text-color);
    padding: 8px;
    text-decoration: none;
    border-radius: 3px;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Keyboard navigation improvements */
.desktop-nav ul li a {
    position: relative;
    display: inline-block;
    padding: 8px 4px;
    margin: 0 2px;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.desktop-nav ul li a:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Apply consistent text styles within scrollable boxes */
.content-box-scrollable .scroll-inner p,
.content-box-scrollable .scroll-inner .styled-list {
    text-align: left;
    font-size: 1.1rem;
    line-height: 1.9;
}

.content-box-scrollable .scroll-inner .styled-list {
    margin-top: 1.2em;
    margin-bottom: 1.2em;
    padding-left: 15px;
}

.content-box-scrollable .scroll-inner .styled-list li {
    margin-bottom: 1em;
}


/* Hamburger Menu & Mobile Nav */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 101;
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateY(-100%);
    transition: transform 0.5s ease-in-out;
    z-index: 99;
}

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

.mobile-nav ul li {
    margin: 30px 0;
    text-align: center;
}

.mobile-nav ul li a {
    font-size: 2rem;
}

.mobile-nav ul li a i {
    margin-right: 15px;
    width: 30px; /* アイコンの幅を固定してテキストの整列を補助 */
    text-align: center;
    color: #c5040c; /* Keep icon red */
}


/* Tablet specific styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .content-box-container {
        gap: 20px;
        max-width: 900px;
    }
    
    .content-box {
        padding: 25px;
        width: calc((100% - 40px) / 3);
    }
    
    .content-box h2, .content-box h3 {
        font-size: 1.5rem;
    }
    
    .content-box p {
        font-size: 1.1rem;
    }
    
    .profile-key {
        font-size: 1rem;
    }
    
    .profile-value {
        font-size: 1.1rem;
    }
    
    .site-title {
        font-size: 1.6rem;
    }
    
    .desktop-nav ul li {
        margin-left: 20px;
    }
    
    .desktop-nav ul li a {
        font-size: 0.9rem;
    }
    
    .scroll-section {
        padding: 90px 3%;
    }
    
    #contact .content-box {
        width: calc((100% - 20px) / 2);
    }
    
    .content-box-map-wide {
        width: calc((100% - 20px) / 3 * 2 + 20px);
    }
}

/* Responsive (Mobile) */
@media (max-width: 768px) {
    body {
        height: auto; /* Allow body to grow with content */
        overflow: auto; /* Enable vertical scroll */
    }

    header {
        padding: 0 5%;
        height: 60px;
    }
    
    footer {
        height: 60px;
    }

    .site-title {
        font-size: 1.5rem;
    }

    .desktop-nav {
        display: none;
    }

    .hamburger-menu {
        display: block;
        position: relative;
        width: 30px;
        height: 20px;
    }

    .bar {
        display: block;
        width: 100%;
        height: 3px;
        background-color: var(--text-color);
        border-radius: 3px;
        position: absolute;
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, top 0.3s ease-in-out;
    }

    .bar:nth-child(1) {
        top: 0;
    }

    .bar:nth-child(2) {
        top: 50%;
        transform: translateY(-50%);
        background: repeating-linear-gradient(to right, red 0, red 2px, transparent 2px, transparent 4px);
        background-color: transparent; /* 背景色を透明に */
    }

    .bar:nth-child(3) {
        top: 100%;
        transform: translateY(-100%);
    }

    .hamburger-menu.active .bar:nth-child(1) {
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
    }

    .hamburger-menu.active .bar {
        background-color: #c5040c; /* 閉じるボタンの色を赤に */
    }

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

    .hamburger-menu.active .bar:nth-child(3) {
        top: 50%;
        transform: translateY(-50%) rotate(-45deg);
    }


    .scroll-container {
        display: block;
        width: 100%;
        height: auto;
    }

    .scroll-section {
        width: 100%;
        height: auto;
        min-height: 100vh; /* Full viewport height for each section */
        flex-direction: column;
        padding: 100px 20px 80px; /* モバイル用に左右の余白を調整 */
    }

    .content-box-container {
        flex-direction: column;
        gap: 30px;
        width: 100%;
    }

    .content-box {
        min-width: 0;
        width: 100%;
    }

    /* PC用のスクロール設定をモバイルでリセット */
    .content-box-scrollable {
        position: static;
        padding: 30px; /* 元のpaddingに戻す */
    }

    .scroll-inner {
        position: static;
        overflow-y: visible;
        padding: 0;
    }

    /* モバイル表示でマップの高さを確保 */
    .content-box-map {
        height: 400px;
    }

    /* Ensure contact boxes are full-width on mobile */
    #contact .content-box {
        width: 100%;
    }
}

/* Contact Form Styles */
.content-box-form h3 {
    margin-bottom: 10px;
}

.form-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
    text-align: center;
}

.contact-form {
    width: 100%;
}

.form-group {
    position: relative;
    margin-bottom: 25px;
}

.form-group i {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--box-border-color);
    transition: color 0.3s;
}

.form-group label {
    position: absolute;
    top: 50%;
    left: 45px;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    pointer-events: none;
    transition: all 0.3s ease;
}

.form-group .required {
    color: var(--accent-color);
    margin-left: 5px;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px 15px 15px 45px; /* Left padding for icon */
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--box-border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1.1rem;
    font-family: 'Sawarabi Gothic', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group textarea {
    padding-top: 15px;
    resize: vertical;
    min-height: 150px;
}

/* Adjust label for textarea */
.form-group textarea + label {
    top: 25px;
    transform: translateY(0);
}

/* Floating label and icon color change on focus/filled */
.form-group input:focus,
.form-group textarea:focus,
.form-group input:not(:placeholder-shown),
.form-group textarea:not(:placeholder-shown) {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.form-group input:focus + label,
.form-group textarea:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -10px;
    left: 10px;
    font-size: 0.9rem;
    color: var(--accent-color);
    background-color: #1a1a1a; /* Match the content-box inner bg */
    padding: 0 5px;
}

.form-group input:focus ~ i,
.form-group textarea:focus ~ i,
.form-group input:not(:placeholder-shown) ~ i,
.form-group textarea:not(:placeholder-shown) ~ i {
    color: var(--accent-color);
}

.submit-button {
    display: block;
    width: 100%;
    padding: 15px;
    margin-top: 10px;
    background-color: var(--accent-color);
    border: none;
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.submit-button:hover {
    background-color: #b89456; /* Darker gold for hover */
    transform: translateY(-2px);
}

/* Disabled state for submit button */
.submit-button:disabled {
    background-color: #555;
    cursor: not-allowed;
    transform: none;
}

/* Checkbox for privacy consent */
.form-group-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.form-group-checkbox input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color); /* チェックマークの色をアクセントカラーに */
}

.form-group-checkbox label {
    color: rgba(255, 255, 255, 0.8);
}

.form-group-checkbox .privacy-link {
    color: var(--accent-color);
    text-decoration: none;
    cursor: default;
}

/* Mobile-only styles for the privacy link */
@media (max-width: 768px) {
    .form-group-checkbox .privacy-link {
        text-decoration: underline;
        cursor: pointer;
    }

    .form-group-checkbox .privacy-link:hover {
        color: #fff;
    }
}

/* Optional label style */
.form-group .optional {
    color: #aaa;
    font-size: 0.9rem;
    margin-left: 5px;
}

/* Header/Footer Black Text Override */
footer,
.desktop-nav ul li a,
.hamburger-menu {
    color: #000000;
}

.bar {
    background-color: #000000;
}

/* Remove unused/redundant styles */
.content-box:nth-child(4) { 
    transition-delay: 0.4s; 
}

/* Improve contrast for better accessibility */
.form-group input:focus,
.form-group textarea:focus {
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.5);
    border-color: var(--accent-color);
}

/* Smooth animations */
.content-box,
.desktop-nav ul li a,
.hamburger-menu {
    transition: all 0.3s ease;
}

/* Google reCAPTCHA */
.grecaptcha-badge {
    visibility: hidden;
}

/* Print styles */
@media print {
    .hamburger-menu,
    .mobile-nav,
    .desktop-nav,
    .skip-link {
        display: none;
    }
    
    .content-box {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .scroll-section {
        page-break-before: always;
    }
    
    .scroll-section:first-child {
        page-break-before: avoid;
    }
}

/* Custom override for policy box h3 color */
.policy-box .philosophy-list h3,
.policy-box .philosophy-list h3 i {
    color: var(--text-color);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-container {
        transition: none !important;
    }
    
    .content-box {
        transition: none !important;
    }
}