/* Interaction / animation styles — loaded alongside styles.scss */

/* Scroll reveal */
.rrb-fade {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1);
}
.rrb-in {
  opacity: 1;
  transform: translateY(0);
}

/* Reading progress bar */
.rrb-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: #1e5a8e;
  z-index: 9999;
  transition: width 0.1s linear;
}

/* Reading time counter — small circle, fixed bottom-right */
.rrb-read-counter {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 0.55em;
  background: rgba(246, 236, 213, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid #d9cfb8;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(10, 37, 64, 0.10);
  padding: 0.38em 0.75em 0.38em 0.42em;
  font-family: "Inter", -apple-system, sans-serif;
  z-index: 9998;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.3s ease;
  pointer-events: none;
}
.rrb-read-counter.rrb-read-visible {
  opacity: 1;
  transform: translateY(0);
}
.rrb-read-counter.rrb-read-done {
  background: #0a2540;
  color: #fff;
  border-color: #0a2540;
}
.rrb-read-counter.rrb-read-done .rrb-read-remaining { color: #fff; }
.rrb-read-counter.rrb-read-done .rrb-read-label { color: rgba(255,255,255,0.6); }
.rrb-read-counter.rrb-read-done .rrb-ring-fill { stroke: #8ab9d8; }
.rrb-read-counter.rrb-read-done .rrb-ring-track { stroke: rgba(255,255,255,0.15); }

.rrb-read-ring { width: 26px; height: 26px; flex: 0 0 26px; }
.rrb-read-ring svg { width: 26px; height: 26px; transform: rotate(-90deg); }
.rrb-ring-track {
  fill: none;
  stroke: rgba(30, 90, 142, 0.18);
  stroke-width: 3;
}
.rrb-ring-fill {
  fill: none;
  stroke: #1e5a8e;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.15s linear;
}
.rrb-read-text { line-height: 1; }
.rrb-read-remaining {
  font-size: 0.7em;
  font-weight: 600;
  color: #0d3b66;
  letter-spacing: 0.02em;
}
.rrb-read-label {
  font-size: 0.52em;
  font-weight: 500;
  color: #5a7a95;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-top: 0.1em;
}
@media (max-width: 600px) {
  .rrb-read-counter { bottom: 12px; right: 12px; padding: 0.32em 0.6em 0.32em 0.36em; }
}

/* Left rail: share icons + reading progress circle */
.rrb-side-rail {
  position: fixed;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9997;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.rrb-side-rail.rrb-visible { opacity: 1; }
.rrb-side-rail .rrb-share-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(246, 236, 213, 0.9);
  color: #0d3b66;
  border: 1px solid #d9cfb8;
  border-radius: 50%;
  font-size: 0.95em;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  pointer-events: auto;
}
.rrb-side-rail .rrb-share-btn:hover {
  background: #0a2540;
  color: #fbf4de;
  transform: translateY(-1px);
}
.rrb-side-rail .rrb-share-sep {
  width: 1px;
  height: 22px;
  background: #d9cfb8;
  margin: 2px 0;
}

.rrb-side-progress {
  width: 36px;
  height: 36px;
  pointer-events: none;
}
.rrb-side-progress svg {
  width: 36px;
  height: 36px;
  transform: rotate(-90deg);
  display: block;
}
.rrb-side-track {
  fill: none;
  stroke: rgba(13, 59, 102, 0.16);
  stroke-width: 2;
}
.rrb-side-fill {
  fill: none;
  stroke: #1e5a8e;
  stroke-width: 2;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.12s linear;
}
.rrb-side-progress.rrb-side-done .rrb-side-fill {
  stroke: #0d3b66;
}
@media (max-width: 1100px) {
  .rrb-side-rail { display: none; }
}

/* Hero image transition */
.rrb-hero-img {
  transition: transform 0.8s cubic-bezier(.2,.7,.2,1), filter 0.4s ease;
  will-change: transform;
}
.rrb-hero:hover .rrb-hero-img {
  filter: grayscale(0%) contrast(1.04);
}

/* Card hover lift */
.rrb-card .rrb-card-img {
  transition: transform 0.5s ease, filter 0.4s ease;
}
.rrb-card:hover .rrb-card-img {
  transform: scale(1.02);
  filter: grayscale(0%);
}
.rrb-card .rrb-card-title a {
  background-image: linear-gradient(#1e5a8e, #1e5a8e);
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: left bottom;
  transition: background-size 0.35s ease;
}
.rrb-card:hover .rrb-card-title a {
  background-size: 100% 2px;
}

/* Ticker (marquee) — Cormorant italic, literary feel */
.rrb-ticker {
  background: #0a2540;
  color: #fbf4de;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  font-family: "Cormorant Garamond", "Libre Caslon Text", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.08em;
  letter-spacing: 0.015em;
  text-transform: none;
  padding: 0.75em 0;
}
.rrb-ticker-inner {
  display: inline-block;
  white-space: nowrap;
  animation: rrb-ticker-move 55s linear infinite;
}
.rrb-ticker span {
  padding: 0 2.4em;
  position: relative;
}
.rrb-ticker span::after {
  content: "◆";
  color: #8ab9d8;
  margin-left: 2.4em;
  font-style: normal;
  font-size: 0.75em;
  vertical-align: 0.15em;
}
@keyframes rrb-ticker-move {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Carousel */
.rrb-carousel {
  position: relative;
  margin: 2em 0 3em;
}
.rrb-carousel-track {
  display: flex;
  gap: 1.5em;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.6em;
  scrollbar-width: thin;
}
.rrb-carousel-track::-webkit-scrollbar { height: 6px; }
.rrb-carousel-track::-webkit-scrollbar-thumb { background: #1e5a8e; }
.rrb-carousel-track > * {
  flex: 0 0 calc((100% - 3em) / 3);
  scroll-snap-align: start;
}
@media (max-width: 900px) {
  .rrb-carousel-track > * { flex: 0 0 calc((100% - 1.5em) / 2); }
}
@media (max-width: 600px) {
  .rrb-carousel-track > * { flex: 0 0 100%; }
}
.rrb-carousel-nav {
  display: flex;
  gap: 0.5em;
  justify-content: flex-end;
  margin-top: 0.6em;
}
.rrb-carousel-nav button {
  width: 38px; height: 38px;
  background: #111;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.2em;
  transition: background 0.15s;
}
.rrb-carousel-nav button:hover { background: #1e5a8e; }

/* Hover caret on section see-all */
.rrb-see-all::after {
  content: " →";
  transition: margin-left 0.2s;
}
.rrb-see-all:hover::after { margin-left: 0.3em; }

/* Subtle masthead entrance */
.rrb-masthead h1.rrb-title {
  animation: rrb-mast-in 1.2s cubic-bezier(.2,.7,.2,1) both;
}
.rrb-masthead .rrb-tagline {
  animation: rrb-mast-in 1.2s cubic-bezier(.2,.7,.2,1) 0.15s both;
}
@keyframes rrb-mast-in {
  from { opacity: 0; letter-spacing: 0.1em; }
  to   { opacity: 1; letter-spacing: -0.015em; }
}

/* Sepia mode toggle (optional) */
body.rrb-sepia {
  background: #f1e9d6;
}
body.rrb-sepia .navbar { background: #3a2a18 !important; }

/* Image placeholders: gradient wash */
.rrb-ph {
  background: linear-gradient(135deg, #2b2b2b 0%, #1e5a8e 100%);
  width: 100%;
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 800;
  font-size: 1.6em;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.rrb-ph.rrb-ph-4-3 { aspect-ratio: 4 / 3; }
.rrb-ph.rrb-ph-hero { aspect-ratio: 4 / 3; font-size: 2.2em; }
.rrb-ph-essays  { background: linear-gradient(135deg, #0a2540 0%, #1e5a8e 100%); }
.rrb-ph-reviews { background: linear-gradient(135deg, #0d3b66 0%, #8ab9d8 100%); }
.rrb-ph-fiction { background: linear-gradient(135deg, #1e5a8e 0%, #a8c8e0 100%); }
.rrb-ph-poetry  { background: linear-gradient(135deg, #0a2540 0%, #d4a64a 100%); }
