@import url('https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@400;500;700&family=Zen+Maru+Gothic:wght@400;700&display=swap');

/* Komorebi Design System - Warm & Handcrafted */
:root {
    --color-bg: #f5faff;
    /* Fresh Light Blue */
    --color-text: #1a252f;
    /* Deep Navy */
    --color-accent: #4a90e2;
    /* Clear Blue */
    --color-sub: #546e7a;
    /* Blue Gray */
    --color-white: #ffffff;

    --font-mincho: 'Shippori Mincho', serif;
    --font-maru: 'Zen Maru Gothic', sans-serif;

    --container-width: 1100px;
    --transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-mincho);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 2.0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Texture Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,%3Csvg width="200" height="200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noise)" opacity="0.04"/%3E%3C/svg%3E');
    pointer-events: none;
    z-index: 9999;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
}

/* Utilities */
.tategaki {
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.3em;
}

.section {
    padding: 120px 0;
}

/* Floating Elements */
.float-card {
    background: var(--color-white);
    padding: 40px;
    border-radius: 40px;
    box-shadow: 15px 15px 0 rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Typography Classes */
.shippori {
    font-family: var(--font-mincho);
}

.zen-maru {
    font-family: var(--font-maru);
}

.accent-text {
    color: var(--color-accent);
    font-weight: 700;
}

/* Global Layout Adjustments for Fixed Header */
main>.section:first-child,
main>.hero:first-child {
    padding-top: 240px !important;
    /* Visual clearance for vertical logo on PC */
}

@media (max-width: 768px) {

    main>.section:first-child,
    main>.hero:first-child {
        padding-top: 120px !important;
        /* Clearance for horizontal header on mobile */
    }
}

/* Header & Nav */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem 40px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.logo-v {
    font-size: 1.4rem;
    font-weight: 700;
    writing-mode: vertical-rl;
    letter-spacing: 0.4em;
    line-height: 1;
    white-space: nowrap;
}

/* Nav Toggle & Link Styles */
.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
}

.btn-contact {
    padding: 10px 25px;
    background: var(--color-text);
    color: #fff !important;
    border-radius: 50px;
    font-size: 0.8rem;
    display: inline-block;
    white-space: nowrap;
}

.nav-h {
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-h a {
    font-family: var(--font-maru);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-sub);
    position: relative;
    padding-bottom: 5px;
}

.nav-h a:hover,
.nav-h a.active {
    color: var(--color-text);
}

/* Company Page Components */
.company-empathy-box {
    background: #fdfbf7;
    padding: 50px;
    border-radius: 40px;
    border: 1px solid #eee;
}

.company-partner-card {
    padding: 40px;
    border-radius: 40px;
    background: #fff !important;
}

.company-partner-tag {
    display: inline-block;
    background: #eee;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

/* Link Card Interaction */
a.info-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

a.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08) !important;
}

/* Empathy Block Flex Layout */
.company-empathy-flex {
    display: flex;
    gap: 40px;
    align-items: stretch;
}

.company-empathy-flex .company-empathy-box {
    flex: 1.2;
}

.company-empathy-image {
    flex: 0.8;
    border-radius: 40px;
    overflow: hidden;
}

.company-empathy-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 900px) {
    .company-empathy-flex {
        flex-direction: column;
    }

    .company-empathy-image {
        height: 300px;
    }
}

.article-content h2 {
    font-size: 1.6rem;
    border-bottom: 1px solid var(--color-text);
    padding-bottom: 10px;
    margin: 60px 0 30px;
}

.article-content h3 {
    font-size: 1.3rem;
    margin: 40px 0 20px;
    color: var(--color-accent);
}

.article-content p {
    margin-bottom: 30px;
}

.article-content img {
    max-width: 100%;
    border-radius: 4px;
    margin: 20px 0;
}

.news-list {
    border-top: 1px solid #d6ccc2;
}

.news-item {
    border-bottom: 1px solid #eee;
    padding: 40px 0;
}

.news-link {
    display: flex;
    align-items: baseline;
    gap: 40px;
}

.news-date {
    font-size: 0.85rem;
    color: var(--color-sub);
    width: 120px;
    flex-shrink: 0;
}

.news-category {
    font-size: 0.7rem;
    background: #f7f3e8;
    color: var(--color-accent);
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: inline-block;
}

.news-title {
    font-size: 1.2rem;
    font-weight: 500;
}

@media (max-width: 768px) {

    /* Responsive Fonts */
    h1,
    .h1 {
        font-size: calc(1.8rem + 1vw) !important;
    }

    h2,
    .h2 {
        font-size: calc(1.5rem + 1vw) !important;
    }

    h3,
    .h3 {
        font-size: calc(1.2rem + 1vw) !important;
    }

    /* Tategaki Reset - Only keep for Hero */
    .tategaki:not(.hero-content) {
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
        letter-spacing: 0.05em !important;
        text-align: left !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        display: block !important;
    }

    /* Adjust items inside reset tategaki */
    .tategaki:not(.hero-content) h2,
    .tategaki:not(.hero-content) h3,
    .tategaki:not(.hero-content) p {
        margin-left: 0 !important;
        margin-right: 0 !important;
        text-align: left !important;
    }

    /* Hero Tategaki Adjustment */
    .hero-content.tategaki {
        font-size: min(0.95rem, 2.2vh);
    }

    .hero-title {
        font-size: min(calc(1.4rem + 1.5vh), 1.8rem) !important;
    }

    .section {
        padding: 60px 0;
    }

    .container {
        padding: 0 20px;
    }

    .float-card {
        padding: 30px 20px;
    }

    .nav-toggle-label {
        display: block;
        cursor: pointer;
        padding: 10px;
        z-index: 1001;
    }

    .nav-toggle-label span,
    .nav-toggle-label span::before,
    .nav-toggle-label span::after {
        display: block;
        background: var(--color-text);
        height: 2px;
        width: 22px;
        border-radius: 2px;
        position: relative;
        transition: all 0.3s;
    }

    .nav-toggle-label span::before,
    .nav-toggle-label span::after {
        content: '';
        position: absolute;
    }

    .nav-toggle-label span::before {
        bottom: 7px;
    }

    .nav-toggle-label span::after {
        top: 7px;
    }

    /* Open State */
    .nav-toggle:checked~.nav-toggle-label span {
        background: transparent;
    }

    .nav-toggle:checked~.nav-toggle-label span::before {
        transform: rotate(45deg);
        bottom: 0;
    }

    .nav-toggle:checked~.nav-toggle-label span::after {
        transform: rotate(-45deg);
        top: 0;
    }

    .nav-h {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: rgba(252, 250, 242, 0.98);
        /* Matching creamy bg */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 50px;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 999;
        margin-top: 0 !important;
    }

    .nav-toggle:checked~.nav-h {
        transform: translateX(0);
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    .nav-h a {
        font-size: 1.1rem;
    }
}

.nav-h a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-accent);
    transition: width 0.3s;
}

.nav-h a:hover::after,
.nav-h a.active::after {
    width: 100%;
}

/* Buttons */
.btn-circle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 120px;
    height: 120px;
    border: 1px solid var(--color-text);
    border-radius: 50%;
    transition: 0.3s;
    font-weight: 700;
}

.btn-circle:hover {
    background-color: var(--color-text);
    color: #fff;
    transform: scale(1.05);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background-color: var(--color-bg);
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    z-index: 2;
}

.hero-title {
    font-size: 2.4rem;
    line-height: 1.6;
    white-space: nowrap;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--color-sub);
    white-space: nowrap;
}

/* Cards & Lists */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.simple-card {
    text-align: left;
}

.card-img {
    display: block;
    aspect-ratio: 16 / 9;
    height: auto;
    background-color: #eee;
    margin-bottom: 30px;
    border-radius: 80% 80% 0 0;
    /* Bakery-like arch */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fill the frame */
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.simple-card:hover .card-img img {
    transform: scale(1.05);
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
    border-bottom: 1px dotted var(--color-sub);
    padding-bottom: 15px;
    display: inline-block;
}

/* Simple Footer */
footer {
    padding: 100px 0 60px;
    text-align: center;
    font-family: var(--font-maru);
    color: var(--color-sub);
    font-size: 0.8rem;
}

footer p {
    white-space: nowrap;
    font-size: min(0.8rem, 3.5vw);
}

footer a {
    white-space: nowrap;
    display: inline-block;
}

/* Table Design - Organic & Warm */
.responsive-table-wrapper {
    overflow-x: auto;
    margin-bottom: 40px;
    border-radius: 4px;
}

.info-table,
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-maru);
    font-size: 0.95rem;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.5);
}

.info-table th,
.info-table td,
.schedule-table th,
.schedule-table td {
    padding: 20px;
    text-align: left;
    border-bottom: 1px dotted var(--color-sub);
}

.info-table th,
.schedule-table th {
    width: 30%;
    color: var(--color-accent);
    font-weight: 700;
    background: rgba(var(--color-accent), 0.05);
}

.schedule-table th {
    width: 20%;
}

@media (max-width: 600px) {

    .info-table th,
    .schedule-table th {
        width: 35%;
        padding: 15px 10px;
    }

    .info-table td,
    .schedule-table td {
        padding: 15px 10px;
    }
}

/* Side-by-Side Cards */
.side-by-side-cards {
    display: flex;
    gap: 40px;
    margin-bottom: 80px;
}

.info-card {
    flex: 1;
    background: #fff;
    padding: 40px;
    border-radius: 40px;
    box-shadow: 15px 15px 0 rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.info-card h3 {
    text-align: center;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .side-by-side-cards {
        flex-direction: column;
        gap: 40px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    /* .tategaki の縦書きをスマホでも維持するため削除 */

    .news-link {
        flex-direction: column;
        gap: 15px;
    }

    .news-date {
        width: auto;
    }

    .hero {
        height: auto;
        min-height: 80vh;
        padding: 140px 0 60px;
        display: flex;
        align-items: flex-start;
        /* Align to top */
        justify-content: center;
    }

    .hero-content {
        /* Remove confusion with vertical text and flex stacking */
        display: block;
        text-align: left;
        /* Top in vertical-rl */
    }

    .hero-title {
        font-size: 1.8rem;
        margin-top: 0;
    }

    .nav-h {
        display: flex;
        margin-top: 15px;
        width: 100%;
        justify-content: center;
    }

    .header {
        padding: 1.2rem 25px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    }

    .logo-v {
        writing-mode: horizontal-tb;
        letter-spacing: 0.1em;
        margin-bottom: 0;
        font-size: min(1.1rem, 4vw);
        white-space: nowrap;
    }
}

/* Supplemental Responsive Utilities */
.story-img-container {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    opacity: 0.15;
}

/* Floating Action Buttons */
.floating-action-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
}

.fab-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    white-space: nowrap;
}

.fab-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.fab-consult {
    background: var(--color-accent);
    /* Blue accent for primary action */
}

.fab-contact {
    background: var(--color-text);
    /* Dark navy for secondary action */
}

@media (max-width: 768px) {
    .floating-action-buttons {
        bottom: 20px;
        right: 20px;
        gap: 10px;
    }

    .fab-btn {
        padding: 12px 20px;
        font-size: 0.85rem;
    }
}

.story-img-container:nth-of-type(1) {
    top: 40px;
    left: 0;
}

.story-img-container:nth-of-type(2) {
    top: 250px;
    left: 30px;
}

@media (max-width: 768px) {
    #story {
        overflow: hidden;
    }

    #story .container {
        padding: 60px 0 100px;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #story .tategaki {
        margin: 0 auto !important;
        width: 100%;
        text-align: left;
        /* Top in vertical-rl */
        position: relative;
        z-index: 2;
    }

    #story .tategaki p {
        display: block;
        /* Show specified text */
        font-size: 0.95rem;
        margin-top: 2rem;
    }

    .story-img-container {
        position: absolute !important;
        opacity: 0.12 !important;
        max-width: 90% !important;
        width: 80% !important;
        left: 50% !important;
        top: 50% !important;
        z-index: 1;
        margin: 0 !important;
    }

    .story-img-container:nth-of-type(1) {
        transform: translate(-50%, -50%) rotate(-2deg) !important;
        top: 33% !important;
    }

    .story-img-container:nth-of-type(2) {
        transform: translate(-45%, -50%) rotate(1deg) !important;
        top: 67% !important;
        bottom: auto !important;
    }

    /* Representative Message Responsive */
    .company-message-container {
        flex-direction: column !important;
        gap: 40px !important;
    }

    /* Organization Data (DL) Responsive */
    .info-table-dl {
        display: block !important;
        border-top: 1px dotted #ccc;
        padding-top: 30px;
    }

    .info-table-dl dt {
        margin-top: 20px;
        font-size: 0.8rem;
        opacity: 0.7;
    }

    .info-table-dl dd {
        margin-left: 0;
        padding-bottom: 10px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .info-table-dl dt:first-child {
        margin-top: 0;
    }


}

/* Desktop Organization Data (DL) Default */
@media (min-width: 769px) {
    .info-table-dl {
        display: grid;
        grid-template-columns: 150px 1fr;
        gap: 30px;
        border-top: 1px dotted #ccc;
        padding-top: 30px;
    }
}

/* Fixed Booking Button */
.fixed-booking-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    background: var(--color-accent);
    color: #fff !important;
    padding: 15px 40px;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(74, 144, 226, 0.3);
    white-space: nowrap;
    transition: var(--transition);
    text-decoration: none;
}

.fixed-booking-btn:hover {
    transform: translateX(-50%) translateY(-5px);
    box-shadow: 0 15px 35px rgba(74, 144, 226, 0.4);
    background: var(--color-text);
}

@media (max-width: 768px) {
    .fixed-booking-btn {
        bottom: 20px;
        padding: 12px 30px;
        font-size: 0.9rem;
        width: 80%;
        max-width: 300px;
        text-align: center;
    }
}

/* Company Page Grid */
.company-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}


@media (max-width: 768px) {
    .company-card-grid {
        grid-template-columns: 1fr;
    }
}

/* Page Specific Mobile Overrides */
@media (max-width: 768px) {

    /* index.php contact cards */
    #contact .float-card {
        padding: 40px 20px !important;
    }

    /* company.php empathy block */
    .zen-maru[style*="padding: 50px"] {
        padding: 30px 20px !important;
        border-radius: 30px !important;
    }

    /* Vision section fonts */
    .shippori[style*="font-size: 2.2rem"] {
        font-size: 1.8rem !important;
    }

    .shippori[style*="font-size: 1.8rem"] {
        font-size: 1.5rem !important;
    }

    /* company.php empathy block */
    .company-empathy-box {
        padding: 30px 20px !important;
        border-radius: 30px !important;
    }

    .company-partner-card {
        padding: 30px 20px !important;
        border-radius: 30px !important;
    }
}

/* Page Specific: UNLOCK KIDS */
.unlock-kids-page .info-card {
    background: #f7f3e8 !important;
}

.unlock-kids-page .info-table,
.unlock-kids-page .schedule-table {
    background: transparent !important;
}