/* Shared visual adapter. Original content, image URLs and JS states stay intact. */
html.rf-legacy {
  --rf-paper: #faf5ea;
  --rf-surface: #fffaf1;
  --rf-ink: #35483e;
  --rf-brown: #30251e;
  --rf-green: #315642;
  --rf-line: #d8cab3;
  --rf-gold: #ad8b55;
  --yellow: #f3ead7;
  --green: #315642;
  --black: #35483e;
  --white: #fffaf1;
  background-color: var(--rf-paper);
}
html.rf-legacy body {
  margin: 0;
  background-color: var(--rf-paper);
  color: var(--rf-ink);
  font: 18px/1.75 Georgia, "Times New Roman", serif;
  overflow-wrap: break-word;
}
html.rf-legacy [hidden] { display: none !important; }
html.rf-legacy a { color: var(--rf-green); text-underline-offset: .22em; }
html.rf-legacy a:hover { text-decoration: underline; }
html.rf-legacy :focus-visible { outline: 3px solid var(--rf-gold); outline-offset: 4px; }
html.rf-legacy body :is(h1,h2,h3) {
  color: var(--rf-brown);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: normal;
}
html.rf-legacy h1 { font-size: clamp(2rem,4.6vw,3.25rem); }
html.rf-legacy h2 { font-size: clamp(1.55rem,3vw,2.1rem); }
html.rf-legacy h3 { font-size: clamp(1.2rem,2.1vw,1.5rem); }
html.rf-legacy p { margin-block: 0 1.15em; }
html.rf-legacy :is(ul,ol) { padding-inline-start: 1.4em; }
html.rf-legacy .inner { width: min(1120px,calc(100% - 40px)); margin-inline: auto; }
/* The old wrapper also contains page content on some templates. */
html.rf-legacy .sticky-header { position: static; top: auto; }
html.rf-legacy .top-bar { height: auto; min-height: 0; padding: 0; background-color: #f0e6d5; }
html.rf-legacy .top-bar .inner { min-height: 0; padding: 0; }
html.rf-legacy .top-bar :is(.language,.language-switch) { padding-block: 6px; font: 14px/1.5 Arial,sans-serif; }
/* Do not reset background-image: these are original page illustrations. */
html.rf-legacy .header-main {
  height: auto;
  min-height: 96px;
  background-color: #eee4cf;
  background-size: contain;
}
html.rf-legacy .header-main .inner {
  height: auto;
  min-height: 96px;
  padding: 14px 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
}
html.rf-legacy .header-main .logo { min-width: 0; max-width: 100%; }
html.rf-legacy .header-main .logo a { display: block; max-width: 100%; }
html.rf-legacy .header-main .logo img {
  display: block;
  max-width: min(280px,100%);
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
}
html.rf-legacy .social-icons { padding: 0; gap: 8px; }
html.rf-legacy .social-icons a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #98846a66;
  border-radius: 50%;
  background-color: #fffaf1dc;
}
html.rf-legacy .social-icons a img { width: 21px; height: 21px; filter: none; object-fit: contain; }
html.rf-legacy .social-icons a img:hover { transform: none; filter: none; }
html.rf-legacy .navbar {
  display: block;
  height: auto;
  background-color: var(--rf-surface);
  border-block: 1px solid var(--rf-line);
}
html.rf-legacy .navbar .inner {
  height: auto;
  padding: 6px 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px 12px;
}
html.rf-legacy .navbar a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 8px;
  font: 16px/1.4 Georgia,serif;
  color: var(--rf-brown);
}
html.rf-legacy .navbar a:not(:last-child)::after { content: none; }
html.rf-legacy .rf-legacy-menu-toggle { display: none; }
html.rf-legacy.rf-legacy-menu-ready :is(.hamburger,#mobileMenu) { display: none !important; }
html.rf-legacy .under-nav {
  height: auto;
  min-height: 190px;
  background-color: #efe3cc;
  background-size: contain;
}
html.rf-legacy .under-nav .inner {
  height: auto;
  min-height: 190px;
  padding: 28px 0;
  gap: 20px;
  flex-wrap: wrap;
}
html.rf-legacy .under-nav .text {
  max-width: 760px;
  padding: 18px 24px;
  border-radius: 14px;
  background-color: #fffaf1ed;
  color: var(--rf-brown);
}
html.rf-legacy .under-nav h1 { margin-block: 0 8px; }
html.rf-legacy .under-nav p { margin: 0; font-size: 18px; }
html.rf-legacy .under-nav .art { display: flex; height: auto; max-width: 200px; }
html.rf-legacy .under-nav .art img { max-width: 100%; height: auto; object-fit: contain; }
html.rf-legacy .strip-share { height: auto; background-color: var(--rf-surface); border-color: var(--rf-line); }
html.rf-legacy .strip-share .inner { height: auto; min-height: 76px; padding: 12px 0; gap: 12px; }
html.rf-legacy :is(.strip-path,.strip-social) { font: 15px/1.5 Arial,sans-serif; font-weight: 400; color: var(--rf-green); }
html.rf-legacy .strip-social-icons a { display: grid; place-items: center; min-width: 40px; min-height: 40px; }

/* Reading surfaces retain the original grids and content order. */
html.rf-legacy :is(.contact-info,.bio-cont,.news-section,.book-synopsis,.legal,.h1-index,.h2-index) {
  padding: clamp(32px,5vw,64px) 0;
  background-color: var(--rf-paper);
}
html.rf-legacy :is(.contact-info .inner,.bio-col p,.news-item p,.news-fulltext,.news-text p,.synopsis-text,.book-data,.product-info,.legal>div,.faq-section) {
  color: var(--rf-ink);
  font: 18px/1.75 Georgia,serif;
}
html.rf-legacy .contact-info .inner { max-width: 820px; }
html.rf-legacy .contact-info :is(h2,h3) { font-weight: 400; margin-block: 1.4em .65em; }
html.rf-legacy .contact-info h2 { font-size: clamp(1.6rem,3.4vw,2.2rem); }
html.rf-legacy .contact-info h3 { font-size: clamp(1.3rem,2.4vw,1.7rem); }
html.rf-legacy .contact-actions-inline { flex-wrap: wrap; gap: 16px; margin-block: 24px; }
html.rf-legacy .contact-actions-inline .social-icon { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--rf-line); border-radius: 50%; background-color: var(--rf-surface); }
html.rf-legacy .bio-cont .inner { gap: 40px; }
html.rf-legacy .bio-divider { background-color: var(--rf-line); opacity: 1; }
html.rf-legacy .bio-col :is(h2,h3) { color: var(--rf-brown); }
html.rf-legacy :is(.contacto-img,.bio-inline-img,.bio-inline-img2) { max-width: 100%; height: auto; object-fit: contain; border-radius: 14px; box-shadow: 0 8px 28px #30251e18; }
html.rf-legacy .contacto-img { width: min(100%,560px); margin-block: 36px; }
html.rf-legacy :is(.news-section .inner,.synopsis-content,.reader-layout) { gap: 32px; }
html.rf-legacy .news-section .inner { grid-template-columns: minmax(0,1fr) 280px; }
html.rf-legacy .news-item { padding-bottom: 28px; margin-bottom: 28px; border-color: var(--rf-line); }
html.rf-legacy .news-item h2 { font-size: clamp(1.4rem,2.5vw,1.8rem); }
html.rf-legacy .news-title { font-size: clamp(1.7rem,3vw,2.2rem); }
html.rf-legacy :is(.news-date,.date,.synopsis-nav,.breadcrumb,.author-line,.rating-row,.product-meta,.secure-note,.related,.news-nav-bottom) { font: 14px/1.6 Arial,sans-serif; color: #665e52; }
html.rf-legacy .news-sidebar { padding: 24px; border: 1px solid var(--rf-line); border-radius: 16px; background-color: var(--rf-surface); }
html.rf-legacy .sidebar-block h3 { font-size: 1.2rem; }
html.rf-legacy :is(.news-layout img,.detail-image-container img,.sidebar-block img,.book-cover img,.reader-side img) { max-width: 100%; height: auto; object-fit: contain; border-radius: 10px; }
html.rf-legacy .news-pagination { flex-wrap: wrap; gap: 8px; }
html.rf-legacy .news-pagination :is(a,span) { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 6px 12px; border-color: var(--rf-line); border-radius: 8px; font-size: 16px; }
html.rf-legacy .tag.s { font-size: 14px; }
html.rf-legacy .legal>div { width: min(860px,calc(100% - 40px)); }
html.rf-legacy .legal :is(h2,h3) { margin-block: 1.5em .65em; font-size: clamp(1.25rem,2.5vw,1.7rem); }
html.rf-legacy .legal li { margin-bottom: .55em; }
html.rf-legacy .faq-section { width: min(920px,calc(100% - 40px)); margin: 36px auto; padding: 16px 0; }
html.rf-legacy .faq-item { border-color: var(--rf-line); padding-block: 12px; }
html.rf-legacy .faq-question { min-height: 48px; gap: 16px; padding-block: 12px; text-align: left; color: var(--rf-brown); font: 19px/1.5 Georgia,serif; }
html.rf-legacy .faq-item.active .faq-answer { max-height: none; overflow: visible; }
html.rf-legacy .faq-answer p { font: 18px/1.75 Georgia,serif; color: var(--rf-ink); }
html.rf-legacy .product-title { font-size: clamp(1.7rem,3vw,2.2rem); }
html.rf-legacy .product-purchase { flex-wrap: wrap; }
html.rf-legacy .product-purchase label { font-size: 16px; }
html.rf-legacy .purchase-box { padding: 24px; border-color: var(--rf-line); border-radius: 16px; background-color: var(--rf-surface); box-shadow: 0 8px 24px #30251e0c; font: 16px/1.65 Arial,sans-serif; }
html.rf-legacy .price-row { font: 28px/1.3 Georgia,serif; color: var(--rf-brown); }
html.rf-legacy .stock { font-size: 14px; }
html.rf-legacy .pdf-side iframe { max-width: 100%; border: 1px solid var(--rf-line); border-radius: 12px; }
html.rf-legacy :is(.box-element,.news-sidebar) { background-color: #f2e9d8; }
html.rf-legacy .box-element { padding: 48px 0; border-top: 1px solid var(--rf-line); }
html.rf-legacy .box-element .inner { gap: 20px; }
html.rf-legacy .box-element .box-item { transform: none; padding: 18px; border: 1px solid var(--rf-line); border-radius: 14px; background-color: var(--rf-surface); }
html.rf-legacy .box-item h3 { margin-bottom: 16px; font-size: 1.15rem; }
html.rf-legacy .box-item a { color: var(--rf-ink); font-size: 16px; }
html.rf-legacy .box-item .media { aspect-ratio: auto; overflow: visible; margin-bottom: 16px; }
html.rf-legacy .box-item .media img { width: 100%; height: auto; object-fit: contain; border-radius: 8px; margin-bottom: 0; }
html.rf-legacy .box-item p { margin-bottom: 0; }
html.rf-legacy .footer { background-color: var(--rf-brown); color: #fff2d7; padding: 28px 0; font: 14px/1.8 Arial,sans-serif; }
html.rf-legacy .footer .inner { justify-content: center; text-align: center; }
html.rf-legacy .footer a { display: inline-block; color: #fff2d7; margin: 4px 6px; white-space: normal; text-decoration: underline; }

/* Form controls keep original names, values, actions and event handlers. */
html.rf-legacy :is(input,textarea,select,button) { font-family: Arial,sans-serif; }
html.rf-legacy :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),textarea,select) {
  min-height: 44px;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid #a9ad9c;
  border-radius: 8px;
  background-color: #fff;
  color: var(--rf-ink);
  font-size: 16px;
  line-height: 1.5;
}
html.rf-legacy :is(.buy-button,.contact-trigger,.contact-actions .submit,.cookie-accept,.sidebar-search button,.btn) {
  min-height: 44px;
  padding: 11px 20px;
  border: 1px solid var(--rf-green);
  border-radius: 9px;
  background-color: var(--rf-green);
  color: #fffaf1;
  font: 16px/1.4 Arial,sans-serif;
  letter-spacing: normal;
  text-decoration: none;
  cursor: pointer;
}
html.rf-legacy :is(.secondary-btn,.format-toggle-btn,.cookie-reject,.contact-actions .cancel) { min-height: 44px; padding: 10px 16px; border: 1px solid #a9ad9c; border-radius: 8px; background-color: var(--rf-surface); color: var(--rf-ink); font: 16px/1.4 Arial,sans-serif; opacity: 1; }
html.rf-legacy .format-toggle-btn.active { background-color: #e3eadf; border-color: var(--rf-green); }
html.rf-legacy .qty-control :is(button,input) { min-height: 44px; height: 44px; font-size: 16px; }
html.rf-legacy .contact-modal { width: min(620px,calc(100vw - 32px)); max-width: 620px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: clamp(20px,4vw,32px); border: 1px solid var(--rf-line); border-radius: 18px; background-color: var(--rf-surface); box-shadow: 0 18px 60px #30251e33; }
html.rf-legacy .contact-modal h2 { margin-bottom: 20px; font-size: 1.8rem; }
html.rf-legacy .contact-modal .contact-form label { margin-bottom: 16px; font: 15px/1.5 Arial,sans-serif; }
html.rf-legacy .contact-modal .contact-form textarea { min-height: 140px; max-height: none; }
html.rf-legacy .contact-form .contact-checkbox { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; white-space: normal; }
html.rf-legacy .contact-form .contact-checkbox input[type=checkbox] { flex: 0 0 22px; width: 22px; min-width: 22px; max-width: 22px; height: 22px; margin-top: 1px; accent-color: var(--rf-green); }
html.rf-legacy .contact-actions { flex-wrap: wrap; margin-top: 20px; gap: 12px; }
/* No override of opacity/pointer-events/active: consent state stays in global.js. */
html.rf-legacy .cookie-overlay { left: 20px; bottom: 20px; width: min(440px,calc(100vw - 40px)); max-width: calc(100vw - 40px); }
html.rf-legacy .cookie-modal { width: 100%; max-width: none; max-height: calc(100vh - 40px); overflow-y: auto; padding: 24px; border: 1px solid var(--rf-line); border-radius: 16px; background-color: var(--rf-surface); opacity: 1; text-align: left; box-shadow: 0 12px 40px #30251e24; }
html.rf-legacy .cookie-modal h2 { font-size: 1.5rem; }
html.rf-legacy .cookie-modal p { font-size: 16px; color: var(--rf-ink); }
html.rf-legacy .cookie-actions { justify-content: flex-start; flex-wrap: wrap; gap: 12px; }

@media(max-width:900px) {
  html.rf-legacy .news-section .inner { grid-template-columns: minmax(0,1fr); }
  html.rf-legacy .news-sidebar { margin-top: 8px; }
  html.rf-legacy .bio-cont .inner { grid-template-columns: minmax(0,1fr); gap: 24px; }
  html.rf-legacy .bio-divider { display: none; }
  html.rf-legacy .box-element .inner { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:820px) {
  html.rf-legacy .header-main .inner { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; min-height: 0; padding: 12px 0; }
  html.rf-legacy .header-main .logo { grid-column: 1; grid-row: 1; }
  html.rf-legacy .header-main .logo img { max-height: 52px; }
  html.rf-legacy .header-main .social-icons { grid-column: 1/-1; grid-row: 2; justify-content: flex-start; }
  html.rf-legacy .rf-legacy-menu-toggle:not([hidden]) { display: inline-flex; grid-column: 2; grid-row: 1; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid #99866b; border-radius: 8px; background-color: var(--rf-surface); color: var(--rf-brown); font: 16px/1.3 Arial,sans-serif; cursor: pointer; }
  html.rf-legacy .navbar .inner { flex-direction: column; align-items: stretch; padding-block: 8px; max-height: 65vh; overflow-y: auto; gap: 0; }
  html.rf-legacy .navbar a { padding: 10px 12px; font-size: 17px; }
  html.rf-legacy .under-nav,html.rf-legacy .under-nav .inner { min-height: 160px; }
  html.rf-legacy .under-nav .inner { padding-block: 24px; }
  html.rf-legacy .under-nav .text { padding: 16px 18px; }
  html.rf-legacy .strip-share .inner { flex-direction: column; align-items: flex-start; text-align: left; }
  html.rf-legacy .strip-social { flex-wrap: wrap; gap: 8px; }
}
@media(max-width:770px) {
  html.rf-legacy :is(.synopsis-content,.reader-layout,.news-layout) { grid-template-columns: minmax(0,1fr); }
  html.rf-legacy .news-image { float: none; width: 100%; max-width: 420px; margin: 0 auto 24px; }
}
@media(max-width:560px) {
  html.rf-legacy .inner { width: calc(100% - 32px); }
  html.rf-legacy .box-element .inner { grid-template-columns: minmax(0,1fr); }
  html.rf-legacy .contact-row { grid-template-columns: minmax(0,1fr); }
  html.rf-legacy .contact-actions { justify-content: stretch; }
  html.rf-legacy .contact-actions button { flex: 1 1 120px; }
  html.rf-legacy .legal>div,html.rf-legacy .faq-section { width: calc(100% - 32px); }
}
@media(prefers-reduced-motion:reduce) {
  html.rf-legacy .grat-logo { animation: none; }
  html.rf-legacy :is(.social-icons img,.logo img,.contact-modal,.cookie-modal,.faq-answer) { transition: none; }
}
