/* History affiliate rails: keep article readable and mobile adverts in normal flow. */
.history-book-card{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;align-items:center;text-align:center;margin:16px 0;padding:12px;background:#fff;border:1px solid #d7e3e7;border-radius:12px}.history-content .history-book-card img{width:auto;max-width:100%;height:220px;object-fit:contain;margin:0 auto;border-radius:5px}.history-book-card>a{font-size:15px;line-height:1.5}.history-books-rail{scroll-margin-top:24px}.history-content .history-viator-rail .floatrightside,.history-content .history-viator-rail .floatleftside{position:static;width:100%;margin:0 0 20px}.history-viator-rail{min-width:0}.history-viator-rail iframe{max-width:100%}
@media(min-width:1280px){
.history-content{max-width:min(900px,calc(100vw - 600px))}
.history-books-rail,.history-viator-rail{position:fixed;top:var(--history-rail-top,180px);width:260px;max-height:calc(100vh - var(--history-rail-top,180px) - 20px);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;z-index:10;box-sizing:border-box;background:#f5f9fa;border:1px solid #d7e3e7;border-radius:14px;padding:14px;box-shadow:0 4px 18px #123f560b}
.history-books-rail{left:max(16px,calc((100vw - 1460px)/2))}.history-viator-rail{right:max(16px,calc((100vw - 1460px)/2))}
.history-content .history-books-rail h2{font-size:20px;line-height:1.35;margin:0 0 14px}.history-content .history-books-rail .history-block{margin:0}.history-book-card{grid-template-columns:minmax(0,1fr);padding:12px;gap:12px;text-align:center;margin:12px 0}.history-content .history-book-card img{width:auto;max-width:100%;height:220px;object-fit:contain;margin:0 auto}.history-book-card>a{font-size:14px;line-height:1.4}.history-content .history-viator-rail .floatleftside{margin-bottom:0}
}
@media print{.history-books-rail,.history-viator-rail{display:none}.history-content{max-width:100%}}

/* Refined history layout: centred heading, paired illustrations and viewport-fitted books. */
.history-content h1{text-align:center!important}
.history-photo-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:28px 0;align-items:start}
.history-photo-pair figure{min-width:0;margin:0}
.history-content .history-photo-pair img{display:block;width:100%;height:auto;aspect-ratio:4/3;object-fit:contain;background:#eef3f5;border-radius:12px;margin:0 0 12px}
.history-photo-pair figcaption{font-size:14px;line-height:1.5;color:#425d6b}
.history-photo-pair figcaption p{margin:0}
@media(max-width:599px){.history-photo-pair{grid-template-columns:minmax(0,1fr);gap:24px}}
@media(min-width:1280px){
.history-books-rail{height:calc(100vh - var(--history-rail-top,180px) - 20px);height:calc(100dvh - var(--history-rail-top,180px) - 20px);display:flex;flex-direction:column;overflow:visible}
.history-content .history-books-rail h2{flex:0 0 auto;margin:0 0 10px}
.history-content .history-books-rail>.history-block{flex:1;min-height:0;display:grid;grid-template-rows:repeat(3,minmax(0,1fr));gap:8px}
.history-books-rail .history-book-card{min-height:0;margin:0;padding:8px;gap:6px;grid-template-rows:minmax(0,1fr) auto;align-items:stretch}
.history-books-rail .history-book-card>a:first-child{display:flex;align-items:center;justify-content:center;min-height:0;height:100%}
.history-content .history-books-rail .history-book-card img{width:auto;height:100%;max-height:100%;max-width:100%;object-fit:contain;margin:0 auto}
.history-books-rail .history-book-card>a:last-child{font-size:13px;line-height:1.2}
}
@media(min-width:1280px) and (max-height:700px){
.history-books-rail{padding:10px}
.history-content .history-books-rail h2{font-size:17px;margin-bottom:8px}
.history-books-rail .history-book-card{padding:5px;gap:4px}
.history-books-rail .history-book-card>a:last-child{font-size:12px;line-height:1.15}
}
