/* Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

:root {
    --primary-color: #000000;
    --background-color: #ffffff;
    --text-color: #333333;
    --blue-accent: #00B3FF;
    --pastel-blue: #d8f0fa;
    --light-green: #e0f4e0;
    --gray-bg: #f9f9f9;
    --border-color: #dddddd;
    --font-main: 'Noto Sans JP', sans-serif;
    --font-heading: 'ta-fuga-fude', 'Noto Sans JP', serif;
}

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

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Utilities */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
}

.text-block {
    flex: 1;
    min-width: 300px;
}

.half-width {
    flex: 1;
    min-width: 250px;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-4 { margin-top: 40px; }
.mb-2 { margin-bottom: 20px; }
.mb-4 { margin-bottom: 40px; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.inline-block { display: inline-block; }
.justify-center { justify-content: center; }

/* Mockup Elements */
.pastel-blue {
    background-color: var(--pastel-blue);
    border: 1px solid #bce2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #666;
    font-weight: 500;
}

.light-green {
    background-color: var(--light-green);
    border: 1px solid #c8e8c8;
}

.mockup-text {
    color: #999;
    line-height: 1.5;
    word-break: break-all;
}

div.image-block {
    flex: 0 0 300px;
    min-height: 250px;
    border-radius: 4px;
}

img.image-block {
    flex: 0 0 300px;
    width: 300px;
    height: 250px;
    border-radius: 4px;
    background-color: transparent;
    border: none;
    padding: 0;
    object-fit: cover;
}

/* Enlarge specific images */
#classes p,
#info p,
#admission p {
    text-align: justify;
}

#about div.image-block,
#kids-class div.image-block,
#general-class div.image-block {
    flex: 0 0 360px;
    min-height: 264px;
}
#about img.image-block,
#kids-class img.image-block,
#general-class img.image-block {
    flex: 0 0 360px;
    width: 360px;
    height: 264px;
}

div.leader-img {
    flex: 0 0 350px;
    min-height: 260px;
}
.leader-img-wrapper {
    flex: 0 0 350px;
    height: 250px;
}

/* Align images with paragraph text below h3 on desktop */
@media (min-width: 769px) {
    #about img.image-block,
    #kids-class img.image-block,
    #general-class img.image-block {
        margin-top: 48px;
    }
}

img.admission-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    margin-bottom: 0;
}

.images-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 0 0 45%; 
    min-width: 250px;
}

.map-block {
    flex: 1;
    min-width: 300px;
    height: 350px;
    border-radius: 4px;
    overflow: hidden;
}

#access .content-flex {
    align-items: center; 
}

.info-row {
    display: flex;
    margin-bottom: 12px;
}
.info-label {
    width: 90px;
    font-weight: bold;
    flex-shrink: 0;
}
.info-value {
    flex: 1;
}

.section-divider {
    border: none;
    border-top: 1px solid #ccc;
    margin: 40px 0;
}

.title-line {
    border: none;
    border-top: 1px solid #ccc;
    margin-bottom: 15px;
    margin-top: 5px;
}

/* Header & Navigation */
#top {
    height: 600px;
    background-image: url('images/Photo⑦.png');
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 40px;
    width: 100%;
    background-color: transparent; /* removed white background */
    padding: 20px;
    border-radius: 10px;
}

.header-logo {
    width: 150px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 20px rgba(255, 255, 255, 0.9));
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 40px;
    line-height: 1.4;
    color: #111;
    text-align: left;
    font-weight: normal;
    text-shadow: 0 0 10px rgba(255,255,255,1), 0 0 20px rgba(255,255,255,1), 0 0 30px rgba(255,255,255,1);
}

/* Nav Bar Below Header */
.navbar {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 50px;
    transition: max-height 0.3s ease;
}

.nav-links a {
    font-size: 16px;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--blue-accent) !important;
}

.nav-main {
    font-weight: 500;
    color: var(--blue-accent) !important;
}

.nav-sub {
    font-size: 14px;
    color: #555 !important;
}

.nav-icon {
    font-size: 0.6em;
    vertical-align: middle;
    margin-right: 4px;
    display: inline-block;
    transform: translateY(-1px);
}

/* Dropdown Styles */
.nav-item-dropdown {
    position: relative;
}

@media (min-width: 769px) {
    .dropdown-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #ffffff;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        padding: 10px 0;
        min-width: 250px;
        z-index: 1000;
        border-radius: 4px;
        border: 1px solid #eee;
    }
    
    .nav-item-dropdown:hover .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu li {
        margin: 0;
        list-style: none;
    }
    
    .dropdown-menu a {
        display: block;
        padding: 10px 20px;
        font-size: 14px;
    }

    .dropdown-menu a:hover {
        background-color: #f9f9f9;
        color: var(--blue-accent) !important;
    }
}

@media (max-width: 768px) {
    .navbar {
        position: static;
    }
    .nav-links li, .nav-item-dropdown, .dropdown-menu {
        display: contents;
    }
}


/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
}

/* Sections */
.section-container {
    padding: 60px 0;
    border-top: 1px solid #eee;
    position: relative;
}

.section-container:first-child {
    border-top: none;
    padding-top: 40px;
}

.section-title {
    font-family: var(--font-main);
    font-size: 22px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.blue-box {
    display: inline-block;
    width: 5px;
    height: 18px;
    background-color: var(--blue-accent);
}

h3 {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    color: #222;
}

.border-bottom {
    border-bottom: 2px solid #eee;
}

h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #444;
}

p {
    margin-bottom: 15px;
}

.back-to-top-wrapper {
    display: none;
}

.back-to-top {
    font-size: 14px;
    color: var(--blue-accent);
}

.back-to-top:hover {
    text-decoration: underline;
}

/* Contact Form */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    display: flex;
    margin-bottom: 20px;
    align-items: center;
}

.form-group-textarea {
    align-items: flex-start;
}

.form-group label {
    width: 150px;
    text-align: right;
    padding-right: 20px;
    font-weight: 500;
}

.form-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
}

.half-width-desktop input {
    max-width: 50%;
}

.form-group-textarea textarea {
    flex: 1;
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
}

.btn-submit {
    background-color: #00B3FF;
    color: white;
    border: none;
    padding: 12px 60px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: bold;
}

.btn-submit:hover {
    background-color: #0099e6;
}

/* Contact Banners */
.banner-wrap {
    gap: 20px;
}

.banner-line, .banner-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 320px;
    height: 80px;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.3s;
    gap: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.banner-line {
    background-color: #4CAF50;
    color: white;
}

.line-icon i {
    font-size: 40px;
}

.line-text {
    font-size: 18px;
    font-weight: bold;
}

.banner-phone {
    background-color: #2c68cd;
    color: white;
}

.phone-icon i {
    font-size: 40px;
}

.phone-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.phone-number {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 1px;
}

.phone-sub {
    font-size: 14px;
}

.banner-line:hover, .banner-phone:hover {
    opacity: 0.8;
}

.campaign-banner {
    width: 40%;
    height: auto;
    display: inline-block;
    border-radius: 5px;
}

.bottom-banners-grid {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    justify-content: center;
    gap: 15px;
    max-width: 850px;
    margin: 0 auto;
}

.bottom-banner {
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.bottom-banner img {
    height: 120px;
    width: auto;
    border-radius: 5px;
    border: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Sitemap Box */
.sitemap-box {
    padding: 20px 0;
    font-size: 16px;
    border-top: 1px solid #eee;
}

.sitemap-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.sitemap-logo {
    display: block;
    margin-right: 30px; /* Space between logo and links */
    flex-shrink: 0; /* Prevent logo from shrinking */
}

.sitemap-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: opacity 0.3s;
}

.sitemap-logo:hover img {
    opacity: 0.7;
}

.sitemap-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 15px 30px; 
    flex: 1;
}

.sitemap-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sitemap-sub-group {
    display: flex;
    align-items: center;
    gap: 5px; 
}

.sitemap-item {
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}

.sitemap-sub {
    color: #666;
    white-space: nowrap;
}

.sitemap-sep {
    color: #ccc;
    margin: 0 2px;
}

/* Floating Back to Top Button */
.floating-back-to-top {
    position: fixed;
    bottom: 60px;
    right: 60px;
    width: 50px;
    height: 50px;
    background-color: #00B3FF;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px); /* Initial position for slide animation */
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s;
    z-index: 1000;
}

.floating-back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* Slide up to original position */
}

.floating-back-to-top:hover {
    background-color: #0099e6;
    color: white;
}

/* Responsive */
@media (max-width: 1024px) {
    .form-group {
        flex-direction: column;
        align-items: flex-start;
    }
    .form-group label {
        text-align: left;
        margin-bottom: 5px;
        width: 100%;
    }
    .form-group input, .form-group-textarea textarea {
        width: 100%;
        flex: auto;
    }
    .half-width-desktop input {
        max-width: 100%;
    }
    .contact-form {
        width: 100%;
    }
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 0;
    }

    #top {
        height: 600px;
        align-items: flex-end;
        padding-bottom: 20px;
        background-size: 300% auto;
        background-position: 53% 60%;
        background-repeat: no-repeat;
    }

    .hero-content {
        flex-direction: column;
        gap: 20px;
        justify-content: center;
        width: 100%;
    }
    .hero-title {
        text-align: center;
    }
    .content-flex {
        flex-direction: column;
    }
    .content-flex.reverse-on-mobile {
        flex-direction: column-reverse;
    }
    .text-block {
        width: 100%;
        min-width: 100%;
        padding-right: 0;
    }
    
    img.leader-img {
        width: 100%;
        height: auto;
        flex: auto;
    }
    .leader-img-wrapper {
        width: 100%;
        min-height: 250px;
        flex: auto;
    }

    .map-block {
        width: 100%;
        flex: auto;
        height: 350px;
    }
    .images-column {
        width: 100%;
        flex: auto;
    }
    
    #about img.image-block,
    #kids-class img.image-block,
    #general-class img.image-block {
        width: 100%;
        height: auto;
        flex: auto;
    }

    img.admission-img {
        width: 100%;
    }
    
    .campaign-banner {
        width: 100%;
        max-width: 360px;
    }

    .bottom-banners-grid {
        grid-template-columns: max-content;
    }
    
    /* Mobile Menu */
    .menu-toggle {
        display: none;
    }
    .nav-links {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 20px;
        padding: 15px 20px;
    }
    
    /* Contact Banners Mobile */
    .banner-wrap {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .banner-line, .banner-phone {
        width: 100%;
        max-width: 400px;
    }

    /* Sitemap Mobile */
    .sitemap-container {
        flex-direction: column;
        justify-content: center;
    }
    .sitemap-logo {
        position: static;
        margin-right: 0;
        margin-bottom: 15px;
    }
    .sitemap-logo img {
        width: 120px;
        height: 120px;
    }
    .sitemap-line {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 20px;
    }
    .sitemap-group {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .floating-back-to-top {
        bottom: 40px;
        right: 40px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}
