/* =========================================================
  Posts / News styles
  - Keeps the same dark theme from styles.css
========================================================= */

.posts{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

@media (min-width: 860px){
  .posts{grid-template-columns:1fr 1fr}
}

.postcard{
  display:grid;
  grid-template-columns:1fr;
  gap:0;
  text-decoration:none;
  border:1px solid rgba(255,255,255,.14);
  border-radius:var(--radius);
  overflow:hidden;
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.04));
  box-shadow:0 14px 36px rgba(0,0,0,.28);
  transition:transform 160ms ease, border-color 160ms ease;
}
.postcard:hover{transform:translateY(-2px);border-color:rgba(255,255,255,.22)}

.postcard__media{
  aspect-ratio: 16 / 9;
  background-image:
    var(--img),
    radial-gradient(900px 520px at 30% 10%, rgba(225,6,0,.18), transparent 60%),
    linear-gradient(135deg, rgba(255,255,255,.06), rgba(0,0,0,.35));
  background-size:cover;
  background-position:center;
  border-bottom:1px solid rgba(255,255,255,.12);
}

.postcard__body{padding:14px 14px 12px}

.postcard__title{
  margin:0 0 6px;
  font-size:17px;
  line-height:1.25;
  letter-spacing:.02em;
}

.postcard__meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  color:rgba(255,255,255,.70);
  font-size:12px;
  margin-bottom:10px;
}

.postcard__excerpt{
  margin:0;
  color:rgba(255,255,255,.78);
  font-size:13px;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:5px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.22);
}
.badge__dot{
  width:7px;height:7px;border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 3px rgba(225,6,0,.14);
}

/* ---------------------------
  Post detail
---------------------------- */
.post{
  border-radius:var(--radius);
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.04);
  overflow:hidden;
  box-shadow:0 12px 30px rgba(0,0,0,.20);
}

.post__head{padding:16px 16px 0}

.post__title{
  margin:0 0 6px;
  font-size:26px;
  line-height:1.2;
  letter-spacing:.02em;
}

.post__meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  color:rgba(255,255,255,.72);
  font-size:12px;
  margin-bottom:12px;
}

.post__cover{
  margin:12px 16px 0;
  border-radius:var(--radius-sm);
  border:1px solid rgba(255,255,255,.14);
  overflow:hidden;
  aspect-ratio: 16 / 9;
  background-image:
    var(--img),
    radial-gradient(900px 520px at 30% 10%, rgba(225,6,0,.18), transparent 60%),
    linear-gradient(135deg, rgba(255,255,255,.06), rgba(0,0,0,.35));
  background-size:cover;
  background-position:center;
}

.post__content{
  padding:16px;
  color:rgba(255,255,255,.88);
}

.post__content p{margin:0 0 12px}
.post__content p:last-child{margin-bottom:0}

/* contenteditable が div を出すブラウザ対策 */
.post__content div{margin:0 0 12px}
.post__content div:last-child{margin-bottom:0}

.post__content h2,
.post__content h3{
  margin:18px 0 10px;
  line-height:1.25;
}

.post__content h2{font-size:18px}
.post__content h3{font-size:16px}

.post__content ul,
.post__content ol{margin:0 0 12px 1.2em}

.post__content li{margin:6px 0}

.post__content a{
  text-decoration:underline;
  text-underline-offset:3px;
}

.post__content blockquote{
  margin:12px 0;
  padding:10px 12px;
  border-left:3px solid rgba(225,6,0,.6);
  background:rgba(0,0,0,.18);
  border-radius:12px;
  color:rgba(255,255,255,.82);
}

/* ---------------------------
  Simple admin editor helpers
  (keeps admin pages consistent)
---------------------------- */
.editor-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  padding:10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.18);
  margin:8px 0;
}

.editor-toolbar .btn{
  padding:8px 10px;
  font-size:13px;
}

.editor-toolbar label{
  font-size:12px;
  color:rgba(255,255,255,.72);
  font-weight:700;
}

.editor-box{
  min-height:240px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.22);
  color:rgba(255,255,255,.92);
  outline:none;
}

.editor-box:empty:before{
  content:attr(data-placeholder);
  color:rgba(255,255,255,.48);
}

.cover-preview{
  margin-top:8px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  overflow:hidden;
}
.cover-preview img{display:block;width:100%;height:auto}

/* ---------------------------
  Admin table (optional)
---------------------------- */
.admin-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 10px;
}
.admin-table thead th{
  font-size:12px;
  color:rgba(255,255,255,.72);
  font-weight:800;
  padding:0 8px;
  text-align:left;
}
.admin-table tbody td{
  background:rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.12);
  padding:10px 8px;
  vertical-align:top;
}
.admin-table tbody tr td:first-child{
  border-radius:14px 0 0 14px;
}
.admin-table tbody tr td:last-child{
  border-radius:0 14px 14px 0;
}

.admin-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

@media (max-width: 560px){
  .admin-table thead{display:none}
  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td{display:block; width:100%}
  .admin-table tbody td{
    border-radius:14px !important;
    margin-bottom:10px;
  }
}

