/* ─── Container width variants ────────────────────────────────────────────── */
/*
  All three extend the base .container grid from base.css.
  They only override grid-template-columns to set the content column width.
  To change how wide the content area is, edit the min() value below.
*/

/* Default — wide layout for listing/index pages */
.sketchbook-container {
  grid-template-columns:
    [full-start] minmax(2rem, 1fr)
    [content-start] min(968px, 100% - 3rem)
    [content-end] minmax(0.5rem, 1fr)
    [full-end];
  padding-top: 1.5rem;
}

.sketchbook-container--home {
  grid-template-columns:
    [full-start] minmax(2rem, 1fr)
    [content-start] min(820px, 100% - 3rem)
    [content-end] minmax(0.5rem, 1fr)
    [full-end];
}

/* Constrain images inside content containers */
.sketchbook-container img {
  max-width: 100%;
  height: auto;
}

/* Narrow — for single-column reading pages (most sketch posts) */
.sketchbook-container--narrow {
  grid-template-columns:
    [full-start] minmax(2rem, 1fr)
    [content-start] min(48rem, 100% - 3rem)
    [content-end] minmax(0.5rem, 1fr)
    [full-end];
}

/* Scrollspy — same reading width as --narrow; the side nav is fixed to the
   viewport (see .scrollspy in nav.css), so the content column doesn't need
   extra width reserved for it. */
.sketchbook-container--scrollspy {
  grid-template-columns:
    [full-start] minmax(2rem, 1fr)
    [content-start] min(48rem, 100% - 3rem)
    [content-end] minmax(0.5rem, 1fr)
    [full-end];
}


/* ─── Sketch hero (_includes/layout/sketch-hero.html) ────────────────────── */
.sketch-hero {
  position: relative;
  height: clamp(240px, 38vh, 380px);
  overflow: hidden;
  background: var(--near-black);
  border-bottom: 3px solid var(--terra);
}

.sketch-hero--policy { border-bottom-color: var(--indigo); }

.sketch-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

/* Dark gradient from the bottom so the title reads over any image */
.sketch-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.05) 100%);
}

/* Title and credit line up with the content column below */
.sketch-hero-inner {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  width: min(48rem, 100% - 3rem);
  margin: 0 auto;
  padding-bottom: 1.25rem;
}

.sketch-hero-title {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.1;
  color: var(--white);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

.sketch-hero-credit {
  margin: 0.4rem 0 0;
  font-size: var(--text-xs);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.78);
}

.sketch-hero-credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* The hero carries the title, so hide the in-content H1 and its accent line */
.has-sketch-hero .sketchbook-container h1:first-of-type,
.has-sketch-hero .sketchbook-container .section-accent:first-of-type {
  display: none;
}

.has-sketch-hero .sketch-info {
  margin-top: 0;
}


/* ─── Footer ──────────────────────────────────────────────────────────────── */
footer,
.site-footer {
  background-color: var(--black);
  color: var(--muted-gray);
  border-top: 2px solid var(--terra);
}

footer a,
.site-footer a {
  color: var(--mesa);
  text-decoration: none;
}

footer a:hover,
.site-footer a:hover {
  color: var(--sunset);
}

footer h4,
footer h5,
.site-footer h4,
.site-footer h5 {
  color: var(--rule-gray);
}

.site-footer-sketchbook {
  margin-top: 4rem;
  border-top: 2px solid var(--sunset);
  background: var(--near-black);
}

.site-footer-sketchbook .footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.5rem 1rem;
  background-color: transparent;
}

.site-footer-sketchbook .footer-bottom-brand,
.site-footer-sketchbook .footer-bottom-contact {
  color: var(--muted-gray);
  font-size: var(--text-xs);
}

.site-footer-sketchbook .footer-brand {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--terra);
}

.site-footer-sketchbook .footer-sep {
  color: var(--dark-gray);
}

.site-footer-sketchbook .footer-heart {
  color: var(--unm-cherry);
}

.site-footer-sketchbook .footer-bottom-contact a {
  color: var(--mesa);
  text-decoration: none;
}

.site-footer-sketchbook .footer-bottom-contact a:hover {
  color: var(--sunset);
}


/* ─── Page title ──────────────────────────────────────────────────────────── */
/* Larger than the body h2 defined in typography.css */
.sketchbook-container > h1:first-child,
.section-intro > h1:first-child {
  margin-top: 0;
  padding-top: 1.5rem;
  margin-bottom: 0.25rem;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.15;
}

.sketchbook-container > h1:first-child + p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.65;
  color: var(--mid-gray);
  max-width: 760px;
  margin: 0.75rem 0 1.75rem;
}


/* ─── Section accent bar ──────────────────────────────────────────────────── */
/* Thin colored rule that appears below the page title */
p:has(> .section-accent) {
  margin: 0;
  padding: 0;
  line-height: 0;
}

.section-accent {
  display: block;
  width: 100%;
  height: 3px;
  margin: 1.25rem 0 2rem 0;
}

.section-accent.teach    { background: linear-gradient(90deg, var(--terra)     0%, var(--terra)     60%, transparent 100%); }
.section-accent.policy   { background: linear-gradient(90deg, var(--indigo)    0%, var(--indigo)    60%, transparent 100%); }
.section-accent.research { background: linear-gradient(90deg, var(--turquoise) 0%, var(--turquoise) 60%, transparent 100%); }
.section-accent.default  { background: linear-gradient(90deg, var(--terra) 0%, var(--mesa) 40%, var(--sunset) 68%, transparent 100%); }


/* ─── Home page intro & pull quote ───────────────────────────────────────── */
.section-intro {
  max-width: 760px;
  margin: 0 auto 2rem;
}

.sketchbook-pull {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.85rem, 3.2vw, 2.55rem);
  color: var(--dark-gray);
  line-height: 1.18;
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  border-left: 3px solid var(--terra);
  width: 100%;
}


/* ─── Feature row include ────────────────────────────────────────────────── */
.feature-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.feature-row-text {
  flex: 1 1 auto;
  max-width: 50%;
  min-width: 0;
}

.feature-row-text--wide {
  max-width: 60%;
}

.feature-row-text--narrow {
  max-width: 40%;
}

.feature-row h5 {
  margin-top: 0;
}

.feature-row p {
  margin-bottom: 0;
}

.feature-row-action {
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .feature-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .feature-row-text,
  .feature-row-text--wide,
  .feature-row-text--narrow {
    max-width: none;
  }
}


/* ─── Print ───────────────────────────────────────────────────────────────────
   Sketch pages print as clean handouts: content, summary box, and the
   "Using This Sketch" citation; no navigation, search, or related cards. */
@media print {
  .navbar,
  .search-overlay,
  .scrollspy,
  .sketch-bottom-nav,
  .sketch-related,
  .sketch-print-button,
  .site-footer {
    display: none !important;
  }

  body {
    font-size: 11pt;
    color: #000;
    background: #fff;
  }

  .sketchbook-container,
  .sketchbook-container--narrow,
  .sketchbook-container--scrollspy,
  .scrollspy-wrapper,
  .scrollspy-content {
    max-width: none;
    width: auto;
    margin: 0;
    padding: 0;
  }

  .sketch-info,
  .callout,
  .sketch-license {
    break-inside: avoid;
  }

  h2,
  h3 {
    break-after: avoid;
  }

  .sketch-license {
    background: none;
    border-top: 1px solid #999;
    padding: 0.5rem 0 0;
  }

}
