/*
  File: stylesheets/style.css
  Description: Styles for the Soba Restaurant Website.
*/

/* --- Base Styles & Reset --- */
:root {
    --font-serif: 'Noto Serif JP', serif;
    --color-text: #333333;
    --color-background: #fdfcfb;
    --color-primary: #a19284;
    --color-dark: #3a3a3a;
    --color-accent: #8c7e75;
}

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

body {
    font-family: var(--font-serif);
    line-height: 1.8;
    color: var(--color-text);
    background-color: var(--color-background);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

a, button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.7;
}

.inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
}

/* --- Loading Animation --- */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-background);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading.loaded {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: var(--color-dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Header --- */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    z-index: 100;
    transition: background-color 0.4s ease, color 0.4s ease;
}

#header.scrolled {
    background-color: rgba(253, 252, 251, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.site-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 2px;
    margin: 0;
}

#header nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

#header nav li {
    margin-left: 30px;
}

/* --- Hero Section --- */
#hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/hero.jpg');
    background-size: cover;
    background-position: center;
    filter: brightness(0.7);
    transform: scale(1.1);
    animation: hero-zoom-in 1.5s ease-out forwards;
}

@keyframes hero-zoom-in {
    from { transform: scale(1.2); opacity: 0; }
    to { transform: scale(1.1); opacity: 1; }
}

.hero-text-container {
    color: white;
    text-align: center;
    z-index: 1;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.5em;
    opacity: 0;
    animation: fade-in-up 1.5s ease-out 1s forwards;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.vertical-text {
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 2.5;
}

/* Scroll Down Animation */
.scrolldown {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 12px;
    letter-spacing: 2px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    z-index: 2;
    opacity: 0;
    animation: fade-in-up 1s ease-out 2s forwards;
}

.scrolldown::after {
    content: '';
    position: absolute;
    top: 60px;
    left: 50%;
    width: 1px;
    height: 50px;
    background: white;
    animation: scroll-indicator 2s infinite ease-in-out;
}

@keyframes scroll-indicator {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    51% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}


/* --- Content Sections --- */
.content-section {
    padding: 120px 0;
}

.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 80px;
    font-weight: 600;
    letter-spacing: 4px;
}

/* Fade In Animation on Scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

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

/* --- Concept Section --- */
#concept {
    background-image: url('https://www.transparenttextures.com/patterns/washi.png');
    background-color: var(--color-background);
}
.concept-text {
    text-align: center;
    font-size: 1.2rem;
    line-height: 2.5;
}
.concept-text p:not(:last-child) {
    margin-bottom: 2em;
}
.concept-text p:nth-child(2) { transition-delay: 0.2s; }
.concept-text p:nth-child(3) { transition-delay: 0.4s; }

/* --- Kodawari Section --- */
.kodawari-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.kodawari-item {
    text-align: center;
}

.kodawari-item .item-image {
    margin-bottom: 20px;
    overflow: hidden;
}
.kodawari-item img {
    transition: transform 0.5s ease;
}
.kodawari-item:hover img {
    transform: scale(1.05);
}

.kodawari-item h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
}

.kodawari-item p {
    text-align: left;
    font-size: 0.95rem;
}
.kodawari-items .kodawari-item:nth-child(2) { transition-delay: 0.2s; }
.kodawari-items .kodawari-item:nth-child(3) { transition-delay: 0.4s; }


/* --- Oshinagaki Section --- */
#oshinagaki {
    background-color: #f5f3f1;
}
.menu-items {
    max-width: 800px;
    margin: 0 auto;
}
.menu-item {
    display: flex;
    align-items: center;
    background: var(--color-background);
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    overflow: hidden;
}
.menu-item:nth-child(even) {
    flex-direction: row-reverse;
}
.menu-item img {
    width: 45%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.menu-item:hover img {
    transform: scale(1.05);
}

.menu-description {
    padding: 40px;
    width: 55%;
}

.menu-description h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}
.menu-description p {
    font-size: 0.9rem;
}
.menu-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-left: 10px;
}


/* --- New Sections (Follow & Contact) --- */
.section-lead {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 2;
}

.bg-gray {
    background-color: #f5f3f1;
}

.sns-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.sns-link {
    display: inline-block;
    padding: 12px 30px;
    border: 1px solid var(--color-dark);
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sns-link:hover {
    color: white;
    opacity: 1; /* Override default link opacity */
}

.sns-link.facebook:hover { background-color: #1877f2; border-color: #1877f2; }
.sns-link.x:hover { background-color: #14171A; border-color: #14171A; }
.sns-link.instagram:hover { 
    background: #d6249f; 
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%,#285aeb 90%); 
    border-color: transparent; 
}

.contact-button-container {
    text-align: center;
}

.contact-button {
    display: inline-block;
    background-color: var(--color-dark);
    color: white;
    padding: 15px 40px;
    border-radius: 5px;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.contact-button:hover {
    background-color: var(--color-accent);
    transform: translateY(-2px);
    opacity: 1; /* Override default link opacity */
}

/* --- Reservation Form --- */
.reservation-form {
    max-height: 0;
    overflow: hidden;
    transition: max-height 1s ease-in-out;
    margin-top: 0;
}

.reservation-form.is-open {
    max-height: 1000px; /* 十分な高さを確保 */
    margin-top: 40px;
}

.form-body {
    max-width: 600px;
    margin: 0 auto;
    background: #fdfcfb;
    border: 1px solid #eee;
    padding: 30px;
    border-radius: 5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background-color: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(140, 126, 117, 0.2);
}

textarea.form-control {
    resize: vertical;
}

.radio-group label {
    margin-right: 20px;
}

.form-fieldset {
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 4px;
    margin-top: 30px;
    margin-bottom: 20px;
}

.order-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

#menu-select { flex-grow: 1; }
#menu-quantity { width: 70px; }

.add-button {
    padding: 12px 20px;
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s;
}
.add-button:hover {
    background-color: var(--color-dark);
}

.order-summary {
    margin-top: 20px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.order-item-remove {
    background-color: #fbebeb;
    color: #e53e3e;
    border: 1px solid #e53e3e;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-weight: bold;
    line-height: 22px;
    text-align: center;
}
.order-item-remove:hover {
    background-color: #e53e3e;
    color: white;
}

.total-price {
    margin-top: 20px;
    text-align: right;
}

.total-price span {
    display: block;
}

.subtotal-price {
    font-size: 0.9rem;
    color: #666;
}
.main-total-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-dark);
}


.form-submit {
    text-align: center;
    margin-top: 30px;
}

/* --- Info Section --- */
.info-container {
    display: flex;
    gap: 40px;
}
.info-text, .info-map {
    flex: 1;
}
.info-text dl {
    margin: 0;
}
.info-text dt {
    font-weight: 600;
    margin-top: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}
.info-text dd {
    margin: 5px 0 0 0;
    font-size: 0.95rem;
}
.info-map iframe {
    width: 100%;
    height: 100%;
    min-height: 350px;
    border: none;
}

/* --- Footer --- */
#footer {
    background: var(--color-dark);
    color: #e0e0e0;
    padding: 30px 0;
    text-align: center;
    font-size: 0.8rem;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .inner {
        padding: 0 20px;
    }
    #header {
        padding: 15px 20px;
    }
    .site-title {
        font-size: 20px;
    }
    #header nav {
        /* Simple navigation for now, can be replaced with hamburger menu */
        display: none; 
    }

    .vertical-text {
        font-size: 1.8rem;
    }

    .content-section {
        padding: 80px 0;
    }
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 40px;
    }

    .kodawari-items {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .menu-item,
    .menu-item:nth-child(even) {
        flex-direction: column;
    }
    .menu-item img,
    .menu-item .menu-description {
        width: 100%;
    }

    .info-container {
        flex-direction: column;
    }

    .order-controls {
        flex-direction: column;
        align-items: stretch;
    }
    #menu-quantity {
        width: 100%;
    }
}
