/* ============================================
   Members Stories Page Styles
   ============================================ */

/* ============================================
   Header Overrides
   ============================================ */

.btn--entry {
  background-color: #e53935;
  color: #fff;
}

.btn--entry:hover {
  background-color: #c62828;
}

.site-header__nav-list a.is-active {
  color: var(--color-accent-green);
  border-bottom: 2px solid var(--color-accent-green);
  padding-bottom: 2px;
}

/* ============================================
   Hero Section
   ============================================ */

.ms-hero {
  position: relative;
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
  background: linear-gradient(160deg, #e6f4ef 0%, #f5fbf8 40%, #e8f5f0 100%);
  overflow: hidden;
}

/* Geometric mesh background */
.ms-hero__mesh {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(46, 125, 50, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(46, 125, 50, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 125, 50, 0.04) 1px, transparent 1px);
  background-size: 40px 40px, 80px 80px, 80px 80px;
  pointer-events: none;
}

/* Polygon accent shapes */
.ms-hero__mesh::before,
.ms-hero__mesh::after {
  content: '';
  position: absolute;
  border-style: solid;
  opacity: 0.12;
}

.ms-hero__mesh::before {
  top: 20px;
  right: 80px;
  width: 0;
  height: 0;
  border-width: 0 60px 104px 60px;
  border-color: transparent transparent #2e7d32 transparent;
}

.ms-hero__mesh::after {
  bottom: 30px;
  left: 60px;
  width: 0;
  height: 0;
  border-width: 60px 104px 0 60px;
  border-color: #2e7d32 transparent transparent transparent;
}

.ms-hero__content {
  position: relative;
  z-index: 1;
}

.ms-hero__title {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--color-primary-dark);
  line-height: 1.1;
  margin-bottom: var(--space-md);
}

.ms-hero__subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* ============================================
   Featured Post
   ============================================ */

.featured-post {
  display: block;
  position: relative;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  margin: var(--space-2xl) auto;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.2s;
}

.featured-post:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.featured-post__image {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: center;
  background: linear-gradient(135deg, #8090a0 0%, #a8b8c8 50%, #7888a0 100%);
}

@media (min-width: 768px) {
  .featured-post__image {
    height: 420px;
  }
}

.featured-post__image-fallback {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #8090a0 0%, #a8b8c8 50%, #7888a0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

.featured-post__image-fallback svg {
  width: 60px;
  height: 60px;
  color: rgba(255,255,255,0.5);
}

.featured-post__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.05) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-xl);
}

.featured-badge {
  display: inline-block;
  background-color: var(--color-accent-green);
  color: #fff;
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: var(--border-radius-sm);
  margin-bottom: var(--space-md);
  align-self: flex-start;
}

.featured-post__title {
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: var(--space-sm);
}

.featured-post__excerpt {
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-post__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.featured-post__author {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.featured-post__author-name {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: #fff;
}

.featured-post__meta {
  display: block;
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.7);
}

.featured-post__cta {
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.9);
  font-weight: 500;
  transition: color 0.2s;
}

.featured-post:hover .featured-post__cta {
  color: #fff;
}

/* ============================================
   Author Avatar (shared)
   ============================================ */

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c0c0c0, #e0e0e0);
  flex-shrink: 0;
  overflow: hidden;
}

.author-avatar--sm {
  width: 32px;
  height: 32px;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   Section Common
   ============================================ */

.ms-section {
  margin-bottom: var(--space-3xl);
}

.ms-section__heading {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  font-size: var(--font-size-lg);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-primary-dark);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-primary-dark);
}

/* ============================================
   Latest Posts Grid
   ============================================ */

.latest-posts__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

@media (min-width: 640px) {
  .latest-posts__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s, transform 0.2s;
}

.post-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.post-card__thumb {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #b0bcc8 0%, #cdd8e0 50%, #a8b8c8 100%);
}

.post-card__body {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.post-card__title {
  font-size: var(--font-size-base);
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-text-primary);
  flex: 1;
}

.post-card__author {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.post-card__author-name {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
}

.post-card__meta {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ============================================
   Main + Sidebar Layout
   ============================================ */

.ms-body {
  padding-bottom: var(--space-3xl);
}

.ms-body__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3xl);
  align-items: start;
}

@media (min-width: 1024px) {
  .ms-body__grid {
    grid-template-columns: 1fr 280px;
  }
}

/* ============================================
   Category Tabs
   ============================================ */

.category-tabs {
  display: flex;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.category-tab {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--color-text-secondary);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}

.category-tab:hover {
  color: var(--color-accent-green);
}

.category-tab--active {
  color: var(--color-accent-green);
  border-bottom-color: var(--color-accent-green);
}

/* ============================================
   Category Posts (2-col)
   ============================================ */

.category-posts {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 640px) {
  .category-posts {
    grid-template-columns: repeat(2, 1fr);
  }
}

.category-post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s;
}

.category-post-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.category-post-card__thumb {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #7888a0 0%, #a8b8c8 50%, #7888a0 100%);
}

.category-post-card__body {
  padding: var(--space-lg);
}

.category-post-card__title {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.5;
  margin-bottom: var(--space-sm);
}

.category-post-card__tag {
  font-size: var(--font-size-xs);
  color: var(--color-accent-green);
  font-weight: 500;
}

/* ============================================
   More Articles Grid (2 col x 3 row)
   ============================================ */

.more-articles__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

@media (min-width: 480px) {
  .more-articles__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.more-article-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s, transform 0.2s;
}

.more-article-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.more-article-card__thumb {
  width: 100%;
  height: 120px;
  background: linear-gradient(135deg, #b0bcc8 0%, #cdd8e0 50%, #a8b8c8 100%);
}

.more-article-card__body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
}

.more-article-card__title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-text-primary);
  flex: 1;
}

.more-article-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.dept-badge {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.reading-bar {
  flex: 1;
  height: 3px;
  background-color: var(--color-border);
  border-radius: var(--border-radius-pill);
  overflow: hidden;
  max-width: 60px;
}

.reading-bar span {
  display: block;
  height: 100%;
  background-color: var(--color-accent-green);
  border-radius: var(--border-radius-pill);
}

.reading-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.more-articles__action {
  text-align: center;
}

.btn--outline-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7em 2em;
  font-size: var(--font-size-sm);
  font-weight: 500;
  border: 1px solid var(--color-primary-dark);
  border-radius: var(--border-radius-sm);
  color: var(--color-primary-dark);
  background: transparent;
  transition: background-color 0.2s, color 0.2s;
}

.btn--outline-dark:hover {
  background-color: var(--color-primary-dark);
  color: #fff;
}

/* ============================================
   Sidebar
   ============================================ */

.ms-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

@media (min-width: 1024px) {
  .ms-sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--space-xl));
    max-height: calc(100vh - var(--header-height) - var(--space-2xl));
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

.ms-sidebar__box {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}

.ms-sidebar__heading {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  font-size: var(--font-size-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-accent-green);
}

/* Popular This Month */
.popular-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.popular-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.popular-list__item:last-child {
  border-bottom: none;
}

.popular-list__rank {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--color-primary-dark);
  color: #fff;
  font-size: var(--font-size-xs);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.popular-list__thumb {
  flex-shrink: 0;
  width: 44px;
  height: 36px;
  background: linear-gradient(135deg, #c0c0c0, #e0e0e0);
  border-radius: var(--border-radius-sm);
}

.popular-list__info {
  flex: 1;
  min-width: 0;
}

.popular-list__title {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.4;
  margin-bottom: 2px;
}

.popular-list__views {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* All Authors */
.all-authors__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.author-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  transition: opacity 0.2s;
}

.author-item:hover {
  opacity: 0.7;
}

.author-item span {
  font-size: 9px;
  color: var(--color-text-muted);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  text-align: center;
}

.all-authors__action {
  text-align: right;
}

.all-authors__action a {
  font-size: var(--font-size-xs);
  color: var(--color-accent-green);
  font-weight: 500;
  transition: color 0.2s;
}

.all-authors__action a:hover {
  color: var(--color-accent-green-hover);
}

/* Search */
.ms-search {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

.ms-search__input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  border: none;
  outline: none;
  font-family: var(--font-family-base);
  color: var(--color-text-primary);
  background: var(--color-bg-white);
}

.ms-search__input::placeholder {
  color: var(--color-text-muted);
}

.ms-search__btn {
  flex-shrink: 0;
  width: 40px;
  background: var(--color-bg-light);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.ms-search__btn:hover {
  background-color: var(--color-accent-green);
  color: #fff;
}

.ms-search__btn svg {
  width: 16px;
  height: 16px;
}

/* Archive */
.archive-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.archive-list li {
  border-bottom: 1px solid var(--color-border);
}

.archive-list li:last-child {
  border-bottom: none;
}

.archive-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  transition: color 0.2s;
}

.archive-list a::after {
  content: '›';
  color: var(--color-text-muted);
}

.archive-list a:hover {
  color: var(--color-accent-green);
}

/* ============================================
   Join Our Team CTA
   ============================================ */

.join-cta {
  padding: var(--space-3xl) 0;
  background-color: var(--color-bg-light);
  text-align: center;
}

.join-cta__inner {
  max-width: 640px;
  margin: 0 auto;
}

.join-cta__title {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.join-cta__subtitle {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xl);
  line-height: 1.7;
}

.join-cta__btn {
  padding: 0.8em 2.4em;
  font-size: var(--font-size-base);
}
