/*
Theme Name: HASHIRE
Theme URI: https://example.com/hashire/
Author: Takayuki Komori
Author URI: https://example.com/
Description: HASHIRE — ドライブ旅・投資・IT資格の3カテゴリ統合型アフィリエイトメディア用WordPressテーマ。みんカラ運用との連携を前提に、車旅軸（asphalt graphite）、投資（navy）、IT資格（orange）のカテゴリ別カラー、AdSense/楽天/Amazon用の広告枠、関連記事、スティッキーCTA、構造化データを標準装備。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
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: hashire
Tags: blog, three-columns, custom-colors, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, footer-widgets, sticky-post
*/

/* ========== Reset & Base ========== */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
        "Hiragino Sans", "Yu Gothic", "Meiryo", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: #1f2937;
    background: #f8fafc;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: #0ea5a4; text-decoration: none; transition: color .2s ease; }
a:hover { color: #0f766e; text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { line-height: 1.4; margin: 1.6em 0 0.6em; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; padding: .35em .7em; border-left: 6px solid var(--mp-accent, #0ea5a4); background: #f1f5f9; border-radius: 4px; }
h3 { font-size: 1.2rem; border-bottom: 2px solid #e5e7eb; padding-bottom: .25em; }
p { margin: 0 0 1em; }

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px; height: 1px; overflow: hidden;
}

/* ========== Layout ========== */
:root {
    --mp-accent: #0ea5a4;
    --mp-accent-dark: #0f766e;
    --mp-text: #1f2937;
    --mp-muted: #6b7280;
    --mp-border: #e5e7eb;
    --mp-card-bg: #ffffff;
    --mp-bg: #f8fafc;
}

.site-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

.site-main-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    margin: 28px auto;
}

@media (max-width: 960px) {
    .site-main-wrap { grid-template-columns: 1fr; }
}

/* ========== Header ========== */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--mp-border);
    position: sticky; top: 0; z-index: 100;
}
.header-inner {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 0;
}
.site-branding .site-title {
    margin: 0; font-size: 1.4rem; font-weight: 800; letter-spacing: .02em;
}
.site-branding .site-title a { color: var(--mp-text); }
.site-description { margin: 0; font-size: .8rem; color: var(--mp-muted); }

.main-navigation { display: flex; align-items: center; }
.main-navigation ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 18px; }
.main-navigation a {
    color: var(--mp-text); font-weight: 600; padding: 8px 4px;
    border-bottom: 2px solid transparent;
}
.main-navigation a:hover { color: var(--mp-accent); border-color: var(--mp-accent); text-decoration: none; }

.menu-toggle {
    display: none; background: none; border: 1px solid var(--mp-border);
    border-radius: 6px; padding: 8px 12px; cursor: pointer; font-size: .9rem;
}

@media (max-width: 720px) {
    .menu-toggle { display: inline-block; }
    .main-navigation ul { display: none; flex-direction: column; gap: 0;
        position: absolute; top: 60px; left: 0; right: 0;
        background: #fff; border-bottom: 1px solid var(--mp-border); padding: 8px 16px; }
    .main-navigation.is-open ul { display: flex; }
    .main-navigation a { display: block; padding: 12px 4px; border-bottom: 1px solid var(--mp-border); }
}

/* ========== Hero (front page) ========== */
.hero {
    background: linear-gradient(135deg, #475569 0%, #1e3a8a 50%, #f97316 100%);
    color: #fff; padding: 56px 16px; text-align: center;
}
.hero h1 { font-size: 2.2rem; margin: 0 0 12px; color: #fff; }
.hero p { font-size: 1.05rem; margin: 0 auto 18px; max-width: 720px; opacity: .95; }
.hero .hero-cats {
    display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
}
.hero .hero-cats a {
    background: rgba(255,255,255,.15); backdrop-filter: blur(4px);
    color: #fff; border: 1px solid rgba(255,255,255,.4);
    padding: 10px 18px; border-radius: 999px; font-weight: 700;
}
.hero .hero-cats a:hover { background: rgba(255,255,255,.3); text-decoration: none; }

/* ========== Category accent (3テーマ別カラー) ========== */
body.category-travel,
body.cat-travel,
.cat-travel { --mp-accent: #475569; --mp-accent-dark: #1f2937; } /* asphalt / graphite — for ドライブ旅 */
body.category-invest,
body.cat-invest,
.cat-invest { --mp-accent: #1e3a8a; --mp-accent-dark: #1e40af; }
body.category-it,
body.cat-it,
.cat-it { --mp-accent: #f97316; --mp-accent-dark: #c2410c; }

/* ========== Article cards ========== */
.cards-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px;
    margin-top: 16px;
}
.card {
    background: var(--mp-card-bg); border: 1px solid var(--mp-border); border-radius: 10px;
    overflow: hidden; transition: transform .2s ease, box-shadow .2s ease;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,23,42,.08); }
.card .card-thumb { aspect-ratio: 16 / 9; background: #e2e8f0; overflow: hidden; }
.card .card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .card-body { padding: 14px 16px 18px; flex: 1; display: flex; flex-direction: column; }
.card .card-cat {
    align-self: flex-start; font-size: .72rem; font-weight: 700;
    background: var(--mp-accent); color: #fff; padding: 3px 10px; border-radius: 999px;
    letter-spacing: .04em; margin-bottom: 8px;
}
.card .card-title { font-size: 1rem; line-height: 1.4; margin: 0 0 8px; flex: 1; }
.card .card-title a { color: var(--mp-text); }
.card .card-meta { font-size: .78rem; color: var(--mp-muted); }

/* ========== Section heading ========== */
.section-heading {
    margin: 36px 0 8px; padding: 0; border: none; background: none;
    font-size: 1.4rem; display: flex; align-items: center; gap: 12px;
}
.section-heading::before {
    content: ""; width: 6px; height: 24px; background: var(--mp-accent); border-radius: 3px;
}
.section-heading .more-link { margin-left: auto; font-size: .85rem; font-weight: 500; }

/* ========== Single post ========== */
.post-article {
    background: #fff; border: 1px solid var(--mp-border); border-radius: 10px;
    padding: 28px; margin-bottom: 24px;
}
.post-article header h1 { margin-top: 0; font-size: 1.8rem; }
.post-article .entry-meta { font-size: .85rem; color: var(--mp-muted); margin-bottom: 16px; }
.post-article .entry-content > * + * { margin-top: 1em; }
.post-article .entry-content blockquote {
    border-left: 4px solid var(--mp-accent); margin: 1em 0; padding: .5em 1em;
    background: #f1f5f9; border-radius: 0 6px 6px 0;
}
.post-article .entry-content code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.post-article .entry-content pre {
    background: #0f172a; color: #f1f5f9; padding: 14px 16px; border-radius: 8px; overflow-x: auto;
}
.post-article .entry-content pre code { background: transparent; color: inherit; padding: 0; }
.post-article .entry-content table {
    width: 100%; border-collapse: collapse; margin: 1em 0;
}
.post-article .entry-content th,
.post-article .entry-content td {
    border: 1px solid var(--mp-border); padding: 8px 12px; text-align: left;
}
.post-article .entry-content th { background: #f1f5f9; }

.post-thumbnail { margin: -28px -28px 20px; }
.post-thumbnail img { width: 100%; }

/* ========== Affiliate / Ads boxes ========== */
.affiliate-disclaimer {
    background: #fef3c7; border: 1px solid #f59e0b; color: #78350f;
    padding: 8px 14px; border-radius: 6px; font-size: .82rem;
    margin-bottom: 16px;
}
.adsense-slot {
    background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px;
    padding: 12px; margin: 24px 0; text-align: center;
    font-size: .8rem; color: var(--mp-muted);
}
.cta-box {
    background: linear-gradient(135deg, var(--mp-accent), var(--mp-accent-dark));
    color: #fff; padding: 22px 24px; border-radius: 12px;
    margin: 28px 0; box-shadow: 0 10px 25px rgba(15,23,42,.1);
}
.cta-box h4 { color: #fff; margin: 0 0 8px; }
.cta-box p { margin: 0 0 14px; opacity: .95; }
.cta-button {
    display: inline-block; background: #fff; color: var(--mp-accent-dark);
    font-weight: 700; padding: 11px 22px; border-radius: 999px;
    box-shadow: 0 4px 10px rgba(0,0,0,.15);
}
.cta-button:hover { background: #f8fafc; text-decoration: none; transform: translateY(-1px); }

/* スティッキーCTA */
.sticky-cta {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--mp-accent); color: #fff;
    padding: 10px 16px; box-shadow: 0 -4px 12px rgba(0,0,0,.15);
    display: none; align-items: center; justify-content: space-between; gap: 12px;
    z-index: 90; font-size: .9rem;
}
.sticky-cta a {
    background: #fff; color: var(--mp-accent-dark); padding: 8px 18px;
    border-radius: 999px; font-weight: 700; white-space: nowrap;
}
.sticky-cta .close-cta {
    background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff;
    padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: .75rem;
}
@media (max-width: 720px) { .sticky-cta { display: flex; } }

/* ========== Sidebar ========== */
.site-sidebar { display: flex; flex-direction: column; gap: 20px; }
.widget {
    background: #fff; border: 1px solid var(--mp-border); border-radius: 10px;
    padding: 18px;
}
.widget-title {
    font-size: 1rem; margin: 0 0 12px; padding: 0 0 8px;
    border-bottom: 2px solid var(--mp-accent); border-left: none; background: none;
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 6px 0; border-bottom: 1px dashed var(--mp-border); }
.widget li:last-child { border-bottom: none; }

/* ========== Breadcrumb ========== */
.breadcrumb {
    font-size: .82rem; color: var(--mp-muted); margin: 16px 0;
}
.breadcrumb a { color: var(--mp-muted); }
.breadcrumb a:hover { color: var(--mp-accent); }
.breadcrumb .sep { margin: 0 6px; }

/* ========== Pagination ========== */
.pagination {
    display: flex; gap: 6px; justify-content: center; margin: 32px 0;
}
.pagination .page-numbers {
    padding: 8px 14px; border: 1px solid var(--mp-border); border-radius: 6px;
    background: #fff; color: var(--mp-text);
}
.pagination .page-numbers.current {
    background: var(--mp-accent); color: #fff; border-color: var(--mp-accent);
}
.pagination .page-numbers:hover { background: var(--mp-accent); color: #fff; text-decoration: none; }

/* ========== Footer ========== */
.site-footer {
    background: #0f172a; color: #cbd5e1; padding: 32px 0 18px; margin-top: 40px;
}
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.footer-widgets {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}
.footer-widgets .widget { background: transparent; border: none; padding: 0; }
.footer-widgets .widget-title { color: #fff; border-color: var(--mp-accent); }
.site-info { text-align: center; margin-top: 24px; font-size: .82rem; opacity: .7; }

/* ========== Search form ========== */
.search-form { display: flex; gap: 6px; }
.search-form input[type="search"] {
    flex: 1; padding: 8px 10px; border: 1px solid var(--mp-border); border-radius: 6px;
}
.search-form button {
    background: var(--mp-accent); color: #fff; border: none; padding: 8px 14px;
    border-radius: 6px; cursor: pointer; font-weight: 600;
}

/* ========== Related posts ========== */
.related-posts { margin-top: 32px; }
.related-posts h3 { margin-bottom: 14px; }

/* ========== Author / Profile box ========== */
.author-box {
    display: flex; gap: 14px; align-items: flex-start;
    background: #f1f5f9; border-radius: 10px; padding: 16px;
    margin: 24px 0;
}
.author-box .avatar { border-radius: 999px; width: 64px; height: 64px; }
.author-box .author-meta strong { display: block; margin-bottom: 4px; }
.author-box .author-meta p { margin: 0; font-size: .9rem; color: var(--mp-muted); }
