/* AutoDevJournal - Minimal Media Style
   Inspired by Techmeme/Slashdot: clean typography, generous whitespace, readable density
   ========================================================================== */

/* Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  color: #1a1a1a;
  background: #fff;
  margin: 0;
  padding: 0;
}

/* Layout Container
   -------------------------------------------------------------------------- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header
   -------------------------------------------------------------------------- */
.site-header {
  padding: 1.25rem 0;
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
}


.header-inner {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.header-left {
  flex: 1;
  min-width: 0;
}

.header-visual {
  width: 240px;
  height: auto;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: -0.75rem;
}

.site-logo {
  display: block;
  text-decoration: none;
}

.site-logo img {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  margin: 0;
  padding: 0;
}

.site-text {
  margin-top: 1.25rem;
}

.site-tagline {
  font-size: 0.9375rem;
  color: #555;
  margin: 0 0 0.25rem 0;
  line-height: 1.5;
}

.site-credits {
  display: block;
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.1rem;
}

.site-date {
  display: inline;
  font-size: 0.8125rem;
  color: #5f5f5f;
  margin: 0 0.3rem;
}

/* Main Content
   -------------------------------------------------------------------------- */
main {
  padding: 2rem 0 0;
  min-height: calc(100vh - 200px);
}

/* Section Titles
   -------------------------------------------------------------------------- */
.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #0066cc;
  display: inline-block;
}

/* Post List (Index Page)
   -------------------------------------------------------------------------- */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
}

.post-list li:first-child {
  padding-top: 0;
}

.post-list li:last-child {
  border-bottom: none;
}

.post-item {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.post-item:hover {
  background: #f8f9fa;
  margin: 0 -0.75rem;
  padding: 0 0.75rem;
  border-radius: 4px;
}

.post-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 0.25rem 0;
  line-height: 1.4;
}

.post-item:hover .post-title {
  color: #0066cc;
}

.post-meta {
  font-size: 0.8125rem;
  color: #666;
  margin: 0;
}

.post-meta time {
  color: #5f5f5f;
}

/* Featured Post (optional future use)
   -------------------------------------------------------------------------- */
.post-list li.featured {
  background: #f8f9fa;
  margin: 0 -1rem;
  padding: 1rem;
  border-radius: 4px;
  border-bottom: none;
}

.post-list li.featured + li {
  margin-top: 1rem;
}

/* Links
   -------------------------------------------------------------------------- */
a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:visited {
  color: #551a8b;
}

.post-item:visited .post-title {
  color: #4a4a4a;
}

/* Article Page
   -------------------------------------------------------------------------- */
.back-link {
  display: inline-block;
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 1.5rem;
}

.back-link:hover {
  color: #0066cc;
}

article {
  max-width: 100%;
}

article > h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.5rem 0;
  color: #1a1a1a;
}

article .meta {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

article .meta time {
  color: #5f5f5f;
}

/* Article Content
   -------------------------------------------------------------------------- */
article .content {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #2a2a2a;
}

article .content p {
  margin: 0 0 1.25rem 0;
}

article .content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem 0;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  color: #1a1a1a;
}

article .content h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem 0;
  color: #1a1a1a;
}

article .content ul,
article .content ol {
  margin: 0 0 1.25rem 0;
  padding-left: 1.5rem;
}

article .content li {
  margin-bottom: 0.5rem;
}

article .content blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid #0066cc;
  background: #f8f9fa;
  color: #4a4a4a;
  font-style: italic;
}

article .content blockquote p:last-child {
  margin-bottom: 0;
}

/* Code Blocks
   -------------------------------------------------------------------------- */
article .content pre {
  background: #f4f4f4;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border-radius: 4px;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 1.5rem 0;
}

article .content code {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
  font-size: 0.9em;
  background: #f4f4f4;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
}

article .content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 0.875rem 0;
  border-top: 1px solid #e5e5e5;
  margin-top: 0.5rem;
}

.site-footer p {
  font-size: 0.8125rem;
  color: #5f5f5f;
  margin: 0;
  text-align: center;
}

.footer-meta {
  margin-top: 0.25rem !important;
  font-size: 0.8125rem;
}

.footer-meta a {
  color: #0066cc;
}

/* Utility Classes (for future extensibility)
   -------------------------------------------------------------------------- */
.new-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #0066cc;
  color: #fff;
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  color: #666;
  background: #f0f0f0;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  margin-right: 0.25rem;
}

.role-badge {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.3rem;
  width: fit-content;
  line-height: 1.4;
}

.role-tryable             { background: #e6f4ea; color: #1a6b2e; }
.role-learn,
.role-explanation         { background: #e8f0fe; color: #1a4bbf; }
.role-trend               { background: #fff3e0; color: #b35c00; }
.role-frontier            { background: #f3e8fd; color: #6b1fa6; }

/* Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 1rem;
  }

  .site-tagline {
    font-size: 0.8125rem;
  }

  article > h1 {
    font-size: 1.5rem;
  }

  .post-title {
    font-size: 1rem;
  }
}

/* Index page: section spacing
   -------------------------------------------------------------------------- */
.index-section {
  margin-top: 2.5rem;
}

.archive-link-row {
  margin: 1rem 0 0;
  font-size: 0.9375rem;
}

/* Bottom navigation (links + fish decorative image)
   -------------------------------------------------------------------------- */
.bottom-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: 1rem;
}

.bottom-nav-links {
  flex: 1;
  min-width: 0;
}

.bottom-nav-links .archive-link-row:first-child {
  margin-top: 0;
}

.bottom-nav-fish {
  flex-shrink: 0;
}

.bottom-nav-fish .deco-fish-img {
  display: block;
  height: 72px;
  width: auto;
  opacity: 0.75;
}

.footer-source {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: #5f5f5f;
}

/* Share Section (Article Pages)
   -------------------------------------------------------------------------- */
.share-section {
  margin-top: 0;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.share-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  margin: 0 0 0.75rem 0;
}

.share-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: #444;
  background: #f4f4f4;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.share-btn:hover {
  background: #e8e8e8;
  color: #1a1a1a;
  text-decoration: none;
}

/* placeholder for future SVG swap — replace content of this span */
.share-icon {
  font-style: normal;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

/* Popular Articles Section (Index Page)
   -------------------------------------------------------------------------- */
.popular-section {
  background: #f5f5f5;
  border-radius: 6px;
  padding: 1.25rem 1.25rem 1.5rem;
  margin-top: 2.5rem;
}

.popular-section .post-list li {
  border-bottom-color: #e0e0e0;
}

.popular-section .post-list li:last-child {
  border-bottom: none;
}

/* Archive Page
   -------------------------------------------------------------------------- */
.archive-nav {
  background: #f8f9fa;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 2.5rem;
}

.archive-month-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
}

.archive-nav-month > a {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #1a1a1a;
  text-decoration: none;
}

.archive-nav-month > a:hover {
  color: #0066cc;
  text-decoration: underline;
}

.archive-day-nav {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.archive-day-nav a {
  font-size: 0.8125rem;
  color: #0066cc;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 0.1rem 0.45rem;
  text-decoration: none;
  white-space: nowrap;
}

.archive-day-nav a:hover {
  background: #e8f0fe;
  border-color: #0066cc;
}

.archive-month {
  margin-bottom: 2.5rem;
}

.archive-month-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 1.25rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #0066cc;
}

.archive-day {
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid #e5e5e5;
}

.archive-day-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #666;
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.archive-day .post-list li {
  padding: 0.6rem 0;
}

.archive-day .post-title {
  font-size: 1rem;
}

@media (max-width: 600px) {
  .archive-month-nav {
    gap: 1rem;
  }

  .popular-section {
    padding: 1rem;
    border-radius: 4px;
  }
}

/* Weekly Feature Section（今週の5本）
   -------------------------------------------------------------------------- */
.weekly-section {
  margin-bottom: 2.5rem;
}

.weekly-feature-card {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  background: #f6f9ff;
  border: 1px solid #dce9f8;
  border-radius: 10px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  margin-bottom: 1.25rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.weekly-feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
  text-decoration: none;
}

.weekly-feature-card:visited .weekly-feature-title {
  color: #4a4a4a;
}

.weekly-feature-text {
  flex: 1;
  min-width: 0;
}

.weekly-feature-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0.25rem 0 0.5rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.weekly-feature-card:hover .weekly-feature-title {
  color: #0066cc;
}

.weekly-feature-dek {
  font-size: 0.9375rem;
  color: #555;
  margin: 0 0 0.5rem;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.weekly-feature-voice {
  font-size: 0.8125rem;
  color: #67676f;
  margin: 0 0 0.4rem;
  line-height: 1.55;
  font-style: normal;
}

.weekly-feature-meta {
  font-size: 0.8125rem;
  color: #5f5f5f;
  margin: 0;
}

.weekly-feature-image-wrap {
  flex-shrink: 0;
  width: 220px;
}

.weekly-feature-visual {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

/* Weekly Small Cards（2〜5位）
   -------------------------------------------------------------------------- */
.weekly-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.weekly-card {
  display: block;
  background: #fbfcff;
  border: 1px solid #e8e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.weekly-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.10);
  text-decoration: none;
}

.weekly-card:visited .weekly-card-title {
  color: #4a4a4a;
}

.weekly-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0.25rem 0 0.35rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.weekly-card:hover .weekly-card-title {
  color: #0066cc;
}

.weekly-card-dek {
  font-size: 0.8125rem;
  color: #666;
  margin: 0 0 0.35rem;
  line-height: 1.5;
}

.weekly-card-voice {
  font-size: 0.75rem;
  color: #6a6a72;
  margin: 0 0 0.3rem;
  line-height: 1.5;
}

.weekly-card-meta {
  font-size: 0.75rem;
  color: #5f5f5f;
  margin: 0;
}

/* Latest cards section（ピックアップ除外の最新5本 — 簡易表示）
   -------------------------------------------------------------------------- */
.latest-section {
  margin-top: 2.5rem;
}

.latest-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.latest-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fdfdff;
  border: 1px solid #ececf2;
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.latest-card:hover {
  background: #f5f7ff;
  border-color: #d8d8e8;
  text-decoration: none;
}

.latest-card:visited .latest-title {
  color: #4a4a4a;
}

.latest-card .role-badge {
  flex-shrink: 0;
}

.latest-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.5;
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.latest-card:hover .latest-title {
  color: #0066cc;
}

.latest-meta {
  font-size: 0.75rem;
  color: #5f5f5f;
  margin: 0;
  flex-shrink: 0;
}

/* Decorative illustrations
   -------------------------------------------------------------------------- */

/* Fish (index page) */
.deco-fish-row {
  display: flex;
  justify-content: flex-end;
  margin: 0.5rem 0 1.25rem;
}

.deco-fish-center {
  justify-content: center;
}

.deco-fish-img {
  height: 72px;
  width: auto;
  opacity: 0.75;
}

/* Share section: ボタン群と足跡イラストを横並び */
.share-section-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.deco-share-img {
  height: 56px;
  width: auto;
  opacity: 0.6;
  flex-shrink: 0;
  margin-left: auto;
}

/* Penguins (記事ページ — 元リンク以下の右下) */
.deco-penguins-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.deco-penguins-img {
  height: 80px;
  width: auto;
  opacity: 0.8;
}

/* モバイル: 魚・足跡は非表示、ペンギンは縮小 */
@media (max-width: 600px) {
  .deco-fish-img,
  .deco-share-img {
    display: none;
  }

  .deco-penguins-img {
    height: 60px;
  }
}

/* Weekly section responsive
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .weekly-feature-card {
    flex-direction: column-reverse;
    gap: 1rem;
  }

  .weekly-feature-image-wrap {
    width: 100%;
  }

  .weekly-feature-visual {
    height: 200px;
  }

  .weekly-feature-title {
    font-size: 1.125rem;
  }

  .weekly-cards-grid {
    grid-template-columns: 1fr;
  }

  .latest-card {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .latest-title {
    -webkit-line-clamp: 2;
    flex-basis: 100%;
  }

  .latest-meta {
    margin-left: auto;
  }

  .bottom-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .bottom-nav-fish .deco-fish-img {
    height: 56px;
  }
}

/* Accessibility utilities
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: #0066cc;
  color: #fff;
  text-decoration: none;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  left: 0;
}