/* Adrian3.com site theme
   Supplements design-system/baseline.css.
   Only override baseline values here when you intentionally want
   something different from the design system defaults. */

@import url('https://fonts.googleapis.com/css2?family=Vollkorn:ital,wght@0,400;0,600;1,400&family=Montserrat:wght@400;600&display=swap');

:root {
  /* Override baseline defaults for this site */
  --ade-muted: #7a7a7a;       /* baseline default is #555 — lighten for this site */
  --ade-content-width: 48rem; /* baseline default is 35rem */
}

/* ── Site header ─────────────────────────────────── */

body > header {
  padding: 0;
  background: var(--ade-parchment);
  border-bottom: 1px solid var(--ade-hairline);
  text-align: center;
  overflow: hidden;
}

.logo-link {
  width: 100%;
  display: inline-block;
}

.logo-link svg {
  max-width: 320px;
  width: 100%;
  overflow: visible;
  cursor: pointer;
  margin: 0 auto -60px;
  display: block;
}

.outlineA, .outlineD, .outlineE {
  fill: none;
  stroke: #cccccc;
  stroke-width: 0.5;
  stroke-miterlimit: 10;
}

.site-nav {
  display: inline-flex;
  gap: 0;
  padding: 0 0 10px;
}

.site-nav a {
  font-family: var(--ade-font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ade-primary);
  text-decoration: none;
  margin: 0 20px;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--ade-primary-focus);
}

/* ── Main content ─────────────────────────────────── */

main.content {
  display: flow-root; /* creates BFC: stops child margins collapsing upward through <main> */
  max-width: var(--ade-content-width);
  margin: 1.5rem auto 3rem;
  padding: 0 1.5rem;
}

main.content > *:first-child {
  margin-top: 0;
}

/* baseline.css forces display:block on all images which breaks
   float layouts and inline image grids defined in page-level styles.
   Restore default inline display inside content so markdown pages
   control their own image layout. Floats still work — floating an
   inline element promotes it to block automatically. */
main.content img {
  display: inline;
  margin: 1.5rem 0;
  /* No max-width here — baseline.css sets it at (0,0,1) specificity,
     which lets page-level img.classname rules freely override it. */
}

/* Full-viewport-width image breakout.
   Handles both img.full-width (class) and style="width:100vw" (existing case-studies).
   !important on margins is required because the case-study markdown uses inline
   style="margin:25px" which would otherwise override the breakout margin-left. */
main.content img.full-width,
main.content img[style*="100vw"] {
  display: block !important;
  width: 100vw !important;
  max-width: 100vw !important; /* overrides baseline img { max-width: 100% } which caps at container width */
  margin-left: calc(-50vw + 50%) !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
}

main.content h1 {
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 1rem;
}

main.content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

main.content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

/* font-size and line-height intentionally omitted — inherit from
   baseline.css (p, li, td, th rule). Edit design-system/baseline.css
   to change those values site-wide. */
main.content p,
main.content li {
  color: var(--ade-ink);    /* baseline uses --ade-muted; use ink for readability */
  margin-bottom: 1.25rem;
}

/* Links inside <button> elements inherit the button's white text,
   not the content link color. */
main.content button a,
main.content button a:hover,
main.content a.button,
main.content a.button:hover {
  color: #fff;
  text-decoration: none;
}

.sidebar {
  margin-top: 0;
}

main.content .sidebar h2 {
  margin-top: 0;
}

main.content hr {
  border: none;
  border-top: 1px solid var(--ade-hairline);
  margin: 3rem 0;
}

/* Full-bleed caption bars — used in case studies as p.caption */
main.content p.caption {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: 0;
}

/* Full-bleed rule — generated by <divider> tag in markdown */
main.content hr.full-rule {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: 0;
}

main.content blockquote {
  border-left: 3px solid var(--ade-primary);
  padding-left: 1.25rem;
  margin-left: 0;
  color: var(--ade-muted);
  font-style: italic;
}

/* ── Gallery pages ───────────────────────────────── */

main.gallery-main {
  max-width: var(--ade-wide-width, 1100px);
  margin: 2rem auto;
  padding: 0 1.5rem;
}

main.gallery-main h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.gallery-meta {
  font-family: var(--ade-font-ui);
  font-size: 0.8rem;
  color: var(--ade-muted);
  margin-bottom: 1.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 1rem;
}

.gallery-grid figure {
  margin: 0;
  cursor: pointer;
}

.gallery-grid figure img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: opacity 0.15s;
}

.gallery-grid figure img:hover {
  opacity: 0.85;
}

/* ── Inline gallery embed (<gallery name="slug" />) ── */

.gallery-embed {
  margin: 1.5rem 0;
}

.gallery-embed .gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px;
}

.gallery-embed .gallery-grid figure img {
  aspect-ratio: 1;
  height: auto;
}

.gallery-embed-link {
  margin-top: 0.5rem;
  font-family: var(--ade-font-ui);
  font-size: 0.8rem;
}

.gallery-embed-link a {
  color: var(--ade-muted);
}

.gallery-embed-link a:hover {
  color: var(--ade-primary);
}

/* ── Recent posts list (<recent-posts> tag) ──── */

ul.posts {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.posts li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--ade-divider, #f0f0f0);
}

ul.posts li a {
  color: var(--ade-ink);
  text-decoration: none;
}

ul.posts li a:hover {
  color: var(--ade-primary);
}

ul.posts li.posts-archive {
  border-bottom: none;
  margin-top: 0.5rem;
}

ul.posts li.posts-archive a {
  font-family: var(--ade-font-ui);
  font-size: 0.8rem;
  color: var(--ade-muted);
}

/* ── Post date ─────────────────────────────────── */

.post-date {
  font-family: var(--ade-font-ui);
  font-size: 0.8rem;
  color: var(--ade-muted);
  letter-spacing: 0.03em;
  margin-bottom: 2rem;
  margin-top: -0.5rem;
}

/* ── Blog prev/next ─────────────────────────────── */

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ade-hairline);
  font-family: var(--ade-font-ui);
  font-size: 0.875rem;
}

.post-nav a {
  color: var(--ade-primary);
  text-decoration: none;
}

.post-nav-next {
  margin-left: auto;
}

/* ── Site footer ─────────────────────────────────── */

body > footer {
  padding: 2rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: var(--ade-content-width);
  margin: 0 auto;
}

/* baseline.css targets footer p:first-child (0,1,2) as an uppercase eyebrow.
   Override with the same pseudo-class to match specificity and win by source order. */
body > footer p,
body > footer p:first-child {
  font-family: var(--ade-font-body);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ade-muted);
  letter-spacing: normal;
  text-transform: none;
  margin-bottom: 0.5rem;
}

body > footer small {
  font-family: var(--ade-font-display);
  font-size: 0.75rem;
  color: var(--ade-muted);
}

body > footer a {
  color: var(--ade-muted);
}

/* ── Reading page ─────────────────────────────────── */

.book-list {
  margin-top: 2rem;
}

.book-row {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--ade-hairline);
  align-items: flex-start;
}

.book-row:last-child {
  border-bottom: none;
}

.book-cover {
  width: 80px;
  flex-shrink: 0;
  display: block;
}

.book-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.book-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.book-title a {
  color: var(--ade-ink);
  text-decoration: none;
}

.book-title a:hover { color: var(--ade-primary); }

.book-author {
  font-size: 0.9rem;
  color: var(--ade-muted);
  margin: 0;
}

.book-rating {
  font-size: 0.85rem;
  color: var(--ade-primary);
  margin: 0;
  letter-spacing: 0.05em;
}

.book-date {
  font-family: var(--ade-font-ui);
  font-size: 0.75rem;
  color: var(--ade-muted);
  margin: 0;
}

/* ── Archive page ─────────────────────────────────── */

.archive-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  max-width: 52rem;
  margin: 3rem auto;
  padding: 0 1.5rem;
  align-items: start;
}

.archive-layout h1 {
  font-size: 2.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.archive-sidebar h4 {
  font-family: var(--ade-font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ade-muted);
  margin-bottom: 0.75rem;
  margin-top: 3.5rem;
}

.post-row {
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.post-row a {
  font-size: 1rem;
  color: var(--ade-ink);
  text-decoration: none;
}

.post-row a:hover {
  color: var(--ade-primary);
}

.post-row .post-date {
  font-family: var(--ade-font-ui);
  font-size: 0.75rem;
  color: var(--ade-muted);
}

.cat-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  padding: 0.35rem 0.6rem;
  margin-bottom: 0.2rem;
  font-family: var(--ade-font-ui);
  font-size: 0.8rem;
  color: var(--ade-muted);
  cursor: pointer;
  border-radius: 0;
  transform: none;
}

.cat-btn:hover {
  color: var(--ade-ink);
}

.cat-btn.active {
  color: var(--ade-primary);
  border-left-color: var(--ade-primary);
}
