/* ============================================================
   I-AREAシリーズ記事 専用CSS
   single-iarea.php からのみ条件付き読み込み
   全セレクタを .iarea-article でスコープ化し、
   既存テーマCSSとの衝突を回避する
   ============================================================ */

/* ---- CSS変数（テーマ共通のブランドカラーと揃える） ---- */
.iarea-article {
    --ia-accent: #8B7355;
    --ia-gold: #a68968;
    --ia-bg: #f7f5f2;
    --ia-ink: #3d3d3d;
    --ia-sub: #5a5449;
    --ia-cap: #8a8378;
    --ia-line: #efeae3;
    --ia-faint: #c7bcab;
}

/* ---- base ---- */
.iarea-article {
    background: var(--ia-bg);
    color: var(--ia-ink);
    font-size: 15px;
    line-height: 2;
    -webkit-font-smoothing: antialiased;
}
.iarea-article img {
    display: block;
    max-width: 100%;
    height: auto;
}
.iarea-article .serif {
    font-family: 'Noto Serif JP', serif;
}
.iarea-article .en-label {
    font-family: 'Noto Serif JP', serif;
    font-size: 11px;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--ia-gold);
}

/* ============ hero ============ */
.iarea-article .hero {
    position: relative;
    height: 560px;
    overflow: hidden;
}
.iarea-article .hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(.85);
}
.iarea-article .hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20,16,10,.55) 0%, rgba(20,16,10,0) 45%);
}
.iarea-article .hero-txt {
    position: absolute;
    left: 48px;
    bottom: 44px;
    z-index: 2;
    color: #fff;
}
.iarea-article .hero-txt .en-label {
    color: rgba(255,255,255,.8);
    display: block;
    margin-bottom: 14px;
}
.iarea-article .hero-txt h1 {
    font-family: 'Noto Serif JP', serif;
    font-size: 42px;
    font-weight: 600;
    letter-spacing: .14em;
    line-height: 1.4;
}
.iarea-article .hero-txt .hero-meta {
    margin-top: 12px;
    font-size: 13px;
    letter-spacing: .12em;
    color: rgba(255,255,255,.85);
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}
.iarea-article .hero-txt .hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.iarea-article .hero-txt .hero-meta span::before {
    content: '';
    width: 14px;
    height: 1px;
    background: rgba(255,255,255,.55);
}

/* ============ intro ============ */
.iarea-article .intro {
    max-width: 760px;
    margin: 0 auto;
    padding: 88px 32px 96px;
    text-align: center;
}
.iarea-article .intro .en-label {
    display: block;
    margin-bottom: 22px;
}
.iarea-article .intro p {
    text-align: left;
    color: var(--ia-sub);
    margin-bottom: 1.6em;
}
.iarea-article .intro p:last-child {
    margin-bottom: 0;
}

/* ============ sticky split sections ============ */
.iarea-article .works {
    border-top: 1px solid var(--ia-line);
}
.iarea-article .work {
    display: grid;
    grid-template-columns: 38% 62%;
    border-bottom: 1px solid var(--ia-line);
}
.iarea-article .work.flip .work-text {
    order: 2;
}
.iarea-article .work.flip .work-photos {
    order: 1;
}
.iarea-article .work-text {
    padding: 72px 56px;
}
.iarea-article .work-text-inner {
    position: sticky;
    /* 固定ヘッダー（70px）+ 余白20px = 90px */
    top: 90px;
}
.iarea-article .work-num {
    font-family: 'Noto Serif JP', serif;
    font-size: 13px;
    letter-spacing: .3em;
    color: var(--ia-faint);
    display: block;
    margin-bottom: 18px;
}
.iarea-article .work-text h3 {
    font-family: 'Noto Serif JP', serif;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: .1em;
    line-height: 1.7;
    margin-bottom: 20px;
}
.iarea-article .work-rule {
    width: 36px;
    height: 1px;
    background: var(--ia-gold);
    border: none;
    margin: 0 0 26px;
}
.iarea-article .work-text p {
    color: var(--ia-sub);
    font-size: 14.5px;
    margin-bottom: 1.5em;
}
.iarea-article .work-text p:last-child {
    margin-bottom: 0;
}
.iarea-article .work-photos {
    padding: 72px 56px;
    display: flex;
    flex-direction: column;
    gap: 36px;
    border-left: 1px solid var(--ia-line);
}
.iarea-article .work.flip .work-photos {
    border-left: none;
    border-right: 1px solid var(--ia-line);
}
.iarea-article .work-photos figure {
    margin: 0;
}
.iarea-article .work-photos figcaption {
    font-size: 12px;
    letter-spacing: .08em;
    color: var(--ia-cap);
    margin-top: 10px;
}
/* 画像1枚のセクション: テキストに対して中央寄せ */
.iarea-article .work-photos.single {
    justify-content: center;
}

/* ============ other works ============ */
.iarea-article .others {
    border-top: 1px solid var(--ia-line);
    padding: 80px 48px 90px;
}
.iarea-article .others-head {
    text-align: center;
    margin-bottom: 44px;
}
.iarea-article .others-head .en-label {
    display: block;
    margin-bottom: 14px;
}
.iarea-article .others-head h2 {
    font-family: 'Noto Serif JP', serif;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: .14em;
}
.iarea-article .others-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    max-width: 1200px;
    margin: 0 auto;
}
.iarea-article .other-card {
    background: #fff;
    border: 1px solid var(--ia-line);
    text-decoration: none;
    color: inherit;
    transition: box-shadow .3s ease;
}
.iarea-article .other-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,.08);
}
.iarea-article .other-card .thumb {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: repeating-linear-gradient(-45deg, #f0ece5, #f0ece5 10px, #f7f4ef 10px, #f7f4ef 20px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.iarea-article .other-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.iarea-article .other-card:hover .thumb img {
    transform: scale(1.04);
}
.iarea-article .other-card .thumb span {
    font-size: 11px;
    letter-spacing: .15em;
    color: var(--ia-faint);
}
.iarea-article .other-card .body {
    padding: 16px 18px 20px;
}
.iarea-article .other-card .no {
    font-family: 'Noto Serif JP', serif;
    font-size: 11px;
    letter-spacing: .25em;
    color: var(--ia-gold);
    display: block;
    margin-bottom: 6px;
}
.iarea-article .other-card h4 {
    font-family: 'Noto Serif JP', serif;
    font-size: 15.5px;
    font-weight: 500;
    letter-spacing: .08em;
    margin-bottom: 4px;
}
.iarea-article .other-card p {
    font-size: 12px;
    color: var(--ia-cap);
    letter-spacing: .05em;
    margin: 0;
}

/* ============ CTA ============ */
.iarea-article .cta {
    border-top: 1px solid var(--ia-line);
    background: #efe9e1;
    text-align: center;
    padding: 92px 32px;
}
.iarea-article .cta .en-label {
    display: block;
    margin-bottom: 18px;
}
.iarea-article .cta h2 {
    font-family: 'Noto Serif JP', serif;
    font-size: 26px;
    font-weight: 500;
    letter-spacing: .14em;
    line-height: 1.9;
    margin-bottom: 18px;
}
.iarea-article .cta p {
    color: var(--ia-sub);
    font-size: 14px;
    margin-bottom: 36px;
}
.iarea-article .cta .btn {
    display: inline-block;
    font-family: 'Noto Serif JP', serif;
    font-size: 14px;
    letter-spacing: .28em;
    color: var(--ia-ink);
    border: 1px solid var(--ia-ink);
    padding: 16px 58px;
    text-decoration: none;
    transition: background .3s, color .3s;
}
.iarea-article .cta .btn:hover {
    background: var(--ia-ink);
    color: #fff;
}

/* ============ reveal (opacity only — sticky-safe) ============ */
/* 既存テーマの .reveal/.reveal.is-visible との衝突を回避するため
   .ia-reveal クラスを使用 */
.iarea-article .ia-reveal {
    opacity: 0;
    transition: opacity 1s ease;
}
.iarea-article .ia-reveal.on {
    opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
    .iarea-article .ia-reveal {
        opacity: 1;
        transition: none;
    }
}

/* ============================================================
   レスポンシブ: 1024px以下
   ============================================================ */
@media (max-width: 1024px) {
    /* 左右分割を解除し1カラム縦積み（テキスト→画像） */
    .iarea-article .work {
        grid-template-columns: 1fr;
    }
    .iarea-article .work.flip .work-text {
        order: 1; /* 常にテキストが先 */
    }
    .iarea-article .work.flip .work-photos {
        order: 2;
    }
    .iarea-article .work-text {
        padding: 56px 32px 8px;
    }
    /* sticky 解除 */
    .iarea-article .work-text-inner {
        position: static;
    }
    .iarea-article .work-photos {
        padding: 36px 32px 60px;
        border-left: none;
        gap: 28px;
    }
    .iarea-article .work.flip .work-photos {
        border-right: none;
    }
    /* 施工例一覧を2カラムに */
    .iarea-article .others-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   レスポンシブ: 768px以下
   ============================================================ */
@media (max-width: 768px) {
    .iarea-article .hero {
        height: 360px;
    }
    .iarea-article .hero-txt {
        left: 24px;
        bottom: 28px;
        right: 24px;
    }
    .iarea-article .hero-txt h1 {
        font-size: 26px;
    }
    .iarea-article .intro {
        padding: 60px 24px 64px;
    }
    .iarea-article .work-text h3 {
        font-size: 20px;
    }
    .iarea-article .work-text {
        padding: 48px 24px 8px;
    }
    .iarea-article .work-photos {
        padding: 28px 24px 48px;
        gap: 20px;
    }
    /* 画像はアスペクト比4:3を維持 */
    .iarea-article .work-photos img {
        aspect-ratio: 4/3;
        object-fit: cover;
    }
    .iarea-article .others {
        padding: 60px 24px;
    }
    .iarea-article .others-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }
    .iarea-article .cta {
        padding: 64px 24px;
    }
    .iarea-article .cta h2 {
        font-size: 20px;
    }
}
