/*
 * polish.css — Modern refinements
 *
 * Maintains Azuro typeface and blue/teal/orange palette.
 * Adds breathing room, modern spacing, and subtle polish
 * inspired by the Quarto design system.
 *
 * Loaded after jk.css so these selectors take precedence.
 */

/* ===== CSS Custom Properties ============================= */
:root {
  --color-primary:     #006699;
  --color-teal:        #009966;
  --color-accent:      #FF9900;
  --color-navy:        #003366;
  --color-text:        #2d3748;
  --color-text-muted:  #6b7280;
  --color-border:      #e2e8f0;
  --color-bg:          #ffffff;
  --color-bg-subtle:   #f8faf9;
  --color-bg-code:     #eef4f8;
  --color-bg-teal:     #f0f7f4;

  --radius-sm: 3px;
  --radius-md: 6px;

  --transition-fast: 0.12s ease;
  --transition-base: 0.2s ease;
}

/* ===== Background ======================================== */
/* Remove dated noise texture; clean white background */
html, body {
  background-image: none;
  background-color: var(--color-bg);
}

/* ===== Body ============================================== */
body {
  color: var(--color-text);
  line-height: 1.7;
}

/* ===== Container ========================================= */
div.container {
  padding-top: 64px;
}

/* ===== Headings ========================================== */
h1 {
  letter-spacing: -0.5px;
  line-height: 1.1;
}

/* Page/section title in header */
header h1 {
  font-size: 46px;
  line-height: 1.1;
  letter-spacing: -1px;
}

h2 {
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: -0.2px;
  margin-top: 1.8em;
  margin-bottom: 0.5em;
}

/* First h2 in content should not have large top margin */
.article-content h2:first-child,
.article-content h3:first-child,
.doc-section h2:first-child {
  margin-top: 0;
}

h3 {
  font-size: 20px;
  line-height: 1.4;
  margin-top: 1.5em;
  margin-bottom: 0.4em;
}

/* Blog list: tighten gap between title (h2) and subtitle (h3) */
.doc-section h2 {
  margin-bottom: 0.1em;
}
.doc-section h3 {
  margin-top: 0.1em;
  margin-bottom: 0.1em;
}

h4 {
  margin-top: 1.2em;
  margin-bottom: 0.3em;
}

/* Dates / metadata — small caps treatment */
h5 {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: bold;
  margin-bottom: 0.6em;
}

/* ===== Body Text ========================================= */
p {
  line-height: 1.75;
  margin-bottom: 1.4em;
}

/* Slightly enlarged body text inside articles for readability */
.article-content {
  margin-top: 1.5rem;
  font-size: 17px;
  line-height: 1.8;
}

.article-content p {
  margin-bottom: 1.5em;
}

/* ===== Links ============================================= */
a, a:visited {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover, a:focus {
  color: var(--color-navy);
}

/* Underline only body-copy links */
p a, p a:visited {
  text-decoration: underline;
  text-decoration-color: var(--color-text-muted);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Keep heading links clean (no underline) */
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
  text-decoration: none;
}

h2 a:hover, h3 a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

/* ===== Strong ============================================ */
/* Inherit body color — colored bold text feels dated */
strong {
  font-weight: bold;
  color: inherit;
}

/* ===== Blockquotes ======================================= */
blockquote, blockquote p {
  font-size: 16px;
  line-height: 1.7;
  color: #4a5568;
}

blockquote {
  background: var(--color-bg-teal);
  border-left: 3px solid var(--color-teal);
  padding: 14px 22px;
  margin: 1.5em 0;
}

/* ===== Code ============================================== */
code {
  font-size: 88%;
  color: var(--color-primary);
  background: var(--color-bg-code);
  padding: 1px 5px;
}

pre {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  padding: 16px 18px;
  line-height: 1.6;
  margin: 1.2em 0;
  overflow: auto;
}

pre > code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: 92%;
}

/* ===== Horizontal Rules ================================== */
hr.small {
  background: var(--color-border);
  height: 1px;
  border-radius: 1px;
  margin: 1.5em 0;
}

/* ===== Navigation ======================================== */
nav ul li {
  margin-bottom: 12px;
}

nav ul li a,
nav ul li a:visited,
nav ul li a:active {
  transition: color var(--transition-fast);
}

nav ul li a:hover,
nav ul li a:focus {
  color: var(--color-teal);
}

nav ul#subnav li a:hover,
nav ul#subnav li a:focus {
  color: var(--color-teal);
}

/* External links — pill badge style */
nav ul#external {
  margin-top: 16px;
}

nav ul#external li {
  height: auto;
  margin-bottom: 6px;
  padding: 0;
}

nav ul#external li a,
nav ul#external li a:visited,
nav ul#external li a:active {
  display: block;
  /* background: #e8f0ee;
  color: #3b5249; */
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  padding: 6px 12px;
  height: auto;
  line-height: 1.4;
  transition: background var(--transition-base), color var(--transition-base);
}

nav ul#external li a:hover,
nav ul#external li a:focus {
  background: var(--color-primary);
  color: #ffffff;
  text-decoration: none;
}

/* ===== Blog List Entries ================================= */
/* Give each entry natural breathing room */
.doc-section {
  margin: 0 0 0.5rem 0;
}

.doc-section:first-child {
  padding-top: 0;
}

/* Cover image in list — rounded corners and hover fade */
.blog-image {
  margin: 0.75rem 0;
  overflow: hidden;
}

.blog-image img {
  transition: opacity var(--transition-base);
}

.blog-image a:hover img {
  opacity: 0.9;
}

/* Article cover image */
article .blog-image {
  margin-bottom: 1.5rem;
}

/* ===== Tables ============================================ */
table {
  font-size: 15px;
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin: 1.5em 0;
}

table th, table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
}

table thead th {
  background: #eef4f8;
  color: var(--color-primary);
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

table tbody tr:nth-child(odd) {
  background-color: var(--color-bg-subtle);
}

table tbody tr:last-child td {
  border-bottom: none;
}

/* ===== Footer ============================================ */
.footer {
  margin-top: 3em;
  margin-bottom: 1.5em;
  padding: 14px 0;
  border-top: 2px solid var(--color-accent);
  color: var(--color-text-muted);
}

.footer p {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ===== Mobile Refinements ================================ */
@media only screen and (max-width: 767px) {
  div.container {
    padding-top: 0;
  }

  nav ul#external li a,
  nav ul#external li a:visited,
  nav ul#external li a:active {
    display: inline-block;
  }

  /* Mobile main nav tab bar */
  nav ul#mainnav li a {
    transition: background var(--transition-fast), color var(--transition-fast);
  }

  nav ul#mainnav li a:hover {
    background: #c8c8c8;
  }
}
