/* =========================
   基本レイアウト
========================= */
:root{
  --max-width: 900px;
}

*{
  box-sizing: border-box;
}

body{
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f4f4f4;
  color: #222;
}

header{
  background: #222;
  color: #fff;
  padding: 14px 16px;
  font-size: 18px;
}

main{
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px;
}

/* =========================
   カード
========================= */
.card{
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.card h3{
  margin: 0 0 6px;
  font-size: 18px;
}

.card a{
  color: #1a5fb4;
  text-decoration: none;
}

.card a:hover{
  text-decoration: underline;
}

.meta{
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

/* =========================
   本文
========================= */
.card p{
  margin: 8px 0;
  line-height: 1.7;
}

/* =========================
   サムネイル画像
========================= */
.thumb{
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 10px 0;
  cursor: zoom-in;
}

/* =========================
   アクション（編集・削除）
========================= */
.actions{
  display: flex;
  gap: 14px;
  margin-top: 10px;
  font-size: 14px;
}

/* =========================
   続きを読む
========================= */
.card a.readmore{
  display: inline-block;
  margin-top: 6px;
  font-size: 14px;
}

.lightbox-overlay{
  display:none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 18px;
}
.lightbox-overlay.is-open{ display:flex; }

#lightboxImg{
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 12px;
}


/* =========================
   スマホ微調整
========================= */
@media (max-width: 600px){
  header{
    font-size: 16px;
  }
  .card h3{
    font-size: 17px;
  }
}

/* =========================
   投稿フォーム（write.php）用
========================= */

/* ラベル */
.small{
  display: block;
  font-size: 13px;
  color: #666;
  margin: 10px 0 6px;
}

/* 入力系は幅100% */
input, textarea, select{
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 16px;              /* スマホの勝手な拡大防止にも効く */
  background: #fff;
}

/* ファイル入力は少し詰める */
input[type="file"]{
  padding: 8px;
}

/* 2カラム行（PC）→ スマホは縦並びに */
.row{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;              /* これが重要 */
}
.row > *{
  flex: 1 1 280px;              /* 狭いときは自動で折り返す */
  min-width: 0;                 /* はみ出し防止 */
}

/* ボタン */
button{
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
}

/* textarea */
textarea{
  line-height: 1.7;
  resize: vertical;
}

/* YouTube 埋め込み */
.youtube-wrap{
  position: relative;
  padding-top: 56.25%; /* 16:9 */
  margin: 12px 0;
}
.youtube-wrap iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  
  
}

/* Link Card */
.linkcard{
  display:flex;
  gap:12px;
  text-decoration:none;
  border:1px solid #e5e5e5;
  border-radius:12px;
  padding:12px;
  margin:10px 0;
  background:#fff;
  color:inherit;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
}

.linkcard:hover{
  box-shadow:0 4px 14px rgba(0,0,0,.10);
  transform: translateY(-1px);
  transition: .15s;
}

.lc-thumb{
  width:120px;
  flex:0 0 120px;
  overflow:hidden;
  border-radius:10px;
  background:#f3f3f3;
}

.lc-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.lc-body{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.lc-title{
  font-weight:700;
  line-height:1.3;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}

.lc-desc{
  font-size: 0.9rem;
  color:#555;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}

.lc-site{
  font-size:0.85rem;
  color:#888;
  margin-top:auto;
}

/* YouTube embed */
.youtube-wrap{
  position:relative;
  width:100%;
  padding-top:56.25%;
  margin:10px 0;
}
.youtube-wrap iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
  border-radius:12px;
}

