/* v4.27 BOOKS page and homepage entry */
.books-teaser {
  position: relative;
  overflow: hidden;
  background: #eef0ed;
  border-block: 1px solid rgba(17,21,26,.07);
}
.books-teaser > .container { width: min(calc(100% - 48px), 1320px); }
.books-teaser.section { padding-block: clamp(56px, 5vw, 84px); }
.books-teaser-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 24px;
}
.books-teaser-heading h2 {
  margin: 14px 0 10px;
  font-size: clamp(36px, 5vw, 66px);
  line-height: 1.08;
  letter-spacing: -.045em;
}
.books-teaser-cta {
  min-height: 54px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 0 19px;
  color: #fff;
  background: #11151a;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 800;
  transition: background .2s ease, transform .2s ease;
}
.books-teaser-cta:hover { background: #e51f36; transform: translateY(-2px); }
.books-teaser-cta b { font-size: 18px; }
.books-teaser-grid { width: calc(100% - 12px); margin-inline: auto; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); align-items: start; gap: 12px; }
.books-teaser-card {
  align-self: start;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  align-items: start;
  align-content: start;
  gap: 0;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(17,21,26,.08);
  border-radius: 13px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 10px 30px rgba(18,22,27,.045);
  transition: transform .2s ease, box-shadow .2s ease;
}
.books-teaser-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(18,22,27,.10); }
.books-teaser-card > img { width: 100%; height: auto; aspect-ratio: 5 / 8; object-fit: contain; border-radius: 0; background: #f5f6f3; }
.books-teaser-info { min-width: 0; display: grid; align-content: start; gap: 7px; padding: 13px; }
.books-teaser-info small { color: #7d252e; font-size: 9px; font-weight: 800; line-height: 1.45; letter-spacing: .06em; }
.books-teaser-info strong { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.books-teaser-info time { color: #555e64; font-size: 11px; font-weight: 700; }
.books-teaser-release { color: #e51f36; font-size: 10px; font-weight: 800; }

.books-page { min-height: 100vh; background: #f5f6f3; color: #11151a; }

/* Books uses the homepage header rules without page-specific position overrides. */
.books-page a { color: inherit; text-decoration: none; }
.books-footer-brand img { width: 100%; height: auto; }
.books-hero {
  position: relative;
  overflow: hidden;
  margin-top: calc(var(--header-h) + 40px);
  min-height: clamp(390px, 36vw, 590px);
  color: #fff;
  background-color: #0d1116;
  background-image:
    linear-gradient(90deg,rgba(7,10,15,.24) 0%,rgba(7,10,15,.14) 38%,rgba(7,10,15,.08) 68%,rgba(7,10,15,.18) 100%),
    linear-gradient(0deg,rgba(7,10,15,.30),rgba(7,10,15,.05)),
    url("../img/gato-ip-books-banner-v437.webp");
  background-position: center,center,center 52%;
  background-size: cover,cover,cover;
  background-repeat: no-repeat;
  isolation: isolate;
}
.books-hero::before, .books-hero::after { position: absolute; z-index: -1; content: ""; pointer-events: none; }
.books-hero::before {
  inset: 0;
  opacity: .2;
  background-image: linear-gradient(rgba(255,255,255,.09) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.09) 1px,transparent 1px);
  background-size: 62px 62px;
  mask-image: linear-gradient(90deg,#000,transparent 85%);
}
.books-hero::after {
  width: 620px;
  height: 620px;
  right: -40px;
  top: -260px;
  border-radius: 50%;
  background: radial-gradient(circle,rgba(229,31,54,.28),rgba(229,31,54,0) 68%);
}
.books-hero-inner { width: min(calc(100% - 48px), 1320px); min-height: inherit; margin: 0 auto; display: flex; align-items: center; padding: clamp(50px,7vw,94px) 0; }
.books-hero-copy { position: relative; z-index: 1; width: min(100%, 780px); }
.books-eyebrow { margin: 0 0 16px; color: #ff7181; font: 800 11px/1.5 Manrope,sans-serif; letter-spacing: .16em; text-shadow: 0 2px 14px rgba(0,0,0,.6); }
.books-hero h1 { max-width: 100%; margin: 0; color: #fff; font-size: clamp(42px,6.4vw,88px); line-height: .98; letter-spacing: -.06em; text-shadow: 0 3px 24px rgba(0,0,0,.62); }
.books-listing { padding: 56px 0 96px; }
.books-listing-inner { width: min(calc(100% - 48px), 1320px); margin-inline: auto; }
.books-controls { display: grid; grid-template-columns: minmax(0,1fr) 250px; gap: 14px; }
.books-search, .books-month-filter { display: grid; gap: 7px; color: #5e676e; font-size: 11px; font-weight: 800; }
.books-search input, .books-month-filter select {
  width: 100%; min-height: 50px; padding: 0 15px; color: #11151a;
  border: 1px solid #d7dbd6; border-radius: 11px; outline: 0; background: #fff;
  font: inherit; font-size: 14px; line-height: 1.4;
}
.books-search input:focus, .books-month-filter select:focus { border-color: #e51f36; box-shadow: 0 0 0 3px rgba(229,31,54,.1); }
.books-filter-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 20px 0 40px; padding-bottom: 17px; border-bottom: 1px solid #daddd8; }
.book-filter { min-height: 41px; padding: 0 15px; color: #4c545b; background: #fff; border: 1px solid #daddd8; border-radius: 999px; font-size: 12px; font-weight: 800; cursor: pointer; transition: color .18s ease,background .18s ease,border-color .18s ease; }
.book-filter:hover, .book-filter.is-active { color: #fff; background: #11151a; border-color: #11151a; }
.books-result-count { margin: 0 0 0 auto; color: #677078; font-size: 12px; font-weight: 700; }
.book-month-group { margin-top: 58px; }
.book-month-group:first-child { margin-top: 0; }
.book-month-heading { display: flex; align-items: end; gap: 20px; margin-bottom: 21px; }
.book-month-heading h2 { margin: 0; font-size: clamp(27px,3vw,38px); line-height: 1.15; letter-spacing: -.045em; }
.books-section-index { margin: 0 0 5px; color: #e51f36; font: 800 9px/1.5 Manrope,sans-serif; letter-spacing: .16em; }
.book-month-count { margin: 0 0 4px auto; color: #7a8389; font: 700 10px/1.4 Manrope,sans-serif; letter-spacing: .1em; }
.books-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 15px; }
.book-card { min-width: 0; overflow: hidden; border: 1px solid rgba(17,21,26,.08); border-radius: 13px; background: #fff; box-shadow: 0 9px 28px rgba(18,22,27,.045); transition: transform .2s ease,box-shadow .2s ease; }
.book-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(18,22,27,.1); }
.book-card[hidden], .book-month-group[hidden] { display: none !important; }
.book-cover-link { display: block; overflow: hidden; aspect-ratio: 5 / 8; background: #f5f6f3; }
.book-cover { display: block; width: 100%; height: 100%; aspect-ratio: 5 / 8; object-fit: contain; }
.book-card:hover .book-cover { transform: none; }
.book-card-body { padding: 13px 13px 14px; }
.book-card-series { min-height: 2.8em; margin: 0 0 7px; color: #8b3038; font: 800 9px/1.5 Manrope,"Zen Kaku Gothic New",sans-serif; letter-spacing: .04em; }
.book-card-title { min-height: 3em; margin: 0; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.book-card-detail { min-height: 1.5em; margin: 6px 0 0; color: #677078; font-size: 11px; line-height: 1.55; }
.book-release-date { display: flex; flex-wrap: wrap; gap: 5px 7px; align-items: baseline; margin: 11px 0 0; color: #667078; font-size: 10px; line-height: 1.55; }
.book-release-date span { color: #e51f36; font-weight: 800; }
.book-release-date time { color: #20262d; font-weight: 800; }
.book-card-links { min-height: 32px; display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px; margin-top: 9px; padding-top: 8px; border-top: 1px solid #edf0ed; }
.book-site-link, .book-related-link, .book-kindle-link { min-height: 29px; display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border-radius: 999px; font-size: 10px; line-height: 1.3; font-weight: 800; white-space: nowrap; text-decoration: none; transition: color .18s ease, background .18s ease, border-color .18s ease; }
.book-site-link, .book-related-link { color: #363e44 !important; background: #fff; border: 1px solid #d7dbd6; }
.book-kindle-link { color: #1d1a0e !important; background: #ffd768; border: 1px solid #e2b93c; }
.book-site-link:hover, .book-related-link:hover { color: #e51f36 !important; background: #fff8f8; border-color: #e7b6bc; }
.book-kindle-link:hover { color: #17140b !important; background: #ffc83d; border-color: #d7a10c; }
.book-site-link:focus-visible, .book-related-link:focus-visible, .book-kindle-link:focus-visible { outline: 2px solid #e51f36; outline-offset: 2px; }
.book-site-link[hidden], .book-kindle-link[hidden] { display: none; }
.books-no-results { padding: 32px 0; color: #596169; font-size: 14px; }
.books-future-note { display: flex; align-items: center; gap: 16px; margin-top: 64px; padding: 20px 23px; border-radius: 15px; background: #e9ece8; }
.books-future-mark { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: #11151a; border-radius: 50%; font: 800 13px/1 Manrope,sans-serif; }
.books-future-note p { margin: 0; color: #525c63; font-size: 12px; line-height: 1.7; }
.books-footer { padding: 25px 0; color: #d7dbde; background: #0d1116; }
.books-footer-inner { width: min(calc(100% - 48px), 1320px); margin-inline: auto; display: flex; align-items: center; gap: 28px; }
.books-footer-brand { display: block; width: 150px; filter: grayscale(1) brightness(0) invert(1); }
.books-footer-inner > div { display: flex; flex-wrap: wrap; gap: 12px 25px; margin-left: auto; }
.books-footer-inner > div a { color: #d7dbde; font-size: 10px; font-weight: 800; letter-spacing: .09em; }
.books-footer-inner > div a:hover { color: #ff5267; }
.books-footer-inner > small { color: #8a9298; font-size: 9px; white-space: nowrap; }

@media (max-width: 1120px) {
  .books-teaser-grid { width: calc(100% - 9px); grid-template-columns: repeat(4,minmax(0,1fr)); }
  .books-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .books-hero { background-image: linear-gradient(90deg,rgba(7,10,15,.62) 0%,rgba(7,10,15,.42) 48%,rgba(7,10,15,.16) 100%),linear-gradient(0deg,rgba(7,10,15,.32),rgba(7,10,15,.08)),url("../img/gato-ip-books-banner-v437.webp"); }
  .books-hero-inner { padding: 52px 0 46px; }
  .books-hero-copy { max-width: 780px; }
}
@media (max-width: 760px) {
  .books-teaser > .container { width: calc(100% - 32px); }
  .books-teaser-grid { width: 100%; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
  .books-teaser-heading { align-items: start; flex-direction: column; }
  .books-teaser-cta { align-self: stretch; }
  .books-teaser-card { grid-template-columns: minmax(0,1fr); gap: 0; padding: 0; }
  .books-teaser-card > img { width: 100%; }
  .books-teaser-info { padding: 10px; gap: 5px; }
  .books-teaser-info strong { font-size: 12px; }
  .books-hero-inner, .books-listing-inner, .books-footer-inner { width: calc(100% - 32px); }
  .books-controls { grid-template-columns: 1fr; }
  .books-month-filter { max-width: none; }
  .books-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
  .book-card-body { padding: 10px; }
  .book-card-series { font-size: 8px; }
  .book-card-title { font-size: 12px; }
  .book-card-detail, .book-release-date, .books-footer-inner { align-items: start; flex-wrap: wrap; }
  .books-footer-brand { width: 125px; }
  .books-footer-inner > div { gap: 10px 16px; }
  .books-footer-inner > small { width: 100%; }
}
@media (max-width: 500px) {
  .books-teaser-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .books-teaser-card { grid-template-columns: minmax(0,1fr); gap: 0; padding: 0; }
  .books-teaser-card > img { width: 100%; aspect-ratio: 5 / 8; object-fit: contain; }
  .books-teaser-info { padding: 8px; gap: 4px; }
  .books-teaser-info small { font-size: 8px; }
  .books-teaser-info strong { font-size: 11px; }
  .books-teaser-info time { font-size: 9px; }
  .books-teaser-release { font-size: 8px; }
  .books-hero { min-height: 390px; background-position: center,center,30% center; }
  .books-hero-inner { width: calc(100% - 34px); }
  .books-hero-copy { padding: 0 18px; }
  .books-eyebrow { font-size: 9px; letter-spacing: .12em; }
  .books-hero h1 { font-size: clamp(34px,10vw,62px); }
  .books-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .book-card-body { padding: 9px; }
  .book-card-title { font-size: 12px; }
  .book-month-heading { gap: 11px; flex-wrap: wrap; }
  .book-month-count { font-size: 9px; }
  .books-result-count { width: 100%; margin: 5px 0 0; }
  .books-filter-row { gap: 7px; }
  .book-filter { padding-inline: 12px; font-size: 11px; }
  .books-listing { padding-top: 38px; }
  .books-future-note { margin-top: 45px; padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .books-teaser-card, .books-teaser-cta, .book-card, .book-cover { transition: none !important; }
}


/* v4.45: independent Kindle/note calendars and native landscape covers */
.books-results-summary { display: flex; justify-content: flex-end; margin: 8px 0 38px; }
.books-results-summary .books-result-count { margin: 0; }
.book-platform-section { margin-top: clamp(56px, 6vw, 88px); }
.book-platform-section[hidden] { display: none !important; }
.book-platform-heading { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 18px; padding-top: 25px; border-top: 1px solid #daddd8; }
.book-platform-heading .books-section-index { grid-column: 1 / -1; margin: 0; }
.book-platform-heading h2 { margin: 0; font-size: clamp(28px, 3vw, 40px); line-height: 1.15; letter-spacing: -.045em; }
.book-platform-caption { grid-column: 1; grid-row: 3; margin: 0 0 3px; color: #677078; font-size: 12px; font-weight: 700; }
.book-platform-count { grid-column: 2; grid-row: 2; margin-bottom: 4px; color: #7a8389; font: 700 10px/1.4 Manrope,sans-serif; letter-spacing: .1em; }
.book-platform-months .book-month-group:first-child { margin-top: 28px; }
.book-month-heading h3 { margin: 0; font-size: clamp(27px, 3vw, 38px); line-height: 1.15; letter-spacing: -.045em; }
.book-card--note .book-cover-link { aspect-ratio: 1733 / 907; }
.book-card--note .book-cover { aspect-ratio: 1733 / 907; object-fit: cover; }
.book-note-link { min-height: 29px; display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border: 1px solid #b9d7c5; border-radius: 999px; color: #163c26 !important; background: #dff2e5; font-size: 10px; line-height: 1.3; font-weight: 800; white-space: nowrap; text-decoration: none; }
.book-note-link:hover { background: #c8e9d3; border-color: #7ab58d; }
.book-note-link[hidden] { display: none; }
.books-teaser-card--note > img { aspect-ratio: 1733 / 907; object-fit: contain; }
@media (max-width: 500px) {
  .books-results-summary { margin-bottom: 30px; }
  .book-platform-heading { gap: 5px 10px; }
  .book-platform-heading h2 { font-size: clamp(22px, 6vw, 30px); }
  .book-platform-caption { grid-column: 1 / -1; grid-row: 3; font-size: 10px; }
  .book-platform-count { grid-column: 2; grid-row: 2; }
  .book-platform-months .book-month-group:first-child { margin-top: 24px; }
}


/* v4.49: compact schedule time labels */
.book-release-date .book-release-time { color: #788087; font-size: 9px; font-weight: 700; white-space: nowrap; }
.books-teaser-info .books-teaser-release-time { color: #667078; font-size: 10px; font-weight: 700; }

/* v4.51: note schedule link keyboard focus */
.book-note-link:focus-visible { outline: 2px solid #e51f36; outline-offset: 2px; }
