/*
Theme Name: Fanart Starter
Theme URI: https://fanartanime.com
Author: ニイト
Author URI: https://fanartanime.com
Description: ショートコード・プラグインベースのサイト用軽量テーマ。SEO・広告・ヘッダー/フッターを一元管理。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fanart-starter
*/

/* ==========================================================================
   CSS Variables (グローバルカラー)
   ========================================================================== */
:root {
    --fs-primary: #333333;
    --fs-secondary: #666666;
    --fs-accent: #0073aa;
    --fs-background: #ffffff;
    --fs-surface: #f5f5f5;
    --fs-border: #e0e0e0;
    --fs-text: #333333;
    --fs-text-light: #666666;
    --fs-header-height: 60px;
    --fs-content-width: 1200px;
    --fs-mobile-breakpoint: 768px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--fs-text);
    background-color: var(--fs-background);
}

/* ヘッダー非表示時のbody調整 */
body.no-header {
    --fs-header-height: 0px;
}

body.no-footer .site-footer {
    display: none;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.site-content {
    min-height: calc(100vh - var(--fs-header-height) - 100px);
}

.container {
    width: 100%;
    max-width: var(--fs-content-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* フルワイドコンテンツ用 */
.full-width {
    max-width: none;
    padding: 0;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--fs-background);
    border-bottom: 1px solid var(--fs-border);
    height: var(--fs-header-height);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--fs-content-width);
    margin: 0 auto;
    padding: 0 20px;
}

.site-branding {
    display: flex;
    align-items: center;
}

.site-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.site-title a {
    color: var(--fs-text);
    text-decoration: none;
}

/* Desktop Navigation */
.main-navigation {
    display: none;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 24px;
}

.main-navigation a {
    color: var(--fs-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.main-navigation a:hover {
    color: var(--fs-accent);
}

@media (min-width: 768px) {
    .main-navigation {
        display: block;
    }
    .mobile-menu-toggle {
        display: none !important;
    }
}

/* ==========================================================================
   Mobile Menu
   ========================================================================== */
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--fs-text);
    transition: transform 0.3s, opacity 0.3s;
}

.mobile-menu-toggle.active .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-navigation {
    position: fixed;
    top: var(--fs-header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--fs-background);
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 999;
}

.mobile-navigation.active {
    transform: translateX(0);
}

.mobile-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-navigation li {
    border-bottom: 1px solid var(--fs-border);
}

.mobile-navigation a {
    display: block;
    padding: 16px 0;
    color: var(--fs-text);
    text-decoration: none;
    font-size: 1rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: var(--fs-surface);
    border-top: 1px solid var(--fs-border);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: var(--fs-content-width);
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-nav {
    margin-bottom: 20px;
}

.footer-nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-nav a {
    color: var(--fs-text-light);
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-nav a:hover {
    color: var(--fs-accent);
}

.copyright {
    color: var(--fs-text-light);
    font-size: 0.8rem;
    margin: 0;
}

/* ==========================================================================
   Content Area
   ========================================================================== */
.entry-content {
    padding: 40px 0;
}

/* ショートコード用：余白なしオプション */
.page-template-fullwidth .entry-content {
    padding: 0;
}

/* ==========================================================================
   Ads Placeholder (広告エリア)
   ========================================================================== */
.ad-slot {
    margin: 20px 0;
    text-align: center;
}

.ad-slot-header {
    margin-bottom: 20px;
}

.ad-slot-footer {
    margin-top: 20px;
}

.ad-slot-content-top {
    margin-bottom: 30px;
}

.ad-slot-content-bottom {
    margin-top: 30px;
}

/* 広告プレビューモード */
body.ad-preview .ad-slot {
    background: #fff3cd;
    border: 2px dashed #ffc107;
    padding: 20px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.ad-preview .ad-slot::before {
    content: attr(data-slot-name);
    color: #856404;
    font-weight: bold;
}

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

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .site-header,
    .site-footer,
    .ad-slot,
    .mobile-navigation {
        display: none !important;
    }
}

/* ==========================================================================
   Menu Templates (多言語対応メニュー)
   ========================================================================== */
.fs-menu-template {
    margin: 0;
}

.fs-menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.fs-menu-layout-horizontal .fs-menu-list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.fs-menu-layout-vertical .fs-menu-list {
    flex-direction: column;
}

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

.fs-menu-item a {
    color: var(--fs-text-light);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 4px 8px;
    transition: color 0.2s;
}

.fs-menu-item a:hover {
    color: var(--fs-accent);
}

.fs-menu-separator {
    color: var(--fs-border);
    font-size: 0.75rem;
    padding: 0 4px;
    user-select: none;
}

/* フッター用メニューテンプレート */
.fs-menu-footer {
    margin-bottom: 20px;
}

.fs-menu-footer .fs-menu-list {
    justify-content: center;
}

/* ヘッダー用メニューテンプレート */
.fs-menu-header {
    display: none;
}

.fs-menu-header .fs-menu-item a {
    color: var(--fs-text);
    font-size: 0.9rem;
    font-weight: 500;
}

@media (min-width: 768px) {
    .fs-menu-header {
        display: block;
    }
}

/* レスポンシブ調整 */
@media (max-width: 767px) {
    .fs-menu-layout-horizontal .fs-menu-list {
        gap: 8px;
    }
    
    .fs-menu-item a {
        font-size: 0.8rem;
        padding: 4px 4px;
    }
    
    .fs-menu-separator {
        padding: 0 2px;
    }
}
