/* Colors taken from the KOMU logo */
:root {
  --navy: #030434;
  --navy-2: #0e1660;
  --sky: #a8cbec;
  --sky-light: #e8f1fb;
  --gold: #fda730;
  --gold-dark: #d9860f;
  --ink: #1c2033;
  --muted: #5b6178;
  --white: #ffffff;
  --line: #dbe4f0;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(3, 4, 52, .10);
  --font-head: "Cinzel", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--white); line-height: 1.65; font-size: 17px; }
img { max-width: 100%; display: block; }
a { color: var(--navy-2); }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy); line-height: 1.2; margin: 0 0 .6em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h3 { font-size: 1.1rem; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(820px, 100% - 32px); }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 700; color: var(--gold-dark); margin: 0 0 .5rem; }

/* Top bar */
/* Event banner above the top bar (Announcements → Event banner) */
.event-bar { background: #2e2716; color: #f3ead6; border-bottom: 1px solid rgba(253,167,48,.25); font-size: .95rem; transition: opacity .25s, margin-top .25s; }
.event-bar.is-closing { opacity: 0; }
.event-bar__inner { display: flex; align-items: center; gap: .9rem; padding: .7rem 0; }
.event-bar__label { flex: none; padding: .28rem .65rem; border-radius: 6px; background: var(--navy); color: var(--white); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.event-bar__text { flex: 1; margin: 0; line-height: 1.45; }
.event-bar__text a { margin-left: .5rem; color: #fff6e0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.event-bar__text a:hover { color: var(--gold); }
.event-bar__close { flex: none; width: 36px; height: 36px; margin-right: -8px; border: 0; border-radius: 50%; background: none; color: #f3ead6; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.event-bar__close:hover { background: rgba(255,255,255,.1); }
.event-bar__close:focus-visible, .event-bar__text a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 640px) {
  .event-bar { font-size: .88rem; }
  .event-bar__inner { align-items: flex-start; gap: .6rem; padding: .6rem 0; }
  .event-bar__label { margin-top: .1rem; font-size: .66rem; }
  .event-bar__text a { display: inline-block; margin: .15rem 0 0; }
  .event-bar__close { margin-top: -6px; }
}
.topbar { background: var(--navy); color: var(--sky); font-size: .85rem; }
.topbar__inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .45rem 0; flex-wrap: wrap; }
.topbar a { color: var(--sky); text-decoration: none; }
.topbar__links { display: flex; gap: 1.2rem; align-items: center; }
.topbar__status { padding: .1rem .6rem; border-radius: 99px; background: rgba(255,255,255,.1); font-weight: 600; }
.topbar__status.is-open { background: var(--gold); color: var(--navy); }
.topbar__status { white-space: nowrap; }

/* Header */
.header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.header.is-scrolled { box-shadow: var(--shadow); }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 78px; }
.brand img { height: 58px; width: auto; }
.nav { display: flex; gap: .3rem; align-items: center; }
.nav a { text-decoration: none; color: var(--navy); font-weight: 600; padding: .5rem .75rem; border-radius: 8px; transition: background .2s, color .2s; }
.nav a:hover, .nav a.is-active { background: var(--sky-light); }
.nav a.nav__cta { background: var(--navy); color: var(--white); }
.nav a.nav__cta:hover { background: var(--gold); color: var(--navy); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 26px; height: 3px; background: var(--navy); margin: 5px 0; border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Hero */
.hero { position: relative; z-index: 3; min-height: 600px; display: flex; align-items: center; color: var(--white); }
.hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, rgba(3,4,52,.94) 0%, rgba(3,4,52,.78) 50%, rgba(14,22,96,.45) 100%); }
.hero__content { position: relative; padding: 5rem 0; }
.hero .eyebrow { color: var(--gold); }
.hero h1 { color: var(--white); font-size: clamp(2.4rem, 6vw, 4.2rem); margin-bottom: .3em; }
.hero h1 span { color: var(--gold); }
.hero__lead { max-width: 600px; font-size: 1.15rem; color: #dbe7f6; margin: 0 0 2rem; }
.hero__lead strong { color: var(--white); }
.hero__more { display: none; }
.rt-mark { background: none; color: var(--gold); font-weight: 600; }

.search { position: relative; display: flex; max-width: 720px; background: var(--white); border-radius: 12px; padding: 6px; box-shadow: 0 15px 40px rgba(0,0,0,.25); }
.search select, .search input { border: 0; font: inherit; color: var(--ink); background: transparent; outline: none; }
.search select { padding: 0 .8rem; border-right: 1px solid var(--line); color: var(--navy); font-weight: 600; cursor: pointer; }
.search input { flex: 1; min-width: 0; padding: .85rem 1rem; }
.search button { border: 0; background: var(--gold); color: var(--navy); font: inherit; font-weight: 700; padding: 0 1.6rem; border-radius: 8px; cursor: pointer; transition: background .2s; }
.search button:hover { background: var(--gold-dark); color: var(--white); }

/* Live search results under the search bar */
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 40; max-height: min(420px, 60vh); overflow-y: auto; padding: 6px; background: var(--white); border-radius: 12px; box-shadow: 0 18px 50px rgba(3,4,52,.3); color: var(--ink); text-align: left; }
.search-results[hidden] { display: none; }
.search .search-result { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; width: 100%; padding: .7rem .85rem; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.search .search-result:hover, .search .search-result.is-active { background: var(--sky-light); color: var(--navy); }
.search-result mark { background: #ffe7bf; color: inherit; border-radius: 3px; padding: 0 1px; }
.search-result__type { flex: none; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.search .search-result--action { font-weight: 700; color: var(--navy); }
.search-results__head { margin: .5rem .85rem .2rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-dark); }
.search-results__head ~ .search-results__head { margin-top: .4rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.search-results__count { color: var(--muted); letter-spacing: .04em; }
.search-results__foot { padding: .6rem .85rem .5rem; border-top: 1px solid var(--line); margin-top: 4px; font-size: .92rem; color: var(--muted); }
.search .search-results__foot button { width: auto; padding: 0; background: none; border: 0; color: var(--navy-2); font: inherit; font-weight: 700; cursor: pointer; }
.search-results__foot a { color: var(--navy-2); font-weight: 700; }
.is-found { animation: found 1.6s ease; }
@keyframes found { 0%, 40% { box-shadow: 0 0 0 4px var(--gold); } 100% { box-shadow: 0 0 0 4px transparent; } }

.hero__stats { display: flex; gap: 2.5rem; margin-top: 2.5rem; flex-wrap: wrap; }
.hero__stats .stat { position: relative; padding-left: .9rem; }
.hero__stats .stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 2px; background: var(--gold); transform-origin: bottom; }
.hero__stats strong { display: block; font-family: var(--font-head); font-size: 1.8rem; color: var(--white); font-variant-numeric: tabular-nums; }
.hero__stats span { color: var(--sky); font-size: .92rem; }

/* Load animation for the highlight numbers: each one rises in after the other, its gold bar
   grows upwards and numbers count up (js/main.js). Skipped for reduced-motion settings. */
.hero__stats.is-animating .stat { opacity: 0; transform: translateY(18px); animation: stat-in .8s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--i) * 160ms + 250ms); }
.hero__stats.is-animating .stat::before { transform: scaleY(0); animation: stat-bar .7s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--i) * 160ms + 350ms); }
.hero__stats.is-animating .stat span { opacity: 0; animation: stat-fade .6s ease forwards; animation-delay: calc(var(--i) * 160ms + 650ms); }
@keyframes stat-in { to { opacity: 1; transform: none; } }
@keyframes stat-bar { to { transform: scaleY(1); } }
@keyframes stat-fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .hero__stats.is-animating .stat, .hero__stats.is-animating .stat::before, .hero__stats.is-animating .stat span { animation: none; opacity: 1; transform: none; }
}

/* Announcements ticker: a seamless, edge-faded marquee. js/main.js repeats the
   items so the loop never shows a gap, and sets the duration from the speed. */
.ticker { background: #f5f6f8; border-bottom: 1px solid #e6e8ee; }
.ticker__inner { display: flex; align-items: center; gap: 2.25rem; height: 132px; }
.ticker__label { flex: none; display: inline-flex; align-items: center; gap: .55rem; margin: 0; padding: .7rem 1.35rem; border-radius: 99px; background: var(--white); border: 1px solid #e2e5ec; box-shadow: 0 2px 6px rgba(3,4,52,.08); font-size: .9rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--navy); }
.ticker__label svg { display: none; width: 22px; height: 22px; fill: none; stroke: var(--navy); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ticker__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(253,167,48,.6); animation: ticker-pulse 2s infinite; }
.ticker__viewport { flex: 1; min-width: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent); }
.ticker__track { display: flex; width: max-content; animation: ticker-scroll var(--ticker-duration, 40s) linear infinite; }
.ticker__track.is-static { animation: none; }
.ticker:hover .ticker__track, .ticker:focus-within .ticker__track { animation-play-state: paused; }
.ticker__group { display: flex; align-items: center; gap: 4.5rem; padding: 0 4.5rem 0 0; margin: 0; list-style: none; }
.ticker__item { display: inline-flex; align-items: center; gap: .8rem; white-space: nowrap; font-size: 1.3rem; font-weight: 600; letter-spacing: -.005em; color: #1f2230; text-decoration: none; }
.ticker__item svg { flex: none; width: 26px; height: 26px; fill: none; stroke: var(--navy); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ticker__arrow { color: var(--gold-dark); opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .2s; }
a.ticker__item:hover { color: var(--navy-2); }
a.ticker__item:hover .ticker__arrow, a.ticker__item:focus-visible .ticker__arrow { opacity: 1; transform: none; }
@keyframes ticker-scroll { to { transform: translateX(-50%); } }
@keyframes ticker-pulse { 70% { box-shadow: 0 0 0 7px rgba(253,167,48,0); } 100% { box-shadow: 0 0 0 0 rgba(253,167,48,0); } }
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
  .ticker__viewport { overflow-x: auto; }
  .ticker__dot { animation: none; }
}

/* Sections */
.section { position: relative; padding: 5.5rem 0; overflow-x: clip; }

/* Line illustrations for the centred headings (js/illustrations.js). Wide screens put
   one drawing either side of the heading; narrower screens, where that space doesn't
   exist, show the first drawing small and centred above the heading. */
.section-art { pointer-events: none; }
.section-art svg { display: block; width: 100%; height: auto; }
.section-art--left { width: clamp(96px, 22vw, 130px); margin: -1rem auto .4rem; }
.section-art--right { display: none; }
@media (min-width: 1180px) {
  .section-art { position: absolute; top: 2.6rem; width: clamp(150px, 11vw, 190px); margin: 0; }
  .section-art--left { left: max(1.5rem, calc(50% - 650px)); }
  .section-art--right { display: block; right: max(1.5rem, calc(50% - 650px)); }
}
/* On the navy Gallery section: light lines, darker shapes */
.section--dark .section-art svg { stroke: var(--sky); }
.section--dark .section-art svg > circle:first-of-type { fill: rgba(255,255,255,.06); }
.section--dark .section-art [fill="#ffffff"] { fill: #141c64; }
.section--dark .section-art [fill="#e8f1fb"] { fill: #1d2675; }

/* Scroll animations (added by js/main.js; skipped when the visitor prefers less motion) */
[data-reveal] { opacity: 0; transition: opacity .75s ease, transform .85s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--reveal-delay, 0ms); will-change: opacity, transform; }
[data-reveal="up"] { transform: translateY(34px); }
[data-reveal="left"] { transform: translateX(-36px); }
[data-reveal="right"] { transform: translateX(36px); }
[data-reveal="zoom"] { transform: scale(.94) translateY(20px); }
[data-reveal="fade"] { transform: none; }
[data-reveal].is-revealed { opacity: 1; transform: none; }
.section--tint { background: var(--sky-light); }
.section--dark { background: var(--navy); color: var(--sky); }
.section--dark h2 { color: var(--white); }
.section--dark .eyebrow { color: var(--gold); }
.section__head { text-align: center; max-width: 700px; margin: 0 auto 2.8rem; }
.section__head p:not(.eyebrow) { color: var(--muted); }

/* About */
.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: 4rem; align-items: center; }
.about__text p { color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .6rem; }
.checklist li { padding-left: 1.9rem; position: relative; font-weight: 500; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .3em; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23030434' stroke-width='4'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center/70% no-repeat; }
.about { grid-template-columns: 1.25fr 1fr; }
.about__media { position: relative; margin: 0; justify-self: center; width: min(100%, 440px); }
/* Portrait frame for the librarian's photo; faces sit near the top of a photo, so keep the top. */
.about__media img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 4 / 5; object-fit: cover; object-position: center 20%; width: 100%; }
.about__person { position: absolute; left: -24px; right: 24px; bottom: -24px; display: grid; gap: .15rem; background: var(--navy); color: var(--sky); padding: 1.1rem 1.4rem; border-radius: var(--radius); border-top: 4px solid var(--gold); box-shadow: var(--shadow); }
.about__person strong { color: var(--white); font-family: var(--font-head); font-size: 1.2rem; line-height: 1.25; }
.about__person span { color: var(--gold); font-weight: 600; font-size: .92rem; letter-spacing: .02em; }
.about__vision { margin-top: 1.8rem; padding: 1.1rem 1.3rem; border-left: 4px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0; background: var(--sky-light); }
.about__vision strong { display: block; color: var(--navy); font-family: var(--font-head); margin-bottom: .3rem; }
.about__vision span { color: var(--muted); font-size: .97rem; }
.about__text strong, .about__vision strong { color: var(--navy); }
.about .rt-mark { color: var(--gold-dark); }

/* Resource filters + cards */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-bottom: 2rem; }
.filter { border: 1.5px solid var(--navy); background: transparent; color: var(--navy); font: inherit; font-weight: 600; padding: .45rem 1.1rem; border-radius: 99px; cursor: pointer; transition: all .2s; }
.filter:hover { background: var(--white); }
.filter.is-active { background: var(--navy); color: var(--white); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.3rem; }
.card { display: flex; flex-direction: column; background: var(--white); border-radius: var(--radius); padding: 1.5rem; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-top: 4px solid var(--sky); transition: transform .2s, box-shadow .2s, border-color .2s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-top-color: var(--gold); }
.card__tag { align-self: flex-start; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: .2rem .6rem; border-radius: 99px; background: var(--sky-light); color: var(--navy-2); margin-bottom: .8rem; }
.card__tag--free { background: #fff1dc; color: #8a4f00; }
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--muted); font-size: .95rem; margin: 0 0 1rem; flex: 1; }
.card__link { font-weight: 700; color: var(--navy-2); }
.card:hover .card__link { color: var(--gold-dark); }
.card[hidden] { display: none; }

/* Free textbooks by department */
.tb-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem 1rem; margin: -1rem 0 2rem; }
.tb-bar__label { font-weight: 700; color: var(--navy); }
.tb-select { min-width: min(320px, 100%); padding: .7rem 2.4rem .7rem 1rem; border: 1.5px solid var(--navy); border-radius: 10px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23030434' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .8rem center / 16px; color: var(--navy); font: inherit; font-weight: 600; appearance: none; cursor: pointer; }
.tb-select:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.tb-count { flex-basis: 100%; margin: 0; text-align: center; color: var(--muted); font-size: .95rem; }
.tb-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.5rem; }
.tb-book { display: flex; flex-direction: column; gap: .8rem; text-decoration: none; color: var(--ink); animation: tb-in .4s ease both; animation-delay: calc(var(--i) * 60ms); }
@keyframes tb-in { from { opacity: 0; transform: translateY(10px); } }
.tb-cover { position: relative; display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 3 / 4; padding: 1.1rem 1rem 1.2rem 1.4rem; border-radius: 4px 10px 10px 4px; color: var(--white); box-shadow: 0 10px 24px rgba(3,4,52,.18); overflow: hidden; transition: transform .25s, box-shadow .25s; }
.tb-cover::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: rgba(0,0,0,.25); }
.tb-cover--0 { background: linear-gradient(160deg, #0e1660, #030434); }
.tb-cover--1 { background: linear-gradient(160deg, #1f4e79, #0e2a47); }
.tb-cover--2 { background: linear-gradient(160deg, #7a4b0c, #4a2c05); }
.tb-cover--3 { background: linear-gradient(160deg, #2c3e66, #141d3a); }
.tb-cover__art { position: relative; display: grid; place-items: center; width: 58%; aspect-ratio: 1; margin: .3rem auto 0; border-radius: 50%; background: rgba(255,255,255,.08); color: rgba(255,255,255,.92); transition: transform .3s; }
.tb-cover__art::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 1px dashed rgba(255,255,255,.18); }
.tb-cover__art svg { width: 70%; height: 70%; }
.tb-book:hover .tb-cover__art { transform: scale(1.06); }
/* Long titles: smaller type, the drawing gives way, and never more than five lines */
.tb-cover__art { flex: 0 1 auto; min-height: 0; }
.tb-cover__source, .tb-cover__title { flex: none; }
.tb-cover--long .tb-cover__title { font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.tb-cover--long .tb-cover__art { width: 42%; }
.tb-cover__source { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: flex-start; padding: .2rem .55rem; border-radius: 99px; background: rgba(255,255,255,.14); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tb-cover__title { font-family: var(--font-head, "Cinzel", serif); font-size: 1.12rem; line-height: 1.25; margin-bottom: .4rem; }
.tb-cover__title::before { content: ""; display: block; width: 44px; height: 3px; margin-bottom: .7rem; border-radius: 2px; background: var(--gold); }
.tb-book:hover .tb-cover, .tb-book:focus-visible .tb-cover { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 18px 34px rgba(3,4,52,.25); }
.tb-book:focus-visible { outline: none; }
.tb-book:focus-visible .tb-cover { outline: 3px solid var(--gold); outline-offset: 3px; }
.tb-book__meta { display: grid; gap: .15rem; }
.tb-book__meta strong { color: var(--navy); line-height: 1.3; }
.tb-book__go { color: var(--navy-2); font-size: .9rem; font-weight: 600; }
.tb-book:hover .tb-book__go { color: var(--gold-dark); }
.tb-empty { grid-column: 1 / -1; margin: 0; padding: 1.4rem; border: 1.5px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }
.tb-more { margin-top: 2.5rem; padding: 1.4rem 1.5rem; border-radius: var(--radius); background: var(--sky-light, #eef4fb); }
.tb-more__title { margin: 0 0 1rem; color: var(--navy); }
.tb-more__links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; }
.tb-lib { display: grid; gap: .15rem; padding: .9rem 1rem; border-radius: 10px; background: var(--white); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .2s, transform .2s; }
.tb-lib strong { color: var(--navy); }
.tb-lib span { font-size: .88rem; color: var(--muted); }
.tb-lib:hover { border-color: var(--gold); transform: translateY(-2px); }
@media (max-width: 640px) {
  .tb-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .tb-cover { padding: .8rem .7rem 1rem 1.1rem; }
  .tb-cover__title { font-size: .95rem; }
  .tb-cover__source { font-size: .62rem; padding: .18rem .45rem; letter-spacing: .05em; }
  .tb-cover__art { width: 54%; }
  .tb-bar__label { flex-basis: 100%; text-align: center; }
  .tb-select { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .tb-book { animation: none; } }
.empty { text-align: center; color: var(--muted); }

/* Services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.service { padding: 2rem 1.6rem; border-radius: var(--radius); border: 1px solid var(--line); transition: box-shadow .2s, transform .2s; }
.service:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.service__icon { width: 54px; height: 54px; border-radius: 12px; background: var(--navy); display: grid; place-items: center; margin-bottom: 1.1rem; }
.service__icon svg { width: 26px; height: 26px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.service p { color: var(--muted); margin: 0; font-size: .97rem; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 270px; gap: 1rem; }
.gallery__item { position: relative; border: 0; padding: 0; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; background: var(--navy-2); }
.gallery__item:first-child { grid-column: span 2; grid-row: span 2; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gallery__item:hover img { transform: scale(1.05); }
.gallery__item span { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.5rem 1rem .9rem; text-align: left; color: var(--white); font-weight: 600; background: linear-gradient(transparent, rgba(3,4,52,.85)); }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(3,4,52,.92); display: grid; place-items: center; padding: 1rem; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 1000px; }
.lightbox img { max-height: 80vh; border-radius: 10px; margin: auto; }
.lightbox figcaption { color: var(--sky); text-align: center; margin-top: .8rem; }
.lightbox__close { position: absolute; top: 1rem; right: 1.4rem; background: none; border: 0; color: var(--white); font-size: 2.6rem; cursor: pointer; }

/* Hours / rules */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.hours { width: 100%; border-collapse: collapse; }
.hours th, .hours td { padding: .9rem 1rem; border-bottom: 1px solid var(--line); text-align: left; }
.hours td { text-align: right; font-weight: 600; color: var(--navy); }
.hours tr.is-today { background: #fff6e8; }
.hours tr.is-today th::after { content: "Today"; margin-left: .6rem; font-size: .7rem; text-transform: uppercase; background: var(--gold); color: var(--navy); padding: .1rem .5rem; border-radius: 99px; }
.note { color: var(--muted); font-size: .92rem; }
.rules { padding-left: 0; list-style: none; counter-reset: r; display: grid; gap: .8rem; }
.rules li { counter-increment: r; display: flex; gap: .9rem; align-items: baseline; }
.rules li::before { content: counter(r); flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--gold); font-weight: 700; font-size: .85rem; }

/* FAQ */
.faq { display: grid; gap: .8rem; }
.faq details { background: var(--white); border-radius: 12px; border: 1px solid var(--line); padding: 0 1.3rem; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: 1.1rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold-dark); font-size: 1.4rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 1.2rem; color: var(--muted); }

/* Contact */
.contact-list { list-style: none; padding: 0; display: grid; gap: 1.1rem; }
.contact-list li { display: grid; gap: .1rem; padding-left: 1rem; border-left: 3px solid var(--gold); }
.contact-list strong { color: var(--navy); }
.contact-list span { color: var(--muted); }
.contact-form { display: grid; gap: 1rem; background: var(--sky-light); padding: 2rem; border-radius: var(--radius); }
.contact-form label { display: grid; gap: .35rem; font-weight: 600; color: var(--navy); font-size: .95rem; }
.contact-form input, .contact-form select, .contact-form textarea { font: inherit; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }
.btn { border: 0; background: var(--navy); color: var(--white); font: inherit; font-weight: 700; padding: .9rem 1.4rem; border-radius: 8px; cursor: pointer; transition: background .2s; }
.btn:hover { background: var(--gold); color: var(--navy); }
.form-note { margin: 0; color: var(--navy-2); font-weight: 600; }
.form-note--ok { color: #17643a; }
.form-note--error { color: #a1281b; }
.contact-form .btn:disabled { opacity: .6; cursor: wait; }
/* Hidden spam trap: off-screen rather than display:none, so simple bots still fill it in */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.footer { background: var(--navy); color: var(--sky); }
.footer__inner { display: grid; grid-template-columns: 1.5fr repeat(var(--cols, 2), 1fr); gap: 2.5rem; padding: 3.5rem 0; }
.footer__logo { height: 64px; background: var(--white); padding: 6px 10px; border-radius: 8px; margin-bottom: 1rem; }
.footer h4 { color: var(--gold); font-size: 1rem; }
.footer a { display: block; color: var(--sky); text-decoration: none; padding: .2rem 0; }
.footer a:hover { color: var(--white); }
.footer .footer__logo-link { display: block; width: max-content; padding: 0; border-radius: 8px; margin-bottom: 1rem; }
.footer__logo-link .footer__logo { display: block; margin-bottom: 0; transition: box-shadow .2s, transform .2s; }
.footer__logo-link:hover .footer__logo, .footer__logo-link:focus-visible .footer__logo { box-shadow: 0 0 0 3px var(--gold); transform: translateY(-2px); }
.footer__bottom { border-top: 1px solid rgba(168,203,236,.18); padding: 1.1rem 0; font-size: .88rem; text-align: center; }

.to-top { position: fixed; right: 18px; bottom: 18px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--gold); color: var(--navy); font-size: 1.3rem; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 40; }
.to-top.is-visible { opacity: 1; pointer-events: auto; }

/* Responsive */
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--white); padding: .8rem 16px 1.2rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
  .nav.is-open { display: flex; }
  .nav a { padding: .8rem; }
  .about, .two-col { grid-template-columns: 1fr; gap: 3rem; }
  .about__person { left: 16px; right: 16px; }
  .about__media { margin-bottom: 24px; }
  .services { grid-template-columns: repeat(2, 1fr); }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__inner > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 4rem 0; }
  .brand img { height: 46px; }
  .header__inner { height: 68px; }

  /* Top strip: one tidy line (the email is in the Contact section) */
  .topbar__inner > span, .topbar__links a { display: none; }
  .topbar__inner { justify-content: center; padding: .4rem 0; }
  .topbar__status { font-size: .78rem; padding: .15rem .7rem; }

  /* Banner: smaller type, long introductions shortened with "Read more" */
  .hero { min-height: 0; }
  .hero__content { padding: 2.4rem 0 2.6rem; }
  .hero .eyebrow { margin-bottom: .35rem; }
  .hero h1 { font-size: clamp(2rem, 9vw, 2.5rem); }
  .hero__lead { font-size: .98rem; line-height: 1.6; margin-bottom: .6rem; }
  .hero__lead.is-clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .hero__more { display: inline-block; margin: 0 0 1.4rem; padding: .2rem 0; border: 0; background: none; color: var(--gold); font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; }
  .hero__more[hidden] { display: none; }
  .hero__lead:not(.is-clamped) { margin-bottom: 1.6rem; }
  .hero__lead:not(.is-clamped) + .hero__more:not([hidden]) { margin-top: -1rem; }

  /* Search: scope and words on one row, button underneath */
  .search { display: grid; grid-template-columns: minmax(0, 8.2rem) minmax(0, 1fr); gap: 0; padding: 5px; }
  .search select { padding: 0 .6rem; font-size: .9rem; border-right: 1px solid var(--line); }
  .search input { padding: .8rem .75rem; font-size: .95rem; }
  .search > button[type="submit"] { grid-column: 1 / -1; margin-top: 5px; padding: .75rem; }

  /* Numbers: all three side by side */
  .hero__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin-top: 1.8rem; }
  .hero__stats .stat { padding-left: .65rem; }
  .hero__stats strong { font-size: 1.4rem; }
  .hero__stats span { font-size: .78rem; line-height: 1.35; display: block; }

  /* Announcements: the label becomes a small megaphone so the text has the width */
  .ticker__inner { height: 76px; gap: .8rem; }
  .ticker__label { padding: 0; width: 44px; height: 44px; justify-content: center; border-radius: 50%; background: var(--gold); border-color: var(--gold); }
  .ticker__label svg { display: block; }
  .ticker__label .ticker__dot, .ticker__label-text { display: none; }
  .ticker__viewport { -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); }
  .ticker__item { font-size: 1.02rem; }
  .ticker__item svg { width: 20px; height: 20px; }
  .ticker__group { gap: 2.5rem; padding-right: 2.5rem; }

  .services { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .gallery__item { aspect-ratio: 4/3; }
  .gallery__item:first-child { grid-column: auto; grid-row: auto; }
  .footer__inner { grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; }
  .contact-form { padding: 1.4rem; }
}
@media (max-width: 380px) {
  .topbar__status-extra { display: none; }
  .hero__stats { gap: .6rem; }
  .hero__stats strong { font-size: 1.2rem; }
}

/* Skeleton loading: placeholder shapes of the page with a soft shimmer, shown until
   the content arrives from Supabase. */
.skeleton { display: none; }
.is-loading .skeleton { display: block; }
.is-loading .footer { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sk { display: block; border-radius: 8px; background: rgba(255,255,255,.10); background-image: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.14) 50%, transparent 80%); background-size: 220% 100%; animation: sk-shimmer 1.4s ease-in-out infinite; }
.sk--light { background-color: #e9eef6; background-image: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.75) 50%, transparent 80%); }
@keyframes sk-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.sk-hero { background: linear-gradient(105deg, #030434 0%, #0b1150 55%, #161c66 100%); min-height: 600px; display: flex; align-items: center; }
.sk-hero .container { padding: 5rem 0; display: grid; gap: 1rem; }
.sk--eyebrow { width: 150px; height: 12px; }
.sk--title { width: min(520px, 85%); height: 58px; margin-bottom: .4rem; }
.sk--line { width: min(600px, 95%); height: 16px; }
.sk--short { width: min(380px, 60%); }
.sk--search { width: min(720px, 100%); height: 62px; border-radius: 12px; margin-top: 1rem; background-color: rgba(255,255,255,.88); background-image: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.9) 50%, transparent 80%); }
.sk-stats { display: flex; gap: 2.5rem; margin-top: 1.4rem; flex-wrap: wrap; }
.sk--stat { width: 130px; height: 56px; border-left: 3px solid rgba(253,167,48,.55); border-radius: 0 8px 8px 0; }
.sk-ticker { background: #f5f6f8; border-bottom: 1px solid #e6e8ee; }
.sk-ticker .container { height: 132px; display: flex; align-items: center; gap: 2.25rem; }
.sk-ticker .sk { background-color: #e3e7ef; background-image: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.8) 50%, transparent 80%); }
.sk--pill { flex: none; width: 190px; height: 44px; border-radius: 99px; }
.sk--bar { flex: 1; height: 20px; }
.sk-about { display: grid; grid-template-columns: 1.25fr 1fr; gap: 4rem; align-items: center; padding: 5.5rem 0 2rem; }
.sk-about > div { display: grid; gap: .9rem; }
.sk--heading { width: 70%; height: 38px; margin-bottom: .6rem; }
.sk--text { height: 14px; }
.sk--photo { width: min(100%, 440px); aspect-ratio: 4 / 5; justify-self: center; border-radius: var(--radius); }
.sk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.3rem; padding: 2rem 0 5rem; }
.sk--card { height: 190px; border-radius: var(--radius); }
@media (max-width: 960px) { .sk-about { grid-template-columns: 1fr; gap: 2.5rem; } }
@media (max-width: 640px) {
  .sk-hero { min-height: 0; }
  .sk-hero .container { padding: 2.4rem 0 2.6rem; gap: .8rem; }
  .sk--title { height: 42px; }
  .sk--search { height: 100px; }
  .sk-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
  .sk--stat { width: auto; height: 50px; }
  .sk-ticker .container { height: 76px; gap: .8rem; }
  .sk--pill { width: 44px; height: 44px; }
  .sk-about { padding-top: 4rem; }
  .sk-cards { grid-template-columns: 1fr; }
  .sk--card { height: 150px; }
}
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
#textbooks + #services { border-top: 1px solid var(--line); }

/* Textbooks → "Share your work" card for lecturers and researchers */
.share-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.2rem 1.6rem; margin-top: 2rem; padding: 1.6rem 1.8rem; border-radius: 16px; background: linear-gradient(120deg, var(--navy) 0%, #101a63 100%); color: var(--sky); overflow: hidden; }
.share-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; border: 2px solid rgba(253,167,48,.18); pointer-events: none; }
.share-card__art { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: rgba(255,255,255,.08); color: var(--white); }
.share-card__art svg { width: 40px; height: 40px; }
.share-card h3 { margin: 0 0 .3rem; color: var(--white); font-size: 1.2rem; }
.share-card__body p { margin: 0; font-size: .97rem; line-height: 1.55; max-width: 62ch; }
.share-card__steps { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0 0; padding: 0; list-style: none; counter-reset: s; }
.share-card__steps li { counter-increment: s; padding: .2rem .65rem; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--white); font-size: .8rem; font-weight: 600; }
.share-card__steps li::before { content: counter(s) " · "; color: var(--gold); }
.share-card__btn { position: relative; z-index: 1; padding: .85rem 1.4rem; border: 0; border-radius: 10px; background: var(--gold); color: var(--navy); font: inherit; font-weight: 700; white-space: nowrap; cursor: pointer; transition: transform .2s, background .2s; }
.share-card__btn:hover { background: #ffb84d; transform: translateY(-2px); }
.share-card__btn:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
@media (max-width: 760px) {
  .share-card { grid-template-columns: 1fr; padding: 1.4rem 1.2rem; }
  .share-card__art { width: 52px; height: 52px; }
  .share-card__btn { width: 100%; }
}

/* The submission form (opens in the pop-up frame from css/notice.css) */
.share-box { width: min(620px, 100%); }
.share-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin: .4rem 0 1.3rem; padding: 0; list-style: none; }
.share-steps li { display: grid; gap: .3rem; align-content: start; padding: .7rem; border-radius: 10px; background: #eef4fb; font-size: .82rem; line-height: 1.35; color: #4a4f6a; }
.share-steps strong { display: block; color: #030434; font-size: .88rem; }
.share-steps__n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #030434; color: #fff; font-weight: 700; font-size: .78rem; }
.share-form { display: grid; gap: .8rem; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.share-field { display: grid; gap: .3rem; font-size: .9rem; font-weight: 600; color: #030434; }
.share-field input, .share-field select, .share-field textarea { width: 100%; padding: .6rem .75rem; border: 1px solid #cfd9e6; border-radius: 8px; font: inherit; font-weight: 400; color: #1b1f3b; background: #fff; }
.share-field input:focus, .share-field select:focus, .share-field textarea:focus { outline: 2px solid #a8cbec; border-color: #030434; }
.share-field input:user-invalid, .share-field select:user-invalid { border-color: #c0392b; }
.share-field small { font-weight: 400; color: #5b6178; }
.share-check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; color: #1b1f3b; }
.share-check input { margin-top: .25rem; width: 18px; height: 18px; flex: none; }
.share-hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.share-note { margin: 0; font-size: .92rem; color: #5b6178; }
.share-note--error { color: #c0392b; }
.share-done { padding: 1rem; border-radius: 10px; background: #eaf6ee; color: #17643a; }
.share-done p { margin: .3rem 0 0; color: #1b1f3b; }
@media (max-width: 560px) {
  .share-steps { grid-template-columns: 1fr 1fr; }
  .share-grid { grid-template-columns: 1fr; }
}
