/*
Theme Name: Kensaibou Tokyo
Theme URI: https://www.kensaibou-t.com/
Author: アベ印刷
Author URI: https://abeprint.co.jp/
Description: 建設業労働災害防止協会 東京支部 公式サイト用WordPressテーマ。Classic Editor + SiteOrigin Page Builder対応。Tailwind CSS + カスタムスタイルによるモダンデザイン。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kensaibou-tokyo
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
*/

/* ==========================================================================
   Tailwind CSS はCDNで読み込むため、ここではカスタムスタイルのみ記述
   ========================================================================== */

/* ベースフォント設定 */
body {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: #2c2c2c;
    background-color: #fff;
}

/* ==========================================================================
   アニメーション
   ========================================================================== */

/* Ken Burns エフェクト（ヒーロー画像用） */
@keyframes kenburns {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.05);
    }
}

.hero-img {
    animation: kenburns 20s ease-out infinite alternate;
}

/* フェードインアニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* ==========================================================================
   モバイルメニュー
   ========================================================================== */

/* パターンC：全画面フェードインメニュー */
#mobile-menu-fade {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-in-out, visibility 0.4s;
    pointer-events: none;
}

#mobile-menu-fade.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* メニュー項目の出現アニメーション */
#mobile-menu-fade nav a,
#mobile-menu-fade nav .mobile-nav-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#mobile-menu-fade.open nav a,
#mobile-menu-fade.open nav .mobile-nav-item {
    opacity: 1;
    transform: translateY(0);
}

/* 順番に表示 */
#mobile-menu-fade.open nav>*:nth-child(1) {
    transition-delay: 0.1s;
}

#mobile-menu-fade.open nav>*:nth-child(2) {
    transition-delay: 0.15s;
}

#mobile-menu-fade.open nav>*:nth-child(3) {
    transition-delay: 0.2s;
}

#mobile-menu-fade.open nav>*:nth-child(4) {
    transition-delay: 0.25s;
}

#mobile-menu-fade.open nav>*:nth-child(5) {
    transition-delay: 0.3s;
}

#mobile-menu-fade.open nav>*:nth-child(6) {
    transition-delay: 0.35s;
}

#mobile-menu-fade.open nav>*:nth-child(7) {
    transition-delay: 0.4s;
}

#mobile-menu-fade.open nav>*:nth-child(8) {
    transition-delay: 0.45s;
}

#mobile-menu-fade.open nav>*:nth-child(9) {
    transition-delay: 0.5s;
}

#mobile-menu-fade.open nav>*:nth-child(10) {
    transition-delay: 0.55s;
}

/* ==========================================================================
   タブコンポーネント（下層ページ用）
   ========================================================================== */

.tab-btn.active {
    background-color: #2c2c2c;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-0.25rem);
}

.tab-btn.active .tab-indicator {
    display: block;
}

.tab-btn.active i {
    color: #bfa57d;
}

.tab-btn.inactive {
    background-color: white;
    border: 1px solid #e5e7eb;
    color: #6b7280;
}

.tab-btn.inactive:hover {
    background-color: #f9fafb;
    color: #2c2c2c;
}

.tab-btn.inactive .tab-indicator {
    display: none;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-out forwards;
}

/* ==========================================================================
   展開カードコンポーネント
   ========================================================================== */

.expand-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

.expand-content.open {
    max-height: 500px;
    opacity: 1;
    transition: max-height 0.5s ease-in, opacity 0.3s ease-in;
}

.expand-btn {
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
    color: #2c2c2c;
    padding: 0.5rem 0;
}

.expand-btn:hover {
    color: #bfa57d;
}

.expand-btn .expand-icon {
    transition: transform 0.3s ease;
}

.expand-btn.active .expand-icon {
    transform: rotate(180deg);
}

.text-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-clamp-none {
    -webkit-line-clamp: unset;
}

/* ==========================================================================
   ヘッダードロップダウンメニュー
   ========================================================================== */

.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-self: center;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    min-width: 220px;
    background: white;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    z-index: 60;
    pointer-events: none;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: white;
    border-left: 1px solid #e5e7eb;
    border-top: 1px solid #e5e7eb;
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
}

.nav-dropdown-menu a:last-child {
    border-bottom: none;
}

.nav-dropdown-menu a:hover {
    background-color: #2c2c2c;
    color: white;
}

.nav-dropdown-menu a:hover .dropdown-sub {
    color: #bfa57d;
}

.dropdown-sub {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: #9ca3af;
    margin-top: 2px;
    transition: color 0.2s ease;
}

html {
    scroll-padding-top: 120px;
}

/* テーブルの行間 */
th,
td {
    line-height: 1.6;
}

/* モバイルナビゲーションのアコーディオン */
.mobile-nav-dropdown {
    display: flex;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, margin 0.3s ease-in-out, padding 0.3s ease-in-out;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    border-color: transparent;
}

.mobile-nav-dropdown.open {
    max-height: 800px;
    opacity: 1;
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
    margin-top: 0.25rem;
    border-color: #f3f4f6;
}

/* ==========================================================================
   WordPress 固有スタイル
   ========================================================================== */

/* パスワード保護フォーム */
.post-password-form {
    max-width: 480px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.post-password-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    color: #2c2c2c;
}

.post-password-form input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #f4f4f2;
    border: 1px solid transparent;
    outline: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.post-password-form input[type="password"]:focus {
    border-color: #bfa57d;
    background-color: white;
}

.post-password-form input[type="submit"] {
    display: inline-block;
    padding: 0.75rem 3rem;
    background-color: #2c2c2c;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.post-password-form input[type="submit"]:hover {
    background-color: #bfa57d;
}

/* Contact Form 7 スタイル */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea,
.wpcf7 select {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #f4f4f2;
    border: 1px solid transparent;
    outline: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 textarea:focus,
.wpcf7 select:focus {
    border-color: #bfa57d;
    background-color: white;
}

.wpcf7 input[type="submit"] {
    display: inline-block;
    padding: 1rem 4rem;
    background-color: #2c2c2c;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.wpcf7 input[type="submit"]:hover {
    background-color: #bfa57d;
}

.wpcf7 .wpcf7-not-valid-tip {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.wpcf7 .wpcf7-response-output {
    border: 1px solid #e5e7eb;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* WordPress エディター用コンテンツスタイル */
.entry-content h2 {
    font-size: 1.5rem;
    font-weight: 500;
    font-family: 'Shippori Mincho', serif;
    color: #2c2c2c;
    margin-bottom: 1.5rem;
    margin-top: 3rem;
    padding-left: 1.5rem;
    border-left: 4px solid #bfa57d;
}

.entry-content h3 {
    font-size: 1.125rem;
    font-weight: 500;
    font-family: 'Shippori Mincho', serif;
    color: #2c2c2c;
    margin-bottom: 1rem;
    margin-top: 2rem;
    padding-left: 1rem;
    border-left: 4px solid #bfa57d;
}

.entry-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #2c2c2c;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.entry-content p {
    font-size: 1rem;
    color: #4b5563;
    line-height: 2;
    margin-bottom: 1.5rem;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.entry-content ul li {
    list-style-type: disc;
    margin-bottom: 0.5rem;
    color: #4b5563;
}

.entry-content ol li {
    list-style-type: decimal;
    margin-bottom: 0.5rem;
    color: #4b5563;
}

.entry-content a {
    color: #bfa57d;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.entry-content a:hover {
    color: #2c2c2c;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.entry-content table th,
.entry-content table td {
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

.entry-content table th {
    background-color: #f4f4f2;
    font-weight: 700;
    text-align: left;
}

.entry-content img {
    max-width: 100%;
    height: auto;
}

.entry-content blockquote {
    border-left: 4px solid #bfa57d;
    padding: 1rem 1.5rem;
    background-color: #f4f4f2;
    margin-bottom: 1.5rem;
    font-style: italic;
    color: #6b7280;
}

/* SiteOrigin Page Builder 対応 */
.so-widget-sow-editor .entry-content,
.panel-widget-style .entry-content {
    /* SiteOriginウィジェット内のスタイルも統一 */
}

.so-panel {
    margin-bottom: 0;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    background-color: white;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover {
    background-color: #2c2c2c;
    color: white;
    border-color: #2c2c2c;
}

.pagination .page-numbers.current {
    background-color: #2c2c2c;
    color: white;
    border-color: #2c2c2c;
}

.pagination .page-numbers.dots {
    border: none;
    background: none;
}

.pagination .page-numbers.prev,
.pagination .page-numbers.next {
    width: auto;
    padding: 0 1rem;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

/* カスタムスクロールバー */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}