/* The Hours Shelf - independent guide to Naperville Public Library hours */
:root {
  --paper: #FAF7F0;
  --paper-2: #F2ECDD;
  --paper-3: #E9E0CB;
  --green: #2F4F3A;
  --green-dk: #22392A;
  --brick: #9C3D2E;
  --brick-dk: #7E2F23;
  --ochre: #B5853A;
  --ink: #222222;
  --muted: #55524A;
  --rule: #D8CDB4;
  --focus: #9C3D2E;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Work Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4rem;
  --measure: 70ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}
img, svg, iframe { max-width: 100%; }
img { height: auto; }

a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brick); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4 { font-family: var(--serif); color: var(--green-dk); line-height: 1.25; margin: 0 0 var(--s3); }
h1 { font-size: clamp(1.9rem, 5.5vw, 2.85rem); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 3.6vw, 1.9rem); font-weight: 600; margin-top: var(--s7); }
h3 { font-size: 1.22rem; font-weight: 600; margin-top: var(--s5); }
p, ul, ol { margin: 0 0 var(--s4); }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: var(--s2); }
strong { font-weight: 600; }
small { font-size: .875rem; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--green); color: #fff; padding: var(--s2) var(--s4); z-index: 10; }
.skip:focus { left: var(--s4); top: var(--s4); color: #fff; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 var(--s4); }
.prose { max-width: var(--measure); }

/* Book-spine divider: a shelf of colored spines of varying heights */
.spine-rule {
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='18'%3E%3Crect x='0' y='4' width='9' height='14' fill='%232F4F3A'/%3E%3Crect x='11' y='7' width='6' height='11' fill='%239C3D2E'/%3E%3Crect x='19' y='2' width='11' height='16' fill='%23B5853A'/%3E%3Crect x='32' y='6' width='7' height='12' fill='%2322392A'/%3E%3Crect x='41' y='3' width='10' height='15' fill='%239C3D2E'/%3E%3Crect x='53' y='8' width='5' height='10' fill='%232F4F3A'/%3E%3Crect x='60' y='5' width='12' height='13' fill='%23D8CDB4'/%3E%3Crect x='74' y='1' width='8' height='17' fill='%232F4F3A'/%3E%3Crect x='84' y='6' width='9' height='12' fill='%23B5853A'/%3E%3Crect x='95' y='4' width='6' height='14' fill='%237E2F23'/%3E%3Crect x='103' y='7' width='11' height='11' fill='%2322392A'/%3E%3Crect x='116' y='3' width='7' height='15' fill='%239C3D2E'/%3E%3Crect x='125' y='9' width='6' height='9' fill='%23B5853A'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: left bottom;
  border-bottom: 3px solid var(--green-dk);
}
.spine-rule.thin { height: 12px; background-size: 88px 12px; border-bottom-width: 2px; margin: var(--s6) 0; }

/* Header */
.site-header { background: var(--paper); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); padding-top: var(--s4); padding-bottom: var(--s3); }
.brand { display: inline-block; line-height: 0; }
.brand img { width: 240px; max-width: 100%; height: auto; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); }
.nav li { margin: 0; }
.nav a { display: inline-block; padding: var(--s1) 0; font-weight: 500; font-size: .95rem; color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--green); border-bottom-color: var(--brick); }

/* Breadcrumbs & meta */
.crumbs { font-size: .875rem; color: var(--muted); margin: var(--s5) 0 var(--s3); }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s1); }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: var(--s1); color: var(--rule); }
.byline { font-size: .9rem; color: var(--muted); margin-bottom: var(--s5); }
.kicker { font-family: var(--sans); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--brick); margin: var(--s6) 0 var(--s2); }
.lede { font-size: 1.15rem; color: #2b2b2b; }

main { padding-bottom: var(--s8); }

/* Layout with sidebar TOC on wide screens */
.layout { display: block; }
@media (min-width: 1024px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: var(--s7); align-items: start; }
  .layout aside { position: sticky; top: var(--s5); }
}

/* Quick answer */
.quick {
  background: #fff;
  border: 1px solid var(--rule);
  border-left: 6px solid var(--green);
  padding: var(--s5);
  margin: var(--s5) 0;
  max-width: var(--measure);
}
.quick h2 { margin-top: 0; font-size: 1.3rem; }
.quick ul { margin-bottom: var(--s3); }
.quick .src { font-size: .85rem; color: var(--muted); margin: 0; }

.callout {
  background: var(--paper-2);
  border-top: 3px solid var(--brick);
  padding: var(--s4) var(--s5);
  margin: var(--s5) 0;
  max-width: var(--measure);
}
.callout p:last-child { margin-bottom: 0; }
.callout-title { font-family: var(--serif); font-weight: 600; color: var(--brick-dk); margin-bottom: var(--s2); display: flex; align-items: center; gap: var(--s2); }
.callout-title svg { flex: none; }

/* Open now widget */
.open-now {
  background: var(--green);
  color: #fff;
  padding: var(--s5);
  margin: var(--s6) 0;
  border-radius: 4px 4px 0 0;
  border-bottom: 6px solid var(--brick);
  max-width: var(--measure);
}
.open-now h2 { color: #fff; margin-top: 0; font-size: 1.45rem; }
.open-now a { color: #fff; }
.on-clock { font-size: .92rem; opacity: .92; margin-bottom: var(--s4); }
.on-list { list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; gap: var(--s3); }
.on-item {
  background: var(--paper);
  color: var(--ink);
  padding: var(--s3) var(--s4);
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s1) var(--s3);
  align-items: center;
  border-left: 5px solid var(--green);
}
.on-name { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; color: var(--green-dk); }
.on-badge { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: .15rem .55rem; border-radius: 2px; background: var(--green); color: #fff; white-space: nowrap; }
.on-detail { grid-column: 1 / -1; font-size: .93rem; color: var(--muted); }
.on-closed { border-left-color: var(--brick); }
.on-closed .on-badge { background: var(--brick); }
.on-soon { border-left-color: var(--ochre); }
.on-soon .on-badge { background: #F3E3BD; color: #4A3608; }
.on-check { border-left-color: var(--ochre); }
.on-check .on-badge { background: #F3E3BD; color: #4A3608; }
.on-static { background: var(--paper); color: var(--ink); padding: var(--s3); margin-bottom: var(--s4); }
.on-static p { font-size: .92rem; }
.on-note { font-size: .85rem; opacity: .92; margin: 0; }
[hidden] { display: none !important; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: var(--s4) 0 var(--s5); border: 1px solid var(--rule); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
caption { text-align: left; font-family: var(--serif); font-weight: 600; color: var(--green-dk); padding: var(--s3) var(--s3) var(--s2); }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--paper-3); vertical-align: top; }
thead th { background: var(--paper-2); font-weight: 600; color: var(--green-dk); border-bottom: 2px solid var(--green); white-space: nowrap; }
tbody th { font-weight: 600; white-space: nowrap; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
td.closed { color: var(--brick-dk); font-weight: 600; }
.on-static table { font-size: .88rem; }
.on-static th, .on-static td { padding: .4rem .5rem; }

/* Branch cards */
.branch-grid { display: grid; gap: var(--s5); margin: var(--s5) 0; }
@media (min-width: 768px) { .branch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.branch-card { background: #fff; border: 1px solid var(--rule); border-top: 5px solid var(--green); padding: var(--s4); }
.branch-card:nth-child(2) { border-top-color: var(--brick); }
.branch-card:nth-child(3) { border-top-color: var(--ochre); }
.branch-card h3 { margin-top: 0; }
.branch-card address { font-style: normal; font-size: .93rem; color: var(--muted); margin-bottom: var(--s3); }
.branch-card table { font-size: .9rem; }
.branch-card th, .branch-card td { padding: .4rem .3rem; }
.branch-card .table-wrap { border: 0; margin: 0; }

.contact-card { background: #fff; border: 1px solid var(--rule); padding: var(--s4) var(--s5); margin: var(--s4) 0; }
.contact-card h3 { margin-top: 0; }
.contact-card .label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brick); font-weight: 600; margin-bottom: var(--s2); }
.contact-card dl { margin: 0 0 var(--s3); display: grid; grid-template-columns: max-content 1fr; gap: var(--s1) var(--s4); font-size: .95rem; }
.contact-card dt { font-weight: 600; }
.contact-card dd { margin: 0; }
.map { width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--rule); display: block; background: var(--paper-2); }
@media (max-width: 420px) { .contact-card dl { grid-template-columns: 1fr; } .contact-card dd { margin-bottom: var(--s2); } }

/* TOC */
.toc { background: var(--paper-2); padding: var(--s4) var(--s5); margin: var(--s5) 0; border-left: 4px solid var(--brick); max-width: var(--measure); }
.toc h2 { font-size: 1.1rem; margin: 0 0 var(--s2); }
.toc ol { margin: 0; padding-left: 1.2rem; font-size: .95rem; }
.toc li { margin-bottom: var(--s1); }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; max-width: var(--measure); }
.steps li { counter-increment: step; position: relative; padding-left: 2.6rem; margin-bottom: var(--s4); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: .1rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--green); color: #fff; font-family: var(--serif); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .95rem; }

/* FAQ */
.faq { max-width: var(--measure); }
.faq details { border-bottom: 1px solid var(--rule); padding: var(--s3) 0; }
.faq summary { cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 1.08rem; color: var(--green-dk); list-style-position: outside; }
.faq summary:hover { color: var(--brick); }
.faq details p { margin: var(--s3) 0 var(--s2); }

/* Related & sources */
.related { margin-top: var(--s7); }
.related ul { list-style: none; padding: 0; display: grid; gap: var(--s3); }
@media (min-width: 768px) { .related ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.related li { margin: 0; background: #fff; border: 1px solid var(--rule); border-left: 5px solid var(--brick); padding: var(--s3) var(--s4); }
.related a { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.related span { display: block; font-size: .9rem; color: var(--muted); }
.sources { font-size: .92rem; max-width: var(--measure); }
.sources li { margin-bottom: var(--s1); }

/* Footer */
.site-footer { background: var(--paper-2); margin-top: var(--s7); }
.site-footer .wrap { padding-top: var(--s5); padding-bottom: var(--s6); }
.site-footer p { font-size: .92rem; max-width: var(--measure); }
.footer-nav ul { list-style: none; padding: 0; margin: 0 0 var(--s4); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: .92rem; }
.footer-nav li { margin: 0; }
.footer-cols { display: grid; gap: var(--s4); }
@media (min-width: 768px) { .footer-cols { grid-template-columns: 1fr 1fr; } }
.footer-cols h2 { font-size: 1rem; margin: 0 0 var(--s2); }
.indep { border-left: 4px solid var(--brick); padding-left: var(--s3); }
.copy { color: var(--muted); }

/* 404 */
.notfound { text-align: left; padding-top: var(--s7); }

@media print {
  .site-header nav, .open-now, .map, .site-footer .footer-nav { display: none; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* long domains in emails and URLs must wrap on phones */
a[href^="mailto:"], a[href^="http"] { overflow-wrap: anywhere; } /* long domains */
