/*
Theme Name: Photo Portfolio
Theme URI: https://example.com/photo-portfolio
Author: Your Name
Author URI: https://example.com
Description: シンプルな写真ポートフォリオ用のWordPressテーマ
Version: 1.0.0-2025-08-18
Text Domain: photo-portfolio
*/

/* =================================================================
   基本設定
   ================================================================= */

/* リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本スタイル */
body {
    font-family: 'Sawarabi Gothic', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: 0.05em;
    color: #333;
    background-color: #fff;
}

/* 選択時の背景色 */
::selection {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

::-moz-selection {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* スクロールバーのカスタマイズ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =================================================================
   アニメーション
   ================================================================= */

.photo-item,
.entry-content img {
    opacity: 0;
    transition: opacity 0.9s ease;
}

.fade-element {
    opacity: 0;
    transition: opacity 0.9s ease;
}

.fade-element.fade-in {
    opacity: 1;
}

/* =================================================================
   ヘッダー
   ================================================================= */

.site-header {
    background-color: #fff;
    padding: 60px 0;
    border-bottom: 1px solid #f5f5f5;
}

.site-title {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.site-title a {
    color: #333;
    text-decoration: none;
}

.site-description {
    color: #666;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 0.05em;
    margin-top: 10px;
    line-height: 1.8;
}

/* =================================================================
   ナビゲーション
   ================================================================= */

.main-navigation {
    margin-top: 20px;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.main-navigation a {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: color 0.5s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-parent > a,
.main-navigation .current-page-ancestor > a,
.main-navigation .current-category-ancestor > a,
.main-navigation .current-category-parent > a {
    color: #333;
}

/* 現在のページハイライト */
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-parent > a,
.main-navigation .current-page-ancestor > a,
.main-navigation .current-category-ancestor > a,
.main-navigation .current-category-parent > a {
    font-weight: 400;
    position: relative;
}

.main-navigation .current-menu-item > a::after,
.main-navigation .current-menu-parent > a::after,
.main-navigation .current-page-ancestor > a::after,
.main-navigation .current-category-ancestor > a::after,
.main-navigation .current-category-parent > a::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #333;
}

/* ハンバーガーメニュー */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    width: 30px;
    height: 30px;
}

.hamburger-line {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #333;
    margin: 5px 0;
    transition: all 0.3s ease;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.hamburger-line:nth-child(1) { top: 8px; }
.hamburger-line:nth-child(2) { top: 50%; transform: translate(-50%, -50%); }
.hamburger-line:nth-child(3) { bottom: 8px; }

/* ハンバーガーアニメーション */
.menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateX(-50%) translateY(6px) rotate(45deg);
    top: 50%;
}

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

.menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateX(-50%) translateY(-6px) rotate(-45deg);
    bottom: 50%;
}

/* =================================================================
   メインコンテンツ
   ================================================================= */

.site-main {
    padding: 80px 0;
    min-height: 500px;
}

/* =================================================================
   写真グリッド
   ================================================================= */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 35px;
    margin-top: 60px;
}

@media (min-width: 1200px) {
    .photo-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.photo-item {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 1;
    transition: transform 0.5s ease;
}

.photo-item:hover {
    transform: scale(1.02);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.photo-item:hover img,
.photo-item:hover .placeholder-image {
    transform: scale(1.05);
}

/* プレースホルダー画像 */
.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    transition: transform 0.3s;
}

.placeholder-image svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 写真オーバーレイ */
.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 20px;
    transform: translateY(0);
    transition: all 0.3s;
}

.photo-item:hover .photo-overlay {
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.85));
}

.photo-title {
    font-size: 16px;
    margin-bottom: 5px;
}

.photo-date {
    font-size: 12px;
    opacity: 0.8;
}

/* =================================================================
   個別投稿
   ================================================================= */

.single-photo {
    max-width: 1200px;
    margin: 0 auto;
}

.entry-header {
    margin-bottom: 30px;
}

.title-with-share {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 10px;
}

.entry-title {
    font-size: 32px;
    font-weight: 300;
    margin: 0;
}

/* SNSシェアボタン */
.social-share-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: transparent;
    color: #333;
    text-decoration: none !important;
    transition: all 0.3s ease;
    border: 1px solid #e8e8e8;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none !important;
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

.social-share-buttons a {
    text-decoration: none !important;
    border-bottom: none !important;
}

.social-share-buttons a:hover,
.social-share-buttons a:focus,
.social-share-buttons a:active {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* SNSブランドカラー */
.share-twitter:hover { background-color: #000; color: white; border-color: #000; }
.share-facebook:hover { background-color: #1877f2; color: white; border-color: #1877f2; }
.share-line:hover { background-color: #00c300; color: white; border-color: #00c300; }
.share-copy:hover { background-color: #333; color: white; border-color: #333; }

/* コピー完了通知 */
.copy-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 9999;
}

.copy-notification.show {
    opacity: 1;
}

.entry-meta {
    color: #666;
    font-size: 14px;
}

/* =================================================================
   記事コンテンツ
   ================================================================= */

.entry-content {
    font-size: 18px;
    line-height: 1.7;
    color: #333;
}

/* 見出し */
.entry-content h1 {
    font-size: 32px;
    font-weight: 300;
    line-height: 1.4;
    margin: 70px 0 35px;
    color: #222;
    letter-spacing: 0.05em;
}

.entry-content h2 {
    font-size: 28px;
    font-weight: 300;
    line-height: 1.4;
    margin: 60px 0 30px;
    color: #222;
    letter-spacing: 0.05em;
}

.entry-content h3 {
    font-size: 24px;
    font-weight: 400;
    line-height: 1.5;
    margin: 50px 0 25px;
    color: #222;
    letter-spacing: 0.03em;
}

.entry-content h4 {
    font-size: 20px;
    font-weight: 400;
    line-height: 1.5;
    margin: 40px 0 20px;
    color: #333;
    letter-spacing: 0.03em;
}

/* 段落 */
.entry-content p {
    margin-bottom: 28px;
    font-weight: 400;
    line-height: 1.9;
}

.entry-content p:last-child {
    margin-bottom: 0;
}

/* 最初の段落強調（写真投稿以外） */
.post:not(.photo) .entry-content > p:first-of-type {
    font-size: 20px;
    line-height: 1.6;
    color: #222;
    margin-bottom: 30px;
}

/* リスト */
.entry-content ul,
.entry-content ol {
    margin: 24px 0;
    padding-left: 32px;
}

.entry-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.entry-content ul li { list-style-type: disc; }
.entry-content ol li { list-style-type: decimal; }

/* リンク */
.entry-content a {
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #333;
    transition: all 0.3s ease;
}

.entry-content a:hover {
    color: #666;
    border-bottom-color: #666;
}

/* 引用 */
.entry-content blockquote {
    margin: 40px 0;
    padding: 30px 40px;
    background-color: #f8f9fa;
    border-left: 4px solid #333;
    font-style: italic;
    font-size: 20px;
    line-height: 1.6;
    color: #555;
}

.entry-content blockquote p {
    margin-bottom: 0;
}

/* コード */
.entry-content code {
    background-color: #f5f5f5;
    color: #333;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
}

.entry-content pre {
    background-color: #f8f8f8;
    color: #333;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 30px 0;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.entry-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

/* その他のコンテンツ要素 */
.entry-content hr {
    border: none;
    height: 1px;
    background-color: #e5e5e5;
    margin: 50px 0;
}

.entry-content strong,
.entry-content b {
    font-weight: 600;
    color: #222;
}

.entry-content em,
.entry-content i {
    font-style: italic;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    margin: 30px 0;
    cursor: zoom-in;
}

/* テーブル */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 16px;
}

.entry-content th,
.entry-content td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.entry-content th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #222;
}

/* =================================================================
   アーカイブページ
   ================================================================= */

.page-title {
    font-size: 32px;
    font-weight: 300;
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.archive-description {
    text-align: center;
    color: #666;
    font-size: 16px;
    margin-bottom: 40px;
    line-height: 1.6;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results h2 {
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 20px;
    color: #333;
}

.no-results p {
    color: #666;
    font-size: 16px;
    margin-bottom: 15px;
}

.no-results a {
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #333;
    transition: all 0.3s;
}

.no-results a:hover {
    color: #666;
    border-bottom-color: #666;
}

/* =================================================================
   ページネーション
   ================================================================= */

.pagination {
    margin-top: 60px;
    text-align: center;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 3px;
    border: 1px solid #ddd;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
}

.pagination a:hover,
.pagination .current {
    background-color: #333;
    color: white;
    border-color: #333;
}

/* =================================================================
   Lightbox
   ================================================================= */

.lightbox {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out, background-color 0.8s ease-out;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
    background-color: rgba(255, 255, 255, 0.98);
}

.lightbox-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.lightbox.active .lightbox-image {
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #333;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s, opacity 0.5s ease 0.4s;
    z-index: 10000;
    opacity: 0;
}

.lightbox.active .lightbox-close {
    opacity: 1;
}

.lightbox-close:hover {
    color: #666;
}

.lightbox-caption {
    position: relative;
    margin-top: 10px;
    color: #333;
    font-size: 16px;
    font-weight: 100;
    text-align: left;
    padding: 10px 0;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    max-width: 400px;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 10001;
}

.lightbox.active .lightbox-caption {
    opacity: 1;
}

.lightbox-caption strong {
    font-size: 14px;
    font-weight: 100;
    color: #222;
}

.lightbox-caption .caption-text {
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin-top: 5px;
    display: inline-block;
}

/* Lightboxナビゲーション */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 50px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s, opacity 0.5s ease 0.3s;
    z-index: 10000;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
}

.lightbox.active .lightbox-prev,
.lightbox.active .lightbox-next {
    opacity: 1;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(240, 240, 240, 0.95);
    color: #000;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* =================================================================
   フッター
   ================================================================= */

.site-footer {
    background-color: #fff;
    color: #666;
    padding: 30px 0;
    text-align: right;
    font-size: 12px;
    font-weight: 300;
    border-top: 1px solid #f0f0f0;
}

.site-footer a {
    color: #999;
    text-decoration: none;
    font-weight: 300;
}

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

/* =================================================================
   アルバムギャラリー
   ================================================================= */

.album-gallery {
    margin: 40px 0;
}

.album-gallery h3 {
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 300;
    letter-spacing: 1px;
}

.album-counter {
    display: none;
}

.album-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.album-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.album-item:hover img {
    opacity: 0.9;
    transform: scale(1.05);
}

.album-loading {
    display: none !important;
}

.spinner {
    display: none !important;
}

.error-icon {
    display: none !important;
}

.keyboard-hint {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-left: 4px solid #007cba;
    font-size: 14px;
    color: #666;
    border-radius: 4px;
}

.keyboard-hint kbd {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 12px;
    margin: 0 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* =================================================================
   レスポンシブ
   ================================================================= */

@media (max-width: 768px) {
    /* ヘッダー */
    .site-header {
        padding: 40px 0;
    }
    
    .site-header .container {
        position: relative;
    }
    
    .menu-toggle {
        display: block;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    /* モバイルナビゲーション */
    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: #fff;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 9998;
        padding: 80px 30px 30px;
        overflow-y: auto;
    }
    
    .main-navigation.active {
        right: 0;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 25px;
    }
    
    .main-navigation a {
        font-size: 16px;
        color: #333;
        display: block;
        padding: 5px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    /* モバイルハイライト */
    .main-navigation .current-menu-item > a,
    .main-navigation .current-menu-parent > a,
    .main-navigation .current-page-ancestor > a,
    .main-navigation .current-category-ancestor > a,
    .main-navigation .current-category-parent > a {
        color: #000;
        font-weight: 600;
        background-color: #f8f8f8;
    }
    
    .main-navigation .current-menu-item > a::after,
    .main-navigation .current-menu-parent > a::after,
    .main-navigation .current-page-ancestor > a::after,
    .main-navigation .current-category-ancestor > a::after,
    .main-navigation .current-category-parent > a::after {
        display: none;
    }
    
    /* オーバーレイ */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 9997;
    }
    
    .menu-overlay.active {
        display: block;
    }
    
    /* コンテンツ */
    .title-with-share {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .entry-title {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .social-share-buttons {
        margin-bottom: 10px;
    }
    
    .share-btn {
        width: 32px;
        height: 32px;
    }
    
    .share-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* 記事コンテンツ */
    .site-main {
        padding: 60px 0;
    }
    
    .entry-content {
        font-size: 16px;
        line-height: 1.8;
    }
    
    .entry-content h1 {
        font-size: 28px;
        margin: 50px 0 25px;
    }
    
    .entry-content h2 {
        font-size: 24px;
        margin: 45px 0 22px;
    }
    
    .entry-content h3 {
        font-size: 20px;
        margin: 40px 0 20px;
    }
    
    .entry-content h4 {
        font-size: 18px;
        margin: 35px 0 18px;
    }
    
    .post:not(.photo) .entry-content > p:first-of-type {
        font-size: 18px;
    }
    
    .entry-content blockquote {
        font-size: 18px;
        padding: 20px 25px;
        margin: 30px 0;
    }
    
    .entry-content pre {
        font-size: 13px;
        padding: 15px;
        margin: 20px 0;
    }
    
    .entry-content ul,
    .entry-content ol {
        padding-left: 24px;
    }
    
    /* グリッド */
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 25px;
        margin-top: 40px;
    }
    
    .album-grid {
        grid-template-columns: repeat(auto-fill, 160px);
        gap: 15px;
        justify-content: start;
    }
    
    .album-item {
        width: 160px;
        height: 160px;
    }
    
    .site-title {
        font-size: 24px;
        letter-spacing: 0.08em;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Lightbox */
    .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 30px;
        padding: 5px 10px;
    }
    
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    
    .lightbox-caption {
        margin-top: 10px;
        padding: 10px 15px;
        max-width: 90%;
        font-size: 14px;
    }
    
    .lightbox-caption strong {
        font-size: 16px;
    }
    
    .lightbox-caption .caption-text {
        font-size: 13px;
    }
}