/*
Theme Name: Photo Theme
Theme URI: https://kaneda.me
Author: KANEDA Shinya
Author URI: https://uuuu.design
Description: 全画面で写真をスライドショー表示するミニマルなフォトサイト用テーマ。自動再生／停止・前後送り、モバイル操作対応。
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: photo-theme
*/

/* リセット */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #222520;
}

/* ロゴ設定 */
#site-logo {
    position: fixed;
    z-index: 9999;
    line-height: 1;
    cursor: auto;
    opacity: 0;
    transition: opacity 1s ease;
}
#site-logo.visible {
    opacity: 1;
}
#site-logo img {
    display: block;
}

/* スライドショーエリア */
#slideshow-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: #222520;
}

.slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-position: center center;
    background-size: cover;
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 1.5s ease-in-out;
    will-change: opacity, transform;
    z-index: 0;
}

.slide-item.active {
    opacity: 1;
    z-index: 1;
    animation: zoomEffect 7s linear forwards;
}

@keyframes zoomEffect {
    0% { transform: scale(1.1); }
    100% { transform: scale(1.0); }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2;
    pointer-events: none;
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease;
}
#particles-js.visible {
    opacity: 1;
}

#progress-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,0.05);
    z-index: 10;
    opacity: 0;
    transition: opacity 1s ease;
}
#progress-container.visible {
    opacity: 1;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, rgba(255,255,255,0) 20%, rgba(255,255,255,0.7) 100%);
    box-shadow: 1px 0 3px rgba(255,255,255,0.5);
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #222520;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out;
}

#loading-circle {
    width: 10px;
    height: 10px;
    background-color: #ff0000;
    border-radius: 50%;
    animation: pulseRed 0.8s infinite ease-in-out alternate;
}

@keyframes pulseRed {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.4); opacity: 1; }
}

/* --- コントロールパネル --- */
#control-panel {
    position: fixed;
    top: 50%;
    left: 30px;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 40px; 
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

#control-panel.visible {
    opacity: 1;
    pointer-events: auto;
}

/* 押しやすくするための修正 */
.control-btn {
    cursor: pointer;
    /* ボタン全体のサイズを大きく（透明な余白を作る） */
    width: 44px; 
    height: 44px;
    /* アイコンを中央に配置 */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

/* アイコン画像自体のサイズは小さく固定 */
.control-btn img {
    width: 14px; 
    height: auto;
    display: block;
}

.control-btn:hover {
    opacity: 0.7;
}

@media screen and (max-width: 768px) {
    #site-logo {
        left: 50% !important;
        transform: translateX(-50%);
        top: 30px !important; 
        width: 100%;
        text-align: center;
        pointer-events: none;
    }
    #site-logo a {
        display: inline-block;
        pointer-events: auto;
    }
    #site-logo img {
        transform: scale(0.5); 
        transform-origin: top center;
    }
    #control-panel {
        left: 20px;
    }
    #sns-links { left: 16px; bottom: 70px; }
    #slide-caption { left: 16px; bottom: 16px; max-width: 80%; font-size: 12px; }
}

/* --- Ken Burns（ズーム演出）オフ --- */
body.pt-no-kenburns .slide-item.active {
    animation: none;
    transform: scale(1);
}

/* --- 画像キャプション（左下） --- */
#slide-caption {
    position: fixed;
    left: 30px;
    bottom: 24px;
    z-index: 50;
    max-width: 60%;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    pointer-events: none;
}
#slide-caption.visible { opacity: 1; transform: translateY(0); }

/* --- SNSリンク（左下） --- */
#sns-links {
    position: fixed;
    left: 24px;
    bottom: 46px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
}
#sns-links.visible { opacity: 1; pointer-events: auto; }
#sns-links a { color: #fff; }
#sns-links .control-btn { width: 38px; height: 38px; }
#sns-links .control-btn svg { width: 18px; height: 18px; }