/* =============================================
   Art Wrecka — Global Stylesheet
   ============================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --yellow: #f0c020;
  --yellow-dark: #7a5e00;
  --yellow-hover: #e0b210;
  --text-primary: #1a1a1a;
  --text-secondary: #666;
  --text-tertiary: #999;
  --border: rgba(0,0,0,0.12);
  --border-strong: rgba(0,0,0,0.25);
  --bg-secondary: #f5f5f3;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background: #fff;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Layout ── */
.site { max-width: 960px; margin: 0 auto; padding: 0 1.25rem; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0.5px 220px;
  gap: 0 2rem;
  align-items: start;
}

.col-sep {
  background: var(--border);
  width: 0.5px;
  align-self: stretch;
  min-height: 400px;
}

/* ── Site header — GIF logo ── */
.site-header {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
}

.site-logo-link {
  display: inline-block;
  line-height: 0;
}

.site-logo-link:hover { opacity: 0.85; text-decoration: none; }

.site-logo-gif {
  height: 48px;       /* same visual weight as the old text title */
  width: auto;
  display: block;
  margin: 0 auto;
}

/* ── Nav ── */
.site-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  border-bottom: 0.5px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1.75rem;
}

.site-nav a {
  font-size: 14px;
  color: var(--text-secondary);
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}

.site-nav a:hover { color: var(--text-primary); text-decoration: none; }
.site-nav a.active { color: var(--text-primary); border-bottom-color: var(--yellow); }

/* ── Footer ── */
.site-footer {
  border-top: 0.5px solid var(--border);
  margin-top: 3rem;
  padding: 1.5rem 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.site-footer nav { display: flex; gap: 1.5rem; }
.site-footer a:hover { color: var(--text-primary); text-decoration: none; }

/* ── Bio link inside sidebar ── */
.bio-link {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bio-link:hover { color: var(--yellow-dark); }

/* ── External nav link (YouTube) ── */
.nav-external {
  color: var(--text-secondary);
  font-size: 14px;
}
.nav-external:hover { color: var(--text-primary); text-decoration: none; }

/* ── Sidebar ── */
.sidebar { position: sticky; top: 1.5rem; }

.sidebar-avatar {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 0 auto 0.75rem;
  display: block;
}

.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-name { text-align: center; font-weight: 500; font-size: 15px; margin-bottom: 0.4rem; }
.sidebar-bio { text-align: center; font-size: 12px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 1.25rem; }

.sidebar-section { margin-bottom: 1.5rem; }

.sidebar-heading {
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.counter-row { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 0.25rem; }
.counter-item { text-align: center; }
.counter-item strong { display: block; font-size: 16px; font-weight: 500; }
.counter-label { font-size: 11px; color: var(--text-secondary); }

.sidebar-posts { list-style: none; }
.sidebar-posts li { padding: 4px 0; }
.sidebar-posts a { font-size: 13px; color: var(--text-secondary); line-height: 1.4; display: block; }
.sidebar-posts a:hover { color: var(--text-primary); text-decoration: none; }

/* ── Post Cards ── */
.post-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 0.5px solid var(--border);
  align-items: start;
}

.post-thumb {
  width: 100px;
  height: 72px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.post-thumb img { width: 100%; height: 100%; object-fit: cover; }

.post-title { font-size: 17px; font-weight: 500; line-height: 1.35; margin-bottom: 0.35rem; color: var(--text-primary); }
.post-title:hover { text-decoration: underline; }
.post-excerpt { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.post-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.6rem; }
.post-meta { font-size: 12px; color: var(--text-secondary); }
.post-meta span { text-transform: uppercase; letter-spacing: 0.05em; }

.btn-read {
  background: var(--yellow);
  color: var(--yellow-dark);
  border: none;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-read:hover { background: var(--yellow-hover); text-decoration: none; }

/* ── Pagination ── */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 1.75rem 0 0.5rem; }

.page-btn {
  width: 36px;
  height: 36px;
  border: 0.5px solid var(--border-strong);
  background: transparent;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  line-height: 1;
  transition: background 0.1s;
  text-decoration: none;
}
.page-btn:hover { background: var(--bg-secondary); text-decoration: none; }
.page-btn.active, .page-btn[aria-current="page"] {
  background: var(--yellow);
  color: var(--yellow-dark);
  border-color: var(--yellow);
  font-weight: 500;
}

/* ── Article page ── */
.article-back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-secondary); margin-bottom: 1.5rem; }
.article-back:hover { color: var(--text-primary); text-decoration: none; }

.article-hero {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--bg-secondary);
}
.article-hero img, .article-hero video { width: 100%; display: block; border-radius: var(--radius-lg); }

.article-header-meta { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 0.6rem; }
.article-title { font-size: 26px; font-weight: 600; line-height: 1.3; margin-bottom: 0.4rem; }
.article-subtitle { font-size: 16px; color: var(--text-secondary); margin-bottom: 1.25rem; font-style: italic; }

.article-body p { font-size: 15px; line-height: 1.8; color: var(--text-secondary); margin-bottom: 1.1rem; }
.article-body p:first-child { color: var(--text-primary); }
.article-body h2 { font-size: 20px; font-weight: 500; margin: 2rem 0 0.75rem; color: var(--text-primary); }
.article-body blockquote { border-left: 3px solid var(--yellow); margin: 1.5rem 0; padding: 0.5rem 1rem; font-size: 15px; font-style: italic; color: var(--text-secondary); }
.article-body em { color: var(--text-tertiary); font-size: 13px; display: block; text-align: center; margin-top: -0.5rem; margin-bottom: 1rem; }

.article-image {
  margin: 1.25rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.article-image img { width: 100%; display: block; }
.article-image figcaption { font-size: 12px; color: var(--text-tertiary); text-align: center; padding: 0.4rem 0; font-style: italic; }

.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2rem; padding-top: 1rem; border-top: 0.5px solid var(--border); }
.article-tag { font-size: 12px; padding: 4px 10px; border-radius: 12px; background: var(--bg-secondary); color: var(--text-secondary); }

/* ── Library page ── */
.library-year { margin-bottom: 2.5rem; }
.library-year-title { font-size: 22px; font-weight: 500; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.75rem; }

.count-badge { font-size: 13px; background: var(--bg-secondary); border-radius: 12px; padding: 2px 10px; color: var(--text-secondary); font-weight: 400; }

.book-row { display: flex; align-items: center; padding: 14px 0; border-bottom: 0.5px solid var(--border); gap: 1rem; }
.book-info { flex: 1; min-width: 0; }
.book-title { font-size: 15px; font-weight: 500; color: var(--text-primary); }
a.book-title:hover { text-decoration: underline; }
.book-author { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.book-genre { font-size: 12px; padding: 3px 10px; border-radius: 12px; font-weight: 400; flex-shrink: 0; white-space: nowrap; }

.genre-hist   { background: #fdecea; color: #712b13; }
.genre-sci    { background: #e6f1fb; color: #0c447c; }
.genre-phil   { background: #faeeda; color: #633806; }
.genre-scifi  { background: #eeedfe; color: #3c3489; }
.genre-myst   { background: #e1f5ee; color: #085041; }
.genre-bio    { background: #fbeaf0; color: #72243e; }
.genre-self   { background: #eaf3de; color: #27500a; }
.genre-fic    { background: #f1efe8; color: #444441; }
.genre-psych  { background: #f0e8fb; color: #4a2080; }
.genre-health { background: #e4f5f0; color: #0a5e44; }

.stars { display: flex; gap: 1px; flex-shrink: 0; }
.star       { font-size: 16px; color: var(--yellow); }
.star.off   { color: #ddd; }
/* Half star: clip the right half to grey */
.star.half  {
  position: relative;
  display: inline-block;
  color: #ddd;
}
.star.half::before {
  content: '★';
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  overflow: hidden;
  color: var(--yellow);
}

/* Book detail page */
.book-detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 2rem; margin-bottom: 2rem; }
.book-cover { width: 140px; height: 200px; background: var(--bg-secondary); border-radius: 6px; border: 0.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 48px; flex-shrink: 0; overflow: hidden; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-detail-title { font-size: 24px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.book-detail-author { font-size: 15px; color: var(--text-secondary); margin-bottom: 1rem; }
.book-meta-table { display: flex; flex-direction: column; gap: 10px; }
.book-meta-row { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.book-meta-label { color: var(--text-secondary); min-width: 70px; }
.book-review p { font-size: 15px; line-height: 1.8; color: var(--text-secondary); margin-bottom: 1rem; }

/* ── Archive page ── */
.archive-year { margin-bottom: 2.5rem; }
.archive-year-title { font-size: 22px; font-weight: 500; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.75rem; }
.archive-month { margin-bottom: 1.25rem; }
.archive-month-title { font-size: 11px; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; padding-bottom: 0.4rem; border-bottom: 0.5px solid var(--border); }
.archive-post { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; font-size: 14px; color: var(--text-secondary); }
.archive-post a { color: var(--text-secondary); }
.archive-post a:hover { color: var(--text-primary); text-decoration: none; }
.archive-post-date { font-size: 12px; color: var(--text-tertiary); flex-shrink: 0; margin-left: 1rem; }

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

/* ── Responsive ── */
@media (max-width: 700px) {
  .layout { grid-template-columns: 1fr; }
  .col-sep { display: none; }
  .sidebar { position: static; border-top: 0.5px solid var(--border); padding-top: 2rem; margin-top: 2rem; }
  .site-footer { flex-direction: column; gap: 0.75rem; text-align: center; }
  .book-detail-grid { grid-template-columns: 1fr; }
  .book-cover { width: 100%; height: 180px; }
}

@media (max-width: 480px) {
  .post-card { grid-template-columns: 1fr; }
  .post-thumb { width: 100%; height: 140px; }
}
