/* ==========================================================================
   small-store-web-system - Common Template CSS
   ========================================================================== */

/* CSS Variables - Change these to customize the store */
:root {
    /* Colors */
    --color-bg: #ffffff;
    --color-bg-warm: #faf6ef;
    --color-beige: #ece1cd;
    --color-text: #3b332a;
    --color-text-light: #6b6054;
    --color-border: #e4dccd;
    --color-primary: #6f7d52;
    --color-primary-dark: #57623f;
    --color-accent: #8a7b62;

    /* Typography */
    --font-serif: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "HGS明朝E", serif;
    --font-sans: "Yu Gothic", "YuGothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
    --font-size-base: 16px;
    --font-size-small: 14px;
    --font-size-large: 18px;
    --line-height-base: 1.8;

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    --spacing-2xl: 64px;

    /* Layout */
    --max-width: 1160px;
    --header-height: 64px;

    /* Breakpoints (for reference; media queries use literal px values) */
    --bp-mobile: 576px;
    --bp-tablet: 768px;
    --bp-desktop: 1024px;

    /* Scroll reveal motion (themes may override these under body[data-theme="..."]) */
    --motion-duration: 0.6s;
    --motion-ease: ease-out;
    --motion-distance: 18px;
    --motion-stagger-step: 70ms;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

html {
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: var(--line-height-base);
    letter-spacing: 0.02em;
    overflow-x: hidden;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.5;
    color: var(--color-text);
    letter-spacing: 0.03em;
}

p {
    margin-bottom: var(--spacing-md);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

.section-title {
    font-size: 22px;
    margin-bottom: var(--spacing-lg);
}

.section-heading {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-family: var(--font-sans);
    font-size: var(--font-size-small);
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-md);
}

.section-heading__icon {
    width: 18px;
    height: 18px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.text-link {
    display: inline-flex;
    align-items: center;
    font-size: var(--font-size-small);
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-text);
    padding-bottom: 2px;
}

.text-link:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    text-decoration: none;
}

@media (min-width: 1024px) {
    .section-title {
        font-size: 26px;
    }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 28px;
    border: 2px solid transparent;
    border-radius: 4px;
    font-size: var(--font-size-base);
    font-weight: 600;
    font-family: var(--font-sans);
    text-decoration: none;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    min-height: 52px;
    white-space: nowrap;
}

.btn--primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

.btn--primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    text-decoration: none;
}

.btn--secondary {
    background-color: var(--color-bg);
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn--secondary:hover {
    background-color: var(--color-bg-warm);
    border-color: var(--color-text);
    text-decoration: none;
}

/* ==========================================================================
   Header
   ========================================================================== */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    min-height: var(--header-height);
    display: flex;
    align-items: center;
}

.header__inner {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    min-width: 0;
}

.header__brand:hover {
    text-decoration: none;
}

.header__logo {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    color: var(--color-primary);
}

.header__title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header__nav {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header__menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.header__menu a {
    color: var(--color-text);
    font-size: var(--font-size-small);
    font-weight: 500;
    transition: color 0.2s ease;
}

.header__menu a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.header__menu-backdrop {
    display: none;
}

.header__menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    z-index: 101;
    position: relative;
    flex-shrink: 0;
}

.header__menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.header__menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(2) {
    opacity: 0;
}

.header__menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.menu-toggle__line {
    width: 22px;
    height: 2px;
    background-color: var(--color-text);
    margin: 3px 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    transform-origin: center;
}

/* Mobile menu */
@media (max-width: 768px) {
    .header__menu-toggle {
        display: flex;
    }

    .header__menu-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        top: var(--header-height);
        background-color: rgba(59, 51, 42, 0.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 99;
    }

    .header__menu-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .header__menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background-color: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 12px 24px rgba(59, 51, 42, 0.08);
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        padding: var(--spacing-sm) 0;
        z-index: 100;
        opacity: 0;
        transform: translateY(-8px);
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .header__menu.is-open {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .header__menu li {
        border-bottom: 1px solid var(--color-border);
    }

    .header__menu li:last-child {
        border-bottom: none;
    }

    .header__menu a {
        display: block;
        padding: var(--spacing-md);
        font-size: var(--font-size-base);
    }

    .header__menu a:hover {
        background-color: var(--color-bg-warm);
    }
}

/* ==========================================================================
   Sections - Common Container
   ========================================================================== */

section {
    padding: var(--spacing-2xl) var(--spacing-md);
}

section > div[class$="__inner"] {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
}

@media (min-width: 1024px) {
    section {
        padding: var(--spacing-2xl) var(--spacing-xl);
    }
}

/* ==========================================================================
   Hero Section (First View)
   ========================================================================== */

.hero {
    background-color: var(--color-bg-warm);
    padding: 0;
    display: flex;
    flex-direction: column;
}

.hero__media {
    width: 100%;
    height: 320px;
    overflow: hidden;
}

.hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero__content {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg) var(--spacing-md) var(--spacing-xl);
    min-width: 0;
}

.hero__eyebrow {
    color: var(--color-primary);
    font-size: var(--font-size-small);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.08em;
}

.hero__heading {
    font-size: 30px;
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
}

.hero__description {
    font-size: var(--font-size-base);
    color: var(--color-text);
    margin-bottom: var(--spacing-lg);
    line-height: 1.9;
}

.hero__actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.hero__actions .btn {
    width: 100%;
}

@media (min-width: 769px) {
    .hero {
        flex-direction: row;
        align-items: stretch;
        min-height: 560px;
    }

    .hero__media {
        order: 2;
        flex: 0 0 52%;
        max-width: 52%;
        min-width: 0;
        height: auto;
        overflow: hidden;
        border-radius: 0 0 0 28px;
    }

    .hero__image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .hero__content {
        order: 1;
        flex: 1;
        min-width: 0;
        justify-content: center;
        padding: var(--spacing-2xl) var(--spacing-xl);
        max-width: 560px;
    }

    .hero__heading {
        font-size: 42px;
    }

    .hero__description {
        font-size: var(--font-size-large);
    }

    .hero__actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .hero__actions .btn {
        width: auto;
    }
}

/* ==========================================================================
   Concept Section
   ========================================================================== */

.concept {
    background-color: var(--color-bg);
}

.concept__inner {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.concept__text p {
    font-size: var(--font-size-base);
    line-height: 1.9;
    color: var(--color-text);
}

.concept__media {
    border-radius: 4px;
    overflow: hidden;
}

.concept__image {
    width: 100%;
}

@media (min-width: 769px) {
    .concept__inner {
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-2xl);
    }

    .concept__text {
        flex: 0 0 42%;
        max-width: 42%;
    }

    .concept__media {
        flex: 1;
    }
}

/* ==========================================================================
   Products Section
   ========================================================================== */

.products {
    background-color: var(--color-bg-warm);
}

.products__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

@media (min-width: 769px) {
    .products__grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-lg);
    }
}

.product-card__image {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: var(--spacing-sm);
    overflow: hidden;
    border-radius: 4px;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card__title {
    font-size: var(--font-size-large);
    margin-bottom: 4px;
}

.product-card__description {
    font-size: var(--font-size-small);
    color: var(--color-text-light);
    line-height: 1.7;
    margin-bottom: 0;
}

/* ==========================================================================
   Features Section
   ========================================================================== */

.features {
    background-color: var(--color-bg);
}

.features__list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.feature-item__icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    color: var(--color-primary);
}

.feature-item__title {
    font-size: var(--font-size-large);
    margin-bottom: 4px;
}

.feature-item__text p {
    font-size: var(--font-size-small);
    color: var(--color-text-light);
    margin-bottom: 0;
    line-height: 1.7;
}

@media (min-width: 769px) {
    .features__list {
        flex-direction: row;
        gap: var(--spacing-xl);
    }

    .feature-item {
        flex: 1;
    }
}

/* ==========================================================================
   Gallery Section
   ========================================================================== */

.gallery {
    background-color: var(--color-bg-warm);
}

.gallery__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--spacing-lg);
}

.gallery__header .section-title {
    margin-bottom: 0;
}

.gallery__scroller {
    display: flex;
    gap: var(--spacing-sm);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: var(--spacing-xs);
    margin: 0 calc(var(--spacing-md) * -1);
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    -webkit-overflow-scrolling: touch;
}

.gallery-item {
    flex: 0 0 62%;
    scroll-snap-align: start;
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--color-bg);
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

@media (min-width: 769px) {
    .gallery__scroller {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-lg);
        overflow-x: visible;
        margin: 0;
        padding: 0;
    }

    .gallery-item {
        flex: initial;
    }
}

/* ==========================================================================
   Info Band: Store Info / Access / Social
   ========================================================================== */

.info-band {
    display: flex;
    flex-direction: column;
}

.info-band > section {
    padding: var(--spacing-2xl) var(--spacing-md);
}

.store-info {
    background-color: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

.access {
    background-color: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

.social {
    background-color: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

.store-info__list {
    margin-bottom: var(--spacing-md);
}

.store-info__row {
    display: grid;
    grid-template-columns: 6em 1fr;
    gap: var(--spacing-sm);
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-small);
}

.store-info__row dt {
    font-weight: 600;
    color: var(--color-text-light);
}

.store-info__row dd {
    margin: 0;
    min-width: 0;
}

.store-info__note {
    font-size: 12px;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
}

.access__media {
    margin-bottom: var(--spacing-md);
    border-radius: 4px;
    overflow: hidden;
    max-width: 320px;
}

.access__media img {
    /* Pre-existing gap (found during the v5 design-review pass): unlike
       every other photo slot (.hero__image, .concept__image, gallery/
       product images), this one had no width rule, so the photo rendered
       at its intrinsic pixel size instead of filling the frame -- leaving
       visible empty space around a small image inside the column. */
    width: 100%;
    height: auto;
    display: block;
}

.access__description {
    font-size: var(--font-size-small);
    line-height: 1.8;
}

.access__note {
    font-size: 12px;
    color: var(--color-text-light);
    background-color: var(--color-bg-warm);
    padding: var(--spacing-sm);
    border-radius: 4px;
    margin-bottom: var(--spacing-md);
}

.social__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.social__grid img {
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
}

.social__description {
    font-size: var(--font-size-small);
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
}

@media (min-width: 1024px) {
    .info-band {
        flex-direction: row;
    }

    .info-band > section {
        flex: 1;
        border-top: none;
        border-left: 1px solid var(--color-border);
    }

    .info-band > section:first-child {
        border-left: none;
    }
}

/* ==========================================================================
   Final CTA Section
   ========================================================================== */

.final-cta {
    background-color: var(--color-beige);
}

.final-cta__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--spacing-md);
}

.final-cta__icon {
    width: 40px;
    height: 40px;
    color: var(--color-primary);
}

.final-cta__text {
    font-size: var(--font-size-base);
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 0;
}

@media (min-width: 769px) {
    .final-cta__inner {
        flex-direction: row;
        text-align: left;
        justify-content: center;
    }

    .final-cta__text {
        flex: 1;
        max-width: 520px;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    background-color: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-lg) var(--spacing-md);
}

.footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm) var(--spacing-lg);
}

.footer__links a {
    color: var(--color-text-light);
    font-size: var(--font-size-small);
}

.footer__links a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.footer__links-pending {
    color: var(--color-text-light);
    font-size: var(--font-size-small);
    cursor: default;
}

.footer__copyright {
    font-size: 12px;
    color: var(--color-text-light);
    margin-bottom: 0;
}

@media (min-width: 769px) {
    .footer__inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .header,
    .header__menu-toggle {
        display: none;
    }

    body {
        font-size: 12pt;
    }

    a {
        color: inherit;
    }
}

/* ==========================================================================
   Scroll Reveal Motion
   - Default state (no JS, or JS failed/skipped): content stays fully visible.
   - Only when main.js confirms IntersectionObserver support and the user has
     not requested reduced motion does it add "js-motion-armed" to <html>,
     which is what actually hides [data-reveal] elements pending reveal.
   ========================================================================== */

[data-reveal] {
    opacity: 1;
    transform: none;
}

html.js-motion-armed [data-reveal] {
    opacity: 0;
    transform: translateY(var(--motion-distance));
    transition: opacity var(--motion-duration) var(--motion-ease),
                transform var(--motion-duration) var(--motion-ease);
    transition-delay: calc(var(--motion-stagger-step) * min(var(--motion-stagger-index, 0), 4));
}

html.js-motion-armed [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
