/* =========================================
   Reset & Base (Matched index.html & news_list.html)
   ========================================= */
html {
    font-size: 62.5%;
    /* 1rem = 10px */
    scroll-behavior: smooth;
}

:root {
    --color-primary: #333333;
    --color-accent-brand: #4CB5A2;
    /* ブランド戦略室カラー */
    --color-accent-data: #2C5282;
    /* データ分析室カラー */
    --color-accent: #4CB5A2;
    /* 共通アクセント */
    --color-accent-dark: #3A8F7F;
    /* ホバー用 */
    --color-bg-gray: #F5F5F5;
    --color-border: #E9E9E9;
    --font-base: 'Noto Sans JP', sans-serif;
    --font-en: 'Manrope', sans-serif;
    --header-height: 80px;
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-base);
    color: var(--color-primary);
    line-height: 1.8;
    /* 詳細ページは読みやすさ重視で少し広め */
    font-size: 1.6rem;
    letter-spacing: 0.01em;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    padding-top: var(--header-height);
    overflow-x: hidden;
    background-color: #fff;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
}

a:not(.c-btn):not(.link-with-arrow):not(.c-mobile-cta-btn):not(.p-floating-cta__btn):not(.c-back-link):not(.wp-block-button__link):hover {
    opacity: 0.7;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: bottom;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Animation Utilities */
.js-scroll-fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.0s var(--ease-out-expo), transform 1.0s var(--ease-out-expo);
}

.js-scroll-fade-up.is-show {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   Header Styles (From index.html)
   ========================================= */
.p-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: #fff;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.p-header__logo img {
    width: 180px;
    display: block;
}

.p-header__nav {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.p-nav__list {
    display: flex;
    align-items: center;
}

.p-nav__item {
    position: relative;
    padding: 0 24px;
}

.p-nav__item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px;
    background-color: #ccc;
}

.p-nav__link {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    display: block;
    white-space: nowrap;
    position: relative;
}

.p-nav__link::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #333;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s var(--ease-out-expo);
}

.p-nav__link:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.p-header__right-content {
    display: flex;
    gap: 12px;
    align-items: center;
}

.c-header-btn {
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 50px;
    background-color: #F5F5F5;
    color: #333;
    padding: 10px 24px;
    transition: all 0.3s;
    white-space: nowrap;
}

.c-header-btn:hover {
    background-color: #333;
    color: #fff;
    transform: translateY(-2px);
}

.c-header-btn--primary {
    background-color: #333;
    color: #fff;
}

.c-hamburger {
    display: none;
    width: 40px;
    height: 40px;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    margin-left: 10px;
}

.c-hamburger span {
    position: absolute;
    left: 5px;
    width: 30px;
    height: 2px;
    background-color: #333;
    transition: all 0.3s;
}

.c-hamburger span:nth-of-type(1) {
    top: 12px;
}

.c-hamburger span:nth-of-type(2) {
    top: 19px;
}

.c-hamburger span:nth-of-type(3) {
    top: 26px;
}

.c-hamburger.is-active span:nth-of-type(1) {
    top: 19px;
    transform: rotate(45deg);
}

.c-hamburger.is-active span:nth-of-type(2) {
    opacity: 0;
}

.c-hamburger.is-active span:nth-of-type(3) {
    top: 19px;
    transform: rotate(-45deg);
}

/* Mobile Menu */
.p-mobile-header {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: #fff;
    z-index: 999;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-out-expo);
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
}

.p-mobile-header.is-active {
    transform: translateX(0);
}

.p-mobile-header__inner {
    padding: 20px 20px 40px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.p-mobile-header__nav-item {
    border-bottom: 1px solid #eee;
}

.p-mobile-header__nav-item a {
    display: block;
    padding: 16px 0;
    font-size: 1.6rem;
    font-weight: 700;
    width: 100%;
    text-align: left;
}

.p-mobile-header__cta-area {
    margin-top: 2rem;
    padding-top: 30px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.c-mobile-cta-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 16px;
    font-size: 1.6rem;
    font-weight: 700;
    border-radius: 4px;
    text-align: center;
    transition: all 0.3s;
    line-height: 1.4;
    gap: 10px;
}

.c-mobile-cta-btn--secondary {
    background-color: #fff;
    color: #333;
    border: 1px solid #333;
}

.c-mobile-cta-btn--primary {
    background-color: #333;
    color: #fff;
    border: 1px solid #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* =========================================
   Breadcrumb
   ========================================= */
.p-breadcrumb {
    background-color: var(--color-bg-gray);
    padding: 20px 0;
    font-size: 1.2rem;
    color: #666;
}

.p-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.p-breadcrumb li {
    display: flex;
    align-items: center;
}

.p-breadcrumb li:not(:last-child)::after {
    content: '>';
    margin-left: 8px;
    font-family: var(--font-en);
}

.p-breadcrumb a:hover {
    text-decoration: underline;
}

/* =========================================
   News Detail Layout
   ========================================= */
.section-news-detail {
    padding: 80px 0 100px;
}

.news-detail-container {
    max-width: 800px;
    margin: 0 auto;
}

/* News Header */
.news-header {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--color-border);
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.news-date {
    font-family: var(--font-en);
    color: #666;
    font-size: 1.4rem;
    font-weight: 500;
}

.news-category {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    line-height: 1;
    color: #333;
    border: 1px solid #333;
}

/* Specific Category Colors */
.cat-brand {
    color: var(--color-accent-brand);
    border-color: var(--color-accent-brand);
}

.cat-data {
    color: var(--color-accent-data);
    border-color: var(--color-accent-data);
}

.cat-corp {
    color: #333;
    border-color: #333;
}

.news-title {
    font-size: 3.2rem;
    font-weight: 900;
    line-height: 1.4;
    color: #333;
}

/* =========================================
   News Body (Content) - Matched Blog Style
   ========================================= */
.news-content {
    font-size: 1.6rem;
    line-height: 1.9;
    color: #333;
    margin-bottom: 80px;
}

/* Paragraphs */
.news-content p {
    margin-bottom: 24px;
}

.news-content p:last-child {
    margin-bottom: 0;
}

/* Headings (Matched blog_detail.html) */
.news-content h2 {
    font-size: 2.4rem;
    font-weight: 900;
    margin: 60px 0 30px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--color-accent-brand);
    line-height: 1.4;
}

.news-content h3 {
    font-size: 2.0rem;
    font-weight: 900;
    margin: 40px 0 24px;
    padding-left: 16px;
    border-left: 5px solid var(--color-accent-brand);
    line-height: 1.4;
}

.news-content h4 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 30px 0 20px;
}

/* Lists */
.news-content ul,
.news-content ol {
    margin-bottom: 30px;
    padding: 24px 30px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.news-content ul li {
    list-style: none;
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
}

.news-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-accent-brand);
}

.news-content ul li:last-child {
    margin-bottom: 0;
}

.news-content ol {
    padding-left: 50px;
    /* 番号分の余白 */
}

.news-content ol li {
    list-style: decimal;
    margin-bottom: 10px;
    padding-left: 4px;
}

/* Images (figure) */
.news-content figure {
    margin: 40px 0;
}

.news-content figcaption {
    font-size: 1.2rem;
    color: #888;
    text-align: center;
    margin-top: 8px;
}

/* Blockquote */
.news-content blockquote {
    margin: 40px 0;
    padding: 30px;
    background-color: #f0f8f6;
    /* 淡いブランドカラー */
    border-left: 4px solid var(--color-accent-brand);
    position: relative;
}

.news-content blockquote p {
    margin-bottom: 0;
    font-weight: 700;
}

.news-content blockquote cite {
    display: block;
    margin-top: 16px;
    font-size: 1.2rem;
    color: #666;
    font-style: normal;
    text-align: right;
}

/* Table */
.news-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 40px 0;
    font-size: 1.5rem;
}

.news-content th,
.news-content td {
    padding: 16px;
    border: 1px solid #ddd;
}

.news-content th {
    background-color: #f5f5f5;
    font-weight: 700;
    text-align: left;
    width: 30%;
}

/* Mobile scroll for table */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Button Block */
.wp-block-button {
    margin: 40px 0;
    text-align: center;
}

.wp-block-button__link {
    display: inline-block;
    background-color: var(--color-accent-brand);
    color: #fff;
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(76, 181, 162, 0.3);
    text-decoration: none;
}

.wp-block-button__link:hover {
    transform: translateY(-2px);
    background-color: var(--color-accent-dark);
    color: #fff;
}

/* Marker (Highlighter) */
.marker {
    background: linear-gradient(transparent 60%, #ffe9a6 60%);
}

/* Custom Box */
.news-box {
    border: 2px solid var(--color-accent-brand);
    padding: 30px;
    border-radius: 8px;
    margin: 40px 0;
}

.news-box-title {
    font-weight: 900;
    font-size: 1.8rem;
    color: var(--color-accent-brand);
    margin-bottom: 16px;
    display: block;
}

/* General Links in Content */
.news-content a:not(.wp-block-button__link) {
    color: var(--color-accent-brand);
    text-decoration: underline;
}

.news-content a:not(.wp-block-button__link):hover {
    text-decoration: none;
}

/* =========================================
   News Footer (Navigation)
   ========================================= */
.news-footer {
    border-top: 1px solid var(--color-border);
    padding-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.c-back-link {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.6rem;
    color: #333;
    transition: opacity 0.3s;
    gap: 8px;
}

.c-back-link__icon {
    width: 32px;
    height: 32px;
    border: 1px solid #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.3s;
    background-color: #fff;
}

.c-back-link:hover {
    opacity: 0.7;
}

.c-back-link:hover .c-back-link__icon {
    background-color: #333;
    color: #fff;
    transform: translateX(-4px);
}

/* Prev/Next Navigation */
.news-nav {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
}

.news-nav-link {
    display: flex;
    flex-direction: column;
    width: 48%;
    font-size: 1.4rem;
    color: #666;
    transition: opacity 0.3s;
}

.news-nav-link:hover {
    opacity: 0.7;
    color: var(--color-accent-brand);
}

.news-nav-link--prev {
    align-items: flex-start;
    text-align: left;
}

.news-nav-link--next {
    align-items: flex-end;
    text-align: right;
}

.news-nav-label {
    font-family: var(--font-en);
    font-size: 1.2rem;
    color: #999;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.news-nav-title {
    font-weight: 700;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* =========================================
   Footer (Same as index.html)
   ========================================= */
.site-footer {
    background-color: #222;
    color: #fff;
    padding: 80px 0 20px;
    font-size: 1.3rem;
}

/* 【修正】フッター内のコンテナにposition:relativeを追加 */
.site-footer .container {
    position: relative;
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 60px;
}

.footer-logo img {
    width: 200px;
    height: auto;
    display: block;
    filter: brightness(0) invert(1);
}

.footer-nav {
    display: flex;
    gap: 60px;
}

.footer-nav h4 {
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 16px;
    font-weight: 700;
}

.footer-nav ul li {
    margin-bottom: 12px;
}

.footer-nav a {
    color: #fff;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-nav a:hover {
    opacity: 1;
}

.copyright {
    text-align: center;
    border-top: 1px solid #444;
    padding-top: 20px;
    font-family: var(--font-en);
    font-size: 1.2rem;
    opacity: 0.6;
}

.back-to-top {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 48px;
    height: 48px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #222;
    font-size: 2.0rem;
    transition: all 0.3s;
}

.back-to-top:hover {
    opacity: 0.8;
    transform: translateY(-5px);
}

.back-to-top::before {
    content: '↑';
    font-family: sans-serif;
    font-weight: bold;
}

/* Floating CTA */
.p-floating-cta {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 900;
    font-family: var(--font-base);
    transition: transform 0.3s var(--ease-out-expo);
}

.p-floating-cta__inner {
    background-color: #222;
    padding: 24px 20px;
    border-radius: 12px;
    width: 280px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    text-align: center;
}

.p-floating-cta__close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 28px;
    height: 28px;
    background-color: #fff;
    border-radius: 50%;
    border: 1px solid #eee;
    color: #333;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s;
}

.p-floating-cta__title {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.4;
}

.p-floating-cta__buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.p-floating-cta__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 42px;
    border-radius: 25px;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    position: relative;
    transition: opacity 0.3s, transform 0.3s;
}

.p-floating-cta__btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.p-floating-cta__btn--primary {
    background-color: var(--color-accent);
    color: #fff;
}

.p-floating-cta__btn--secondary {
    background-color: #fff;
    color: #333;
}

.p-floating-cta__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #fff;
    margin-right: 12px;
    position: relative;
    top: 1px;
}

.p-floating-cta__dot--green {
    background-color: var(--color-accent);
}

.p-floating-cta__toggle {
    display: none;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 1024px) {

    .p-header__nav,
    .c-header-btn {
        display: none;
    }

    .c-hamburger {
        display: block;
    }

    .footer-row {
        flex-direction: column;
        gap: 40px;
    }

    .footer-nav {
        flex-direction: column;
        gap: 40px;
    }

    /* 【修正】トップへ戻るボタンの位置調整（CTA回避のため底上げ） */
    .back-to-top {
        bottom: 140px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    body {
        font-size: 1.5rem;
    }

    .p-header {
        padding: 0 20px;
    }

    .p-header__logo img {
        width: 160px;
    }

    /* News Detail SP */
    .section-news-detail {
        padding: 40px 0 80px;
    }

    .news-header {
        margin-bottom: 40px;
        padding-bottom: 30px;
    }

    .news-title {
        font-size: 2.4rem;
    }

    .news-meta {
        flex-wrap: wrap;
        gap: 12px;
    }

    .news-content h2 {
        font-size: 2.0rem;
        margin: 40px 0 20px;
    }

    .news-content h3 {
        font-size: 1.8rem;
    }

    .news-content ul,
    .news-content ol {
        padding: 20px 20px 20px 40px;
    }

    .news-nav {
        flex-direction: column;
        gap: 30px;
    }

    .news-nav-link {
        width: 100%;
        align-items: flex-start;
        text-align: left;
    }

    .news-nav-link--next {
        align-items: flex-start;
        text-align: left;
    }

    /* SPは全部左揃えが見やすい */
    .news-nav-link--next .news-nav-label {
        flex-direction: row-reverse;
        align-self: flex-end;
    }

    /* Nextラベルだけ右に置くなど調整可だがシンプルに */

    /* Footer & CTA */
    .p-floating-cta {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        z-index: 2000;
        transform: translateY(0);
    }

    .p-floating-cta.is-closed {
        transform: translateY(100%);
    }

    .p-floating-cta__inner {
        width: 100%;
        border-radius: 16px 16px 0 0;
        padding: 16px 16px 24px;
    }

    .p-floating-cta__close {
        display: none;
    }

    .p-floating-cta__buttons {
        flex-direction: row;
        gap: 8px;
    }

    .p-floating-cta__btn {
        font-size: 1.2rem;
        height: 44px;
    }

    .p-floating-cta__toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: -32px;
        right: 10px;
        width: 44px;
        height: 32px;
        background-color: #222;
        border-radius: 8px 8px 0 0;
        border: none;
        cursor: pointer;
        color: #fff;
        box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    }

    .p-floating-cta__toggle::before {
        content: '';
        display: block;
        width: 10px;
        height: 10px;
        border-top: 2px solid #fff;
        border-right: 2px solid #fff;
        transform: rotate(135deg);
        transition: transform 0.3s;
        margin-top: -4px;
    }

    .p-floating-cta.is-closed .p-floating-cta__toggle::before {
        transform: rotate(-45deg);
        margin-top: 4px;
    }
}