/*
Theme Name: Grant Insight Perfect
Theme URI: https://grant-insight.com
Description: 助成金・補助金検索サイト専用WordPressテーマ - Yahoo! JAPAN風タブナビゲーション、AI機能、Google Sheets連携、SEO最適化対応
Author: Grant Insight Team
Author URI: https://grant-insight.com
Version: 11.0.1
Requires at least: 5.8
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: grant-insight-perfect
Tags: government, grants, subsidies, business, ai-powered, custom-post-type, google-sheets, seo-optimized

Grant Insight Perfect Theme
Copyright (C) 2024 Grant Insight Team

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/**
 * Grant Insight Perfect - Main Stylesheet
 * 
 * Version History:
 * - v11.0.1: Grant Amount Fixer Tool (助成金額修正ツール実装)
 * - v11.0.0: REST API endpoint fix for grant post type
 * - v10.0.0: Yahoo! JAPAN-style tabbed grant browsing system
 * - v9.3.2: Advanced SEO Enhancer (OGP, Schema.org, Internal Links)
 * - v9.3.1: Dynamic CSS Generator (投稿内容に応じた動的CSS生成)
 * - v9.3.0: Grant Content SEO Optimizer
 * - v9.2.1: JavaScript error fixes (Jetpack conflicts, Gutenberg issues)
 * - v9.2.0: Performance optimization with caching
 * - v9.1.0: Column System integration
 * - v9.0.0: AI-powered features and search history
 */

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 
                 "Helvetica Neue", Arial, "Noto Sans", sans-serif,
                 "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
                 "Noto Color Emoji", "Yu Gothic", "游ゴシック", YuGothic,
                 "游ゴシック体", "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro",
                 "メイリオ", Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    background-color: #f5f5f5;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: #222;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #005177;
    text-decoration: underline;
}

/* ==========================================================================
   Layout
   ========================================================================== */

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

.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.alignleft {
    float: left;
    margin-right: 1.5em;
    margin-bottom: 1.5em;
}

.alignright {
    float: right;
    margin-left: 1.5em;
    margin-bottom: 1.5em;
}

.aligncenter {
    clear: both;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5em;
}

/* ==========================================================================
   WordPress Core
   ========================================================================== */

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    text-align: center;
    font-size: 0.9em;
    color: #666;
    margin-top: 0.5em;
}

.sticky {
    /* Sticky post styles */
}

.bypostauthor {
    /* Post author styles */
}

.gallery {
    margin-bottom: 1.5em;
}

.gallery-item {
    display: inline-block;
    text-align: center;
    vertical-align: top;
    width: 100%;
}

/* ==========================================================================
   Grant Insight Specific Styles
   Note: Most styles are loaded via Tailwind CSS and custom component files
   ========================================================================== */

/* Grant Cards */
.grant-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.grant-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-primary {
    background-color: #0073aa;
    color: #fff;
}

.badge-success {
    background-color: #00a32a;
    color: #fff;
}

.badge-warning {
    background-color: #f0b429;
    color: #333;
}

.badge-danger {
    background-color: #d63638;
    color: #fff;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background-color: #0073aa;
    color: #fff;
}

.btn-primary:hover {
    background-color: #005177;
    text-decoration: none;
}

/* Loading Spinner */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

@media screen and (max-width: 480px) {
    html {
        font-size: 13px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]:after {
        content: " (" attr(title) ")";
    }
    
    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }
    
    thead {
        display: table-header-group;
    }
    
    tr,
    img {
        page-break-inside: avoid;
    }
    
    img {
        max-width: 100% !important;
    }
    
    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }
    
    h2,
    h3 {
        page-break-after: avoid;
    }
}

/* ==========================================================================
   Theme Feature: Amount Fixer Tool
   ========================================================================== */

/* Amount Fixer specific styles are loaded via /assets/css/amount-fixer.css */

/* ==========================================================================
   End of Grant Insight Perfect Main Stylesheet
   ========================================================================== */
