H1 {
    font-size: 1.7rem;
    padding-left: 0;
}
H1.new-main-page-header {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-weight: normal;
    color: #E60000;
    padding-left: 0;
}

/* Title + logo: horizontal flex; wrap used on narrow screens instead of column layout */
.new-main-title-row {
    /* H1 text ends at (50vw - 20px), logo starts 40px after it */
    display: flex;
    align-items: center;
}

.new-main-title-row .new-main-page-header {
    margin-bottom: 0;
    /* Box ends at the design line: (50vw - 20px). Text inside is scaled to match. */
    width: calc(50vw - var(--new-main-hero-center-offset) - var(--new-main-hero-gutter));
    display: inline-block;
    white-space: nowrap;
    transform: scale(var(--new-main-h1-scale, 1));
    transform-origin: left center;
}

.new-main-title-row .new-logo {
    flex-shrink: 0;
    margin-left: var(--new-main-hero-logo-gap-fixed);
}

.new-main-title-row .new-logo img {
    display: block;
    width: auto;
}

@media (max-width: 767.98px) {
    /* Keep baseline alignment */
    .new-main-content-inner .new-main-title-row {
        align-items: center;
    }
}

.new-main-page-subtitle {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-weight: normal;
    color: #E60000;
    padding-left: 0;
}
.top-menu-cont .top-menu-item a {
    color: #E60000;
    text-decoration: none;
    font-family: Inter, sans-serif;
    font-weight: normal;
}
.new-main-content{
    background-color: #FFFFFF;
    width: 100%;
}

/* Full viewport width — break out of #app_container.container-fluid gutters (same pattern as .new-main-page-footer) */
#app_container > .new-main-content {
    box-sizing: border-box;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: 0;
    padding-right: 0;
}

/* Hero: height follows fishfone.png (1440×800) so the bottom edge matches the image — no
   arbitrary min-height that “jumps” across breakpoints. White block sits flush under this box. */
.new-main-content-inner {
    box-sizing: border-box;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    /* Base proportions @ 1440px: 40 / 1200 / 40 / (logo) */
    --new-main-hero-gutter: calc(100vw * 40 / 1440);
    --new-main-hero-title: calc(100vw * 1200 / 1440);
    --new-main-hero-gap: calc(100vw * 40 / 1440);
    /* Fixed designer anchors */
    --new-main-hero-center-offset: 20px;
    --new-main-hero-logo-gap-fixed: 40px;
    position: relative;
    aspect-ratio: 1440 / 800;
    padding-top: clamp(0.75rem, calc(1.5vw + 0.35rem), 1.5rem);
    padding-left: var(--new-main-hero-gutter);
    padding-right: var(--new-main-hero-gutter);
    padding-bottom: clamp(2.75rem, 6vw, 4rem);
    text-align: left;
    background-image: url("/static/img/fishfone.png");
    background-size: 100% auto;
    background-position: top center;
    background-repeat: no-repeat;
}

/* Main page: menu scrolls with hero (not fixed). */
.new-main-hero-menu {
    width: 100%;
    margin-bottom: 0.15rem;
}

.new-main-hero-menu .top-menu-cont .top-menu-item a {
    text-transform: lowercase;
}

/* Clickable down arrow: bottom center of hero, scrolls to featured block */
.new-main-scroll-down {
    position: absolute;
    left: 50%;
    bottom: clamp(0.5rem, 2vw, 1.25rem);
    z-index: 2;
    transform: translateX(-50%);
    line-height: 0;
    text-decoration: none;
    display: block;
}

.new-main-scroll-down img {
    display: block;
    width: clamp(28px, 5vw, 40px);
    height: auto;
}

.new-main-scroll-down:hover img,
.new-main-scroll-down:focus-visible img {
    opacity: 0.82;
}

.new-main-scroll-down:focus-visible {
    outline: 2px solid #E60000;
    outline-offset: 4px;
    border-radius: 2px;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Same column width as hero; directly under the hero — no top gap */
.new-main-content-inner-last-stared {
    box-sizing: border-box;
    width: 100%;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
    padding: 0 0 clamp(1rem, 2vw, 1.75rem);
}

/* All stared text parts (grid of cards below featured); same max-width rhythm as last-stared */
.new-main-content-inner-all-stared {
    box-sizing: border-box;
    width: 100%;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
    padding: 0 0 clamp(1rem, 2vw, 1.75rem);
}

/* Red strip under main_new; full viewport width (no gaps from .container-fluid padding) */
#app_container > .new-main-page-footer {
    box-sizing: border-box;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    position: relative;
    min-height: 100px;
    background-color: #E60000;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 clamp(0.75rem, 2vw, 1.5rem);
    margin-top: 0;
}

.new-main-page-footer__link {
    color: #fff;
    text-decoration: none;
    font-family: Inter, sans-serif;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
}

.new-main-page-footer__link:hover,
.new-main-page-footer__link:focus {
    color: #fff;
    text-decoration: underline;
}

.new-main-all-stared-heading {
    margin-bottom: clamp(0.75rem, 1.5vw, 1.25rem);
}

.new-main-all-stared-heading__title {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: normal;
    color: #0B6977;
    margin: 0;
    padding: 0;
}

.new-main-all-stared {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(1rem, 2vw, 1.75rem);
    align-items: start;
}

@media (max-width: 991.98px) {
    .new-main-all-stared {
        grid-template-columns: 1fr;
    }
}

.new-main-all-stared__card {
    margin-top: 0;
}

.bg_seacolor{
    background-color: #99CDD6
}


/* Fluid type and spacing on the new main page — scales with viewport up to clamp max */
:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .top-menu-cont .top-menu-item a {
    font-size: clamp(0.8rem, calc(1.1vw + 0.5rem), 1.5rem);
    margin-right: clamp(0.65rem, 1.8vw, 2rem);
}

/* Hero main_new search only — narrow strip + red outline (#E60000); do not reuse on other pages */
:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .top-menu-search--hero {
    /* Keep search proportional: do not stretch to fill leftover space */
    flex: 0 1 auto;
    min-width: 0;
    max-width: calc(22rem / 3);
    margin-right: 0;
}

/* Tablet / narrow: modest width — avoid a bar that spans most of the hero */
@media (max-width: 991.98px) {
    :is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .top-menu-search--hero {
        align-self: flex-start;
        max-width: min(100%, clamp(7rem, 30vw, 10.5rem));
    }
}

/* Small phones: shorter bar; left-aligned like nav links */
@media (max-width: 575.98px) {
    :is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .top-menu-cont {
        align-items: flex-start;
    }

    :is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .top-menu-search--hero {
        flex: 0 1 auto;
        align-self: flex-start;
        width: auto;
        max-width: min(100%, clamp(6.5rem, 42vw, 9.5rem));
        min-width: 0;
        box-sizing: border-box;
    }

    :is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .new-main-top-search--hero {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    :is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .top-menu-user--hero {
        margin-left: 0;
        align-self: flex-start;
    }
}

:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .new-main-top-search--hero .new-main-top-search__group {
    max-width: 100%;
    /* Bootstrap .input-group uses flex-wrap: wrap — on narrow heroes the button drops to a second row */
    flex-wrap: nowrap;
    align-items: stretch;
    min-width: 0;
}

/* Direct .form-control + .btn (no .input-group-append): same height as BS input-group-sm on both */
:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .new-main-top-search--hero .input-group-sm.new-main-top-search__group > .new-main-top-search__input,
:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .new-main-top-search--hero .input-group-sm.new-main-top-search__group > .new-main-top-search__submit {
    box-sizing: border-box;
    font-size: 0.875rem;
    line-height: 1.5;
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
}

:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .new-main-top-search--hero .new-main-top-search__input {
    min-width: 0;
    flex: 1 1 auto;
    width: 1%;
    background: rgba(255, 255, 255, 0.92);
    border-color: #E60000;
    color: #111;
}

:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .new-main-top-search--hero .new-main-top-search__input:focus {
    border-color: #E60000;
    box-shadow: 0 0 0 0.2rem rgba(230, 0, 0, 0.2);
}

:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .new-main-top-search--hero .new-main-top-search__submit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E60000;
    color: #fff;
    background: #E60000;
}

:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .new-main-top-search--hero .new-main-top-search__submit svg {
    fill: #fff;
    color: #fff;
    width: clamp(14px, calc(0.35rem + 2.8vw), 16px);
    height: clamp(14px, calc(0.35rem + 2.8vw), 16px);
}

:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .new-main-top-search--hero .new-main-top-search__submit:hover {
    background: #c40000;
    color: #fff;
    border-color: #c40000;
}

:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .new-main-top-search--hero .new-main-top-search__submit:hover svg {
    fill: #fff;
}

:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .new-main-top-search--hero .new-main-top-search__submit:focus {
    box-shadow: 0 0 0 0.2rem rgba(230, 0, 0, 0.25);
}

/* user-block in hero top menu (navbar uses light text on dark bg; here we match red menu links) */
:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .top-menu-user--hero {
    align-self: center;
    min-width: 0;
    /* same horizontal rhythm as .top-menu-item a margin-right */
    margin-left: clamp(0.65rem, 1.8vw, 2rem);
}

:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .top-menu-user--hero .user-block.container-fluid {
    width: auto;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    justify-content: flex-end;
}

:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .top-menu-user--hero .user-block .text-light {
    color: #E60000 !important;
    font-family: Inter, sans-serif;
    font-weight: normal;
    font-size: clamp(0.75rem, calc(0.9vw + 0.55rem), 0.95rem);
}

:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .top-menu-user--hero .user-block .btn-outline-light {
    border: 1px solid #E60000;
    color: #fff;
    background: #E60000;
}

:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .top-menu-user--hero .user-block .btn-outline-light:hover {
    background: #c40000;
    border-color: #c40000;
    color: #fff;
}

:is(.new-main-content-inner, .site-top-bar.site-top-bar--sticky) .top-menu-user--hero .user-block .btn-outline-light:focus {
    box-shadow: 0 0 0 0.2rem rgba(230, 0, 0, 0.25);
}

/* Shared clamp for h1; logo uses a fraction of that size (scales together) */
.new-main-content-inner .new-main-title-row {
    --new-main-title-size: clamp(2.25rem, calc(4.4vw + 1.1rem), 5.25rem);
    --new-main-logo-size: calc(var(--new-main-title-size) / 1.5);
    line-height: 1;
    width: 100%;
    margin-top: clamp(1rem, 2.5vw, 1.5rem);
}

.new-main-content-inner .new-main-title-row h1.new-main-page-header {
    font-size: var(--new-main-title-size);
    line-height: 1;
    min-width: 0;
}

/* SVG/img: same fluid scale as the h1 (viewBox 181×52); span must be block-level for sizing */
.new-main-content-inner .new-main-title-row .new-logo {
    display: block;
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    line-height: 0;
}

/* Logo: 1.5× smaller than title cap height; width follows SVG */
.new-main-content-inner .new-main-title-row .new-logo img {
    display: block;
    height: var(--new-main-logo-size);
    max-height: var(--new-main-logo-size);
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.new-main-content-inner .new-main-page-subtitle {
    font-size: clamp(1.125rem, calc(2.2vw + 0.5rem), 2.5rem);
    margin-top: clamp(1rem, 2.5vw, 1.5rem);
    text-align: left;
}

/* Featured stared part (below hero on main_new) */
.new-main-featured {
    background: #fff;
    color: #222;
    margin-top: 0;
    padding: clamp(1rem, 2vw, 1.75rem);
    border-radius: 2px;
    width: 100%;
    box-sizing: border-box;
}

.new-main-featured__tabs {
    font-family: Inter, sans-serif;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    margin-bottom: 0.85rem;
}

.new-main-featured__tab {
    margin-right: 1.25rem;
    font-weight: bold;
    display: inline-block;
}

.new-main-featured__tab--active {
    color: #0B6977;
}

.new-main-featured__tab--muted {
    color: #8ecbd3;
}

.new-main-featured__grid {
    display: grid;
    gap: clamp(1rem, 2vw, 1.75rem);
    align-items: start;
}

.new-main-featured__grid--has-image {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.new-main-featured__grid--text-only {
    grid-template-columns: 1fr;
}

@media (max-width: 767.98px) {
    .new-main-featured__grid--has-image {
        grid-template-columns: 1fr;
    }
}

.new-main-featured__image-inner {
    width: 100%;
    background: #e8e8e8;
    border-radius: 2px;
    overflow: hidden;
}

.new-main-featured__img {
    width: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 3 / 4;
}

.new-main-featured__tags {
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
}

.new-main-featured__tag {
    font-family: Inter, sans-serif;
    font-weight: normal;
    font-size: 0.75rem;
    color: #555;
    background: #efefef;
    padding: 0.15rem 0.45rem;
    border-radius: 2px;
    text-decoration: none;
}

.new-main-featured__tag:hover {
    text-decoration: underline;
    color: #333;
}

/* Site-wide tag look = main featured: light #efefef, dark text — never Bootstrap badge-secondary (dark pill / white text) */
.new-main-featured__tags .new-main-featured__tag {
    font-family: Inter, sans-serif !important;
    font-weight: normal !important;
    font-size: 0.75rem !important;
    color: #555 !important;
    background: #efefef !important;
    padding: 0.15rem 0.45rem !important;
    border-radius: 2px !important;
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
}

.new-main-featured__tags .new-main-featured__tag:hover {
    text-decoration: underline !important;
    color: #333 !important;
}

/* Staff tag editor: same chip as main, with remove — force over any .badge / cached markup */
.tag-list-interface .new-main-featured__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
}

.tag-list-interface .tag-list-interface__chip {
    display: inline-flex !important;
    align-items: center;
    gap: 0.25rem;
    background: #efefef !important;
    color: #555 !important;
    border-radius: 2px !important;
    padding: 0.15rem 0.35rem 0.15rem 0.45rem !important;
    font-weight: normal !important;
    border: none !important;
    box-shadow: none !important;
}

.tag-list-interface .tag-list-interface__chip .new-main-featured__tag {
    background: transparent !important;
    padding: 0 !important;
    color: #555 !important;
    font-family: Inter, sans-serif !important;
    font-weight: normal !important;
    font-size: 0.75rem !important;
    border-radius: 0 !important;
}

.tag-list-interface .tag-list-interface__chip-remove {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1;
    cursor: pointer;
    color: #555 !important;
    display: inline-flex;
    align-items: center;
    font-weight: normal !important;
    box-shadow: none !important;
}

.tag-list-interface .tag-list-interface__chip-remove:hover {
    color: #111 !important;
}

.tag-list-interface .badge,
.tag-list-interface .badge-pill,
.tag-list-interface .badge-secondary,
.tag-list-interface a.badge-secondary {
    background-color: #efefef !important;
    color: #555 !important;
    font-weight: normal !important;
    font-size: 0.75rem !important;
    border-radius: 2px !important;
    padding: 0.15rem 0.45rem !important;
}

.new-main-featured__author {
    margin: 0 0 0.65rem 0;
    font-family: Inter, sans-serif;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    line-height: 1.3;
}

.new-main-featured__author-link {
    color: #0B6977;
    text-decoration: none;
}

.new-main-featured__author-link:hover {
    text-decoration: underline;
    color: #084a54;
}

.new-main-featured__title {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: clamp(1.25rem, 2.5vw, 1.85rem);
    font-weight: normal;
    color: #0B6977;
    margin: 0 0 0.75rem 0;
    line-height: 1.25;
}

.new-main-featured__title-link {
    color: inherit;
    text-decoration: none;
}

.new-main-featured__title-link:hover .new-main-featured__title {
    text-decoration: underline;
}

.new-main-featured__title-arrow {
    vertical-align: -0.125em;
    margin-left: 0.15rem;
}

.new-main-featured__text-body {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: clamp(0.9rem, 1.4vw, 1rem);
    line-height: 1.5;
    color: #111;
}

.new-main-featured__body-arrow {
    display: inline-block;
    margin-left: 0.2em;
    vertical-align: 0.05em;
    color: #111;
    text-decoration: none;
    line-height: 1;
}

.new-main-featured__body-arrow:hover {
    color: #0B6977;
}

.new-main-featured__body-arrow:focus-visible {
    outline: 2px solid #0B6977;
    outline-offset: 2px;
}

.new-main-featured__body-arrow-icon {
    vertical-align: -0.12em;
}

/*
 * Site-wide headings: same font and color as featured block (.new-main-featured__title).
 * Excludes main hero brand (h1.new-main-page-header) — stays red.
 */
.redfisbay h1.book-list-header,
.redfisbay h2.book-list-header,
.redfisbay h1.main-page-header:not(.new-main-page-header),
.redfisbay h1.search-page-header,
.redfisbay h1.part-header,
.redfisbay h4.contents-header,
.redfisbay h2.main-widget_header,
.redfisbay .widget-header h2,
.redfisbay h2.nav-headers {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-weight: normal;
    color: #0B6977;
    line-height: 1.25;
}

.redfisbay h1.book-list-header,
.redfisbay h1.main-page-header:not(.new-main-page-header),
.redfisbay h1.search-page-header,
.redfisbay h1.part-header {
    font-size: clamp(1.25rem, 2.5vw, 1.85rem);
}

.redfisbay h2.book-list-header,
.redfisbay h2.main-widget_header,
.redfisbay .widget-header h2 {
    font-size: clamp(1.25rem, 2.5vw, 1.85rem);
}

.redfisbay h4.contents-header {
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
}

/* Old main.html widgets: card titles (h3 inside .widget-title) */
.redfisbay .widget-title h3 {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-weight: normal;
    color: #0B6977;
    line-height: 1.25;
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
    margin: 0;
}

.redfisbay h2.nav-headers {
    font-size: clamp(1.1rem, 1.9vw, 1.5rem);
}

/* Root / structure admin pages (body.structure-body — no .redfisbay on #app_container) */
body.structure-body h1.root-page-header,
body.structure-body h2.structure-header,
body.structure-body h3.structure-header {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-weight: normal;
    color: #0B6977;
    line-height: 1.25;
}

body.structure-body h1.root-page-header {
    font-size: clamp(1.1rem, 1.9vw, 1.5rem);
}

body.structure-body h2.structure-header,
body.structure-body h3.structure-header {
    font-size: clamp(1.15rem, 2vw, 1.65rem);
}

/* Authors / books / texts list pages: list heading color */
.authors-list-page__title,
.books-list-page__title,
.texts-list-page__title {
    color: #0B6977;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-weight: normal;
    line-height: 1.25;
    font-size: clamp(1.25rem, 2.5vw, 1.85rem);
}

/* Books / texts list: author link in H1 — global `a` rules would otherwise force black */
.books-list-page__title a,
.texts-list-page__title a {
    color: #0B6977;
}
.books-list-page__title a:hover,
.texts-list-page__title a:hover {
    color: #084a54;
}
.books-list-page__title a:visited,
.texts-list-page__title a:visited {
    color: #084a54;
}
.books-list-page__title a:focus-visible,
.texts-list-page__title a:focus-visible {
    outline: 2px solid #0B6977;
    outline-offset: 2px;
}

@media (max-width: 767.98px) {
    /* Match main featured: image on top when stacked */
    .authors-page__card .new-main-featured__image-col,
    .books-page__card .new-main-featured__image-col,
    .texts-page__card .new-main-featured__image-col {
        order: -1;
    }
}

.authors-page__card,
.books-page__card,
.texts-page__card {
    border: 1px solid #d8d8d8;
    margin: 0;
}

.authors-page__card .authors-page__card-grid,
.books-page__card .books-page__card-grid,
.texts-page__card .texts-page__card-grid {
    align-items: stretch;
}

.authors-page__card-actions,
.books-page__card-actions,
.texts-page__card-actions {
    margin: 0 0 0.75rem 0;
}

.authors-page__image-inner,
.books-page__image-inner,
.texts-page__image-inner {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.authors-page__placeholder-wrap,
.books-page__placeholder-wrap,
.texts-page__placeholder-wrap {
    width: 100%;
    flex: 1;
    min-height: 12rem;
    aspect-ratio: 3 / 4;
    border-radius: 2px;
    overflow: hidden;
}

.authors-page__placeholder-svg,
.books-page__placeholder-svg,
.texts-page__placeholder-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.authors-page__author-img,
.authors-page__image-inner .img-thumbnail,
.books-page__book-img,
.books-page__image-inner .img-thumbnail,
.texts-page__text-img,
.texts-page__image-inner .img-thumbnail {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    display: block;
    object-fit: cover;
    aspect-ratio: 3 / 4;
    box-sizing: border-box;
}

.texts-page__title-icon {
    display: inline-block;
    vertical-align: -0.15em;
    margin-left: 0.35rem;
}

.top-menu-cont .top-menu-item a:hover {
    color: #580101;
    text-decoration: underline;
}
.top-menu-cont .top-menu-item a:visited {
    color: #E60000;
    text-decoration: underline;
}

h3, h4 {
    font-size: 1.2rem;
    padding-left: 0;
}

a {
    color: black;
}


a:hover {
    color: #580101;
}
a.card-link:hover {
    color: #580101;
    text-decoration: underline;
}

a:visited {
    color: black;
}

a.link-in-text {
    color: darkred;
    text-decoration: underline;
}
a.link-in-text:hover {
    color: red;
}
a.link-in-text:visited {
    color: darkred;
}

.bg-redfisbay {
    background-color: #411F1F;
    color: whitesmoke;
}

/* Sticky nav in base.html: mint background */
.site-top-bar.site-top-bar--sticky {
    background-color: #efefef;
    color: #222;
}

/* Footer in base.html: brand red */
.footer.footer--brand {
    background-color: #E60000;
    color: whitesmoke;
}

/* Page body: same teal as main_new hero / new-main-content */
.redfisbay-body {
    background-color: #ffffff;
}

.redfisbay{
    min-height: 1000px;
    max-width: 1440px;
}

/*
 * Sidebar table of contents (text parts / book texts + chapters).
 * Inactive: Inter, black, underlined. Current book text (L1): Georgia, teal. Active part (L2): Inter, red, no underline.
 */
.redfisbay .book-toc {
    --book-toc-teal: #0B6977;
    /* Accent for active chapter; #0B6977 is teal — use a true red here (see mockup). */
    --book-toc-red: #C41E3A;
}

.book-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Nested chapter list under the current book text */
.book-toc__list--chapters {
    margin-top: 0.5rem;
    padding-left: 2.5rem;
}

.book-toc__item {
    margin-bottom: 0.85rem;
}

.book-toc__item:last-child {
    margin-bottom: 0;
}

.book-toc__link {
    font-family: Inter, sans-serif;
    font-weight: 400;
    color: #111;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.12em;
    line-height: 1.45;
}

.book-toc__link:hover {
    color: #000;
}

.book-toc__link:focus-visible {
    outline: 2px solid var(--book-toc-teal);
    outline-offset: 2px;
}

/* Level 1 in book TOC: other texts — slightly larger than chapter links */
.book-toc__link--text {
    font-size: clamp(1.03rem, 1.2vw, 1.12rem);
}

/* Current text title in book TOC (level 1, active): Georgia, teal, no underline */
.book-toc__current-text {
    display: block;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-weight: normal;
    color: var(--book-toc-teal);
    line-height: 1.35;
    font-size: clamp(1.1rem, 1.35vw, 1.28rem);
}

/* Active chapter / part (level 2): Inter, red, no underline */
.book-toc__link--chapter.is-active {
    color: var(--book-toc-red);
    text-decoration: none;
    font-family: Inter, sans-serif;
}

/* Mobile: TOC drawer under sticky top bar */
.toc-drawer__toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 767.98px) {
    :root {
        /* Set by JS from actual .site-top-bar--sticky height; fallback is safe. */
        --site-sticky-top: var(--site-top-bar-height, 92px);
    }

    .toc-drawer__ear {
        position: fixed;
        right: 0;
        top: calc(var(--site-sticky-top) + 10px);
        /* Must not cover sticky header */
        z-index: 1000;
        width: 34px;
        height: 104px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #E60000;
        color: #fff;
        border-radius: 12px 0 0 12px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
        cursor: pointer;
        user-select: none;
        padding: 8px 6px;
    }

    .toc-drawer__ear-text {
        font-family: Inter, sans-serif;
        font-size: 0.78rem;
        font-weight: 600;
        letter-spacing: 0.03em;
        text-transform: uppercase;
        line-height: 1;
        writing-mode: vertical-rl;
        text-orientation: mixed;
        /* Make text read top-to-bottom on the right edge */
        transform: rotate(180deg);
    }

    .toc-drawer__ear:focus-visible {
        outline: 2px solid #0B6977;
        outline-offset: 2px;
    }

    .toc-drawer__backdrop {
        position: fixed;
        inset: 0;
        z-index: 1080;
        background: rgba(0, 0, 0, 0.28);
        display: none;
    }

    .toc-drawer {
        position: fixed;
        right: 0;
        top: var(--site-sticky-top);
        z-index: 1090;
        width: min(92vw, 420px);
        height: calc(100vh - var(--site-sticky-top));
        background: #fff;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
        transform: translateX(105%);
        transition: transform 180ms ease-out;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.75rem 0.9rem 1rem;
    }

    .toc-drawer__header {
        position: sticky;
        top: 0;
        z-index: 1;
        background: #fff;
        padding: 0.25rem 0 0.6rem;
        border-bottom: 1px solid #e9ecef;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .toc-drawer__title {
        font-family: Georgia, 'Times New Roman', Times, serif;
        font-size: 1.15rem;
        font-weight: normal;
        color: #0B6977;
        line-height: 1.2;
    }

    .toc-drawer__close {
        width: 34px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        cursor: pointer;
        color: #111;
        background: #f3f5f7;
    }

    .toc-drawer__close:hover {
        background: #e9ecef;
    }

    /* Open state via checkbox hack */
    .toc-drawer__toggle:checked ~ .toc-drawer {
        transform: translateX(0);
    }
    .toc-drawer__toggle:checked ~ .toc-drawer__backdrop {
        display: block;
    }

    /* Reduce spacing inside drawer */
    .toc-drawer .parts-list {
        margin-bottom: 0;
    }
    .toc-drawer .contents-header {
        /* Avoid duplicate "Book contents" heading (drawer has its own title) */
        display: none;
    }
}

.list-group .list-group-item.active {
    background-color: #580101;
    color: white;
    border-color: #580101;
}

.list-group .list-group-item.active a, .copyright a {
    color: white;
}

.list-group .list-group-item.active a:hover, .copyright a:hover {
    color: wheat;
}

.list-group .list-group-item.active a:visited, .copyright a:visited {
    color: white;
}

.nav-menu-cont {
    position: fixed;
    width: 100%;
    bottom: 10px;
    left: 0;
}

.book-nav-panel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #efefef;
    border-radius: 6px;
    color: #0B6977;
}

.book-nav-panel__nav,
.book-nav-panel__actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.book-nav-panel__gap {
    width: 14px;
    height: 1px;
}

.book-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    line-height: 1;
    border: 0;
    background: transparent;
    color: inherit;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 120ms ease, opacity 120ms ease;
}

.book-nav-btn:hover {
    background: rgba(11, 105, 119, 0.10);
    color: inherit;
    text-decoration: none;
}

.book-nav-btn:active {
    background: rgba(11, 105, 119, 0.18);
}

.book-nav-btn:focus {
    outline: none;
}

.book-nav-btn:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(11, 105, 119, 0.25);
}

.book-nav-btn.disabled,
.book-nav-btn[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
}

.book-nav-panel a,
.book-nav-panel button,
.book-nav-panel .btn {
    color: #0B6977;
}

/* Override Bootstrap "secondary" look inside the nav panel */
.book-nav-panel .btn-secondary,
.book-nav-panel .btn.btn-secondary,
.book-nav-panel .btn-outline-secondary,
.book-nav-panel .btn.btn-outline-secondary {
    color: #0B6977 !important;
    background-color: transparent !important;
    border-color: transparent !important;
}

.book-nav-panel .btn-secondary:hover,
.book-nav-panel .btn.btn-secondary:hover,
.book-nav-panel .btn-outline-secondary:hover,
.book-nav-panel .btn.btn-outline-secondary:hover {
    background-color: rgba(11, 105, 119, 0.10) !important;
    color: #0B6977 !important;
}

.book-nav-panel .btn-secondary:active,
.book-nav-panel .btn.btn-secondary:active,
.book-nav-panel .btn-outline-secondary:active,
.book-nav-panel .btn.btn-outline-secondary:active {
    background-color: rgba(11, 105, 119, 0.18) !important;
}

.book-nav-panel .btn-secondary:focus-visible,
.book-nav-panel .btn.btn-secondary:focus-visible,
.book-nav-panel .btn-outline-secondary:focus-visible,
.book-nav-panel .btn.btn-outline-secondary:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(11, 105, 119, 0.25) !important;
}

.book-nav-panel .btn-secondary.disabled,
.book-nav-panel .btn.btn-secondary.disabled,
.book-nav-panel .btn-secondary:disabled,
.book-nav-panel .btn.btn-secondary:disabled {
    opacity: 0.45 !important;
}

.text-meta-icon {
    color: #0B6977;
}

.text-meta-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 3px 6px;
    line-height: 1;
    background: #ffffff;
    color: #0B6977;
    border: 1px solid rgba(11, 105, 119, 0.35);
    border-radius: 4px;
    vertical-align: middle;
}

.text-meta-badge:hover {
    background: rgba(11, 105, 119, 0.06);
    border-color: rgba(11, 105, 119, 0.55);
}

/* Tag add form responsiveness (staff tag-list-interface) */
.tag-list-interface .input-group.input-group-sm {
    width: 100%;
    max-width: 100%;
}

.tag-list-interface .list-group {
    max-width: 100%;
}

@media (min-width: 768px) {
    .tag-list-interface .input-group.input-group-sm,
    .tag-list-interface .list-group {
        max-width: 50vw;
    }
}

@media (min-width: 992px) {
    .tag-list-interface .input-group.input-group-sm,
    .tag-list-interface .list-group {
        max-width: 25vw;
    }
}
.redfisbay .site-top-bar__brand img {
    width: 90px;
    height: 30px;
}

.top-space {
    /* Sticky header uses .fixed-top, so content must reserve its real height. */
    margin-top: 0;
    padding-top: var(--site-top-bar-height, 4rem);
}

@media (max-width: 767.98px) {
    /* On small screens give content a bit more breathing room below sticky header */
    .top-space {
        padding-top: calc(var(--site-top-bar-height, 4rem) + 0.75rem);
    }
}

@media (max-width: 767.98px) {
    /* Mobile sticky header: less crowded */
    .site-top-bar.site-top-bar--sticky .site-top-bar__brand {
        display: none;
    }

    .site-top-bar.site-top-bar--sticky > .container-fluid {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .site-top-bar.site-top-bar--sticky .top-menu-cont {
        row-gap: 0.45rem;
    }

    .site-top-bar.site-top-bar--sticky .top-menu-cont .top-menu-item a {
        line-height: 1.5;
    }
}

@media (max-width: 575.98px) {
    .site-top-bar.site-top-bar--sticky .top-menu-cont .top-menu-item a {
        margin-right: 0.85rem;
    }
}

.authors_content {
    max-width: 600px;
}

.card.author-body {
    min-width: 150px;
}

img.book_image {
    max-width: 300px;
}

img.book_image.book_image_in_list {
    width: 100%;
}

.card.book-body {
    max-width: 250px;
}

img.text-part-image {
    max-width: 300px;
}

img.text-part-small-image {
    max-width: 100px;
}

img.img-red-fish.img_xl{
    max-width: 300px;
}
img.img-red-fish.img_l{
    max-width: 300px;
}
img.img-red-fish.img_m{
    max-width: 200px;
}
img.img-red-fish.img_s{
    max-width: 100px;
}
img.img-red-fish.img_xs{
    max-width: 100px;
}

.text-part-image-cont {
    min-width: 300px;
}

.footer {
    width: 100%;
    min-height: 100px;
}

/* Texts app: main reading blocks use Georgia (see templates: article.part-content, etc.) */
.redfisbay article {
    font-family: Georgia, 'Times New Roman', Times, serif;
}

.part-content {
    min-width: 300px;
    max-width: 600px;
}

.subtitle {
    font-size: 1.5rem;
    color: gray;
}

.image_container {
    max-width: 300px;
}

.image_container img {
    width: 100%;
}

.spinner-container {
    margin-top: 200px;
}

.waite-screen_spinner {
    width: 4em;
    height: 4em;
}

.img-cont {
    width: 150px;
    height: 200px;
    background-color: #411F1F;
    overflow: hidden;
    text-align: center;
}

.widget-texts-cont {
    height: 200px;
    width: 300px;
    overflow: hidden;
}

.widget-title {
    width: 100%;
}

.text-widget img {
    width: auto;
    max-height: 100%;
}

.parts-list {
    max-width: 300px;
}

/* Text page: sidebar 1/3 + main 2/3 — drop fixed widths that fight the grid */
.text-content.row .col-md-4 .text-part-image-cont {
    min-width: 0;
    width: 100%;
}

.text-content.row .col-md-4 .text-part-image-cont .image-container {
    width: 100%;
    max-width: 100%;
}

/* Override global img.img-red-fish.img_* max-width so image fills the column */
.text-content.row .col-md-4 .text-part-image-cont img.img-red-fish {
    width: 100%;
    max-width: 100%;
    height: auto;
}
.text-content.row .col-md-4 .parts-list {
    max-width: none;
}
.text-content.row .col-md-8 .part-content {
    max-width: none;
    min-width: 0;
}

.about-cont {
    max-width: 400px;
}

.card.author-body {
    width: 250px
}

.card.text-body {
    width: 250px
}

.card.author-body-single {
    max-width: 500px;
}

.structure-body H1, .structure-body H2, .structure-body H3, .structure-body H4, .structure-body strong {
    color: #343543;
}

/* Babylon structure: heading font/color — body.structure-body rules above */

.footer-structure {
    padding: 30px;
    background-color: #0B6977
}

.container-fluid.structure {
    padding-right: 0;
    padding-left: 0;
}

.structure .content {
    min-height: 1000px;
}

.root-part.declaration {
    position: relative;
    float: right;
    width: 60%;
    z-index: 102;
}

.logo-prize {
    position: relative;
    width: 100%;
    z-index: 102;
}

.logo-prize-cont{
    width: 40%;
    float: left;
}

.inner-global-container, .inner-global-container-author {
    max-width: 1100px;
    width: 100%;
}

.inner-global-container-text {
    max-width: 700px;
    width: 100%;
}
.maine-text-image{
    overflow: hidden;
    width: 300px;
}

.str-current-author-image-container img {
    width: 300px;
    border-radius: 150px;
    background-color: #343543;
    padding: 0;
    border: 0;
}

.img-thumbnail.structure-img-thumb {
    border-radius: 150px;
    background-color: #343543;
    padding: 0;
    border: 0;
    max-height: 100%;
}
.list-image{
    max-width: 200px;
    max-height: 200px;
}

.list-thumb {
    width: 30%;
    min-width: 200px;
}

.w-30 {
    width: 30%
}

h3.str-current-author-data-cont {
    color: #343543;
}

.fon-order {
    color: #BBF1EC;
    position: absolute;
    font-weight: bold;
    font-size: 300px;
    height: 200px;
    line-height: 30px;
}

.last-author-body {
    position: relative;
}

.middle-container {
    position: relative;
}

.bottom-container {
    position: relative;
}

.top-container {
    position: relative;
}

.last-author-list-cont {
    position: relative;
}

.author-btn-arrow {
    position: relative;
    top: 80px;
    left: -70px;
}

.text-in-list {
    max-height: 300px;
}

.random-element, .statement-cont {
    min-width: 350px ;
}
.random-element h3, .statement-cont h3 {
    border-top: 2px solid #343543;
}

.search-input {
    background-color: #411F1F;
}

.row.form-image-area{
    border-top: 1px solid #ced4da ;
    border-bottom: 1px solid #ced4da ;
}
.extendable{
    cursor: nwse-resize;
}
.gallery-card-cont {
    width: 320px;
}
.logo-prize-cont-mobile{
    max-width: 200px;
}
.str-authors-list{
    position: relative;
    min-width: 320px;
}
.str-authors-list .str-current-author-data-cont{
    display: block;
    width: 30%;
}

.str-authors-list .str-current-author-image-container img{
    width: 200px;
}

.str-authors-list .author-btn-arrow{
    position: relative;
    top: 60px;
    left: -70px;
}
