/* ============================================
   Reset and base styles
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: #ffffff;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  line-height: 1.2;
  color: #1a1a1a;
}

p {
  margin-bottom: 1em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.7;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ============================================
   Site Header
   ============================================ */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.brand-kicker {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

/* Navigation */
.nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-item {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #666;
  background: transparent;
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-item:hover {
  background: #f5f5f5;
  color: #1a1a1a;
}

.nav-item--active {
  background: #1a1a1a;
  color: #ffffff;
}

.nav-item--active:hover {
  background: #333;
}

/* Header Search */
.header-search {
  position: relative;
}

.header-search input {
  width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.header-search input:focus {
  outline: none;
  border-color: #999;
  width: 250px;
}

.header-search input::placeholder {
  color: #999;
}

/* ============================================
   Main Page Layout
   ============================================ */
.page {
  min-height: 60vh;
  background: #ffffff;
}

.page-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ============================================
   Section Layouts
   ============================================ */
.section {
  margin-bottom: 4rem;
}

.section--hero {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid #e0e0e0;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header--row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.section-subtitle {
  font-size: 0.9375rem;
  color: #666;
}

.result-count {
  font-size: 0.875rem;
  color: #666;
  padding: 0.5rem 0;
}

/* ============================================
   Hero Grid (Featured Article)
   ============================================ */
.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.hero-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-main a {
  display: block;
}

.hero-main a:hover .hero-title {
  opacity: 0.7;
}

.hero-kicker {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ff4444;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1a1a1a;
  margin-bottom: 0.75rem;
  transition: opacity 0.2s ease;
}

.hero-excerpt {
  font-size: 1.125rem;
  line-height: 1.5;
  color: #4a4a4a;
  margin-bottom: 1rem;
}

.hero-meta {
  font-size: 0.875rem;
  color: #666;
}

/* Hero Side List */
.hero-side-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-side-item {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.hero-side-item:last-child {
  border-bottom: none;
}

.hero-side-item a {
  display: block;
}

.hero-side-item a:hover .hero-side-title {
  opacity: 0.7;
}

.hero-side-kicker {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0066cc;
  margin-bottom: 0.5rem;
}

.hero-side-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  transition: opacity 0.2s ease;
}

.hero-side-meta {
  font-size: 0.8125rem;
  color: #999;
}

/* ============================================
   Cards Grid (Latest Articles)
   ============================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  background: #ffffff;
}

.article-card:hover {
  border-color: #ccc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.article-card a {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
}

.article-kicker-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.article-kicker {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0066cc;
}

.article-pill {
  font-size: 0.6875rem;
  font-weight: 500;
  color: #666;
  background: #f5f5f5;
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
}

.article-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  color: #1a1a1a;
}

.article-excerpt {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #4a4a4a;
  flex-grow: 1;
}

.article-meta-row {
  font-size: 0.8125rem;
  color: #999;
  display: flex;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f0f0f0;
}

.article-meta-row span:not(:first-child)::before {
  content: "·";
  margin-right: 0.75rem;
  color: #ddd;
}

/* ============================================
   Detail Page (Article View)
   ============================================ */
.detail {
  max-width: 720px;
  margin: 0 auto;
}

.back-button {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}

.back-button:hover {
  color: #1a1a1a;
}

.detail-article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e0e0e0;
}

.detail-category-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.detail-category-pill {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0066cc;
  background: #f0f7ff;
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
}

.detail-readtime {
  font-size: 0.8125rem;
  color: #999;
}

.detail-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: #1a1a1a;
}

.detail-meta {
  font-size: 0.9375rem;
  color: #666;
}

.detail-body {
  font-size: 1.125rem;
  line-height: 1.7;
  color: #2c3e50;
}

.detail-body p {
  margin-bottom: 1.5rem;
}

.detail-body p:first-child {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.6;
  color: #1a1a1a;
  margin-bottom: 2rem;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: #1a1a1a;
  color: #ffffff;
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #ffffff;
  opacity: 1;
}

.footer-links a[aria-disabled="true"] {
  color: rgba(255, 255, 255, 0.4);
  cursor: not-allowed;
  pointer-events: none;
}

.footer-links span {
  color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
  .header-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .brand {
    text-align: center;
  }
  
  .nav {
    justify-content: center;
  }
  
  .header-search {
    text-align: center;
  }
  
  .header-search input {
    width: 100%;
    max-width: 400px;
  }
  
  .header-search input:focus {
    width: 100%;
    max-width: 400px;
  }
  
  .hero-grid {
    grid-template-columns: 1fr;
  }
  
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .page-inner {
    padding: 2rem 1.5rem;
  }
  
  .brand-title {
    font-size: 1.25rem;
  }
  
  .hero-title {
    font-size: 1.5rem;
  }
  
  .section-title {
    font-size: 1.25rem;
  }
  
  .detail-title {
    font-size: 1.875rem;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding: 1rem 1.5rem;
  }
  
  .page-inner {
    padding: 1.5rem 1rem;
  }
  
  .nav {
    gap: 0.25rem;
  }
  
  .nav-item {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }
  
  .hero-title {
    font-size: 1.25rem;
  }
  
  .hero-excerpt {
    font-size: 1rem;
  }
  
  .article-card {
    padding: 1rem;
  }
  
  .article-title {
    font-size: 1.125rem;
  }
  
  .detail-title {
    font-size: 1.5rem;
  }
  
  .detail-body {
    font-size: 1rem;
  }
  
  .detail-body p:first-child {
    font-size: 1.125rem;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .site-header,
  .back-button,
  .site-footer {
    display: none;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  .detail-title {
    font-size: 18pt;
  }
  
  .detail-body {
    font-size: 11pt;
  }
}


/* --- Thumbnail & hero images --- */
.hero-image {
  margin: 0.75rem 0;
}

.hero-image img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 8px;
}

.article-thumb {
  margin-bottom: 0.6rem;
}

.article-thumb img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 6px;
}

/* --- "More in ..." block on article page --- */
.detail-more {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e0e0e0;
}

.detail-more-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 0.6rem;
}

.detail-more-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-more-list a {
  font-size: 0.95rem;
  color: #1a1a1a;
}

.detail-more-list a:hover {
  text-decoration: underline;
}

/* Article page main image */
.detail-image {
  margin: 1rem 0 1.3rem;
}

.detail-image img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 8px;
}

/* --- Mobile readability tweaks --- */
@media (max-width: 768px) {
  body {
    font-size: 0.95rem;
  }
  .article-card {
    padding: 1rem;
  }
  .detail-body {
    padding: 1.25rem 1rem;
  }
}


/* ============================================
   Custom Enhancements: tagline, TL;DR, tags, etc.
   ============================================ */

.brand-tagline {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.15rem;
  max-width: 480px;
}

.nav-item--ghost {
  border: 1px solid #e0e0e0;
  border-radius: 999px;
}

.section-subtitle {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.3rem;
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.recommend-box {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 1.25rem 1.5rem;
  background: #ffffff;
}

.recommend-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.recommend-text {
  font-size: 0.875rem;
  color: #555;
  margin-bottom: 0.75rem;
}

.recommend-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recommend-item {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #f0f0f0;
  text-decoration: none;
  background: #fafafa;
  transition: background 0.15s ease, transform 0.15s ease;
}

.recommend-item:hover {
  background: #f3f4ff;
  transform: translateY(-1px);
}

.recommend-item-title {
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 0.15rem;
  color: #111827;
}

.recommend-item-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
  color: #6b7280;
}

.recommend-empty {
  font-size: 0.85rem;
  color: #999;
}

.difficulty-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.difficulty-badge--easy {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.difficulty-badge--medium {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.difficulty-badge--hard {
  background: #fef3c7;
  border-color: #fde68a;
}

.tldr-box {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: #f5f5ff;
  border-left: 4px solid #4f46e5;
  font-size: 0.92rem;
}

.tldr-box p {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.tldr-box ul {
  padding-left: 1.2rem;
}

.tldr-box li {
  margin-bottom: 0.25rem;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-top: 1.5rem;
}

.tag-list-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tag-pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 0.8rem;
  text-decoration: none;
  color: #111827;
}

.tag-pill:hover {
  background: #e5e7eb;
}

.tag-count {
  font-size: 0.75rem;
  color: #6b7280;
}

.about-body {
  font-size: 0.95rem;
  line-height: 1.9;
  color: #111827;
}

.about-body p + p {
  margin-top: 1rem;
}

.about-note {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 1.25rem;
}

@media (max-width: 768px) {
  .brand-tagline {
    max-width: 100%;
  }
}


/* Logo & header layout */
.brand-link--with-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo {
  height: 44px;
  width: auto;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .brand-logo {
    height: 36px;
  }
}

.article-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
  display: block;
}

.article-card-content {
  padding: 1rem;
  flex: 1;
}

.article-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
}