/* Friends of the Fallbrook Library: homepage preview
   Colours: teal #024d68 (the ground their white logo is drawn for), purple #6850a1 (the
   FRIENDS outline in the logo), sky #c7d6ec (the open book's pages). Every text pair >= 4.5:1. */
:root {
  --teal: #024d68;
  --teal-deep: #013a4f;
  --purple: #6850a1;
  --purple-deep: #4a3880;
  --sky: #c7d6ec;
  --sky-pale: #eaf0f8;
  --paper: #f6f4ef;
  --ink: #1d2230;
  --ink-soft: #454b5c;
  --rule: rgba(29, 34, 48, .12);
  --serif: 'Gentium Book Plus', Georgia, serif;
  --sans: 'Mukta', 'Segoe UI', sans-serif;
  --gutter: 16px;
  --section: 64px;
}
@media (min-width: 700px) { :root { --gutter: 32px; --section: 88px; } }
@media (min-width: 1100px) { :root { --section: 104px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: #fff; color: var(--ink); font: 400 18px/1.55 var(--sans); }
@media (min-width: 1100px) { body { font-size: 19px; } }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0 0 16px; overflow-wrap: break-word; }
h2 { font-size: clamp(30px, 4vw, 42px); }
h3 { font-size: 23px; }
p { margin: 0 0 16px; }
a { color: var(--purple); text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.site-header :focus-visible, .hero :focus-visible, .notice :focus-visible, .site-footer :focus-visible { outline-color: #fff; }
address { font-style: normal; }
cite { font-style: italic; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: #fff; color: var(--teal); padding: 10px 16px; font-weight: 600; }
.skip:focus { top: 8px; }
main:focus { outline: none; }
.small { font-size: 16px; color: var(--ink-soft); }

/* Buttons: square, 2px border, fill swap on mouse hover, 1px press */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 22px; border: 2px solid transparent; border-radius: 0; font: 600 17px/1.2 var(--sans); text-decoration: none; text-align: center; transition: background-color .15s, color .15s, border-color .15s; }
.btn:active { transform: translateY(1px); }
.btn-solid { background: #fff; border-color: #fff; color: var(--teal); }
.btn-line { background: transparent; border-color: #fff; color: #fff; }
.btn-dark { background: var(--purple); border-color: var(--purple); color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .btn-solid:hover { background: var(--sky); border-color: var(--sky); }
  .btn-line:hover { background: #fff; color: var(--teal); }
  .btn-dark:hover { background: var(--purple-deep); border-color: var(--purple-deep); }
  a:hover { text-decoration-thickness: 2px; }
}
.text-link { font-weight: 600; }

/* Closure notice */
.notice { background: var(--purple-deep); color: #fff; font-size: 16px; line-height: 1.45; }
.notice p { margin: 0 auto; padding-top: 12px; padding-bottom: 12px; }
.notice[hidden] { display: none; }

/* Header */
.site-header { background: var(--teal); color: #fff; position: relative; z-index: 20; }
.header-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: block; width: 168px; }
.brand img { width: 100%; }
.main-nav { justify-self: end; }
.menu-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.55); border-radius: 0; font: 600 17px var(--sans); cursor: pointer; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; transition: transform .2s, background-color .2s; }
.menu-icon::before, .menu-icon::after { content: ''; position: absolute; left: 0; }
.menu-icon::before { top: -6px; } .menu-icon::after { top: 6px; }
.menu-btn[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu a { color: #fff; text-decoration: none; font-weight: 600; }
.header-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.header-actions .btn { min-height: 44px; padding: 8px 12px; font-size: 16px; }

.js .menu { position: absolute; left: 0; right: 0; top: 100%; background: var(--teal-deep); border-top: 1px solid rgba(255,255,255,.2); visibility: hidden; opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s, visibility 0s .2s; }
.js .menu.open { visibility: visible; opacity: 1; transform: none; transition: opacity .2s, transform .2s; }
.menu ul { max-width: 1200px; margin: 0 auto; padding: 8px var(--gutter) 16px; }
.menu li + li { border-top: 1px solid rgba(255,255,255,.15); }
.menu a { display: block; padding: 12px 0; font-size: 18px; }
html:not(.js) .menu-btn { display: none; }

@media (min-width: 700px) {
  .header-row { grid-template-columns: auto 1fr auto; }
  .brand { width: 200px; }
  .header-actions { grid-column: auto; display: flex; }
}
@media (min-width: 1080px) {
  .menu-btn { display: none; }
  .main-nav { justify-self: center; }
  .js .menu, .menu { position: static; visibility: visible; opacity: 1; transform: none; background: none; border: 0; transition: none; }
  .menu ul { display: flex; gap: 28px; padding: 0; }
  .menu li + li { border: 0; }
  .menu a { padding: 8px 0; font-size: 17px; border-bottom: 2px solid transparent; }
  .brand { width: 216px; }
}
@media (min-width: 1080px) and (hover: hover) and (pointer: fine) {
  .menu a:hover { border-bottom-color: var(--sky); }
}

/* Hero: teal ground continues from the header, photo stacked like the pages of the logo's book */
.hero { background: var(--teal); color: #fff; padding: 8px 0 56px; }
.hero-grid { display: grid; gap: 28px; }
.hero-photo { margin: 0 12px 12px 0; order: -1; box-shadow: 6px 6px 0 var(--sky), 12px 12px 0 rgba(199, 214, 236, .4); }
.hero-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); margin-bottom: 16px; max-width: 13em; }
.lede { font-family: var(--serif); font-style: italic; font-size: clamp(19px, 2vw, 23px); line-height: 1.45; color: var(--sky-pale); max-width: 30em; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 420px) { .hero-actions .btn { flex: 1 1 100%; } }
@media (min-width: 700px) {
  .hero { padding: 24px 0 var(--section); }
  .hero-photo { margin: 0 16px 16px 0; box-shadow: 8px 8px 0 var(--sky), 16px 16px 0 rgba(199, 214, 236, .4); }
}
@media (min-width: 900px) {
  .hero { padding-top: 32px; }
  .hero-grid { grid-template-columns: 5fr 6fr; align-items: center; gap: 56px; }
  .hero-photo { order: 0; margin: 0 16px 16px 0; box-shadow: 8px 8px 0 var(--sky), 16px 16px 0 rgba(199, 214, 236, .4); }
  .hero-photo img { aspect-ratio: 15 / 8; }
}

/* Events */
.events { padding: var(--section) 0; }
.events-grid { display: grid; gap: 32px; }
.events-head p { color: var(--ink-soft); max-width: 26em; }
.plain-links { list-style: none; padding: 0; margin: 0; }
.plain-links li { padding: 6px 0; }
.event-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.event { display: grid; grid-template-columns: 76px 1fr; gap: 16px; padding: 24px 0; border-bottom: 1px solid var(--rule); }
.event-date { margin: 0; display: grid; justify-items: start; line-height: 1; color: var(--purple); font-variant-numeric: lining-nums; }
.event-date .m { font: 600 17px var(--sans); }
.event-date .d { font: 400 46px/1 var(--serif); margin: 2px 0 6px; }
.event-date .y { font: 400 15px var(--sans); color: var(--ink-soft); }
.event h3 { margin-bottom: 8px; }
.event p { margin-bottom: 8px; }
.event-note { padding: 20px 0; color: var(--ink-soft); font-size: 17px; }
.event-note p { margin: 0; }
.event-empty { padding: 24px 0; }
@media (min-width: 900px) {
  .events-grid { grid-template-columns: 4fr 7fr; gap: 64px; }
  .event { grid-template-columns: 104px 1fr; gap: 24px; }
  .event-date .d { font-size: 56px; }
}

/* Bookstore */
.bookstore { background: var(--paper); padding: var(--section) 0; }
.store-grid { display: grid; gap: 40px; }
.status { display: inline-block; margin: 4px 0 20px; padding: 6px 12px; border-left: 4px solid var(--purple); background: #fff; font-weight: 600; }
.status.open { border-left-color: var(--teal); color: var(--teal); }
.hours { border-collapse: collapse; margin-bottom: 20px; width: 100%; max-width: 420px; }
.hours caption { text-align: left; font-weight: 600; padding-bottom: 6px; }
.hours th, .hours td { text-align: left; padding: 10px 0; border-top: 1px solid var(--rule); font-weight: 400; vertical-align: top; }
.hours td { padding-left: 16px; white-space: nowrap; }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: 1px solid var(--rule); }
.store-info address { line-height: 1.75; }
.store-photos { position: relative; }
@media (max-width: 699px) { .ph-small { display: none; } }
.ph-main { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ph-small { position: absolute; left: -4px; bottom: 0; width: 52%; aspect-ratio: 4 / 3; object-fit: cover; border: 6px solid var(--paper); }
.store-lists { display: grid; gap: 40px; margin-top: 56px; }
.ruled { list-style: none; margin: 0 0 16px; padding: 0; border-top: 2px solid var(--ink); }
.ruled li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.volunteer { border-top: 2px solid var(--ink); padding-top: 16px; }
.volunteer .btn { margin: 8px 0 12px; }
.store-lists h3 { margin-bottom: 12px; }
@media (min-width: 700px) {
  .store-photos { margin: 0 0 18% 12%; }
  .ph-small { left: -12%; bottom: -18%; width: 50%; }
  .store-lists { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .store-grid { grid-template-columns: 5fr 6fr; align-items: start; gap: 56px; }
  .store-photos { margin-left: 0; }
  .ph-small { left: -15%; }
  .volunteer { grid-column: 1 / -1; }
}
@media (min-width: 1080px) {
  .store-lists { grid-template-columns: 1.2fr 1fr 1fr; gap: 48px; margin-top: 80px; }
  .volunteer { grid-column: auto; }
}

/* Join and give */
.join { padding: var(--section) 0; }
.join-grid { display: grid; gap: 56px; }
.join p { max-width: 30em; }
.price-list { list-style: none; margin: 24px 0 28px; padding: 0; max-width: 520px; }
.price-list li { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.price-list li:first-child { border-top: 2px solid var(--ink); }
.tier { font-family: var(--serif); font-size: 22px; }
.leader { flex: 1; border-bottom: 2px dotted rgba(29, 34, 48, .3); transform: translateY(-5px); min-width: 16px; }
.price { font-weight: 600; white-space: nowrap; font-variant-numeric: lining-nums; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.facts { margin: 24px 0 28px; max-width: 520px; border-top: 2px solid var(--ink); }
.facts div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 600; }
@media (min-width: 900px) {
  .join-grid { grid-template-columns: 1fr 1fr; gap: 0; }
  .join-members { padding-right: 56px; }
  .join-give { padding-left: 56px; border-left: 1px solid var(--rule); }
}

/* Library hours */
.library { background: var(--sky-pale); padding: var(--section) 0; }
.library-grid { display: grid; gap: 32px; }
.library address { font-size: 20px; line-height: 1.6; margin-bottom: 16px; }
.lib-hours { border-collapse: collapse; width: 100%; max-width: 560px; background: #fff; border: 1px solid var(--rule); }
.lib-hours th, .lib-hours td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--rule); font-weight: 400; }
.lib-hours td { text-align: right; font-variant-numeric: lining-nums; }
.lib-hours tr:last-child th, .lib-hours tr:last-child td { border-bottom: 0; }
.lib-hours tr.today th, .lib-hours tr.today td { background: var(--teal); color: #fff; font-weight: 600; }
.lib-hours .today-tag { font-weight: 400; color: var(--sky); margin-left: 8px; font-size: 15px; }
@media (min-width: 900px) { .library-grid { grid-template-columns: 4fr 7fr; gap: 64px; align-items: start; } }

/* About */
.about { padding: var(--section) 0; }
.about-grid { display: grid; gap: 0; }
.about-grid > * { border-top: 2px solid var(--ink); padding-top: 24px; }
.about-grid > div { border-top: 0; padding-top: 0; }
.about-lede { font-family: var(--serif); font-size: clamp(22px, 2.4vw, 28px); line-height: 1.4; max-width: 28em; }
.doc-links { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 0 32px; }
.doc-links li { border-bottom: 1px solid var(--rule); }
.doc-links a { display: block; padding: 12px 0; font-weight: 600; }
@media (min-width: 700px) { .doc-links { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .about-grid { grid-template-columns: 4fr 7fr; gap: 64px; } .about-grid > div { border-top: 2px solid var(--ink); padding-top: 24px; } }

/* Footer */
.site-footer { background: var(--teal); color: #fff; padding: 56px 0 24px; font-size: 17px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 32px; }
.footer-logo { width: 220px; margin-bottom: 16px; }
.motto { font-family: var(--serif); font-style: italic; color: var(--sky-pale); max-width: 24em; }
.foot-h { font-size: 21px; margin-bottom: 10px; color: var(--sky); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li a { display: inline-block; padding: 6px 0; }
.site-footer address { line-height: 1.7; }
.footer-base { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.2); font-size: 15px; color: var(--sky-pale); display: grid; gap: 4px; }
.footer-base p { margin: 0; }
.footer-base p:first-child a { margin-left: 12px; }
@media (min-width: 700px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: 48px; }
  .footer-base { grid-template-columns: 1fr auto; }
}

/* Very narrow screens (320px phones, 390px at 200% zoom) */
@media (max-width: 359px) {
  .brand { width: 104px; }
  .header-row { gap: 10px 12px; }
  .menu-btn { padding: 8px 11px; }
  .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .header-actions { grid-template-columns: 1fr; }
  .event { grid-template-columns: 1fr; gap: 6px; }
  .event-date { display: flex; gap: 6px; align-items: baseline; }
  .event-date .d { font-size: 28px; margin: 0; }
  .hours td { white-space: normal; }
}
.hero-grid > *, .events-grid > *, .store-grid > *, .store-lists > *, .join-grid > *, .library-grid > *, .about-grid > *, .footer-grid > * { min-width: 0; }
@media (max-width: 359px) {
  .lib-hours th, .lib-hours td { padding: 10px 8px; }
  .price-list li { flex-wrap: wrap; }
  .leader { display: none; }
  .price { margin-left: auto; }
}
.event-body { min-width: 0; }
.event p { overflow-wrap: anywhere; }
@media (max-width: 359px) {
  .lib-hours tr { display: grid; border-bottom: 1px solid var(--rule); }
  .lib-hours th, .lib-hours td { border: 0; text-align: left; padding: 4px 10px; }
  .lib-hours th { padding-top: 10px; }
  .lib-hours td { padding-bottom: 10px; }
}
