/*
Theme Name: Portfolio Green (Modern Sage)
Theme URI: http://example.com/portfolio-green
Author: toribanbi
Author URI: http://example.com/
Description: A modern, minimal sage-green themed portfolio and blog theme.
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: portfolio-green
*/

:root {
    --sage-primary: #8fa989;     /* Soft Sage Green */
    --sage-light: #d4dfd1;       /* Very Light Sage */
    --sage-light-alpha: rgba(212, 223, 209, 0.3); /* Transparent Sage Light */
    --sage-dark: #5b6d56;        /* Muted Dark Green for text */
    --bg-color: #f8faf9;         /* Off-white Greenish Background */
    --card-bg: #ffffff;
    --text-main: #4a4a4a;
    --text-muted: #888888;
    --accent: #e09f7d;           /* Muted Terracotta Accent */
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Fraunces (display headings) & Inter (body) — self-hosted from
   vendor/fonts/ (see fonts.googleapis.com CSS2 API), latin subset only.
   Each file is a variable-weight font, so one @font-face per style with a
   font-weight range covers every weight used on the site (400/500/600/700
   below) without needing a separate file per exact weight. */
@font-face {
    font-family: 'Fraunces';
    font-style: italic;
    font-weight: 400 500;
    font-display: swap;
    src: url('vendor/fonts/fraunces-italic.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('vendor/fonts/fraunces-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('vendor/fonts/inter-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden; /* Prevent horizontal scrolling globally */
    width: 100%;
}

/* Header & Nav */
.site-header {
    background-color: transparent;
    padding: 4rem 2rem 2rem;
    text-align: center;
}

/* The front page skips the header/nav entirely rather than animating them
   away during the opening scroll-lock: expanding them back in while the
   visitor's own scroll gesture is also moving the page fought with that
   gesture and felt like a jolt. Simpler and jank-free to just not render
   them there — the hero's CTAs and each section's own links cover
   navigation on that page. Other pages keep the header/nav as normal. */
body.home .site-header,
body.home .main-navigation {
    display: none;
}

/* Opening scroll-lock (front page only, applied by intro-lock.js — see
   that file for why this is JS-applied rather than a CSS default). */
body.intro-locked {
    overflow: hidden;
    height: 100%;
}

.site-header h1 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.site-header h1 a {
    color: var(--sage-dark) !important;
    text-decoration: none;
}

.site-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.main-navigation {
    text-align: center;
    margin-bottom: 4rem;
}

.main-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    gap: 2rem;
}

.main-navigation a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: var(--sage-primary);
}

/* Active Menu Item Highlight */
.main-navigation .current-menu-item a,
.main-navigation .current-page-ancestor a,
.main-navigation .current-post-ancestor a {
    color: var(--sage-primary);
    position: relative;
}

.main-navigation .current-menu-item a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--sage-primary);
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 1.5rem 0;
    border-top: 1px solid var(--sage-light-alpha);
    border-bottom: 1px solid var(--sage-light-alpha);
    background-color: white;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.breadcrumbs a {
    color: var(--sage-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: var(--sage-dark);
}

.breadcrumbs .sep {
    margin: 0 0.5rem;
    color: #ddd;
}

.breadcrumbs .current {
    color: var(--text-main);
    font-weight: 500;
}

/* Site Title Hover Hint */
.site-title-container {
    position: relative;
    display: inline-block;
}

.site-logo-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.home-hint {
    font-size: 0.65rem;
    color: var(--sage-primary);
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: absolute;
    top: -20px;
    white-space: nowrap;
}

.site-logo-link:hover .home-hint {
    opacity: 1;
    transform: translateY(0);
}

/* Container & Grid */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Page Loader Styles */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.8s ease, visibility 0.8s;
}

#loader-wrapper.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-circle {
    width: 60px;
    height: 60px;
    border: 3px solid var(--sage-light);
    border-top: 3px solid var(--sage-primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: loader-spin 1.5s infinite linear;
}

.loader-text {
    font-size: 1rem;
    color: var(--sage-dark);
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 300;
    animation: loader-pulse 2s infinite ease-in-out;
}

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

@keyframes loader-pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1.02); }
}

/* Thumbnail Fallbacks */
.thumb-fallback {
    width: 100%;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
    text-align: center;
    color: white;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.9rem;
    overflow: hidden;
}

.thumb-fallback span {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.8;
}

.thumb-fallback-works { background-color: var(--sage-dark); }
.thumb-fallback-tech  { background-color: var(--sage-primary); }
.thumb-fallback-misc  { background-color: var(--sage-light); color: var(--sage-dark); }
.thumb-fallback-common { background-color: var(--bg-color); color: var(--text-muted); }
.thumb-fallback-games { background-color: #1a1a2e; }

/* For single post featured image fallback */
.featured-image.thumb-fallback {
    height: 400px;
    border-radius: 12px;
    font-size: 1.5rem;
    margin-bottom: 4rem;
}

.entry-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 1rem;
}

.entry-title a {
    color: var(--sage-dark);
    transition: opacity 0.3s;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 6rem 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.site-footer p {
    margin: 0.5rem 0;
}

/* Single Post Specific Styles */
.container--narrow {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.entry-single .entry-header {
    margin-bottom: 3.5rem;
    text-align: center;
}

.entry-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.entry-meta a {
    color: var(--sage-primary);
    text-decoration: none;
    font-weight: 600;
}

.entry-single .entry-title {
    font-size: 2.4rem;
    line-height: 1.3;
    color: var(--sage-dark);
    margin-top: 0;
}

.featured-image {
    border-radius: 12px;
    margin-bottom: 4rem;
    box-shadow: var(--shadow);
    width: 100%;
    height: auto;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 2;
    color: var(--text-main);
    min-height: 450px; /* 固定値でしっかり確保 */
    min-height: 50vh;  /* 画面の半分を最低限確保 */
    margin-bottom: 5rem; /* 次の要素との間隔もしっかり空ける */
}

.entry-content h2 {
    color: var(--sage-dark);
    margin: 4rem 0 1.5rem;
    font-size: 1.75rem;
    border-left: 4px solid var(--sage-primary);
    padding-left: 1.2rem;
}

.entry-content h3 {
    color: var(--sage-dark);
    margin: 3rem 0 1.2rem;
    font-size: 1.4rem;
}

.entry-content p {
    margin-bottom: 2.2rem;
}

/* Image Captions */
.entry-content figcaption,
.wp-block-image figcaption,
.wp-caption-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.8rem;
    margin-bottom: 2.5rem;
    line-height: 1.6;
    font-style: italic;
}

.entry-content blockquote {
    border-left: 3px solid var(--sage-light);
    padding: 1.5rem 2.5rem;
    margin: 2.5rem 0;
    background: #fdfdfd;
    font-style: italic;
    color: var(--sage-dark);
}

.post-navigation {
    margin: 6rem 0 3rem;
    border-top: 1px solid var(--sage-light);
    padding-top: 3.5rem;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 3rem;
}

.nav-links > div {
    flex: 1;
}

.nav-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.nav-title {
    display: block;
    font-size: 1rem;
    color: var(--sage-dark);
    font-weight: 500;
}

.post-navigation a {
    text-decoration: none;
}

.post-navigation a:hover .nav-title {
    color: var(--sage-primary);
}

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

/* Comments Section */
.comments-area {
    margin: 6rem 0;
    padding-top: 4rem;
    border-top: 1px solid var(--sage-light);
}

.comments-title {
    font-size: 1.5rem;
    color: var(--sage-dark);
    margin-bottom: 3rem;
}

.comment-list, 
.comment-list .children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list .children {
    margin-left: 2rem; /* 返信コメントのインデント（少しだけ） */
}

.comment-list .comment {
    margin-bottom: 2rem;
    padding: 0;
    border: none;
}

.comment-body {
    display: flex; /* GridからFlexに変更して、より柔軟な配置に */
    gap: 1.2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #f0f0f0;
}

.comment-author .avatar {
    border-radius: 50%;
    flex-shrink: 0;
}

.comment-content-wrapper {
    flex-grow: 1;
}

.comment-meta {
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.comment-author .fn {
    font-weight: 600;
    color: var(--sage-dark);
    font-style: normal;
    display: block;
    font-size: 1rem;
}

.comment-metadata {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-content {
    line-height: 1.7;
    margin-top: 0.8rem;
    color: var(--text-main);
}

.reply {
    margin-top: 1rem;
}

.comment-reply-link {
    display: inline-block; /* 縦並びを防ぐ */
    white-space: nowrap;  /* 改行を防ぐ */
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--sage-primary);
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
}

/* Comment Form */
#respond {
    background: #fdfdfd;
    padding: 3rem;
    border-radius: 12px;
    border: 1px solid var(--sage-light);
    margin-top: 5rem;
}

#reply-title {
    font-size: 1.25rem;
    color: var(--sage-dark);
    margin-bottom: 2rem;
}

.comment-form p {
    margin-bottom: 1.5rem;
}

.comment-form label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--sage-dark);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    box-sizing: border-box; /* パディングを含めた幅計算 */
    padding: 1rem;
    border: 1px solid var(--sage-light);
    border-radius: 8px;
    background: white;
    font-family: inherit;
    transition: border-color 0.3s;
}

.comment-form textarea {
    height: 180px;
    resize: none; /* ユーザーによるサイズ変更を禁止（固定） */
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--sage-primary);
}

.comment-form .submit {
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
}

/* Responsive Embeds & Blog Cards */
.wp-block-embed {
    margin: 2rem 0;
}

.wp-block-embed__wrapper {
    position: relative;
}

/* Ensure WordPress default blog card iframe takes full width */
iframe.wp-embedded-content {
    max-width: 100%;
    width: 100%;
}

/* Custom Blog Card Styles */
.external-card {
    margin: 1.5rem 0;
    max-width: 36rem;
    width: 100%;
}

.external-card-link {
    display: flex;
    background: #ffffff;
    border: 1px solid var(--sage-light);
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none !important;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.external-card-link:hover {
    transform: none;
    background-color: #fcfdfc;
    border-color: var(--sage-primary);
}

.external-card-image {
    width: 100px;
    flex-shrink: 0;
    background: var(--sage-light-alpha);
    border-right: 1px solid var(--sage-light-alpha);
}

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

.external-card-content {
    padding: 0.6rem 0.8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    min-width: 0;
}

.external-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--sage-dark);
    line-height: 1.3;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.external-card-description {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.external-card-meta {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.external-card-favicon {
    width: 12px;
    height: 12px;
    object-fit: contain;
}

.external-card-sitename {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* Mobile adjustments for blog card */
@media (max-width: 600px) {
    .external-card {
        max-width: 100%;
    }
    .external-card-link {
        flex-direction: row;
    }
    .external-card-image {
        width: 80px;
        height: auto;
    }
    .external-card-title {
        font-size: 0.85rem;
    }
    .external-card-description {
        display: none;
    }
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .container {
        padding: 0 3rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .site-header {
        padding: 3rem 1rem 1.5rem;
    }

    .main-navigation {
        margin-bottom: 2.5rem;
    }

    .main-navigation ul {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.2rem;
    }

    .site-footer {
        padding: 4rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .site-header h1 {
        font-size: 1.25rem;
    }

    .site-header p {
        font-size: 0.8rem;
    }

}

/* ==========================================================================
   Front Page: Hero & Section Grid
   front-page.php のインライン<style>から移設(全ページ共通コンポーネント化)。
   front-grid / front-item-card は index.php のアーカイブ一覧でも再利用する。
   ========================================================================== */
/* Fixed full-viewport overlay rather than an in-flow section: the opening
   sits on top of the real page (already scrolled to position 0 underneath)
   and fades away on unlock (see intro-lock.js) instead of being scrolled
   past. Falls back to a normal in-flow section — no fixed positioning —
   when JS can't run the fade (no-JS noscript override below) or when the
   visitor prefers reduced motion (media query below): both cases skip the
   opening entirely, so a permanently-fixed full-screen overlay would
   otherwise trap the page. */
.hero-section {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 2rem;
    overflow: hidden;
    background: radial-gradient(circle at 70% 30%, var(--sage-light) 0%, transparent 50%);
    transition: opacity 0.6s ease;
}

.hero-section.hero-fading-out {
    opacity: 0;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .hero-section {
        position: relative;
        inset: auto;
        height: 100vh;
    }
}

/* Soft blurred blobs, kept as static decoration (no scroll-tied parallax —
   dropped along with the in-flow layout, since there's no scroll happening
   underneath the fixed overlay). Purely decorative: aria-hidden'd in
   markup isn't needed since they're empty, non-focusable divs. */
.hero-decor-layer {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

.hero-blob-1 {
    top: 8%;
    left: 8%;
    width: 260px;
    height: 260px;
    background: var(--sage-light);
    opacity: 0.7;
}

.hero-blob-2 {
    top: 55%;
    right: 10%;
    width: 320px;
    height: 320px;
    background: var(--sage-primary);
    opacity: 0.18;
}

.hero-blob-3 {
    bottom: 5%;
    left: 20%;
    width: 180px;
    height: 180px;
    background: var(--sage-dark);
    opacity: 0.12;
}

.hero-content {
    position: relative;
    z-index: 1;
}

/* Foreground shape: bolder/sharper than the background blobs and layered
   above the text (z-index only now — no scroll parallax), so it reads as
   "in front of" the content rather than behind it. Positioned bleeding off
   a corner so it frames rather than covers the text. */
.hero-foreground-shape {
    width: 420px;
    height: 420px;
    right: -12%;
    bottom: -18%;
    background: var(--sage-primary);
    opacity: 0.3;
    filter: blur(4px);
    border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
    z-index: 2;
}

/* Hidden by default so there's no flash of the un-animated state before
   hero-entrance.js runs its entrance animation (it animates these to
   opacity:1). The <noscript> block in front-page.php restores visibility
   when JS is unavailable; hero-entrance.js itself has a fallback for when
   JS runs but GSAP failed to load. */
.hero-section .hero-subtitle,
.hero-section .hero-title,
.hero-section .scroll-hint {
    opacity: 0;
}

/* Scroll-reveal for section headers/cards below the hero (scroll-reveal.js).
   Scoped to .front-section so index.php's archive grid (same .front-grid/
   .front-item-card markup, but no .front-section wrapper) is unaffected. */
.front-section .section-header,
.front-section .front-item-card {
    opacity: 0;
}

.hero-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 200;
    line-height: 1.1;
    color: var(--sage-dark);
    margin-bottom: 2rem;
    letter-spacing: -2px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 3.5rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.btn-primary, .btn-secondary {
    padding: 1.2rem 3rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--sage-primary);
    color: white !important;
    box-shadow: 0 10px 20px rgba(143, 169, 137, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(143, 169, 137, 0.3);
    background-color: var(--sage-dark);
}

.btn-secondary {
    border: 1px solid var(--sage-primary);
    color: var(--sage-primary) !important;
}

.btn-secondary:hover {
    background-color: var(--sage-light);
}

.scroll-hint {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* Sections Shared Layout */
.front-section {
    padding: 8rem 0;
    background-color: white;
}

.front-section:nth-of-type(even) {
    background-color: var(--sage-light-alpha);
}

.section-header {
    margin-bottom: 5rem;
    text-align: center;
}

.section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--sage-primary);
    margin-bottom: 1rem;
    display: block;
}

.section-heading {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--sage-dark);
}

.view-all-container {
    text-align: center;
    margin-top: 5rem;
}

/* Grid for items (front page sections + archive/category listing) */
.front-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.front-item-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.front-item-card:hover {
    transform: translateY(-10px);
}

.item-thumbnail {
    display: block;
    width: 100%;
    height: 240px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.front-item-card:hover .item-thumbnail img {
    transform: scale(1.05);
}

.item-info {
    padding: 2rem;
}

.item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.item-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.item-title a {
    color: var(--sage-dark);
    text-decoration: none;
}

.item-summary {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.view-more-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sage-primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.front-game-card .item-thumbnail {
    position: relative;
}

.game-play-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    background: rgba(20, 20, 30, 0.75);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
}

@media (max-width: 992px) {
    .front-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 0 1.5rem;
    }

    .hero-title {
        font-size: 2.8rem;
        letter-spacing: -1px;
    }

    .hero-subtitle {
        letter-spacing: 1px;
        font-size: 0.9rem;
    }

    /* Scale the parallax blobs down for narrow viewports — at full desktop
       size they dominated the screen instead of reading as soft depth. */
    .hero-blob-1 {
        width: 160px;
        height: 160px;
    }

    .hero-blob-2 {
        width: 200px;
        height: 200px;
    }

    .hero-blob-3 {
        width: 120px;
        height: 120px;
    }

    .hero-foreground-shape {
        width: 240px;
        height: 240px;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .front-section {
        padding: 5rem 0;
    }

    .front-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ==========================================================================
   404 Page
   404.php のインライン<style>から移設。
   ========================================================================== */
.error-404-container {
    height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.error-code {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 8rem;
    font-weight: 200;
    color: var(--sage-light);
    line-height: 1;
    margin-bottom: 2rem;
    letter-spacing: 10px;
}

.error-title {
    font-size: 2rem;
    color: var(--sage-dark);
    font-weight: 300;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
}

.error-text {
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: 4rem;
    line-height: 1.8;
}

.back-home-btn {
    padding: 1rem 3rem;
    border: 1px solid var(--sage-primary);
    color: var(--sage-primary) !important;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.back-home-btn:hover {
    background-color: var(--sage-primary);
    color: white !important;
    box-shadow: 0 10px 20px rgba(143, 169, 137, 0.2);
}

.error-illustration {
    width: 60px;
    height: 60px;
    border: 2px solid var(--sage-light);
    border-radius: 50%;
    margin-bottom: 3rem;
    position: relative;
    animation: error-float 4s ease-in-out infinite;
}

.error-illustration::after {
    content: "?";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--sage-light);
}

@keyframes error-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* ==========================================================================
   Single Game Page
   single-game.php のインライン<style>から移設。
   ========================================================================== */
.game-page-main {
    padding: 6rem 0 8rem;
}

.game-page-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
    padding: 0 2rem;
}

.game-page-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--sage-dark);
    margin-bottom: 1rem;
}

.game-page-desc {
    color: var(--text-muted);
    line-height: 1.7;
}

.game-embed-wrap {
    width: 100%;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    background: #0a0a12;
}

/* 縦長: スマホ風の操作を想定したゲーム(例: Pixel Raider) */
.game-embed-portrait {
    max-width: 480px;
    aspect-ratio: 9 / 16;
}

/* 横長: PCでのプレイを想定したゲーム */
.game-embed-landscape {
    max-width: 900px;
    aspect-ratio: 16 / 9;
}

.game-embed-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ==========================================================================
   3D Model embed ([model] shortcode)
   Same sandboxed-iframe pattern as the game embeds, but a squarer frame
   suited to orbiting a single object rather than playing a full screen.
   ========================================================================== */
.model-embed-wrap {
    width: 100%;
    max-width: 640px;
    aspect-ratio: 4 / 3;
    margin: 2.5rem auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    background: #f2ebe0;
}

.model-embed-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.game-page-back {
    display: block;
    text-align: center;
    margin-top: 3rem;
    font-size: 0.85rem;
    color: var(--sage-primary);
    text-decoration: none;
    letter-spacing: 1px;
    text-transform: uppercase;
}
