/* ==========================================================
   blog.css: PH's Blog, using the same color scheme as card.css
   Palette: sky-to-cream page, dark navy panels, sky blue text,
   marigold accent, Libre Baskerville throughout.
   Selectors cover plain HTML elements plus the class names
   used by the default Jekyll theme (.site-header, .post-list...).
   ========================================================== */

:root {
  --text: #0f2447;          /* navy text on the light page */
  --text-muted: #2b4570;
  --surface: #0f2447;       /* dark blue panels */
  --surface-hover: #17346a;
  --border: #2a4b8a;
  --panel-text: #9fd3ff;    /* sky blue text on navy */
  --panel-text-soft: #bfe3ff;
  --accent: #f2a541;        /* marigold */

  --font: "Libre Baskerville", Baskerville, Georgia, "Times New Roman", serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background-color: #cfe0e0;
  background-image: linear-gradient(to right, #8bb6d9, #eae8c2);
  background-attachment: fixed;
}

/* ---------- Page width ---------- */

.wrapper,
main,
article {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

main {
  padding: 2rem 1.25rem 3rem;
}

/* ---------- Headings ---------- */

h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: 2rem; margin: 0 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; }

/* ---------- Links ---------- */

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Header and navigation ---------- */

header,
.site-header {
  background: var(--surface);
  border-bottom: 3px solid var(--accent);
  padding: 0.9rem 1.25rem;
  min-height: 0;
}

header a,
.site-header a,
.site-title,
.site-nav a,
.page-link {
  color: var(--panel-text);
  font-weight: 700;
  text-decoration: none;
}

header a:hover,
.site-header a:hover,
.site-nav a:hover {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

header nav ul,
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Posts list ---------- */

.post-list,
main ul.posts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.post-list > li,
main ul.posts > li {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  color: var(--panel-text);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.post-list > li:hover,
main ul.posts > li:hover {
  background: var(--surface-hover);
  border-color: var(--panel-text);
}

.post-list a,
main ul.posts a,
.post-link {
  color: var(--panel-text);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

.post-list h2,
.post-list h3 {
  margin: 0;
  font-size: 1.15rem;
}

.post-meta,
.date,
time {
  color: var(--panel-text-soft);
  font-size: 0.9rem;
}

/* ---------- Individual posts ---------- */

article {
  padding: 2rem 1.25rem 3rem;
}

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

article .post-meta,
article time {
  color: var(--text-muted);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1.25rem;
  background: rgba(15, 36, 71, 0.08);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  color: var(--text);
}

code,
pre {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

code {
  background: rgba(15, 36, 71, 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

pre {
  background: var(--surface);
  color: var(--panel-text);
  padding: 1rem 1.25rem;
  border-radius: 14px;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: var(--surface);
  color: var(--panel-text);
  text-align: left;
}

th, td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
}

hr {
  border: 0;
  border-top: 2px solid var(--border);
  margin: 2rem 0;
}

/* ---------- Footer ---------- */

footer,
.site-footer {
  background: var(--surface);
  color: var(--panel-text-soft);
  text-align: center;
  padding: 1.25rem;
  font-size: 0.9rem;
  border-top: 3px solid var(--accent);
}

footer a,
.site-footer a {
  color: var(--panel-text);
}

/* ---------- Small screens & preferences ---------- */

@media (max-width: 480px) {
  h1 { font-size: 1.6rem; }
  .post-title { font-size: 1.6rem; }
  main, article { padding-left: 1rem; padding-right: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .post-list > li,
  main ul.posts > li { transition: none; }
}
