/* Mobile-First Homepage Design for AI Blog - WordPress Safe Version */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: #ffffff;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* Hero Section - Mobile First */
.custom-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 60px 20px 50px;
    position: relative;
    overflow: hidden;
    min-height: 50vh;
}

.custom-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 15px 15px, rgba(255,255,255,0.1) 2px, transparent 2px);
    background-size: 30px 30px;
}

.custom-hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
}

.custom-hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.custom-hero-subtitle {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    font-weight: 300;
    line-height: 1.5;
}

/* Container */
.custom-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.custom-section {
    padding: 50px 0;
}

.custom-section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.custom-section-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: #1f2937;
    letter-spacing: -0.025em;
}

.custom-section-description {
    font-size: 1rem;
    color: #6b7280;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Featured Posts - Mobile First Design */
.custom-featured-posts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 2.5rem;
}

.custom-featured-post {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
}

.custom-featured-post:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.custom-featured-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-featured-image.no-image {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.custom-featured-image.no-image::after {
    content: 'AI';
    font-size: 2.5rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.8);
}

.custom-featured-content {
    padding: 24px;
}

.custom-featured-category {
    display: inline-block;
    padding: 6px 14px;
    background: #ede9fe;
    color: #7c3aed;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.custom-featured-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.custom-featured-title a {
    color: inherit;
    text-decoration: none;
}

.custom-featured-title a:hover {
    color: #667eea;
}

.custom-featured-excerpt {
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.custom-featured-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #9ca3af;
}

.custom-read-more {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
}

.custom-read-more:hover {
    color: #5a67d8;
}

/* Recent Posts Grid - Mobile Optimized */
.custom-posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 2rem;
}

.custom-post-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
}

.custom-post-card::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.custom-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.custom-post-image {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.custom-post-image.no-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.custom-post-image.no-image::after {
    content: 'AI';
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
}

.custom-post-content {
    padding: 24px;
}

.custom-post-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #1f2937;
    line-height: 1.3;
}

.custom-post-title a {
    color: inherit;
    text-decoration: none;
}

.custom-post-title a:hover {
    color: #667eea;
}

.custom-post-excerpt {
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.custom-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #9ca3af;
}

/* Categories Section - Mobile First */
.custom-categories {
    background: #f8fafc;
}

.custom-categories-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.custom-category-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
}

.custom-category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.custom-category-image {
    height: 120px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.custom-category-content {
    padding: 24px;
    text-align: center;
}

.custom-category-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

.custom-category-desc {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.custom-category-stats {
    font-size: 0.875rem;
    color: #667eea;
    font-weight: 600;
}

/* Buttons */
.custom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
    min-height: 48px;
}

.custom-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.custom-btn-center {
    text-align: center;
    margin-top: 2rem;
}

/* Touch-friendly improvements */
.custom-read-more, .custom-post-title a, .custom-featured-title a {
    min-height: 44px;
    display: flex;
    align-items: center;
}

/* Tablet Responsive */
@media (min-width: 768px) {
    .custom-hero {
        padding: 80px 20px 60px;
        min-height: 60vh;
    }

    .custom-hero h1 {
        font-size: 3rem;
    }

    .custom-hero-subtitle {
        font-size: 1.25rem;
    }
    
    .custom-featured-posts {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    
    .custom-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .custom-categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .custom-section {
        padding: 60px 0;
    }
    
    .custom-section-title {
        font-size: 2.5rem;
    }
}

/* Desktop Responsive */
@media (min-width: 1024px) {
    .custom-hero {
        padding: 100px 20px 80px;
    }

    .custom-hero h1 {
        font-size: 3.5rem;
    }
    
    .custom-posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
    
    .custom-categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }

    .custom-section {
        padding: 80px 0;
    }

    .custom-featured-image {
        height: 200px;
    }

    .custom-featured-content {
        padding: 30px;
    }
}

/* Animations */
@keyframes customFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-animate-fade-in {
    animation: customFadeInUp 0.6s ease-out;
}

/* Loading states */
.custom-loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: customShimmer 1.5s infinite;
}

@keyframes customShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for better accessibility */
.custom-btn:focus,
.custom-read-more:focus,
.custom-post-title a:focus,
.custom-featured-title a:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .custom-hero {
        background: #000080;
    }
    
    .custom-post-card,
    .custom-featured-post,
    .custom-category-card {
        border: 2px solid #000;
    }
}

/* 固定ページの全幅表示設定 */
.page-id-1558 .entry-content,
.page-id-1558 .site-content,
.page-id-1558 .content-area {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* WordPressテーマのコンテナ制約を削除 */
.page-id-1558 .wp-block-group,
.page-id-1558 .wp-block-group__inner-container {
    max-width: 100% !important;
    width: 100% !important;
}

/* テーマの左右padding/marginを無効化 */
.page-id-1558 .entry-content > * {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
}

/* カスタムセクションの幅調整 */
.custom-hero,
.custom-section,
.custom-categories {
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}

/* コンテナの最大幅を調整 */
.custom-container {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
}

/* より大きな画面での調整 */
@media (min-width: 1200px) {
    .custom-container {
        max-width: 1600px !important;
        padding: 0 40px !important;
    }
}

/* 超ワイドスクリーン対応 */
@media (min-width: 1800px) {
    .custom-container {
        max-width: 1800px !important;
        padding: 0 60px !important;
    }
}

/* AI記事テンプレート用カスタムCSS */
.ai-article-wrapper {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.7;
    color: #333;
}

.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-summary {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.content-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.card-icon {
    width: 32px;
    height: 32px;
    background: #667eea;
    border-radius: 8px;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.styled-list {
    list-style: none;
    padding: 0;
}

.styled-list li {
    background: #f8fafc;
    margin-bottom: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: transform 0.2s ease;
}

.styled-list li:hover {
    transform: translateX(4px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.code-block {
    background: #1f2937;
    color: #f9fafb;
    padding: 1.5rem;
    border-radius: 10px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    position: relative;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.code-header {
    background: #374151;
    color: #d1d5db;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 10px 10px 0 0;
    margin: -1.5rem -1.5rem 1rem;
    font-family: inherit;
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.code-block code {
    color: inherit;
    background: none;
    padding: 0;
    font-size: inherit;
}

.expert-quote {
    background: #fef7cd;
    border-left: 5px solid #f59e0b;
    padding: 1.5rem;
    border-radius: 0 10px 10px 0;
    font-style: italic;
    margin: 2rem 0;
    position: relative;
}

.expert-quote::before {
    content: '"';
    font-size: 4rem;
    color: #f59e0b;
    position: absolute;
    top: -10px;
    left: 10px;
    opacity: 0.3;
    font-family: serif;
}

.quote-author {
    font-weight: 600;
    color: #92400e;
    margin-top: 1rem;
    font-style: normal;
}

.ai-section {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.ai-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.ai-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.ai-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.tag {
    background: #e5e7eb;
    color: #374151;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.tag:hover {
    background: #d1d5db;
}

/* エンターテイメント系テンプレート用CSS */
.entertainment-hero {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
}

.lifestyle-hero {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.news-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* テンプレート別アイコンカラー */
.entertainment-template .card-icon {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
}

.lifestyle-template .card-icon {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.news-template .card-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* 汎用テンプレート用スタイル */
.generic-template .hero-section {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.generic-template .card-icon {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .ai-article-wrapper {
        padding: 0 1rem;
    }
    
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .content-card {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .card-icon {
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
    
    .code-block {
        font-size: 0.8rem;
        padding: 1rem;
    }
    
    .ai-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .ai-icon {
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
}

/* Twenty Twenty-Four テーマ対応 */
.wp-site-blocks .ai-article-wrapper {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ai-article-wrapper {
        color: #f3f4f6;
    }
    
    .content-card {
        background: #1f2937;
        border-color: #374151;
    }
    
    .card-title {
        color: #f9fafb;
    }
    
    .styled-list li {
        background: #374151;
        color: #f3f4f6;
    }
    
    .tag {
        background: #374151;
        color: #d1d5db;
    }
    
    .tag:hover {
        background: #4b5563;
    }
}