:root {
    color-scheme: light;
    --outline: #0000ff;
    --link: #000066;
    --shadow: 4px 4px 4px gold;
}
* { box-sizing: border-box; }
body { margin: 8px; color: black; background: white; font: 1rem Arial, Verdana, sans-serif; }
#pagecontainer { max-width: 1204px; padding: 2px; }
a { color: var(--link); text-decoration: none; }
a:visited { color: #555580; }
a:hover { color: #0000cc; text-decoration: underline; }
:focus-visible { outline: 3px solid #1565b5; outline-offset: 2px; }
.skip:not(:focus), .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: absolute; z-index: 2; padding: .5em; background: white; }
#headerformat {
    max-width: 1182px; height: 171px; margin: 0 auto; position: relative; text-align: center;
    background: lightgray url('/volga.jpg') left top / auto 100% no-repeat;
    border: 1px solid var(--outline); border-radius: 24px; overflow: hidden;
}
#headerformat > a { color: black; font-weight: bold; }
.tagline, .river-name { position: absolute; bottom: 23%; }
.tagline { left: 20px; color: gold; font-weight: bold; }
.river-name { right: 20px; }
.mastnav { max-width: 1182px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; font-size: 1.167rem; }
.mastnav div { display: flex; align-items: center; justify-content: center; }
.store-nav { gap: clamp(1rem, 3.2vw, 2.5rem); }
.account-nav { gap: clamp(1rem, 2.3vw, 1.85rem); padding-right: 5px; }
.page-layout { max-width: 1080px; margin: 0 auto; }
.page-layout.home, .page-layout.sides {
    max-width: 1160px; margin: 0 auto 0 min(.45%, 5px); display: grid;
    grid-template-columns: minmax(134px, 167px) minmax(0, 1fr) minmax(134px, 167px);
    grid-template-areas: "search content shop"; gap: 12px;
}
.content-panel, .search-side, .shop-side, #suggestions { border: 1px solid var(--outline); border-radius: 16px; background: white; }
.content-panel { min-width: 0; padding: 1rem 1.3rem; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.home .content-panel, .sides .content-panel { grid-area: content; min-height: 277px; }
.home .content-panel { text-align: center; padding: 0; }
.home ul { text-align: left; }
.search-side, .shop-side { text-align: center; min-width: 0; }
.search-side { grid-area: search; padding-top: 10px; }
.shop-side { grid-area: shop; }
.search-side input { width: 96%; min-width: 0; }
.search-side form { margin-bottom: 4px; }
.search-side img, .shop-side img { display: block; margin: 0 auto; max-width: 95%; object-fit: contain; }
.search-side p { margin: 0 0 .7rem; }
.shop-side span { display: block; }
#suggestions { max-width: 1012px; margin: 4px auto 0; padding: 10px 5px 15px; text-align: center; box-shadow: 3px 3px 3px gold; }
#shelf-title { font: italic 1rem Arial, Verdana, sans-serif; margin: 0; }
.shelf-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) 50px; align-items: center; }
.arrow { display: grid; place-items: center; min-height: 44px; }
.arrow img { display: block; max-width: 100%; height: auto; }
.shelf-books { display: flex; justify-content: space-between; gap: .75rem; padding: 0 clamp(.4rem, 1.5vw, 20px); min-width: 0; }
.suggestion-book { flex: 1 1 0; min-width: 0; max-width: 212px; min-height: 252px; padding: 19px 4px 8px; border: 2px solid red; text-align: left; }
.suggestion-book:nth-child(2) { border-color: yellow; }
.suggestion-book:nth-child(3) { border-color: blue; }
.shelf-title { display: block; width: 66%; margin: 0 auto; }
.shelf-title img { display: block; height: 160px; width: auto; max-width: 100%; object-fit: contain; object-position: left bottom; }
.shelf-title > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
footer { max-width: 1182px; margin: 24px auto; text-align: right; font-family: "Times New Roman", serif; padding: 5px 4px; }
footer p { margin: 1em 0; }
.panel .content-panel > h1:first-child, .narrow h1 { margin-top: 0; }
.narrow { max-width: 800px; margin: 0 auto; }
.narrow p, .description p { line-height: 1.45; }
input, select { min-width: 0; max-width: 100%; }
button, .button { cursor: pointer; }
.button, .stack button, .filters button, .cartrow button, .narrow button {
    display: inline-block; color: black; background: #eee; border: 1px solid #777; border-radius: 2px; font: inherit; padding: .3em .7em;
}
.button:visited { color: black; }
.filters { display: grid; grid-template-columns: 1.5fr 1fr 1fr auto; gap: .75rem; align-items: end; }
.filters label, .stack label { display: block; }
.filters input, .filters select, .stack input, .cartrow input { width: 100%; font: inherit; padding: .3em; }
.section-title, .pages, .orderlines li, .total { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.books { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem; }
.books article { border: 1px solid #a5a5cd; padding: .75rem; }
.jacket img { height: 160px; width: 100%; object-fit: contain; }
.books h3 { font-size: 1rem; margin: .5rem 0; }
.books p { margin: .35em 0; }
.pages { justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.pages a { padding: .3em .65em; border: 1px solid #8c8cac; }
.pages [aria-current] { color: white; background: var(--link); }
.back { display: inline-block; margin-bottom: 1rem; }
.detail { display: grid; grid-template-columns: minmax(110px, 165px) 1fr; align-items: start; gap: 1.25rem; }
.detail .jacket { text-align: center; padding: .75rem .25rem; border: 1px solid var(--outline); border-radius: 16px; }
.detail h1 { margin: .4em 0; }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem .8rem; }
.detail dt, .price { font-weight: bold; }
dd { margin: 0; }
.add-book { padding: .25rem; border: 1px solid #aaa; border-radius: 5px; font: inherit; color: var(--link); background: white; }
.add-book img { display: block; margin: auto; width: 85px; height: auto; }
.description { max-width: 800px; }
.stack { display: grid; gap: .8rem; max-width: 420px; }
.stack input { display: block; }
.stack button { justify-self: start; }
.notice { padding: .65rem .9rem; background: #fff8c7; border-left: 3px solid #b88600; }
.cartrow { display: grid; grid-template-columns: 46px 1fr auto auto; gap: .7rem; align-items: center; padding: .9rem 0; border-top: 1px solid #aaa; }
.cartrow img { width: 46px; max-height: 80px; object-fit: contain; }
.cartrow p { margin: .25rem 0; }
.cartrow form { display: flex; flex-wrap: wrap; align-items: end; gap: .4rem; }
.cartrow input { display: block; width: 4em; }
.checkout-total { margin: .7rem 0; text-align: right; }
.orderlines { padding: 0; }
.orderlines li, .total, details { border-top: 1px solid #aaa; padding: .65rem 0; }
summary { cursor: pointer; }
@media (max-width: 850px) {
    .shelf-books { gap: .55rem; }
    .shelf-title { width: 85%; }
    .books { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cartrow { grid-template-columns: 45px 1fr auto; }
    .cartrow form { grid-column: 2 / -1; grid-row: 2; }
}
@media (max-width: 650px) {
    #headerformat { height: 121px; background-position: 32% top; }
    .tagline { left: 9px; } .river-name { right: 9px; }
    .mastnav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1rem; padding: .3rem 0; font-size: 1rem; }
    .mastnav a { padding: .3rem 0; }
    .account-nav { padding: 0; }
    .page-layout.home, .page-layout.sides { margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "content content" "search shop"; gap: 6px; }
    .home .content-panel, .sides .content-panel { min-height: 0; }
    .home .content-panel { padding: 0 .5rem; }
    .home h1 { font-size: 1.5rem; } .home h2 { font-size: 1.15rem; }
    .search-side, .shop-side { padding: 6px 2px; }
    .search-side img { max-width: 75px; height: auto; } .shop-side img { max-width: 100px; height: auto; }
    .search-side p { font-size: .875rem; margin-bottom: 0; }
    #suggestions { margin-top: 7px; padding: 6px 1px; }
    .shelf-row { grid-template-columns: 32px minmax(0, 1fr) 32px; }
    .shelf-books { padding: 0; gap: 3px; }
    .suggestion-book { min-height: 0; padding: 5px 2px; }
    .shelf-title { width: 100%; font-size: .875rem; }
    .shelf-title img { width: 100%; height: clamp(65px, 24vw, 140px); object-position: center bottom; }
    .books { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
    .content-panel { padding: .75rem; }
    .detail { grid-template-columns: 1fr; } .detail .jacket { max-width: 160px; }
    .filters { grid-template-columns: 1fr; }
    footer { text-align: center; }
}
