/*
Theme Name:   Portfolio v4
Theme URI:    https://github.com/
Author:       Yoshiyuki Fujiwara
Author URI:   https://github.com/
Description:  A minimal portfolio theme, version 4.
Version:      4.1.0
License:      GNU General Public License v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Tags:         portfolio, minimal, clean, custom-menu
Text Domain:  portfolio_v4
*/

/* --- 1. Base Styles & Settings --- */
:root {
    --title-size: 24px;
    --title-align: left;
    --text-color: #333333;
    --sub-text-color: #666666;
    --bg-color: #ffffff;
    --header-height: 60px;
    --font-stack: "Helvetica Neue", Helvetica, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-stack);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* ▼ フッター固定 & スクロール制御 ▼ */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* メニュー表示中の背景スクロールを禁止 */
body.menu-open {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s;
}
a:hover {
    opacity: 0.6;
}

/* --- 2. Header & Hamburger --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    /* ▼ ヘッダーのクリック問題を修正 ▼ */
    z-index: 10001; /* ハンバーガーよりは下、メニューよりは上 */
}

/* メニュー表示中はヘッダーの背景を透明に */
.menu-open header {
    background-color: transparent;
}

.site-title {
    font-size: var(--title-size);
    font-weight: bold;
    letter-spacing: 0.05em;
    flex-grow: 1;
    text-align: var(--title-align);
}

.hamburger {
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
    z-index: 10002; /* 最前面に表示 */
    background: transparent;
    border: none;
    padding: 0;
}
.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    position: absolute;
    transition: all 0.3s ease;
}
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 9px; }
.hamburger span:nth-child(3) { bottom: 0; }

/* メニュー表示中のハンバーガー（×印） */
.hamburger.active span {
    background-color: var(--text-color); /* メニュー背景が白なので、通常時の色を強制 */
}
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 9px;
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 9px;
}

/* --- 3. Fullscreen Navigation Menu --- */
.fullscreen-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    
    display: flex;
    justify-content: center;
    align-items: center;
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
    z-index: 10000;
}
.fullscreen-menu.open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}
.fullscreen-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}
.fullscreen-menu li {
    margin: 20px 0;
}
.fullscreen-menu a {
    font-size: 1.5rem; /* 文字サイズを修正 */
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-color);
    padding: 10px 20px;
}

/* --- 4. Main Content (Works Grid) --- */
main {
    padding: var(--header-height) 20px 60px;
    padding-top: 100px;
    width: 100%;
    box-sizing: border-box;
    /* ▼ フッター固定のため ▼ */
    flex-grow: 1;
}
.works-grid-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    column-gap: 20px;
    row-gap: 40px;
}
.work-item {
    display: flex;
    flex-direction: column;
}
.work-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #f0f0f0;
    overflow: hidden;
    margin-bottom: 10px;
}
.work-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}
.work-item:hover .work-thumbnail img {
    transform: scale(1.05);
}
.work-caption {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-color);
}
.work-title {
    display: block;
    margin-bottom: 4px;
}
.work-date {
    display: block;
    font-size: 0.75rem;
    color: var(--sub-text-color);
    margin-top: 2px;
}

/* --- 5. Footer --- */
footer {
    text-align: center;
    padding: 60px 0;
    font-size: 0.75rem;
    color: #888;
    width: 100%;
}

/* --- 6. Single Post & Page --- */
.content-area {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
    box-sizing: border-box;
}
.entry-header {
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}
.entry-title {
    font-size: 2rem;
    margin: 0 0 10px;
    font-weight: bold;
}
.entry-meta {
    font-size: 0.85rem;
    color: var(--sub-text-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.entry-content {
    font-size: 1rem;
    line-height: 1.7;
}
.entry-content p {
    margin-bottom: 1.5em;
}
.entry-content img,
.featured-image {
    max-width: 100%;
    height: auto;
    margin: 20px auto;
    display: block;
}
.entry-content a {
    text-decoration: underline;
    color: var(--text-color);
}
.entry-content a:hover {
    text-decoration: none;
    opacity: 0.7;
}