/*
Theme Name: Keiba Pedigree Analysis
Description: 競馬血統分析に特化したWordPressテーマ。週末重賞レース分析と種牡馬産駒情報を提供します。
Author: Your Name
Version: 1.0.0
License: GPL v2 or later
Text Domain: keiba-pedigree
Tags: blog, news, horse-racing, pedigree, seo-ready, responsive
*/

/* Reset and Base Styles - Mobile First */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Critical CSS for above-the-fold content */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    font-size: 16px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Load Japanese font asynchronously */
@media screen {
    body {
        font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    }
}

/* Prevent layout shifts */
img, iframe, video {
    max-width: 100%;
    height: auto;
}

/* Prevent CLS for dynamic content */
.site-header {
    min-height: 120px; /* Prevent header height shifts */
}

.site-main {
    min-height: 400px; /* Prevent main content shifts */
}

.site-footer {
    min-height: 100px; /* Prevent footer shifts */
}

/* Prevent layout shifts for images */
.article-featured-image,
.related-post-image {
    position: relative;
    overflow: hidden;
}

.article-featured-image::before,
.related-post-image::before {
    content: "";
    display: block;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.article-featured-image img,
.related-post-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Skeleton loading for better perceived performance */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Reserve space for sidebar widgets */
.widget {
    min-height: 50px;
    margin-bottom: 2rem;
}

/* Reserve space for comments */
.comments-section {
    min-height: 100px;
}

/* ==========================================================================
   LAYOUT FIX - コンテンツ中央表示修正
   ========================================================================== */

/* サイト全体のレイアウト */
.site {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* サイトコンテンツラッパー */
.site-content-wrapper {
    display: flex;
    flex: 1;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* メインコンテンツエリア */
.site-main {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* ページコンテナ */
.page-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* 固定ページ記事 */
.page-article {
    width: 100%;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 固定ページタイトル */
.page .entry-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5em;
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 15px;
}

/* コンテンツの基本スタイル */
.entry-content {
    line-height: 1.8;
    color: #333;
    width: 100%;
    max-width: 100%;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    margin: 2em 0 1em;
    line-height: 1.4;
    color: #2c3e50;
}

.entry-content h1 {
    font-size: 2.2em;
    text-align: center;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

.entry-content h2 {
    font-size: 1.8em;
    border-left: 5px solid #3498db;
    padding-left: 15px;
    margin-top: 40px;
}

.entry-content h3 {
    font-size: 1.4em;
    color: #34495e;
    margin-top: 30px;
}

.entry-content p {
    margin: 1.5em 0;
    line-height: 1.8;
    color: #444;
}

.entry-content ul,
.entry-content ol {
    margin: 1.5em 0;
    padding-left: 0;
    list-style: none;
}

.entry-content li {
    margin: 0.8em 0;
    line-height: 1.6;
    padding-left: 1.5em;
    position: relative;
}

.entry-content li:before {
    content: "•";
    color: #3498db;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* 編集リンク */
.entry-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.edit-link a {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9em;
}

.edit-link a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   SINGLE POST & STALLION DATABASE LAYOUT
   ========================================================================== */

/* Single post container */
.single-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* Stallion database container */
.stallion-database-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.stallion-content-area {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* Article header styles */
.article-header {
    margin-bottom: 30px;
    text-align: center;
}

.article-title {
    font-size: 2.2em;
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 3px solid #3498db;
    padding-bottom: 15px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9em;
    color: #666;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Info boxes */
.race-info-box,
.stallion-info-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.race-info-box h3,
.stallion-info-box h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.2em;
}

.race-details,
.stallion-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

/* Article content */
.article-content {
    line-height: 1.8;
    color: #333;
    margin: 30px 0;
}

/* Article footer */
.article-footer {
    border-top: 2px solid #e9ecef;
    padding-top: 30px;
    margin-top: 40px;
}

.post-tags {
    margin-bottom: 30px;
}

.tags-label {
    font-weight: bold;
    color: #2c3e50;
    margin-right: 10px;
}

.tag-item {
    display: inline-block;
    margin-right: 10px;
}

.tag-item a {
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.85em;
}

.tag-item a:hover {
    background: #2980b9;
}

/* Post navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.nav-previous,
.nav-next {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    background: #f8f9fa;
}

.nav-previous a,
.nav-next a {
    text-decoration: none;
    color: #2c3e50;
    display: block;
}

.nav-subtitle {
    font-size: 0.9em;
    color: #666;
    display: block;
    margin-bottom: 5px;
}

.nav-title {
    font-weight: bold;
    display: block;
}

.nav-next {
    text-align: right;
}

/* Related posts */
.related-posts {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.related-posts-title {
    text-align: center;
    font-size: 1.8em;
    color: #2c3e50;
    margin-bottom: 30px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.related-post-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    transition: box-shadow 0.3s ease;
}

.related-post-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.related-post-thumbnail {
    height: 150px;
    overflow: hidden;
}

.related-post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-post-content {
    padding: 15px;
}

.related-post-title {
    margin: 0 0 10px 0;
    font-size: 1em;
}

.related-post-title a {
    color: #2c3e50;
    text-decoration: none;
}

.related-post-title a:hover {
    color: #3498db;
}

.related-post-date {
    color: #666;
    font-size: 0.85em;
    margin: 0;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .site {
        padding: 0 15px;
    }
    
    .site-content-wrapper {
        padding: 20px 10px;
    }
    
    .page-article {
        padding: 25px 20px;
        margin: 0;
    }
    
    .page .entry-title {
        font-size: 1.8em;
    }
    
    .entry-content h1 {
        font-size: 1.6em;
    }
    
    .entry-content h2 {
        font-size: 1.4em;
    }
    
    .entry-content h3 {
        font-size: 1.2em;
    }
    
    /* Mobile adjustments */
    .article-title {
        font-size: 1.8em;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .post-navigation {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .nav-next {
        text-align: left;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .race-details,
    .stallion-details {
        grid-template-columns: 1fr;
    }
}

/* Header Styles - Mobile First */
.site-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 0.8rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 100;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.site-title a {
    color: white;
    text-decoration: none;
}

.site-description {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

/* Desktop header adjustments */
@media (min-width: 768px) {
    .site-header {
        padding: 1rem 0;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .site-description {
        font-size: 1rem;
    }
}

/* Navigation - Mobile First */
.main-navigation {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1rem;
    padding: 0 1rem;
    min-width: max-content;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
    display: block;
}

.nav-menu a:hover,
.nav-menu a:focus {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

/* Desktop navigation */
@media (min-width: 768px) {
    .main-navigation {
        margin-top: 1rem;
        overflow: visible;
    }
    
    .nav-menu {
        justify-content: center;
        gap: 2rem;
        padding: 0;
    }
    
    .nav-menu a {
        font-size: 1rem;
        padding: 0.5rem 1rem;
        border-radius: 4px;
    }
}

/* Main Content - Mobile First */
.site-main {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
    display: block;
}

/* Desktop layout */
@media (min-width: 768px) {
    .site-main {
        margin: 2rem auto;
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 2rem;
    }
}

/* Article Styles */
.article-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

/* カードタイプ別スタイル */
.blog-card {
    border-left: 4px solid #2a5298;
}

.static-card {
    border-left: 4px solid #28a745;
}

.blog-card .article-meta .post-category {
    background: #2a5298;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

.static-card .article-meta .post-category {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

/* 管理者ガイドスタイル */
.admin-guide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.guide-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.guide-section h4 {
    color: #2a5298;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.guide-section p {
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .admin-guide {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 25px rgba(0,0,0,0.12);
}

.article-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.article-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* SEO Optimized Heading Hierarchy */
.single-article .article-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Content headings with proper hierarchy */
.article-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e3c72;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #2a5298;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2a5298;
    margin: 1.5rem 0 0.8rem 0;
    position: relative;
}

.article-content h3:before {
    content: "▶";
    color: #2a5298;
    margin-right: 0.5rem;
}

.article-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 1.2rem 0 0.6rem 0;
    padding-left: 1rem;
    border-left: 3px solid #2a5298;
}

.article-content h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    margin: 1rem 0 0.5rem 0;
    text-decoration: underline;
    text-decoration-color: #2a5298;
    text-underline-offset: 4px;
}

.article-content h6 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    margin: 0.8rem 0 0.4rem 0;
    font-style: italic;
}

.article-meta {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.article-content {
    padding: 1.5rem;
}

/* Pedigree Table Styles */
.pedigree-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pedigree-table th,
.pedigree-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.pedigree-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

/* Sidebar */
.sidebar {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    height: fit-content;
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e3c72;
    border-bottom: 2px solid #2a5298;
    padding-bottom: 0.5rem;
}

/* Comment Styles */
.comments-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.comment-form {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.submit-button {
    background: #2a5298;
    color: white;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.submit-button:hover {
    background: #1e3c72;
}

/* Footer */
.site-footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Breadcrumb Navigation */
.breadcrumb {
    background: rgba(255,255,255,0.9);
    padding: 0.8rem 0;
    margin-bottom: 1rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    align-items: center;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: ">";
    margin: 0 0.8rem;
    color: #666;
    font-weight: bold;
}

.breadcrumb-item a {
    color: #2a5298;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #1e3c72;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Enhanced Related Posts */
.enhanced-related-posts {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin: 3rem 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.enhanced-related-posts .related-posts-title {
    font-size: 1.5rem;
    color: #1e3c72;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
}

.enhanced-related-posts .related-posts-title::after {
    content: "";
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 2px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.related-post-card {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.related-post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #2a5298;
}

.related-post-image {
    height: 160px;
    overflow: hidden;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-card:hover .related-post-image img {
    transform: scale(1.05);
}

.related-post-content {
    padding: 1.2rem;
}

.related-post-title {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.related-post-title a {
    color: #1e3c72;
    text-decoration: none;
    font-weight: 600;
}

.related-post-title a:hover {
    color: #2a5298;
}

.related-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
}

.related-post-date {
    color: #666;
}

.related-post-category a {
    color: #2a5298;
    text-decoration: none;
    font-weight: 500;
}

.related-post-excerpt {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
}

.more-posts-link {
    text-align: center;
    margin-top: 1.5rem;
}

.btn-more-posts {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-more-posts:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 60, 114, 0.3);
    color: white;
}

/* Internal Link Styling */
.article-content a:not(.btn):not(.button) {
    color: #2a5298;
    text-decoration: underline;
    text-decoration-color: rgba(42, 82, 152, 0.3);
    text-underline-offset: 3px;
    transition: all 0.3s ease;
}

.article-content a:not(.btn):not(.button):hover {
    color: #1e3c72;
    text-decoration-color: #1e3c72;
    background: rgba(42, 82, 152, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

/* Image Optimization Styles */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 1rem 0;
}

.article-content img:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* Responsive Design - Complete Mobile Optimization */

/* Sidebar mobile optimization */
.sidebar {
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .sidebar {
        margin-top: 0;
    }
}

/* Article cards mobile optimization */
.article-card {
    margin: 0 -1rem 1.5rem -1rem;
    border-radius: 0;
}

@media (min-width: 768px) {
    .article-card {
        margin: 0 0 2rem 0;
        border-radius: 8px;
    }
}

/* Typography scaling */
@media (max-width: 480px) {
    .article-title {
        font-size: 1.2rem;
    }
    
    .single-article .article-title {
        font-size: 1.5rem;
    }
    
    .article-content h2 {
        font-size: 1.3rem;
    }
    
    .article-content h3 {
        font-size: 1.1rem;
    }
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
    .nav-menu a,
    .article-title a,
    .btn-more-posts {
        padding: 0.8rem 1.2rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .article-card:hover {
        transform: none;
    }
}

/* Large screens optimization */
@media (min-width: 1200px) {
    .site-main {
        grid-template-columns: 3fr 1fr;
        gap: 3rem;
    }
    
    .container {
        padding: 0 2rem;
    }
}

/* Print styles */
@media print {
    .site-header,
    .main-navigation,
    .sidebar,
    .enhanced-related-posts,
    .breadcrumb {
        display: none;
    }
    
    .site-main {
        display: block;
        margin: 0;
        padding: 0;
    }
    
    .article-content {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .article-card,
    .testimonial-card,
    .glossary-item {
        border: 2px solid #000;
    }
    
    .site-header {
        background: #000;
        color: #fff;
    }
    
    .testimonial-card:hover,
    .glossary-item:hover {
        border-color: #000;
    }
}

/* Dark mode preference */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .article-card,
    .testimonials-container,
    .glossary-container {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .testimonial-card,
    .glossary-item {
        background: #3a3a3a;
        border-color: #555;
    }
    
    .sidebar {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .related-content-suggestions {
        background: #3a3a3a;
    }
    
    .testimonial-result {
        background: #2d4a2d;
        border-color: #4caf50;
    }
}

/* FAQ Styles for AI Search Optimization */
.faq-container {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-color: #2a5298;
}

.faq-question {
    padding: 1.5rem;
    background: #f8f9fa;
    cursor: pointer;
    position: relative;
}

.faq-question h3 {
    font-size: 1.2rem;
    color: #1e3c72;
    margin-bottom: 0.8rem;
    line-height: 1.4;
    font-weight: 600;
}

.faq-question::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: bold;
    color: #2a5298;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.faq-difficulty {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
}

.difficulty-beginner {
    background: #28a745;
}

.difficulty-intermediate {
    background: #ffc107;
    color: #333;
}

.difficulty-advanced {
    background: #dc3545;
}

.faq-keywords {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: 1.5rem;
    max-height: 1000px;
}

.faq-content {
    color: #333;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.faq-content h4 {
    color: #1e3c72;
    margin: 1.5rem 0 0.8rem 0;
    font-size: 1.1rem;
}

.faq-content p {
    margin-bottom: 1rem;
}

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

.faq-content li {
    margin-bottom: 0.5rem;
}

.faq-helpful {
    border-top: 1px solid #e1e5e9;
    padding-top: 1rem;
    background: #f8f9fa;
    margin: 0 -1.5rem -1.5rem -1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 0 0 8px 8px;
}

.faq-helpful p {
    margin: 0;
    font-size: 0.9rem;
}

.faq-note {
    color: #666;
    font-style: italic;
}

/* FAQ Filter Buttons */
.faq-filters {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.faq-filter-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.3rem;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    border-radius: 20px;
    border: 1px solid #e1e5e9;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.faq-filter-btn:hover,
.faq-filter-btn.active {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
    text-decoration: none;
}

/* FAQ Mobile Optimization */
@media (max-width: 768px) {
    .faq-container {
        margin: 1rem -1rem;
        border-radius: 0;
        padding: 1rem;
    }
    
    .faq-question {
        padding: 1rem;
    }
    
    .faq-question h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        padding-right: 2rem;
    }
    
    .faq-meta {
        gap: 0.5rem;
    }
    
    .faq-difficulty {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
    
    .faq-keywords {
        font-size: 0.8rem;
        display: block;
        width: 100%;
        margin-top: 0.3rem;
    }
    
    .faq-item.active .faq-answer {
        padding: 1rem;
    }
    
    .faq-helpful {
        margin: 0 -1rem -1rem -1rem;
        padding: 1rem;
    }
}

/* FAQ Archive Page */
.faq-archive .page-title {
    text-align: center;
    color: #1e3c72;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.faq-intro {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem auto;
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Testimonials Styles */
.testimonials-container {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

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

.testimonial-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
}

.testimonial-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #2a5298;
}

.testimonial-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.testimonial-user {
    flex: 1;
}

.testimonial-name {
    font-size: 1.1rem;
    color: #1e3c72;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.testimonial-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #666;
}

.testimonial-location,
.testimonial-experience {
    background: #e9ecef;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.testimonial-rating {
    display: flex;
    gap: 0.2rem;
}

.testimonial-rating .star {
    font-size: 1.2rem;
    color: #ffc107;
}

.testimonial-rating .star.empty {
    color: #e9ecef;
}

.testimonial-content {
    margin-bottom: 1rem;
}

.testimonial-title {
    font-size: 1rem;
    color: #1e3c72;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.testimonial-text {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.testimonial-result {
    background: #e8f5e8;
    border-left: 4px solid #28a745;
    padding: 0.8rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.testimonial-result strong {
    color: #28a745;
}

.testimonial-footer {
    text-align: right;
}

.testimonial-link {
    color: #2a5298;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.testimonial-link:hover {
    color: #1e3c72;
    text-decoration: underline;
}

/* Glossary Styles */
.glossary-container {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.glossary-search {
    position: relative;
    max-width: 400px;
    margin: 0 auto 2rem auto;
}

.glossary-search-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.glossary-search-input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.glossary-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.glossary-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.glossary-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-color: #2a5298;
}

.glossary-term {
    margin-bottom: 0.8rem;
}

.glossary-term a {
    color: #1e3c72;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.glossary-term a:hover {
    color: #2a5298;
    text-decoration: underline;
}

.glossary-definition {
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Content Indicators */
.content-indicator {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0 0 1rem 0;
    color: white;
}

.content-indicator.beginner {
    background: #28a745;
}

.content-indicator.comparison {
    background: #17a2b8;
}

.content-indicator.prediction {
    background: #fd7e14;
}

.content-indicator.data {
    background: #6f42c1;
}

.content-indicator.news {
    background: #dc3545;
}

/* Related Content Suggestions */
.related-content-suggestions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    border-left: 4px solid #2a5298;
}

.related-content-suggestions h4 {
    color: #1e3c72;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.term-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.term-tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.term-tag:hover {
    background: #2a5298;
    color: white;
    text-decoration: none;
}

.term-tag.term-horses {
    background: #e8f5e8;
    color: #28a745;
}

.term-tag.term-races {
    background: #fff3cd;
    color: #856404;
}

.term-tag.term-tracks {
    background: #d1ecf1;
    color: #0c5460;
}

/* Glossary Link Styling */
.glossary-link {
    color: #2a5298;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    transition: all 0.3s ease;
}

.glossary-link:hover {
    color: #1e3c72;
    text-decoration-style: solid;
    background: rgba(42, 82, 152, 0.1);
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
}

/* Long-tail Keyword Admin Notice */
.notice.notice-info {
    border-left-color: #2a5298;
}

.notice.notice-info strong {
    color: #1e3c72;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .testimonial-card {
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    .testimonial-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .testimonial-meta {
        gap: 0.5rem;
    }
    
    .glossary-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .glossary-item {
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    .term-tags {
        gap: 0.3rem;
    }
    
    .term-tag {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
    
    .content-indicator {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}