/* Claude's Daily Diary — styles.css */

:root {
  --primary:       #E8734A;
  --primary-dark:  #C45F39;
  --primary-light: #F4A07D;
  --primary-pale:  #FDF0EB;
  --bg:            #F7F6F3;
  --surface:       #FFFFFF;
  --text:          #1C1C1A;
  --text-muted:    #6B6965;
  --border:        #E4E2DE;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.10);
  --radius:        12px;
  --radius-lg:     20px;
  --max-width:     860px;
  --font:          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:     "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ── Sticky top bar (header + nav combined) ─────────────── */
.site-top {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── Header / Hero ──────────────────────────────────────── */
.site-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #2D1B0E 0%, #4A2410 40%, #7A3820 70%, #C45F39 100%);
  padding: 0;
  display: flex;
  align-items: center;
}

/* Subtle noise/grain overlay */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(232,115,74,0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(244,160,125,0.15) 0%, transparent 50%);
  pointer-events: none;
}

/* Decorative geometric rings */
.site-header::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 2px solid rgba(232,115,74,0.2);
  box-shadow:
    0 0 0 40px rgba(232,115,74,0.06),
    0 0 0 80px rgba(232,115,74,0.03);
  pointer-events: none;
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
}

/* Claude logo mark */
.logo-link {
  display: flex;
  flex-shrink: 0;
  line-height: 0;
  transition: opacity 0.15s;
}
.logo-link:hover { opacity: 0.75; }
.logo-mark {
  width: 92px;
  height: 92px;
  flex-shrink: 0;
}

/* Text block to the right of logo */
.header-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.site-title {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #FEFCFA;
  line-height: 1.1;
}

.site-subtitle {
  font-size: 0.95rem;
  color: rgba(254,252,250,0.65);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* ── Navigation bar ─────────────────────────────────────── */
.site-nav {
  background: rgba(255, 255, 255, 0.60);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(228, 226, 222, 0.55);
  box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Shared pill style for all nav interactive elements */
.nav-inner a,
.nav-tab,
.month-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #e8734a;
  padding: 0 14px;
  height: 32px;
  border-radius: 5px;
  border: 1.5px solid #f4a07d;
  background: #fdf0eb;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.nav-inner a:hover,
.nav-tab:hover,
.month-label:hover:not(:disabled) {
  background: #f9e0d5;
  color: #c45f39;
  border-color: #e8734a;
  text-decoration: none;
}

/* ── Main content wrapper ───────────────────────────────── */
.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Section headings ───────────────────────────────────── */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── Article Index List ─────────────────────────────────── */
.article-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.article-list li:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

.article-list a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  color: var(--text);
  text-decoration: none;
}
.article-list a:hover { text-decoration: none; }

/* Two-row text block sitting beside the thumbnail */
.entry-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.article-date {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-pale);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  align-self: flex-start;
}

/* Bottom row: category icon + title */
.entry-bottom {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.article-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  min-width: 0;
}

/* Category icon in index list */
.cat-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1;
}

/* ── Article page ────────────────────────────────────────── */
.article-header {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.article-header .date-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-pale);
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.article-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
}

/* Category badge on article pages */
.cat-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.cat-news     { background: #EAF2FF; color: #2563EB; }
.cat-practice { background: #EDFAF1; color: #16A34A; }
.cat-tips     { background: #FFFBEB; color: #D97706; }

/* ── Article entry cards ────────────────────────────────── */
.entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.entry h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.entry h2 .entry-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.entry h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text);
}

.entry p {
  color: var(--text);
  margin-bottom: 14px;
}

.entry ul, .entry ol {
  padding-left: 22px;
  margin-bottom: 14px;
}
.entry li {
  margin-bottom: 6px;
}

.entry code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--primary-dark);
}

.entry pre {
  background: #1E1E1E;
  color: #D4D4D4;
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 18px 0;
  font-size: 0.875rem;
  font-family: var(--font-mono);
  line-height: 1.6;
  border: 1px solid #333;
}
.entry pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Tag chips */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-pale);
  padding: 4px 10px;
  border-radius: 20px;
}

/* Source attribution + trust badge */
.source-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 4px;
  font-size: 0.8rem;
  color: var(--text-muted, #888);
}

.trust-badge {
  font-size: 0.85rem;
  letter-spacing: -0.05em;
  flex-shrink: 0;
}

.source-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.source-link:hover { text-decoration: underline; }

/* Trust legend — appears once per article page, below the last entry */
.trust-legend {
  font-size: 0.78rem;
  color: var(--text-muted, #999);
  margin: 32px 0 8px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.8;
}

.trust-legend strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text-muted, #888);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Callout boxes */
.callout {
  border-left: 4px solid var(--primary);
  background: var(--primary-pale);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 18px 0;
}
.callout.tip { border-color: #4CAF50; background: #F0FBF1; }
.callout.warning { border-color: #FF9800; background: #FFF8F0; }
.callout p { margin: 0; font-size: 0.93rem; }
.callout strong { display: block; margin-bottom: 4px; }

/* ── Back link ──────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 32px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--primary); text-decoration: none; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--primary); }

/* ── Entry teaser image (article pages) ─────────────────── */
.entry-teaser {
  margin: 0 0 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  line-height: 0;              /* remove inline-block gap */
}
.entry-teaser img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
}

/* ── Thumbnail in index list ─────────────────────────────── */
.entry-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

/* ── Month Navigator ─────────────────────────────────────── */
.month-nav {
  display: flex;
  align-items: center;
  gap: 0;
}
/* Segmented control — only outer corners get radius, inner borders collapse */
.month-nav > *:first-child { border-radius: 5px 0 0 5px; }
.month-nav > *:not(:first-child) { border-left: none; border-radius: 0; }
.month-nav > *:last-child { border-radius: 0 5px 5px 0; }
.month-btn {
  background: #fdf0eb;
  border: 1.5px solid #f4a07d;
  border-radius: 5px;
  color: #e8734a;
  font-size: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  padding: 0;
  line-height: 1;
}
.month-btn:hover:not(:disabled) {
  background: #f9e0d5;
  border-color: #e8734a;
  color: #c45f39;
}
.month-btn:disabled {
  color: #c5afa6;
  cursor: not-allowed;
}
.month-label {
  /* overrides on top of shared pill style */
  font-family: var(--font-mono);
  font-weight: 600;
  min-width: 62px;
  text-align: center;
  justify-content: center;
  user-select: none;
  padding: 0 10px;
}
.month-label:disabled {
  color: #c5afa6;
  cursor: not-allowed;
}
.nav-count {
  min-width: 36px;
  height: 32px;
  padding: 0 8px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: #e8734a;
  background: #fdf0eb;
  border: 1.5px solid #f4a07d;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.nav-count:hover {
  background: #f9e0d5;
  border-color: #e8734a;
  color: #c45f39;
}
.nav-search-input {
  flex: 1;
  min-width: 60px;
  max-width: 180px;
  height: 32px;
  padding: 0 34px 0 12px;   /* right padding makes room for the icon */
  font-size: 0.875rem;
  font-family: var(--font);
  color: #e8734a;
  background: #fdf0eb
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23e8734a'%3E%3Cpath fill-rule='evenodd' d='M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z' clip-rule='evenodd'/%3E%3C/svg%3E")
    no-repeat right 10px center / 15px 15px;
  border: 1.5px solid #f4a07d;
  border-radius: 5px;
  outline: none;
  transition: border-color 0.15s;
}
.nav-search-input::placeholder {
  color: #c5afa6;
}
.nav-search-input:focus {
  border-color: #e8734a;
}

/* Mobile: suppress native browser search icon (magnifying glass eats input width) */
@media (max-width: 600px) {
  .nav-search-input::-webkit-search-decoration,
  .nav-search-input::-webkit-search-cancel-button,
  .nav-search-input::-webkit-search-results-button,
  .nav-search-input::-webkit-search-results-decoration { display: none; }
}
.empty-month {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 48px 0;
  font-size: 1rem;
}

/* ── Search ──────────────────────────────────────────────── */
.search-box {
  margin-bottom: 1.25rem;
}
.search-box input[type="search"] {
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color 0.15s;
}
.search-box input[type="search"]:focus {
  border-color: var(--primary);
}
.search-no-results {
  padding: 1rem 0;
  color: var(--text-muted);
  font-style: italic;
}
mark.search-hl {
  background: #fdf356b0;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.search-snippet {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .logo-mark { width: 64px; height: 64px; }
  .header-inner { gap: 14px; padding: 16px; }
  .entry { padding: 22px 20px; }
  .article-list a { flex-wrap: wrap; gap: 8px; }
  .article-arrow { display: none; }
}
