/*
   pattern_SP_LP - Image-Tile Architecture
   Theme: Luxury Renovation / Interior Design
*/

:root {
    --primary-accent: #88713F;
    /* Gold/Olive */
    --bg-white: #FFFFFF;
    --text-dark: #1D1D1D;
    --tile-max-width: 780px;
    /* New rule: Exactly 780px */
}

html {
    touch-action: manipulation;
}

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: #FFFFFF !important;
    /* Strictly white */
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    touch-action: pan-x pan-y;
    /* スクロールは許可し、ピンチズームなどは禁止する */
    touch-action: pan-y;
    /* スクロールは許可し、ピンチズームなどは禁止する */
}

.lp-container {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.global-header {
    width: 100%;
    background-color: #FFFFFF !important;
    display: flex;
    justify-content: center;
    position: fixed;
    top: 0;
    z-index: 1000;
}

.header-inner {
    width: 100%;
    max-width: var(--tile-max-width);
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto;
    /* Allow image to define height */
    padding: 0;
    /* Remove 10px padding */
}

.tel-btn {
    display: flex;
}

.tel-btn a {
    display: block;
    width: 50%;
}

.tel-btn img {
    width: 100%;
    /* Spans the full 780px */
    height: auto;
    display: block;
}

/* Image-Tile Core Logic */
.image-tile {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-color: #FFFFFF;
    /* Normal status for default tiles */
}

#section2 {
    background-color: #efefef !important;
    /* Targeted override */
}

#section3 {
    background: linear-gradient(to bottom, #efefef, #0b1012) !important;
    /* Transition to dark */
}

#section4 {
    /* スクロールした時に画面上端から20%の距離を空けて止まるようにする */
    scroll-margin-top: 20vh;
}

.tile-content {
    width: 100%;
    max-width: var(--tile-max-width);
    position: relative;
    line-height: 0;
    /* Remove gap below image */
}

.tile-content img {
    width: 100%;
    height: auto;
    display: block;
}

/* Fixed CTA */
.fixed-cta {
    display: none;
    /* Hidden until specific sections are reached */
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 100;
}

.cta-button {
    display: block;
    background: linear-gradient(135deg, #B59D5F 0%, #88713F 100%);
    color: #fff;
    text-align: center;
    padding: 18px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Reveal CTA Styles */
#section-reveal .tile-content {
    position: relative;
}

.reveal-cta {
    position: absolute;
    bottom: 8vw;
    /* Adjusted for better mobile alignment */
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    max-width: 90%;
    z-index: 10;
}

/* PC/iPad: adjust reveal-cta position */
@media screen and (min-width: 481px) {
    .reveal-cta {
        bottom: 6vw;
    }
}

.reveal-cta button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 100%;
}

.reveal-cta img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.2s ease;
}

.reveal-cta button:hover img {
    transform: scale(1.05);
}

/* Hidden Content Logic */
.is-hidden {
    display: none;
}

#hidden-sections.is-visible {
    display: block;
}

#section4-1,
#section4-2,
#section4-3,
#section4-4,
#section4-5 {
    background-color: transparent !important;
    /* Make transparent to see wrapper BG */
}

#section4-5 {
    padding-top: 10vw;
    padding-bottom: 10vw;
    padding-left: 15px;
    padding-right: 15px;
}

.bg-cream-area {
    background-color: #fff5e0 !important;
    width: 100%;
}

#section5-1 {
    background-image: url('./parts/bg_wood.png') !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding-top: 8vw;
    padding-bottom: 8vw;
}

#section6-1,
#section6-2 {
    padding-bottom: 10vw;
}

#section6-3 {
    padding-bottom: 0;
    background: linear-gradient(to bottom, #ffffff 95%, #003040 100%) !important;
}

#section7 {
    background-color: #003040 !important;
}


#section9-top,
#section9-1,
#section9-2,
#section9-3 {
    background-color: transparent !important;
    /* Fixed: transparent to see wrapper BG */
}

.bg-yellow-area {
    background-color: #fffcee !important;
    width: 100%;
}

#section9-1,
#section9-2,
#section9-3 {
    padding-bottom: 6vw;
}

/* Section 10 Scroll-Linked Reveal Styles */
#section10-scroll-area {
    position: relative;
    height: 350vh;
    /* Adjust scroll length */
    background-color: #fff;
    width: 100%;
}

.sticky-container {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.reveal-layer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--tile-max-width);
    height: 100%;
    opacity: 0;
    transition: opacity 0.1s linear;
}

.reveal-layer img {
    width: 100%;
    height: auto;
    display: block;
}

#layer10-1 {
    opacity: 1;
    z-index: 1;
}

#layer10-2 {
    z-index: 2;
}

#layer10-3 {
    z-index: 3;
}

#layer10-4 {
    z-index: 4;
}

#layer10-5 {
    z-index: 5;
}

/* Section 10 */
#section10 {
    padding-top: 10vw;
    padding-bottom: 10vw;
    background-color: #ffffff !important;
    transition: opacity 2.5s ease-out;
}

/* Section 11-15 Base Styles */
#section11-01 {
    background-color: #ffffff !important;
}

#section13 {
    background-color: #ffffff !important;
    padding-top: 10vw;
    padding-bottom: 10vw;
    transition: opacity 2.5s ease-out;
}

#section13-1 {
    background-color: #ffffff !important;
}

#section13-2 {
    background-color: #ffffff !important;
    padding-bottom: 6vw;
}

#section14 {
    background-color: #ffffff !important;
}

#section12 {
    background-color: #fff4dc !important;
}

#section12-5 {
    background-color: #fbe990 !important;
}

#section11-02 {
    background-color: #fff4dc !important;
}

#section11-1,
#section11-2,
#section11-3 {
    background-color: #fff4dc !important;
    padding-bottom: 10vw;
}

#section10-05 {
    background-color: #ffffff !important;
}

#section10-1,
#section10-2,
#section10-3,
#section10-4,
#section10-5 {
    background-color: #ffffff !important;
    padding-bottom: 7vw;
}

/* Section 11 CTAs */
.section11-cta {
    position: absolute;
    bottom: 10vw;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    /* Adjust width based on design needs */
    max-width: 500px;
    z-index: 10;
}

.section11-cta a {
    display: block;
    width: 100%;
    transition: transform 0.2s ease;
}

.section11-cta img {
    width: 100%;
    height: auto;
    display: block;
}

.section11-cta a:hover {
    transform: scale(1.05);
}

.section11-cta a:hover {
    transform: scale(1.05);
}

/* Screen size 1500px-1980px: adjust section11-cta position */
@media screen and (min-width: 1500px) and (max-width: 1980px) {
    .section11-cta {
        bottom: 6.5vw;
    }
}

/* Final CTA Section */
.final-cta-section {
    width: 100%;
    background-color: #ffffff;
    padding: 10vw 0;
    display: flex;
    justify-content: center;
}

.final-cta-container {
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 7vw;
    /* SP: 7vw */
    align-items: center;
}

/* iPad specific adjustments */
@media screen and (min-width: 481px) and (max-width: 1024px) {
    .final-cta-container {
        gap: 6vw;
        /* iPad: 6vw */
    }
}

/* PC specific adjustments */
@media screen and (min-width: 1025px) {
    .final-cta-container {
        gap: 5vw;
        /* PC: 5vw */
    }
}

.final-cta-item {
    display: block;
    width: 100%;
    transition: transform 0.2s ease;
}

.final-cta-item img {
    width: 100%;
    height: auto;
    display: block;
}

.final-cta-item:hover {
    transform: scale(1.03);
}

/* Footer Styles */
.global-footer {
    width: 100%;
    background-color: #303030 !important;
    padding: 8vw 0;
    display: flex;
    justify-content: center;
}

/* PC Footer padding */
@media screen and (min-width: 1025px) {
    .global-footer {
        padding: 3vw 0;
    }
}

.footer-inner {
    width: 90%;
    max-width: var(--tile-max-width);
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-logo {
    width: 60%;
    max-width: 300px;
}

.footer-logo img {
    width: 100%;
    height: auto;
    display: block;
}

/* Scroll Animation Styles */
.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

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

.fade-in {
    opacity: 0;
    transition: opacity 1.5s ease-out;
}

.fade-in.is-active {
    opacity: 1;
}

.fade-in-delayed {
    opacity: 0;
    transition: opacity 1.0s ease-out;
    /* transition-delay removed, handled by JS */
}

.fade-in-delayed.is-active {
    opacity: 1;
}

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

.fade-in {
    opacity: 0;
    transition: opacity 1.5s ease-out;
}

.fade-in.is-active {
    opacity: 1;
}

/* Scroll Down Animation for Section 7 */
.scroll-down-wrapper {
    position: absolute;
    top: 7vw;
    /* Adjusted from 6vw */
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    pointer-events: none;
    /* Ensure it doesn't block interaction if it overlaps */
}

.scroll-down-wrapper a {
    display: inline-block;
    position: relative;
    /* Removed width: 13px */
    padding: 1vw 1vw 17vw;
    /* Scaled padding to accommodate 15vw line */
    color: #fff;
    font-size: clamp(12px, 1.8vw, 14px);
    /* Responsive font size with limit */
    font-family: 'Josefin Sans', sans-serif;
    line-height: 1;
    letter-spacing: .2em;
    text-transform: uppercase;
    text-decoration: none;
    writing-mode: vertical-lr;
    transition: .2s;
    overflow: hidden;
    margin: auto;
    pointer-events: auto;
}

.scroll-down-wrapper a:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 2px;
    height: 15vw;
    /* Increased for SP */
    background: rgba(255, 255, 255, 0.2);
    /* Light line */
}

.scroll-down-wrapper a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 2px;
    height: 15vw;
    /* Increased for SP */
    background: #fff;
    /* White moving line */
}

.scroll-down-wrapper a:hover {
    opacity: .5;
}

#scroll-type01 a:after {
    animation: sdl01 2.25s cubic-bezier(1, 0, 0, 1) infinite;
    /* Slowed down to 3/2 */
}

@keyframes sdl01 {
    0% {
        transform: scale(1, 0);
        transform-origin: 0 0;
    }

    50% {
        transform: scale(1, 1);
        transform-origin: 0 0;
    }

    50.1% {
        transform: scale(1, 1);
        transform-origin: 0 100%;
    }

    100% {
        transform: scale(1, 0);
        transform-origin: 0 100%;
    }
}

/* Popup Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-overlay.is-open {
    display: flex;
}

.modal-container {
    width: 90%;
    max-width: 600px;
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-close::before,
.modal-close::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background-color: #333;
}

.modal-close::before {
    transform: rotate(45deg);
}

.modal-close::after {
    transform: rotate(-45deg);
}

/* Slider Styles */
.slider-container {
    position: relative;
    width: 100%;
}

.slider-image-area {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #eee;
}

.slider-image-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slider-content {
    padding: 20px;
    background-color: #fff;
    text-align: center;
}

.slider-comment {
    font-size: 15px;
    color: #444;
    min-height: 3em;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1.5;
}

/* Slider Controls */
.slider-nav {
    position: absolute;
    top: 40%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

.slider-btn {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: none;
    transition: background-color 0.2s;
}

.slider-btn:hover {
    background-color: #fff;
}

.slider-btn i {
    border: solid #555;
    border-width: 0 3px 3px 0;
    display: inline-block;
    padding: 4px;
}

.prev-btn i {
    transform: rotate(135deg);
}

.next-btn i {
    transform: rotate(-45deg);
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dot.is-active {
    background-color: var(--primary-accent);
}

/* Make images clickable for popup */
[id^="section9-"] .tile-content {
    cursor: pointer;
}

[id^="section9-"] .tile-content:hover {
    opacity: 0.8;
    transition: opacity 0.2s;
}

/* Base Responsive Adjustments */
@media screen and (min-width: 781px) {

    /* PC specific overrides for Scroll Animation in Section 7 */
    .scroll-down-wrapper {
        top: 5vw;
        /* Position adjustment for PC */
    }

    .scroll-down-wrapper a {
        padding: 0.5vw 0.5vw 8.5vw;
        /* Roughly half of mobile */
        font-size: 0.9vw;
        /* Half of 1.8vw */
    }

    .scroll-down-wrapper a:before,
    .scroll-down-wrapper a:after {
        height: 7.5vw;
        /* Half of 15vw */
    }

    /* Background colors on tiles will now become visible on the sides */
    .image-tile {
        padding: 0;
        /* Stay flush for seamless vertical transitions */
    }
}

/* Sticky CTA Styles */
/* Sticky CTA Styles */
.sticky-cta-container {
    position: fixed;
    z-index: 9999;
    display: flex;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.sticky-cta-container.is-visible {
    opacity: 1;
    visibility: visible;
}

.sticky-btn {
    display: flex;
    flex-direction: column;
    /* Icon above text */
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #ffffff;
    font-weight: bold;
    transition: opacity 0.3s;
    line-height: 1.2;
}

.sticky-btn:hover {
    opacity: 0.9;
}

.sticky-icon {
    margin-bottom: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sticky-icon img {
    height: auto;
    display: block;
}

/* Button Colors */
.btn-catalog {
    background-color: #b37100;
}

.btn-modelhouse {
    background-color: #bf4c00;
}

.btn-consult {
    background-color: #a83000;
}

/* SP & iPad Layout (Bottom Fixed, Horizontal) */
@media screen and (max-width: 1024px) {
    .sticky-cta-container {
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        /* Adjusted to 60px */
        /* Increased height for icon+text */
        flex-direction: row;
        border-radius: 12px 12px 0 0;
        /* Rounded top corners */
        overflow: hidden;
        /* Clip contents */
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }

    .sticky-btn {
        flex: 1;
        /* Equal width */
        height: 100%;
        font-size: 10px;
        /* Adjusted font size for 60px height */
        border-right: 1px solid rgba(255, 255, 255, 0.2);
        padding: 4px 0;
    }

    .sticky-btn:last-child {
        border-right: none;
    }

    .sticky-icon img {
        width: 20px;
        /* Adjusted icon size for 60px height */
    }

    .btn-text {
        writing-mode: horizontal-tb;
        text-align: center;
        line-height: 1.2;
    }
}

/* PC Layout (Top Right, Vertical Stack) */
@media screen and (min-width: 1025px) {
    .sticky-cta-container {
        top: 15%;
        /* Adjusted to 15% */
        right: 0;
        flex-direction: column;
        width: 70px;
        /* Width for icon+text */
        border-radius: 8px 0 0 8px;
        /* Rounded left corners */
        overflow: hidden;
        box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.1);
    }

    .sticky-btn {
        width: 100%;
        padding: 15px 5px;
        height: 160px;
        /* Fixed height for uniformity */
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .sticky-btn:last-child {
        border-bottom: none;
    }

    .sticky-icon {
        margin-bottom: 10px;
    }

    .sticky-icon img {
        width: 28px;
        /* Icon size for PC */
    }

    .btn-text {
        writing-mode: vertical-rl;
        /* Vertical Text */
        text-orientation: upright;
        letter-spacing: 0.1em;
        font-size: 14px;
    }
}

/* Logic to hide Sticky CTA when overlapping specific elements */
.sticky-cta-container.is-hidden-by-footer {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Page Top Button Styles */
.page-top {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    right: 40px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    border: 0;
    background: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9998;
}

.page-top p {
    writing-mode: vertical-lr;
    text-decoration: none;
    text-transform: uppercase;
    height: 70px;
    margin: 0;
    letter-spacing: 5px;
    text-align: right;
    position: relative;
    font-size: 9px;
    font-weight: 100;
    color: #bebebecc;
}

.page-top p:before {
    content: "";
    position: absolute;
    top: -1px;
    left: 7px;
    width: 1px;
    height: 16px;
    background: #bebebecc;
    transform: skewX(30deg);
}

.page-top p:after {
    content: "";
    position: absolute;
    bottom: 1px;
    left: 2px;
    width: 1px;
    height: 70px;
    background: #bebebecc;
}

.page-top.is-active {
    opacity: 1;
    visibility: visible;
}

/* PC: bottom 10%, 1.5x size */
@media screen and (min-width: 1025px) {
    .page-top {
        bottom: 10%;
        top: auto;
    }

    .page-top p {
        height: 105px;
        font-size: 14px;
        letter-spacing: 8px;
    }

    .page-top p:before {
        height: 24px;
        left: 10px;
    }

    .page-top p:after {
        height: 105px;
        left: 3px;
    }
}

/* iPad/SP: bottom 10% */
@media screen and (max-width: 1024px) {
    .page-top {
        bottom: 10%;
        right: 2.5%;
    }
}

/* Page Top Button Styles */
.page-top {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    right: 40px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    border: 0;
    background: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9998;
}

.page-top p {
    writing-mode: vertical-lr;
    text-decoration: none;
    text-transform: uppercase;
    height: 70px;
    margin: 0;
    letter-spacing: 5px;
    text-align: right;
    position: relative;
    font-size: 9px;
    font-weight: 100;
    color: #bebebecc;
}

.page-top p:before {
    content: "";
    position: absolute;
    top: -1px;
    left: 7px;
    width: 1px;
    height: 16px;
    background: #bebebecc;
    transform: skewX(30deg);
}

.page-top p:after {
    content: "";
    position: absolute;
    bottom: 1px;
    left: 2px;
    width: 1px;
    height: 70px;
    background: #bebebecc;
}

.page-top.is-active {
    opacity: 1;
    visibility: visible;
}

/* PC: bottom 10%, 1.5x size */
@media screen and (min-width: 1025px) {
    .page-top {
        bottom: 10%;
        top: auto;
    }

    .page-top p {
        height: 105px;
        font-size: 14px;
        letter-spacing: 8px;
    }

    .page-top p:before {
        height: 24px;
        left: 10px;
    }

    .page-top p:after {
        height: 105px;
        left: 3px;
    }
}

/* iPad/SP: bottom 10% */
@media screen and (max-width: 1024px) {
    .page-top {
        bottom: 10%;
        right: 2.5%;
    }
}


.add_btn {
    display: block;
    max-width: 600px;
    margin: 0 auto;
}

.add_btn img {
    max-width: 100%;
}