/* ============================================
   JMOOC ニュースページ固有CSS
   common.css と併用
   ============================================ */

/* News Hero */
.news-hero {
  background: linear-gradient(120deg, #f6b087 0%, #80c3eb 100%);
  padding: 36px 0;
}

.news-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.news-logo {
  height: 48px;
}

.news-hero-sub {
  margin-top: 8px;
  font-size: 12px;
  color: #1f2328;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.news-hero-title {
  text-align: right;
}

.news-hero-title span {
  letter-spacing: 0.4em;
  font-size: 12px;
  color: #667085;
}

.news-hero-title h1 {
  margin: 4px 0 0;
  font-size: 28px;
  font-weight: 700;
}

/* News Layout */
.news-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* News Sidebar */
.news-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.news-panel {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.08);
}

.news-panel-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #101828;
}

.news-panel-toggle {
  width: 100%;
  border: none;
  padding: 0;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  color: #101828;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.news-panel-toggle::after {
  content: "＋";
  font-size: 12px;
  color: #667085;
}

.news-panel.is-open .news-panel-toggle::after {
  content: "−";
}

.news-panel-content {
  margin-top: 12px;
}

/* News List (Sidebar) */
.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.news-list a {
  text-decoration: none;
  color: #1f2937;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.news-list a:hover {
  background: #f4f4f5;
}

.news-list a.is-active {
  background: #1f2933;
  color: #ffffff;
}

.news-count {
  font-size: 12px;
  color: #6c757d;
}

.news-list a.is-active .news-count {
  color: #e4e7ec;
}

/* News Archives */
.news-archives {
  display: grid;
  gap: 10px;
}

.archive-year {
  display: grid;
  gap: 6px;
}

.archive-year button {
  background: transparent;
  border: none;
  padding: 6px 0;
  font-weight: 600;
  text-align: left;
  color: #1f2937;
}

.archive-months {
  display: none;
  padding-left: 12px;
  gap: 6px;
}

.archive-months.is-open {
  display: grid;
}

.archive-months a {
  text-decoration: none;
  color: #475467;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}

.archive-months a.is-active {
  font-weight: 700;
  color: #111827;
}

/* News Content Area */
.news-content {
  display: grid;
  gap: 20px;
  align-self: start;
}

/* News Cards */
.news-cards {
  display: grid;
  gap: 16px;
}

.news-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(31, 41, 55, 0.1);
  display: grid;
  gap: 10px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.news-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: #6c757d;
}

.news-card-header .news-share {
  margin-left: auto;
}

.news-category-badge {
  border: 1px solid rgba(31, 41, 55, 0.2);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 12px;
  color: #1f2937;
  background: #ffffff;
}

.news-card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.news-card-body {
  font-size: 14px;
  color: #344054;
  margin-top: 16px;
}

.news-card-thumb {
  width: 160px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  background: #f2f4f7;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #98a2b3;
}

.news-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card-thumb img[src$="no-image-logo.svg"] {
  object-fit: contain;
  padding: 18px;
  background: #ffffff;
}

.news-card-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.news-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  font-size: 14px;
}

.news-card-actions a {
  text-decoration: none;
  color: #1f2937;
  font-weight: 600;
}

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

/* Share Buttons */
.news-share {
  display: flex;
  gap: 10px;
  align-items: center;
}

.news-share a {
  text-decoration: none;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  color: #ffffff;
}

.news-share a:hover {
  opacity: 0.9;
}

.news-share .share-x {
  background: #111111;
}

.news-share .share-fb {
  background: #1877f2;
}

/* News Detail */
.news-detail {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(31, 41, 55, 0.1);
  display: grid;
  gap: 16px;
}

.news-detail-body {
  font-size: 15px;
  line-height: 1.8;
  color: #1f2937;
}

.news-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: #6c757d;
}

.news-detail-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  align-self: start;
}

.news-detail-actions .news-share {
  margin-left: auto;
}

.news-detail-edit {
  display: flex;
  justify-content: flex-end;
}

/* Pagination */
.news-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.news-pager .pager-info {
  margin-right: auto;
  font-size: 12px;
  color: #6c757d;
}

.news-pager .pager-btn {
  border: 1px solid rgba(31, 41, 55, 0.2);
  background: #ffffff;
  color: #1f2937;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.news-pager .pager-btn.is-active {
  background: #1f2933;
  color: #ffffff;
  border-color: #1f2933;
}

/* News Footer */
.news-footer {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding: 20px 0 40px;
  text-align: center;
  color: #98a2b3;
  font-size: 12px;
  background: #ffffff;
}

/* Responsive */
@media (max-width: 991.98px) {
  .members-home-page .members-menu-panel:not(.is-open) .news-panel-content {
    display: none;
  }

  .members-course-page .members-menu-panel:not(.is-open) .news-panel-content {
    display: none;
  }

  .news-panel-archive .news-panel-content {
    margin-top: 0;
  }

  .news-panel-archive.is-open .news-panel-content {
    margin-top: 12px;
  }

  .news-detail-page .news-layout {
    grid-template-columns: 1fr;
  }

  .news-detail-page .news-sidebar {
    display: none;
  }

  .members-home-page .news-sidebar {
    display: flex;
    order: -1;
    gap: 12px;
    margin-bottom: 18px;
  }

  .members-home-page .news-content {
    order: 1;
  }

  .members-home-page .news-panel {
    border-radius: 10px;
    padding: 14px;
  }

  .members-course-page .news-layout {
    grid-template-columns: 1fr;
  }

  .members-course-page .news-sidebar {
    display: flex;
    order: -1;
    gap: 12px;
    margin-bottom: 18px;
  }

  .members-course-page .news-content {
    order: 1;
  }

  .members-course-page .news-panel {
    border-radius: 10px;
    padding: 14px;
  }

}

@media (max-width: 992px) {
  .news-layout {
    grid-template-columns: 1fr;
  }

  .news-hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .news-hero-title {
    text-align: left;
  }

  .news-card-row {
    flex-direction: column;
  }

  .news-card-thumb {
    width: 100%;
    height: 180px;
  }
}
