/*
Theme Name: Coordeble V2
Author: Humaworks
Description: Coordeble 独自CMS対応テーマ
Version: 0.1.0
Requires PHP: 8.3
Text Domain: coordeble-v2
*/

/* 基本スタイル */
body {
    margin: 0;
    font-family: sans-serif;
    line-height: 1.7;
    color: #333;
    background: #fff;
}

header, footer {
    padding: 20px;
    background: #f5f5f5;
}

main {
    min-height: 60vh;
    padding: 40px 20px;
}

/* Coordeble CMS Sections */

.coordeble-page {
    width: 100%;
}

.coordeble-section {
    padding: 60px 24px;
    text-align: center;
}

.coordeble-section h2 {
    margin: 0 0 20px;
    font-size: clamp(24px, 4vw, 36px);
}

.coordeble-section p {
    margin: 0;
}

.coordeble-hero {
    background: #eaf0ff;
}

.coordeble-brand {
    background: #ffffff;
}

.coordeble-products {
    background: #f5f5f5;
}

.coordeble-faq {
    background: #eaf5f0;
}

/* ========================================
   Coordeble CMS Hero v0.5.0
======================================== */

.coordeble-hero-section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.coordeble-hero-link,
.coordeble-hero-picture {
    display: block;
    width: 100%;
}

.coordeble-hero-picture img {
    display: block;
    width: 100%;
    height: auto;
}

.coordeble-hero-copy {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 90%;
    max-width: 1000px;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,.35);
    pointer-events: none;
}

.coordeble-hero-copy h1 {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 56px);
    line-height: 1.35;
    color: inherit;
}

.coordeble-hero-copy p {
    margin: 0;
    font-size: clamp(14px, 1.8vw, 22px);
    line-height: 1.7;
}

.coordeble-hero-placeholder {
    display: grid;
    place-items: center;
    min-height: 280px;
    background: #e9edf0;
    color: #555;
}

@media (max-width: 767px) {
    .coordeble-hero-copy h1 {
        font-size: 26px;
    }

    .coordeble-hero-copy p {
        font-size: 14px;
    }
}

/* ========================================
   Coordeble CMS Hero - Default Layout
======================================== */

.coordeble-hero-section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.coordeble-hero-picture {
    display: block;
    width: 100%;
    height: 600px;
    max-height: 600px;
    overflow: hidden;
}

.coordeble-hero-picture img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

@media (max-width: 767px) {

    .coordeble-hero-picture {
        height: 60vh;
        height: 60svh;
        max-height: 600px;
    }

    .coordeble-hero-picture img {
        object-fit: cover;
        object-position: center center;
    }

    .coordeble-hero-copy {
        width: 88%;
    }

    .coordeble-hero-copy h1 {
        font-size: clamp(22px, 6vw, 30px);
    }

    .coordeble-hero-copy p {
        font-size: 14px;
    }
}

/* ========================================
   Coordeble CMS Hero Slider v0.6.0
======================================== */

.coordeble-hero-section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.coordeble-hero-media {
    position: relative;
}

.coordeble-hero-track {
    position: relative;
}

.coordeble-hero-slide {
    display: none;
    position: relative;
}

.coordeble-hero-slide.is-active {
    display: block;
}

.coordeble-hero-picture {
    display: block;
    width: 100%;
    height: 600px;
    max-height: 600px;
    overflow: hidden;
}

.coordeble-hero-picture img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.coordeble-hero-link {
    display: block;
    width: 100%;
}

.coordeble-hero-copy {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    width: 90%;
    max-width: 1000px;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,.35);
    pointer-events: none;
}

.coordeble-hero-copy h1 {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 56px);
    line-height: 1.35;
    color: inherit;
}

.coordeble-hero-copy p {
    margin: 0;
    font-size: clamp(14px, 1.8vw, 22px);
    line-height: 1.7;
}

.coordeble-hero-placeholder {
    display: grid;
    place-items: center;
    min-height: 280px;
    background: #e9edf0;
    color: #555;
}

.coordeble-hero-dots {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 6;
    display: flex;
    gap: 10px;
}

.coordeble-hero-dot {
    width: 12px;
    height: 12px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    cursor: pointer;
    padding: 0;
}

.coordeble-hero-dot.is-active {
    background: rgba(255,255,255,1);
}

.coordeble-hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 999px;
    background: rgba(0,0,0,.35);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.coordeble-hero-prev {
    left: 20px;
}

.coordeble-hero-next {
    right: 20px;
}

.is-design-fullscreen .coordeble-hero-slide,
.is-design-swiper .coordeble-hero-slide {
    animation: coordebleHeroFade .4s ease;
}

@keyframes coordebleHeroFade {
    from {
        opacity: .4;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 767px) {
    .coordeble-hero-picture {
        height: 60vh;
        height: 60svh;
        max-height: 600px;
    }

    .coordeble-hero-copy {
        width: 88%;
    }

    .coordeble-hero-copy h1 {
        font-size: clamp(22px, 6vw, 30px);
    }

    .coordeble-hero-copy p {
        font-size: 14px;
    }

    .coordeble-hero-nav {
        width: 38px;
        height: 38px;
        font-size: 24px;
    }

    .coordeble-hero-prev {
        left: 10px;
    }

    .coordeble-hero-next {
        right: 10px;
    }
}

/* ========================================
   Coordeble Hero - Smooth Crossfade v0.6.1
======================================== */

/* スライダー時のみ画像を重ねる */
.coordeble-hero-section.is-slider .coordeble-hero-track {
    display: grid;
    overflow: hidden;
}

/* 全スライドを同じ位置に配置 */
.coordeble-hero-section.is-slider .coordeble-hero-slide {
    display: block;
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 1.2s ease-in-out,
        visibility 0s linear 1.2s;
    animation: none;
}

/* 表示対象の画像をゆっくりフェード表示 */
.coordeble-hero-section.is-slider .coordeble-hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 1;
    transition:
        opacity 1.2s ease-in-out,
        visibility 0s;
}

/* 動きを減らすOS設定にも対応 */
@media (prefers-reduced-motion: reduce) {
    .coordeble-hero-section.is-slider .coordeble-hero-slide {
        transition: none;
    }
}

/* ==========================================
   Coordeble CMS - Peek Slider v0.6.2
   Swiper形式のみ適用
========================================== */

.coordeble-hero-section.is-design-swiper.is-slider {
    --hero-slide-width: 82%;
    --hero-slide-gap: 16px;
}

/* 表示領域の外側を隠す */
.coordeble-hero-section.is-design-swiper.is-slider
.coordeble-hero-media {
    position: relative;
    overflow: hidden;
}

/* 画像を横一列に並べる */
.coordeble-hero-section.is-design-swiper.is-slider
.coordeble-hero-track {
    display: flex;
    gap: var(--hero-slide-gap);
    width: 100%;
    overflow: visible;
    transition: transform .7s cubic-bezier(.25,.8,.25,1);
    will-change: transform;
}

/* すべてのスライドを横並びで表示 */
.coordeble-hero-section.is-design-swiper.is-slider
.coordeble-hero-slide {
    display: block;
    position: relative;
    flex: 0 0 var(--hero-slide-width);
    width: var(--hero-slide-width);
    min-width: 0;
    grid-area: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: auto;
    transition: none;
    animation: none;
}

.coordeble-hero-section.is-design-swiper.is-slider
.coordeble-hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    transition: none;
}

/* 画像の見た目 */
.coordeble-hero-section.is-design-swiper.is-slider
.coordeble-hero-picture {
    width: 100%;
    height: 520px;
    max-height: none;
    overflow: hidden;
    border-radius: 8px;
}

.coordeble-hero-section.is-design-swiper.is-slider
.coordeble-hero-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ドットの視認性 */
.coordeble-hero-section.is-design-swiper.is-slider
.coordeble-hero-dots {
    bottom: 18px;
}

.coordeble-hero-section.is-design-swiper.is-slider
.coordeble-hero-dot {
    box-shadow: 0 1px 5px rgba(0,0,0,.25);
}

/* スマートフォン */
@media (max-width: 767px) {

    .coordeble-hero-section.is-design-swiper.is-slider {
        --hero-slide-width: 86%;
        --hero-slide-gap: 10px;
    }

    .coordeble-hero-section.is-design-swiper.is-slider
    .coordeble-hero-picture {
        height: 55vh;
        height: 55svh;
        max-height: 550px;
        border-radius: 5px;
    }

    .coordeble-hero-section.is-design-swiper.is-slider
    .coordeble-hero-nav {
        width: 34px;
        height: 34px;
        font-size: 22px;
    }
}

/* 動きを抑える設定 */
@media (prefers-reduced-motion: reduce) {
    .coordeble-hero-section.is-design-swiper.is-slider
    .coordeble-hero-track {
        transition: none;
    }
}

/* Coordeble Hero - Touch stability v0.6.4 */

.coordeble-hero-section.is-design-swiper.is-slider
.coordeble-hero-media {
    touch-action: pan-y;
}

.coordeble-hero-section.is-design-swiper.is-slider
.coordeble-hero-picture img {
    -webkit-user-drag: none;
    user-select: none;
}

/* ========================================
   Coordeble CMS FAQ v0.7.0
======================================== */

.coordeble-faq {
    max-width: 960px;
    margin: 0 auto;
    padding: 60px 20px;
}

.coordeble-faq-list {
    margin-top: 28px;
    border-top: 1px solid #ddd;
}

.coordeble-faq-item {
    border-bottom: 1px solid #ddd;
}

.coordeble-faq-question {
    position: relative;
    display: block;
    padding: 22px 42px 22px 8px;
    cursor: pointer;
    font-weight: 600;
    line-height: 1.6;
    list-style: none;
}

.coordeble-faq-question::-webkit-details-marker {
    display: none;
}

.coordeble-faq-question::after {
    content: '+';
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: 400;
}

.coordeble-faq-item[open] .coordeble-faq-question::after {
    content: '−';
}

.coordeble-faq-answer {
    padding: 0 12px 24px;
    line-height: 1.8;
}

.coordeble-faq-answer > :last-child {
    margin-bottom: 0;
}

.coordeble-faq-question:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .coordeble-faq {
        padding: 40px 16px;
    }

    .coordeble-faq-question {
        padding-top: 18px;
        padding-bottom: 18px;
    }
}

/* ========================================
   Coordeble CMS FAQ Search v0.8.0
======================================== */

.coordeble-faq-search {
    width: min(100% - 32px, 960px);
    margin: 40px auto 80px;
}

.coordeble-faq-search-form {
    padding: 24px;
    background: #f7f7f7;
    border-radius: 10px;
}

.coordeble-faq-search-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.coordeble-faq-search-input {
    display: flex;
    gap: 10px;
}

.coordeble-faq-search-input input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 10px 14px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
}

.coordeble-faq-search-input button {
    min-width: 85px;
    padding: 10px 18px;
    border: 0;
    border-radius: 5px;
    background: #333;
    color: #fff;
    cursor: pointer;
}

.coordeble-faq-search-category {
    margin-top: 18px;
}

.coordeble-faq-search-category select {
    width: 100%;
    max-width: 380px;
    min-height: 46px;
    padding: 8px 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
}

.coordeble-faq-search-results {
    margin-top: 30px;
}

.coordeble-faq-search-count {
    font-size: 14px;
    color: #666;
}

.coordeble-faq-search-empty {
    padding: 24px 0;
}

.coordeble-faq-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 30px;
}

.coordeble-faq-pagination a {
    text-decoration: underline;
}

@media (max-width: 767px) {
    .coordeble-faq-search {
        margin-top: 24px;
        margin-bottom: 48px;
    }

    .coordeble-faq-search-form {
        padding: 16px;
    }

    .coordeble-faq-search-input button {
        min-width: 72px;
        padding: 10px;
    }
}

/* ====================================
   Coordeble CMS - Product List
==================================== */

.coordeble-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 30px auto;
}

.coordeble-product-card {
    min-width: 0;
}

.coordeble-product-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.coordeble-product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f7f7f7;
    border-radius: 6px;
}

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

.coordeble-product-name {
    margin: 12px 0 6px;
    font-size: 16px;
    line-height: 1.5;
}

.coordeble-product-price {
    font-size: 15px;
    font-weight: 600;
}

@media (max-width: 767px) {
    .coordeble-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .coordeble-product-name,
    .coordeble-product-price {
        font-size: 14px;
    }
}

/* Coordeble CMS Product Layout v0.2 */

.coordeble-products .coordeble-product-grid.coordeble-layout-grid {
    display: grid;
    grid-template-columns: repeat(var(--coordeble-pc, 4), minmax(0, 1fr));
}

.coordeble-products .coordeble-product-grid.coordeble-layout-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 14px;
}

.coordeble-products .coordeble-layout-scroll > .coordeble-product-card {
    flex: 0 0 calc(
        (100% - (var(--coordeble-pc, 4) - 1) * 20px)
        / var(--coordeble-pc, 4)
    );
    scroll-snap-align: start;
}

.coordeble-products .coordeble-product-card[data-image-ratio="square"]
.coordeble-product-image {
    aspect-ratio: 1 / 1;
}

.coordeble-products .coordeble-product-card[data-image-ratio="portrait"]
.coordeble-product-image {
    aspect-ratio: 3 / 4;
}

.coordeble-products .coordeble-product-card[data-image-ratio="landscape"]
.coordeble-product-image {
    aspect-ratio: 4 / 3;
}

@media (max-width: 767px) {
    .coordeble-products .coordeble-product-grid.coordeble-layout-grid {
        grid-template-columns: repeat(var(--coordeble-sp, 2), minmax(0, 1fr));
    }

    .coordeble-products .coordeble-layout-scroll > .coordeble-product-card {
        flex-basis: calc(
            (100% - (var(--coordeble-sp, 2) - 1) * 16px)
            / var(--coordeble-sp, 2)
        );
    }

    .coordeble-products .coordeble-product-grid.coordeble-layout-scroll {
        gap: 16px;
    }
}

/* =====================================
   Coordeble CMS - Product Slider v0.3
===================================== */

.coordeble-products .coordeble-product-grid.coordeble-layout-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 10px;
}

.coordeble-products .coordeble-layout-slider::-webkit-scrollbar {
    display: none;
}

.coordeble-products .coordeble-layout-slider > .coordeble-product-card {
    flex: 0 0 calc(
        (100% - (var(--coordeble-pc, 4) - 1) * 20px)
        / var(--coordeble-pc, 4)
    );
    scroll-snap-align: start;
}

.coordeble-products .coordeble-slider-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    margin: 16px auto 0;
}

.coordeble-products .coordeble-slider-controls button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.coordeble-products .coordeble-slider-controls button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.coordeble-products .coordeble-slider-controls button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .coordeble-products .coordeble-product-grid.coordeble-layout-slider {
        gap: 16px;
    }

    .coordeble-products .coordeble-layout-slider > .coordeble-product-card {
        flex-basis: calc(
            (100% - (var(--coordeble-sp, 2) - 1) * 16px)
            / var(--coordeble-sp, 2)
        );
    }
}

@media (prefers-reduced-motion: reduce) {
    .coordeble-products .coordeble-layout-slider {
        scroll-behavior: auto;
    }
}

/* Coordeble CMS - Brand Section v0.1 */

.coordeble-brand-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 32px;
}

.coordeble-brand-bg-white {
    background: #fff;
}

.coordeble-brand-bg-light {
    background: #f7f7f7;
}

.coordeble-brand-image_right .coordeble-brand-media {
    order: 2;
}

.coordeble-brand-image_top {
    grid-template-columns: 1fr;
}

.coordeble-brand-media img {
    display: block;
    width: 100%;
    height: auto;
}

.coordeble-brand-subtitle {
    margin: 0 0 12px;
    font-size: 13px;
    letter-spacing: .12em;
    color: #777;
}

.coordeble-brand-heading {
    margin: 0 0 24px;
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.5;
}

.coordeble-brand-description {
    font-size: 16px;
    line-height: 1.9;
}

.coordeble-brand-button {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 12px 24px;
    border: 1px solid #333;
    color: #333;
    text-decoration: none;
}

@media (max-width: 767px) {
    .coordeble-brand-inner {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 32px 16px;
    }

    .coordeble-brand-image_right .coordeble-brand-media {
        order: 0;
    }

    .coordeble-brand-description {
        font-size: 14px;
    }
}
