/* ==========================================================
   Book strip - "You Were Visited"
   Place in: css/book-strip.css  (load AFTER css/main.css)
   ========================================================== */

/* Opt the site out of browser "force dark mode" (Brave / Chrome / Samsung on Android).
   Without this, the browser auto-inverts colors: black text turns white and the
   dark blue button text turns light blue. */
:root { color-scheme: only light; }
html, body { color-scheme: only light; }

.book-strip {
	position: relative;
	overflow: hidden;
	background: #00537f;
	color: #fff;
	border-top: 1px solid rgba(255, 255, 255, .35);
	border-bottom: 1px solid rgba(255, 255, 255, .35);
	box-sizing: border-box;
	transition: max-height .3s ease, opacity .25s ease;
}
.book-strip *,
.book-strip *::before,
.book-strip *::after { box-sizing: border-box; }

/* returning visitors who already dismissed it: hidden before first paint */
html.book-strip-off .book-strip { display: none !important; }

/* closing animation (max-height is set inline by the script) */
.book-strip.is-closing {
	max-height: 0 !important;
	opacity: 0;
}

.book-strip__inner {
	max-width: 1170px;
	margin: 0 auto;
	padding: 26px 76px 26px 20px;   /* right padding leaves room for the close button */
	display: flex;
	align-items: center;
	gap: 32px;
}

.book-strip__cover {
	flex: 0 0 auto;
	width: 96px;
	height: auto;
	display: block;
	border: 2px solid #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}

.book-strip__text {
	flex: 1 1 auto;
	min-width: 0;
	text-align: left;
}
.book-strip__eyebrow {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .22em;
	text-transform: uppercase;
	line-height: 1.3;
	margin: 0 0 6px;
}
.book-strip__title {
	font-family: "Playfair Display", Georgia, "Times New Roman", serif;
	font-size: 44px;
	line-height: 1.1;
	margin: 0 0 8px;
	color: #fff;
}
.book-strip__sub {
	font-size: 20px;
	line-height: 1.4;
	color: #fff;
}
.book-strip__dot { margin: 0 .35em; }

/* Amazon button text: dark blue, forced over any site-wide link color */
html body .book-strip a.book-strip__btn,
html body .book-strip a.book-strip__btn:link,
html body .book-strip a.book-strip__btn:visited,
html body .book-strip a.book-strip__btn:hover,
html body .book-strip a.book-strip__btn:focus,
html body .book-strip a.book-strip__btn:active {
	color: #003366 !important;
	-webkit-text-fill-color: #003366 !important;
	opacity: 1 !important;
	text-shadow: none !important;
}

/* Amazon button.
   Text color uses !important (and covers every link state) so the site's
   global link colors in main.css can never turn it light blue again. */
.book-strip .book-strip__btn,
.book-strip .book-strip__btn:link,
.book-strip .book-strip__btn:visited,
.book-strip .book-strip__btn:active {
	flex: 0 0 auto;
	display: inline-block;
	text-align: center;
	text-decoration: none;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	padding: 24px 40px;
	background: #bebdb0;
	color: #003366 !important;      /* dark navy: strong contrast on the beige button */
	text-shadow: none;
	border: 2px solid #bebdb0;
	outline: 2px solid #00537f;
	outline-offset: -7px;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}
.book-strip .book-strip__btn:hover,
.book-strip .book-strip__btn:focus {
	background: #fff;
	color: #003366 !important;
	text-decoration: none;
}

.book-strip__close {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 48px;                 /* comfortable tap target */
	height: 48px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 34px;
	line-height: 48px;
	text-align: center;
	cursor: pointer;
	opacity: .9;
	-webkit-appearance: none;
	appearance: none;
}
.book-strip__close:hover,
.book-strip__close:focus {
	background: rgba(255, 255, 255, .18);
	opacity: 1;
}

/* ---------- tablets ---------- */
@media (max-width: 900px) {
	.book-strip__inner { gap: 22px; }
	.book-strip__title { font-size: 34px; }
	.book-strip__sub   { font-size: 18px; }
	.book-strip .book-strip__btn { font-size: 20px; padding: 20px 28px; }
}

/* ---------- phones ---------- */
@media (max-width: 640px) {
	.book-strip__inner {
		flex-wrap: wrap;
		gap: 18px 16px;
		padding: 18px 20px 20px;
	}
	.book-strip__cover { width: 82px; }
	.book-strip__text  { flex: 1 1 0; padding-right: 30px; }  /* keeps text clear of the close button */
	.book-strip__eyebrow { font-size: 13px; }
	.book-strip__title { font-size: 26px; margin-bottom: 6px; }
	.book-strip__sub   { font-size: 17px; }
	.book-strip .book-strip__btn {
		flex: 1 1 100%;
		width: 100%;
		font-size: 22px;
		padding: 22px 16px;
	}
	.book-strip__close { top: 2px; right: 2px; }
}

@media (prefers-reduced-motion: reduce) {
	.book-strip { transition: none; }
}
