/* ==========================================================================
   Super One - メインスタイルシート
   ========================================================================== */

/* --- CSS Variables --- */
:root {
    --color-primary: #1a1a2e;
    --color-accent: #e94560;
    --color-bg: #f8f9fa;
    --color-white: #ffffff;
    --color-text: #333333;
    --color-text-sub: #666666;
    --color-border: #e0e0e0;
    --color-genre-drama: #e94560;
    --color-genre-movie: #0f3460;
    --color-genre-anime: #16213e;
    --color-genre-manga: #533483;
    --color-genre-novel: #4a7c59;
    --color-genre-stage: #c4a35a;
    --font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --max-width: 1200px;
    --content-width: 780px;
    --sidebar-width: 340px;
    --gap: 40px;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --transition: 0.2s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-weight: 400;
    line-height: 1.8;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: #c73550;
}

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

/* Global overflow prevention */
.site-main {
    overflow-x: hidden;
}

ul, ol {
    list-style: none;
}

/* --- Header --- */
.site-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow var(--transition);
}

.site-header.is-scrolled {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 64px;
    gap: 20px;
}

.site-branding {
    flex-shrink: 0;
}

.site-title-link {
    text-decoration: none;
    color: var(--color-primary);
}

.site-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.custom-logo-link img {
    max-height: 40px;
    width: auto;
}

/* --- Navigation --- */
.global-nav {
    flex: 1;
}

.nav-menu {
    display: flex;
    gap: 4px;
}

.nav-menu .menu-item a {
    display: block;
    padding: 8px 14px;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
}

.nav-menu .menu-item a:hover,
.nav-menu .current-menu-item a {
    background: var(--color-bg);
    color: var(--color-accent);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    transition: transform var(--transition), opacity var(--transition);
}

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

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

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

/* --- Search --- */
.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--color-text);
    flex-shrink: 0;
}

.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
}

.search-overlay.is-active {
    display: flex;
}

.search-overlay-inner {
    background: var(--color-white);
    padding: 48px 30px 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

.search-overlay .search-form {
    display: flex;
    gap: 8px;
    max-width: 100%;
}

.search-overlay .search-form label {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
}

.search-overlay .search-field {
    width: 100%;
    min-width: 0;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: var(--font-family);
    outline: none;
    transition: border-color var(--transition);
    box-sizing: border-box;
}

.search-overlay .search-field:focus {
    border-color: var(--color-accent);
}

.search-overlay .search-submit {
    padding: 12px 24px;
    background: var(--color-accent);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
}

.search-overlay .search-submit:hover {
    background: #c73550;
}

.search-close {
    position: absolute;
    top: 10px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--color-text-sub);
    cursor: pointer;
}

/* --- Layout --- */
.content-area {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 30px 20px;
}

.content-wrapper {
    display: flex;
    gap: var(--gap);
    align-items: flex-start;
}

.single-article,
.page-article,
.archive-content,
.front-page-content {
    flex: 1;
    min-width: 0;
}

/* --- Genre Badge --- */
.genre-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-white);
    border-radius: 4px;
    line-height: 1.4;
    letter-spacing: 0.04em;
}

.genre-drama { background-color: var(--color-genre-drama); }
.genre-movie { background-color: var(--color-genre-movie); }
.genre-anime { background-color: var(--color-genre-anime); }
.genre-manga { background-color: var(--color-genre-manga); }
.genre-novel { background-color: var(--color-genre-novel); }
.genre-stage { background-color: var(--color-genre-stage); }
.genre-default { background-color: var(--color-text-sub); }

/* --- Post Card --- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.post-card {
    background: var(--color-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), transform var(--transition);
}

.post-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.post-card-link {
    display: block;
    color: var(--color-text);
}

.post-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--color-border);
}

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

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

.post-card-thumb .genre-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
}

.post-card-body {
    padding: 16px;
}

.post-card-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.post-card-date {
    font-size: 12px;
    color: var(--color-text-sub);
}

/* --- Category Section (Top page) --- */
.category-section {
    margin-bottom: 48px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--color-primary);
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-primary);
}

.section-more {
    font-size: 14px;
    font-weight: 700;
}

/* --- Hero Slider --- */
.hero-slider {
    position: relative;
    margin-bottom: 48px;
    border-radius: var(--radius);
    overflow: hidden;
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease;
}

.slider-item {
    min-width: 100%;
}

.slider-image {
    position: relative;
    aspect-ratio: 16 / 9;
}

.slider-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--color-white);
}

.slider-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 8px;
}

.slider-date {
    font-size: 13px;
    opacity: 0.8;
}

.slider-prev,
.slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: var(--color-white);
    border: none;
    padding: 12px 16px;
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background var(--transition);
}

.slider-prev { left: 12px; }
.slider-next { right: 12px; }

.slider-prev:hover,
.slider-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* --- Archive --- */
.archive-header {
    margin-bottom: 30px;
}

.archive-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.archive-description {
    color: var(--color-text-sub);
    font-size: 14px;
}

.archive-count {
    color: var(--color-text-sub);
    font-size: 14px;
}

/* --- Pagination --- */
.pagination {
    margin-top: 40px;
    text-align: center;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
    transition: all var(--transition);
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-white);
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 84px;
}

.widget {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.widget-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-primary);
    padding-bottom: 10px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--color-accent);
}

.widget ul {
    list-style: none;
}

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: var(--color-text);
}

.widget ul li a:hover {
    color: var(--color-accent);
}

/* Recent posts widget */
.recent-post-item a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.recent-post-thumb {
    width: 70px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}

.recent-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.5;
}

/* --- Search Form (inline) --- */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 100%;
}

.search-form label {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
}

.search-field {
    width: 100%;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font-family);
    background: var(--color-white);
    outline: none;
    transition: border-color var(--transition);
    box-sizing: border-box;
}

.search-field:focus {
    border-color: var(--color-accent);
}

.search-submit {
    padding: 10px 16px;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
}

.search-submit:hover {
    background: var(--color-accent);
}

/* --- Footer --- */
/* --- Footer --- */
.site-footer {
    background: #000;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

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

.footer-top {
    margin-bottom: 32px;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.45);
}

.site-footer a:hover {
    color: #fff;
}

.footer-logo {
    display: inline-block;
    font-size: 20px;
    font-weight: 700;
    color: #fff !important;
    letter-spacing: 0.04em;
}

.footer-logo:hover {
    opacity: 0.7;
}

.footer-description {
    margin-top: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.6;
}

.footer-nav {
    margin-bottom: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-menu {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-menu li a {
    font-size: 13px;
    transition: color 0.2s;
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-copyright {
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.03em;
}

/* --- 404 --- */
.error-404-content {
    text-align: center;
    padding: 60px 0;
}

.error-title {
    font-size: 80px;
    font-weight: 700;
    color: var(--color-border);
    line-height: 1;
    margin-bottom: 16px;
}

.error-message {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.error-description {
    color: var(--color-text-sub);
    margin-bottom: 30px;
}

.error-search {
    max-width: 500px;
    margin: 0 auto 40px;
}

.error-popular {
    text-align: left;
}

.error-popular h2 {
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
}

/* --- No results --- */
.no-results {
    text-align: center;
    padding: 60px 0;
}

.no-results h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.no-results p {
    color: var(--color-text-sub);
    margin-bottom: 20px;
}

.no-results .search-form {
    max-width: 500px;
    margin: 0 auto;
}

/* --- Ad Slots --- */
.ad-slot {
    margin: 30px 0;
    text-align: center;
    min-height: 250px;
}

.ad-in-content {
    margin: 30px 0;
    text-align: center;
    min-height: 250px;
}

/* --- Focus Indicators (Accessibility) --- */
.menu-toggle:focus-visible,
.search-toggle:focus-visible,
.search-close:focus-visible,
.slider-prev:focus-visible,
.slider-next:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

.search-overlay .search-submit:focus-visible,
.search-submit:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

.search-overlay .search-field:focus,
.search-field:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.2);
}

.pagination .page-numbers:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* --- Skip Link --- */
.skip-link:focus {
    clip: auto !important;
    display: block;
    width: auto;
    height: auto;
    padding: 12px 24px;
    background: var(--color-accent);
    color: var(--color-white);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    z-index: 10000;
    position: fixed;
    top: 0;
    left: 0;
}

/* --- Scroll to Top --- */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
    z-index: 900;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.scroll-top:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

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