/**
 * WordPress & SWELL Override Styles
 * WordPressとSWELLテーマの不要な要素を非表示にし、カスタムデザインを優先させる
 */

/* WordPressのデフォルト要素を非表示 */
.wp-block-post-title,
.entry-header,
.entry-content > .alignwide,
.entry-content > .alignfull,
.wp-block-separator {
    display: none;
}

/* SWELLの不要な要素を非表示 */
#swellHeader,
#swellFooter,
.swell-header,
.swell-footer,
.p-breadcrumb,
.c-postHeader,
.p-entryContent__title,
.p-entryContent__excerpt,
.p-article__footer,
.p-article__share,
.p-article__author,
.p-relatedPosts,
.c-container--has-sidebar,
.l-sidebar,
.p-pager,
.p-fixHeader,
.p-spMenu,
.c-footer,
.l-footer {
    display: none !important;
}

/* body要素のスタイルをリセット */
body {
    background-color: #fafffb !important;
    overflow-x: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

/* ページ全体のレイアウトをリセット */
.l-body,
.l-body__inner,
#wrapper,
#container,
.l-content,
.l-content__inner,
.l-mainContent,
.l-mainContent__inner,
.swell-content,
#main_content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* 記事コンテンツエリアのスタイルをリセット（コンテナ自体のみ） */
/* ただし、記事ページ（Works/News/投稿）とプライバシーポリシー・固定ページは除外 */
body:not(.single):not(.privacy-policy):not(.page) .p-article,
body:not(.single):not(.privacy-policy):not(.page) .p-article__body {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* コンテンツエリア：外側の余白のみリセット、内部のブロック余白は保持 */
/* ただし、記事ページ（Works/News/投稿）とプライバシーポリシー・固定ページは除外（SWELLのスタイルを保持） */
body:not(.single):not(.privacy-policy):not(.page) .p-entryContent,
body:not(.single):not(.privacy-policy):not(.page) .post-content,
body:not(.single):not(.privacy-policy):not(.page) .entry-content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* WordPress標準: ブロックエディターのデフォルト余白設定（ブロックレベル要素のみ） */
/* ただし、記事ページ（Works/News/投稿）とプライバシーポリシー・固定ページは除外（SWELLのスタイルを保持） */
/* WordPressブロック */
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-paragraph:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-image:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-gallery:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-list:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-quote:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-code:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-separator:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-spacer:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-table:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-media-text:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-columns:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-group:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-cover:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-embed:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-video:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-audio:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-file:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-button:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .wp-block-buttons:not([style*="margin"]):not([class*="u-mb-"]) {
    margin-bottom: 2rem;
}

/* SWELLブロック */
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .swell-block-accordion:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .swell-block-step:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .swell-block-fullwide:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .swell-block-balloon:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .swell-block-box:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .swell-block-button:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .swell-block-faq:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .swell-block-post-link:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .swell-block-dl:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .swell-block-tab:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > .swell-block-linkList:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > [class*="swell-block-"]:not([style*="margin"]):not([class*="u-mb-"]):not(svg):not(span):not(a) {
    margin-bottom: 2rem;
}

/* 標準HTML要素（ブロックレベルのみ） */
/* ただし、記事ページ（Works/News/投稿）とプライバシーポリシー・固定ページは除外（SWELLのスタイルを保持） */
body:not(.single):not(.privacy-policy):not(.page) .entry-content > h1:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > h2:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > h3:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > h4:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > h5:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > h6:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > p:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > ul:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > ol:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > figure:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > blockquote:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > pre:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > table:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > hr:not([style*="margin"]):not([class*="u-mb-"]),
body:not(.single):not(.privacy-policy):not(.page) .entry-content > div:not([style*="margin"]):not([class*="u-mb-"]):not([class*="__icon"]):not([class*="__svg"]) {
    margin-bottom: 2rem;
}

/* 最後の要素は余白なし（アーカイブページのみ） */
body:not(.single):not(.privacy-policy):not(.page) .entry-content > *:last-child {
    margin-bottom: 0;
}

/* ヘッダーの固定位置調整（管理バー対応） */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1002 !important;
}

/* 管理バー表示時のヘッダー位置調整 */
body.admin-bar .header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .header {
        top: 46px;
    }
}

/* メインコンテンツのマージン調整 */
main {
    margin-top: 0;
    padding-top: 0;
}


/* ページローダーとスプラッシュを制御 */
.page-load-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.8s ease-out;
}

.splash-screen {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Page Content: Match detail page styles (removed privacy-content, now uses detail-description) */
.page-content .entry-content {
    font-family: 'DNP ShueiGoKinStd', sans-serif !important;
}

.page-content .entry-content p {
    font-family: 'DNP ShueiGoKinStd', sans-serif !important;
    font-size: clamp(14px, 1.19vw, 18px);
    font-weight: 300;
    color: #092217;
    line-height: 2;
}

@media (max-width: 767px) {
    .page-content .entry-content p {
        font-size: 13px;
    }
}

/* 見出しのフォントファミリーのみ調整（SWELLのスタイルとサイズは完全に保持） */
.page-content .entry-content h2,
.page-content .entry-content h3,
.page-content .entry-content h4,
.page-content .entry-content h5,
.page-content .entry-content h6 {
    font-family: 'DNP ShueiGoKinStd', sans-serif !important;
}

.page-content .entry-content ul,
.page-content .entry-content ol {
    font-family: 'DNP ShueiGoKinStd', sans-serif !important;
    font-size: clamp(14px, 1.19vw, 18px);
    font-weight: 300;
    color: #092217;
    line-height: 2;
}

@media (max-width: 767px) {
    .page-content .entry-content ul,
    .page-content .entry-content ol {
        font-size: 13px;
    }
}

.page-content .entry-content li {
    font-family: 'DNP ShueiGoKinStd', sans-serif !important;
}

.page-content .entry-content a {
    color: #092217;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: opacity 0.3s ease;
}

.page-content .entry-content a:hover {
    opacity: 0.7;
}

/* Work/News Detail Pages: Fix font family */
.page-works-detail .work-card__title,
.page-news-detail .work-card__title {
    font-family: DNP ShueiGoKinStd, sans-serif !important;
}

/* SWELL Icon Font: Fix font path if needed */
@font-face {
    font-family: icomoon;
    font-style: normal;
    font-weight: 400;
    src: url('/wp-content/themes/swell/assets/fonts/icomoon.woff2?fq24x') format("woff2"),
         url('/wp-content/themes/swell/assets/fonts/icomoon.ttf?fq24x') format("truetype"),
         url('/wp-content/themes/swell/assets/fonts/icomoon.woff?fq24x') format("woff"),
         url('/wp-content/themes/swell/assets/fonts/icomoon.svg?fq24x#icomoon') format("svg");
}

/* SWELL List Icons: Ensure position relative for :before pseudo-element */
[class*="is-style-"] li,
.-list-flex li {
    position: relative !important;
}

/* SWELL Numbered Circle List: Fix transform */
.is-style-num_circle li:before {
    top: calc(50% * .75) !important;
    transform: scale(.75) translateY(-50%) !important;
}

/* SWELL Flex List Styles */
ol.-list-flex,
ul.-list-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
}
