/*
Theme Name: Video Board
*/

/* ===== リセット ===== */

*{
box-sizing:border-box;
margin:0;
padding:0;
}

body{
font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto;
background:#f5f5f5;
-webkit-font-smoothing:antialiased;
line-height:1.6;
}

/* ===== 共通 ===== */

img, video{
max-width:100%;
display:block;
}

/* ===== レイアウト ===== */

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

/* ===== header ===== */

.site-header{
background:#000;
color:#fff;
}

.header-inner{
max-width:1200px;
margin:auto;
padding:20px 12px;
display:flex;
flex-direction:column;
gap:10px;
}

.site-title{
font-size:24px;
font-weight:bold;
}

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

.main-nav a{
color:#fff;
margin-right:15px;
text-decoration:none;
font-size:14px;
opacity:0.9;
}

.main-nav a:hover{
opacity:1;
}

/* PC */
@media(min-width:768px){
.header-inner{
flex-direction:row;
justify-content:space-between;
align-items:center;
}
}

/* ===== grid ===== */

.video-grid{
display:grid;
grid-template-columns:repeat(2,1fr);
gap:12px;
}

@media(min-width:768px){
.video-grid{
grid-template-columns:repeat(3,1fr);
}
}

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

/* ===== card ===== */

.video-item{
background:#fff;
border-radius:14px;
overflow:hidden;
box-shadow:0 4px 12px rgba(0,0,0,0.08);
transition:0.2s;
}

.video-item:hover{
transform:translateY(-3px);
box-shadow:0 10px 24px rgba(0,0,0,0.15);
}

/* ===== thumb ===== */

.thumb{
position:relative;
aspect-ratio:16/9;
background:#ddd;
overflow:hidden;
border-radius:14px 14px 0 0;
}

/* 画像 */

.thumb img{
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
object-fit:cover;
z-index:1;
}

/* 動画 */

.thumb video{
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
object-fit:cover;
background:#000;
pointer-events:none;
z-index:1;
}

/* Safari対策 */
video::-webkit-media-controls{
display:none !important;
}

/* ===== fallback ===== */

.no-thumb{
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
background:#ddd;
z-index:1;
}

.no-thumb::after{
content:"NO IMAGE";
position:absolute;
bottom:8px;
left:50%;
transform:translateX(-50%);
font-size:11px;
color:#666;
}

/* ===== 再生ボタン ===== */

.play-icon{
position:absolute;
top:50%;
left:50%;
transform:translate(-50%, -50%);
width:64px;
height:64px;
border-radius:50%;
background:rgba(0,0,0,0.4);
display:flex;
align-items:center;
justify-content:center;
z-index:10;
pointer-events:none;
backdrop-filter: blur(6px);
}

/* 三角 */
.play-icon::before{
content:"";
width:0;
height:0;
border-left:18px solid #fff;
border-top:10px solid transparent;
border-bottom:10px solid transparent;
margin-left:4px;
}

/* hover */
@media(hover:hover){
.video-item:hover .play-icon{
transform:translate(-50%, -50%) scale(1.15);
background:rgba(0,0,0,0.75);
}
}

/* ===== 動画時間 ===== */

.video-duration{
position:absolute;
bottom:6px;
right:6px;
background:rgba(0,0,0,0.1);
color:#fff;
font-size:12px;
padding:3px 6px;
border-radius:4px;
z-index:20;
backdrop-filter: blur(4px);
}

/* ===== text ===== */

.video-title{
padding:10px;
color:#5a2ca0;
font-weight:bold;
font-size:14px;
line-height:1.4;
word-break:break-word;
}

.meta{
padding:0 10px 10px;
font-size:13px;
color:#666;
}

/* ===== single ===== */

.video-container{
max-width:900px;
margin:20px auto;
}

.video-container video{
width:100%;
border-radius:12px;
background:#000;
}

/* 再生時間テキスト */
.video-duration-text{
margin:10px 0;
font-size:14px;
color:#444;
}

/* ===== upload ===== */

.upload-page{
max-width:600px;
margin:40px auto;
padding:20px;
}

.upload-page h2{
margin-bottom:20px;
font-size:22px;
}

.upload-form{
display:flex;
flex-direction:column;
gap:15px;
background:#fff;
padding:20px;
border-radius:14px;
box-shadow:0 4px 12px rgba(0,0,0,0.1);
}

.form-group{
display:flex;
flex-direction:column;
gap:6px;
}

.upload-form input,
.upload-form textarea{
width:100%;
padding:12px;
border:1px solid #ddd;
border-radius:8px;
font-size:16px;
background:#fafafa;
}

.upload-form textarea{
min-height:100px;
resize:vertical;
}

.upload-form input:focus,
.upload-form textarea:focus{
outline:none;
border-color:#000;
background:#fff;
}

.upload-form input[type="file"]{
background:#fff;
padding:8px;
}

.upload-form label{
font-size:14px;
color:#555;
}

/* ボタン */

.upload-form button{
margin-top:10px;
padding:14px;
border:none;
border-radius:999px;
background:#000;
color:#fff;
font-size:16px;
cursor:pointer;
transition:0.2s;
}

.upload-form button:hover{
background:#222;
}

.upload-form button:disabled{
background:#777;
cursor:not-allowed;
}

/* ===== 状態表示 ===== */

#upload-status{
display:none;
margin-top:10px;
padding:10px;
background:#000;
color:#fff;
border-radius:8px;
text-align:center;
}

.upload-success{
background:#000;
color:#fff;
padding:12px;
border-radius:10px;
margin-bottom:20px;
text-align:center;
}

/* エラー */
.error-message{
background:#900;
color:#fff;
padding:10px;
border-radius:8px;
margin-bottom:15px;
}

/* ===== コメント ===== */

.comments-area{
margin-top:40px;
background:#fff;
padding:20px;
border-radius:14px;
box-shadow:0 4px 12px rgba(0,0,0,0.08);
}

.comment-list{
list-style:none;
margin-bottom:20px;
}

.comment-list li{
margin-bottom:15px;
padding-bottom:10px;
border-bottom:1px solid #eee;
}

.comment-author{
font-weight:bold;
margin-bottom:5px;
}

.comment-meta{
font-size:12px;
color:#999;
margin-bottom:5px;
}

.comment-content{
font-size:14px;
}

/* フォーム */

.comment-form input,
.comment-form textarea{
width:100%;
padding:10px;
margin-bottom:10px;
border:1px solid #ddd;
border-radius:8px;
}

.comment-form input[type="submit"]{
background:#000;
color:#fff;
border:none;
padding:10px;
border-radius:999px;
cursor:pointer;
}

/* ===== 空状態 ===== */

.no-videos{
padding:40px;
text-align:center;
color:#777;
}

/* ===== スクロール改善 ===== */

html{
scroll-behavior:smooth;
}