/* ============================================================
   tech.breefly.jp — style.css
   Design: Minimal Personal Curation Blog (White base)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

/* ------------------------------------------------------------
   Variables
   ------------------------------------------------------------ */
:root {
  --bg:            #fafafa;
  --surface:       #ffffff;
  --border:        #e8e8e8;
  --border-light:  #f2f2f2;

  --text:          #1a1a1a;
  --text-2:        #555555;
  --text-3:        #999999;

  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;

  --curator-bg:    #eff6ff;
  --curator-border:#2563eb;
  --curator-text:  #1e3a8a;

  --shadow-sm:     0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.09);

  --radius:        8px;
  --font:          'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
}

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.4;
}

p {
  margin: 0;
}

/* ------------------------------------------------------------
   Layout
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.logo-link {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.logo-name {
  color: var(--text);
}

.logo-tld {
  color: var(--accent);
}

.site-tagline {
  font-size: 0.82rem;
  color: var(--text-3);
  margin: 0;
  flex: 1;
}

/* ------------------------------------------------------------
   Main content
   ------------------------------------------------------------ */
.main-content {
  padding: 36px 0 80px;
}

/* ------------------------------------------------------------
   Page meta
   ------------------------------------------------------------ */
.page-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 0.82rem;
  color: var(--text-3);
}

.update-label {
  margin-right: 4px;
}

/* ------------------------------------------------------------
   Card grid
   ------------------------------------------------------------ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* ------------------------------------------------------------
   Article card
   ------------------------------------------------------------ */
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #c7d7f5;
}

.card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px;
  color: inherit;
  text-decoration: none;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.source-badge {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 100px;
  background: #f1f5f9;
  color: var(--text-2);
  white-space: nowrap;
}

.card-date {
  font-size: 0.72rem;
  color: var(--text-3);
  white-space: nowrap;
}

.card-title {
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 10px;
}

.card-link:hover .card-title {
  color: var(--accent);
}

/* キュレーターコメント */
.card-curator {
  background: var(--curator-bg);
  border-left: 3px solid var(--curator-border);
  padding: 7px 11px;
  border-radius: 0 4px 4px 0;
  font-size: 0.8rem;
  color: var(--curator-text);
  line-height: 1.65;
  margin-bottom: 10px;
}

.card-summary {
  font-size: 0.83rem;
  color: var(--text-2);
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
  flex: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.category-tag {
  font-size: 0.72rem;
  color: var(--text-3);
}

.read-more {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
}

/* 元記事リンク */
.card-external-wrap {
  padding: 10px 20px;
  border-top: 1px solid var(--border-light);
}

.card-external {
  font-size: 0.78rem;
  color: var(--text-3);
  text-decoration: none;
}

.card-external:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------
   Empty state
   ------------------------------------------------------------ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-3);
}

/* ------------------------------------------------------------
   Article page
   ------------------------------------------------------------ */
.article-container {
  max-width: 720px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 28px;
}

.breadcrumb a {
  color: var(--text-3);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb-sep {
  color: var(--border);
}

.article-full {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 28px;
}

.article-meta-top {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.article-title {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 10px;
  color: var(--text);
}

.article-meta {
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 18px;
}

.btn-primary-large {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--accent);
  color: #ffffff;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 24px;
  transition: background 0.15s;
}

.btn-primary-large:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

/* キュレーターコメント（記事ページ） */
.article-curator {
  background: var(--curator-bg);
  border-left: 3px solid var(--curator-border);
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 24px;
}

.curator-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 6px;
}

.curator-body {
  font-size: 0.9rem;
  color: var(--curator-text);
  line-height: 1.7;
}

.article-summary-section {
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
}

.summary-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 12px;
}

.article-body {
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--text-2);
}

/* Markdown レンダリング（.prose） */
.prose p {
  margin-bottom: 1.2em;
}
.prose p:last-child {
  margin-bottom: 0;
}
.prose strong {
  font-weight: 700;
  color: var(--text);
}
.prose em {
  font-style: italic;
  color: var(--text);
}
.prose code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875em;
  background: #f1f5f9;
  color: #0f172a;
  padding: 0.15em 0.4em;
  border-radius: 3px;
}
.prose ul,
.prose ol {
  padding-left: 1.5em;
  margin-bottom: 1.2em;
}
.prose li {
  margin-bottom: 0.4em;
}
.prose h2,
.prose h3 {
  font-weight: 700;
  color: var(--text);
  margin: 1.4em 0 0.6em;
  line-height: 1.4;
}
.prose h2 { font-size: 1.1rem; }
.prose h3 { font-size: 1rem; }
.prose blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1em;
  color: var(--text-3);
  margin: 1em 0;
  font-style: italic;
}

/* ------------------------------------------------------------
   Article navigation
   ------------------------------------------------------------ */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.article-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s;
}

.article-nav-link:hover {
  border-color: var(--accent);
}

.article-nav-link.next {
  text-align: right;
}

.nav-dir {
  font-size: 0.72rem;
  color: var(--text-3);
}

.nav-title {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 4px;
}

.footer-copy {
  font-size: 0.76rem;
  color: var(--text-3);
}

.footer-text a {
  color: var(--text-3);
}

.footer-text a:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------
   Scroll to top
   ------------------------------------------------------------ */
.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: var(--shadow-sm);
}

.scroll-top.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* ------------------------------------------------------------
   Pagination
   ------------------------------------------------------------ */
.pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 0 16px;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-3);
}

.pagination-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--accent);
  font-size: 0.9rem;
  font-family: var(--font);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
}

.pagination-btn:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.pagination-btn.is-disabled {
  color: var(--text-3);
  border-color: var(--border-light);
  cursor: default;
  pointer-events: none;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .site-tagline {
    display: none;
  }

  .article-full {
    padding: 20px 16px;
  }

  .article-title {
    font-size: 1.2rem;
  }

  .article-nav {
    grid-template-columns: 1fr;
  }

  .page-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
