/* ============================================================
   ICR Featured Book
   Uses ICR Enchanted's colors/fonts (and its menu-button hover
   color) when active; matching fallbacks otherwise.
   ============================================================ */

.icr-fb {
  --_accent:   var(--icr-accent, #c8703a);
  --_accent-d: var(--icr-accent-dark, #9e4e1f);
  --_accent-l: var(--icr-accent-light, #e8956a);
  --_card:     var(--icr-bg-alt, #f2ebe0);
  --_paper:    var(--icr-bg, #faf6ef);
  --_text:     var(--icr-text, #2a1f14);
  --_muted:    var(--icr-text-muted, #6b5844);
  --_border:   var(--icr-border, #ddd0bb);
  --_hover:    var(--icr-nav-hover, #24505f);
  --_head:     var(--icr-font-heading, 'Playfair Display', Georgia, serif);
  --_accentf:  var(--icr-font-accent, 'Special Elite', 'Courier New', monospace);
  --_body:     var(--icr-font-body, Georgia, serif);
  box-sizing: border-box;
  margin: 0;
}
.icr-fb *, .icr-fb *::before, .icr-fb *::after { box-sizing: border-box; }

/* ---------- Placement ---------- */

/* In the banner: top right. (Positioned the same way before the script
   moves it into the header, so nothing jumps.) */
.icr-fb[data-placement="banner"] {
  position: absolute;
  top: 0.9rem;
  right: 1.25rem;
  z-index: 20;
  max-width: 330px;
}

/* Slim bar across the very top */
.icr-fb[data-placement="bar"] {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  background: var(--_card);
  border-bottom: 1px solid var(--_border);
}

/* ---------- The card ---------- */
.icr-fb__card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.9rem 0.55rem 0.55rem;
  background: var(--_paper) !important;
  border: 1px solid var(--_border);
  border-left: 4px solid var(--_accent);
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(42, 31, 20, 0.18);
  text-decoration: none !important;
  color: var(--_text);
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

a.icr-fb__card:hover,
a.icr-fb__card:focus-visible {
  background: var(--_hover) !important;
  border-color: var(--_hover);
  border-left-color: var(--_accent-l);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
  text-decoration: none !important;
  outline: none;
}
a.icr-fb__card:focus-visible { box-shadow: 0 0 0 3px rgba(200, 112, 58, 0.55), 0 6px 16px rgba(0, 0, 0, 0.3); }

.icr-fb__card--invite { border-style: dashed; border-left-style: solid; }

/* Book cover */
.icr-fb__cover {
  flex: 0 0 44px;
  width: 44px;
  height: 64px;
  border-radius: 2px;
  overflow: hidden;
  background: #2a1f14;
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icr-fb__img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
}
.icr-fb__blank {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--_accent-l);
}

/* Words */
.icr-fb__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  max-width: 210px;
}

.icr-fb__eyebrow {
  font-family: var(--_accentf);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--_accent-d);
}

.icr-fb__tag {
  display: inline-block;
  margin-left: 0.35em;
  padding: 0.02em 0.5em;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.9em;
  letter-spacing: 0.08em;
  vertical-align: 1px;
}

.icr-fb__title {
  font-family: var(--_head);
  font-style: italic;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  color: var(--_text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.icr-fb__author {
  font-family: var(--_body);
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--_muted);
}

/* Colors flip to cream on hover, like the menu buttons */
a.icr-fb__card:hover .icr-fb__title,
a.icr-fb__card:focus-visible .icr-fb__title { color: #f5efe3; }
a.icr-fb__card:hover .icr-fb__eyebrow,
a.icr-fb__card:focus-visible .icr-fb__eyebrow { color: #f5c09b; }
a.icr-fb__card:hover .icr-fb__author,
a.icr-fb__card:focus-visible .icr-fb__author { color: #d9cdb8; }

/* ---------- Phones and small tablets: a slim centered bar ---------- */
@media (max-width: 900px) {
  .icr-fb[data-placement="banner"] {
    position: static;
    display: flex;
    justify-content: center;
    max-width: none;
    padding: 0.5rem 0.75rem;
    background: var(--_card);
    border-bottom: 1px solid var(--_border);
  }
}

@media (max-width: 420px) {
  .icr-fb__text { max-width: 170px; }
}

@media (prefers-reduced-motion: reduce) {
  .icr-fb__card { transition: none; }
  a.icr-fb__card:hover, a.icr-fb__card:focus-visible { transform: none; }
}
