/**
 * Theme Name: JDX Badge Theme
 * Theme URI: https://jdxa.org/
 * Author: JDX Development Team
 * Author URI: https://jdxa.org/
 * Description: JDXスキルバッジ検証システム専用テーマ
 * Version: 1.0.0
 * License: GPL v2 or later
 * Text Domain: jdx-badge-theme
 */

/* ===================================
   CSS変数定義（JDX Ambassador Theme準拠）
   =================================== */
:root {
    /* カラーパレット */
    --primary: #0066cc;
    --accent: #e63946;
    --success: #4CAF50;
    --warning: #ff9800;
    --danger: #f44336;
    --text-dark: #333;
    --text-light: #666;
    --light: #f8f9fa;
    --gray: #f0f0f0;
    --white: #ffffff;
    --premium-gradient: linear-gradient(135deg, #0066cc, #231f20);
    
    /* タイポグラフィ */
    --font-family-base: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.7;
    
    /* スペーシング */
    --space-xs: 5px;
    --space-sm: 10px;
    --space-md: 20px;
    --space-lg: 30px;
    --space-xl: 40px;
    
    /* 角丸 */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    /* シャドウ */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* ===================================
   リセット & ベース
   =================================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-dark);
    background-color: var(--light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: var(--space-md);
    font-weight: bold;
    line-height: 1.4;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary);
}

h2 {
    font-size: 2rem;
    color: var(--text-dark);
}

h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
}

p {
    margin-top: 0;
    margin-bottom: var(--space-md);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent);
}

/* ===================================
   レイアウト
   =================================== */
#page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#content {
    flex: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container-narrow {
    max-width: 800px;
}

/* ===================================
   ヘッダー
   =================================== */
.site-header {
    background: #007aff;
    box-shadow: var(--shadow-sm);
    padding: var(--space-md) 0;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
}

.site-title a {
    color: #ffffff;
    font-weight: bold;
}

.site-description {
    margin: 5px 0 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

.custom-logo {
    height: 50px;
    width: auto;
}

/* ナビゲーション */
.main-navigation {
    flex-grow: 1;
    text-align: right;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    color: #ffffff;
}

.toggle-bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    margin: 5px 0;
    transition: 0.3s;
}

.menu-toggle-text {
    color: #ffffff;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--space-lg);
}

.nav-menu a {
    color: #ffffff;
    font-weight: 500;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu .current-menu-item a {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

/* ===================================
   メインコンテンツ
   =================================== */
.site-main {
    padding: var(--space-xl) 0;
}

.content-area {
    width: 100%;
}

.page-header {
    margin-bottom: var(--space-xl);
    text-align: center;
}

.page-title {
    margin: 0;
}

/* 投稿グリッド */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.post-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: var(--space-md);
}

.entry-title {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.entry-meta {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: var(--space-md);
}

.entry-categories a {
    color: var(--accent);
}

.read-more {
    color: var(--primary);
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ===================================
   検証ページ
   =================================== */
.verify-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.verify-header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    padding: var(--space-md) 0;
}

.verify-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.verify-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.verify-logo img {
    height: 40px;
}

.verify-logo-text {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary);
}

.verify-main {
    flex: 1;
    padding: var(--space-xl) 0;
}

/* プロフィールセクション */
.profile-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    text-align: center;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto var(--space-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--gray);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: var(--space-sm);
}

.profile-info {
    color: var(--text-light);
    font-size: 1.1rem;
}

.profile-affiliation {
    font-weight: 600;
}

/* バッジセクション */
.badges-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
    padding: var(--space-xl);
}

.badges-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--light);
}

.badges-title {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--text-dark);
    margin: 0;
}

.badges-count {
    background: var(--primary);
    color: var(--white);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-weight: bold;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-md);
}

.badge-card {
    background: var(--light);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.badge-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.badge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--premium-gradient);
}

.badge-type {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: bold;
    margin-bottom: var(--space-sm);
}

.badge-type.skill-category {
    background: var(--accent);
}

.badge-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: var(--space-sm);
}

.badge-details {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: var(--space-sm);
}

.badge-date {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.badge-status {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: bold;
}

.badge-status.expired {
    background: #fff3cd;
    color: #856404;
}

.badge-status.revoked {
    background: #f8d7da;
    color: #721c24;
}

/* 検証フッター */
.verify-footer {
    background: var(--text-dark);
    color: var(--white);
    padding: var(--space-lg) 0;
    text-align: center;
}

.verify-info {
    margin-bottom: var(--space-md);
}

.verify-badge-id {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.verify-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-lg);
}

/* ===================================
   フッター
   =================================== */
.site-footer {
    background: var(--text-dark);
    color: var(--white);
    margin-top: var(--space-xl);
}

.footer-widgets {
    background: rgba(255, 255, 255, 0.05);
    padding: var(--space-xl) 0;
}

.footer-widget-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.footer-widget h3 {
    color: var(--white);
    margin-bottom: var(--space-md);
}

.footer-widget a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-widget a:hover {
    color: var(--white);
}

.site-info {
    padding: var(--space-md) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-info-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--space-md);
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.8);
}

.copyright {
    text-align: center;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ===================================
   コンポーネント
   =================================== */

/* ボタン */
.btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    border-radius: 25px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: #0052a3;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
}

/* ページトップボタン */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: var(--accent);
    transform: scale(1.1);
}

/* QRコード */
.qr-code {
    margin: var(--space-lg) 0;
    text-align: center;
}

.qr-code img {
    border: 5px solid var(--white);
    box-shadow: var(--shadow-medium);
}

/* SNS共有ボタン */
.share-buttons {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    margin-top: var(--space-md);
}

.share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transition: all 0.3s ease;
}

.share-button:hover {
    background: var(--white);
    color: var(--primary);
    transform: scale(1.1);
}

/* ===================================
   レスポンシブデザイン
   =================================== */
@media (max-width: 768px) {
    /* タイポグラフィ */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    /* コンテナ */
    .container {
        padding: 0 var(--space-sm);
    }
    
    /* ヘッダー */
    .site-header-inner {
        position: relative;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #007aff;
        flex-direction: column;
        padding: var(--space-md);
        box-shadow: var(--shadow-medium);
        transform: translateY(-20px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    /* 投稿グリッド */
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    /* 検証ページ */
    .verify-header-content {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .profile-section,
    .badges-section {
        padding: var(--space-md);
    }
    
    .badges-grid {
        grid-template-columns: 1fr;
    }
    
    .badges-header {
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
    }
    
    .verify-actions {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: var(--space-lg) auto 0;
    }
    
    /* フッター */
    .site-info-inner {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .footer-nav {
        flex-direction: column;
        text-align: center;
    }
}

/* ===================================
   アニメーション
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ===================================
   印刷スタイル
   =================================== */
@media print {
    .verify-header,
    .verify-footer,
    .share-buttons,
    .btn,
    .scroll-to-top {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .profile-section,
    .badges-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ===================================
   アクセシビリティ
   =================================== */
.screen-reader-text {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 2.5rem;
    z-index: 999999;
    text-decoration: underline;
}

.skip-link:focus {
    position: absolute;
    left: 2%;
    top: 2.5rem;
    z-index: 999999;
    padding: 15px 23px 14px;
    background-color: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-medium);
}
