/* === BOOKS HEADER & FOOTER === */

body[data-sitename="booksgateway"] .journal-header,
body[data-sitename="booksgateway"] .widget-SitePageFooter .journal-footer.journal-bg {
    background: unset;
    background-color: #eb5e62;
}

body[data-sitename="booksgateway"] .journal-header .journal-header_content .journal-logo_wrap a.journal-logo-link {
    color: #000000;
    font-size: 2rem;
}

body[data-sitename="booksgateway"] .journal-header .journal-header_content .journal-logo_wrap a.journal-logo-link:hover {
    text-decoration: none;
}

body[data-sitename="booksgateway"] .journal-header .site-menu .nav-link {
    color: #000000;
}

@media (max-width: 899px) {
    body[data-sitename="booksgateway"] .journal-header .journal-header_content .navbar-menu_wrap .mobile-site-menu-toggle {
        color: #000000;
    }
}

body[data-sitename="booksgateway"] .widget-SitePageFooter .journal-footer .journal-footer_content .journal-footer-affiliations a img {
    max-height: 2rem;
}

/* === BOOKS GATEWAY HOMEPAGE === */

body[data-sitename="booksgateway"].pg_index .theme-homepage-layout.gateway .hero-row {
   background-color: #eb5e6233;
}

body[data-sitename="booksgateway"].pg_index .theme-homepage-layout.gateway .widget-SelfServeContent .homepage-panel-header {
    background-color: #eb5e62;
}

.pg_index .theme-homepage-layout .widget-instance-books_home-self-serve-feature-1 .homepage-panel-wrap {
    width: unset;
    margin: unset;
}

.pg_index .theme-homepage-layout .widget-instance-books_home-self-serve-feature-1 .homepage-panel-wrap h3 {
    margin: unset;
}

/* =========================================================
   BOOKS GATEWAY - THREE MAIN ACTION PANELS
   Browse & Discover / Publish with us / Librarians
   ========================================================= */


/* =========================================================
   ROW / 3-COLUMN LAYOUT
   ========================================================= */

body[data-sitename="booksgateway"]
.home-row2
.widget-dynamic-inner-wrap {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
    align-items: stretch !important;
}


/* Make each SelfServe widget fill its grid column */
body[data-sitename="booksgateway"]
.home-row2
.widget-SelfServeContent {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}


/* Force the existing Silverchair panel wrapper to fill the widget.
   This fixes feature 1 retaining an inherited/narrow panel width. */
body[data-sitename="booksgateway"]
.home-row2
.widget-SelfServeContent
.homepage-panel-wrap {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}


/* =========================================================
   BASE PANEL
   ========================================================= */

body[data-sitename="booksgateway"]
.home-row2
.books-panel {
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 100%;
    background: #ffffff;
    box-sizing: border-box !important;
}


/* =========================================================
   PANEL HEADERS
   ========================================================= */

body[data-sitename="booksgateway"]
.home-row2
.books-panel
.homepage-panel-header {
    padding: 22px 22px 20px;
    margin: 0;
}


body[data-sitename="booksgateway"]
.home-row2
.books-panel
.homepage-panel-header h3 {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 1.2rem;
    line-height: 1.25;
    font-weight: 500;
}


/* =========================================================
   PANEL BODY
   ========================================================= */

body[data-sitename="booksgateway"]
.home-row2
.books-panel
.homepage-panel-text {
    display: flex !important;
    flex-direction: column;
    flex-grow: 1;
    justify-content: flex-start !important;

    padding: 14px 22px 12px;
    margin: 0;
    background: #ffffff;
}


/* =========================================================
   LINK LISTS
   ========================================================= */

body[data-sitename="booksgateway"]
.books-link-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}


body[data-sitename="booksgateway"]
.books-link-list li {
    position: relative;
    margin: 0 0 3px;
    padding: 0 0 0 20px;
    line-height: 1.2;
}


body[data-sitename="booksgateway"]
.books-link-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;

    width: 10px;
    height: 6px;

    transform: translateY(-50%);
}


body[data-sitename="booksgateway"]
.books-link-list a {
    color: #0e4751;
    font-size: 0.875rem;
    line-height: 1.25;
    text-decoration: underline;
    text-underline-offset: 2px;
}


body[data-sitename="booksgateway"]
.books-link-list a:hover {
    text-decoration-thickness: 2px;
}


/* =========================================================
   DIVIDER
   ========================================================= */

body[data-sitename="booksgateway"]
.books-panel-divider {
    width: 100%;
    height: 5px;
    margin: 18px 0 15px;
}


/* =========================================================
   BOX 1 - BROWSE & DISCOVER
   ========================================================= */

body[data-sitename="booksgateway"]
.books-panel--browse {
    border: 1px solid #ef6065;
}


body[data-sitename="booksgateway"]
.books-panel--browse
.homepage-panel-header {
    background: #ef6065;
    color: #000000;
}


body[data-sitename="booksgateway"]
.books-panel--browse
.books-panel-divider {
    background: #ef6065;
}


body[data-sitename="booksgateway"]
.books-panel--browse
.books-link-list--primary li::before {
    background: #ef6065;
}


/* Secondary colours from the design */
body[data-sitename="booksgateway"]
.books-panel--browse
.books-link-list--secondary li:nth-child(1)::before {
    background: #f15a24;
}


body[data-sitename="booksgateway"]
.books-panel--browse
.books-link-list--secondary li:nth-child(2)::before {
    background: #14555d;
}


/* =========================================================
   BOX 2 - PUBLISH WITH US
   ========================================================= */

body[data-sitename="booksgateway"]
.books-panel--publish {
    border: 1px solid #14555d;
}


body[data-sitename="booksgateway"]
.books-panel--publish
.homepage-panel-header {
    background: #14555d;
    color: #ffffff;
}


body[data-sitename="booksgateway"]
.books-panel--publish
.books-panel-divider {
    background: #14555d;
}


body[data-sitename="booksgateway"]
.books-panel--publish
.books-link-list--primary li::before {
    background: #ef6065;
}


body[data-sitename="booksgateway"]
.books-panel--publish
.books-link-list--secondary li:nth-child(1)::before {
    background: #14555d;
}


body[data-sitename="booksgateway"]
.books-panel--publish
.books-link-list--secondary li:nth-child(2)::before,
body[data-sitename="booksgateway"]
.books-panel--publish
.books-link-list--secondary li:nth-child(3)::before {
    background: #ef6065;
}


/* =========================================================
   BOX 3 - LIBRARIANS & INSTITUTIONS
   ========================================================= */

body[data-sitename="booksgateway"]
.books-panel--librarians {
    border: 1px solid #98cf2d;
}


body[data-sitename="booksgateway"]
.books-panel--librarians
.homepage-panel-header {
    background: #98cf2d;
    color: #000000;
}


body[data-sitename="booksgateway"]
.books-panel--librarians
.books-panel-divider {
    background: #98cf2d;
}


body[data-sitename="booksgateway"]
.books-panel--librarians
.books-link-list--primary li:nth-child(1)::before {
    background: #ef6065;
}


body[data-sitename="booksgateway"]
.books-panel--librarians
.books-link-list--primary li:nth-child(2)::before {
    background: #8b86f6;
}


body[data-sitename="booksgateway"]
.books-panel--librarians
.books-link-list--primary li:nth-child(3)::before,
body[data-sitename="booksgateway"]
.books-panel--librarians
.books-link-list--primary li:nth-child(4)::before {
    background: #14555d;
}


body[data-sitename="booksgateway"]
.books-panel--librarians
.books-link-list--secondary li:nth-child(1)::before {
    background: #008dd2;
}


body[data-sitename="booksgateway"]
.books-panel--librarians
.books-link-list--secondary li:nth-child(2)::before {
    background: #ef6065;
}


body[data-sitename="booksgateway"]
.books-panel--librarians
.books-link-list--secondary li:nth-child(3)::before {
    background: #14555d;
}


/* =========================================================
   REMOVE DEFAULT SILVERCHAIR PANEL STYLING
   ========================================================= */

body[data-sitename="booksgateway"]
.home-row2
.books-panel.homepage-panel-wrap {
    box-shadow: none !important;
    border-radius: 0 !important;
}


body[data-sitename="booksgateway"]
.home-row2
.books-panel
.homepage-panel-text p {
    margin: 0;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

    body[data-sitename="booksgateway"]
    .home-row2
    .widget-dynamic-inner-wrap {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

}


@media (max-width: 600px) {

    body[data-sitename="booksgateway"]
    .home-row2
    .books-panel
    .homepage-panel-header {
        padding: 18px;
    }


    body[data-sitename="booksgateway"]
    .home-row2
    .books-panel
    .homepage-panel-text {
        padding: 16px 18px;
    }

}

/* =========================================================
   BOOKS GATEWAY - OUR COLLECTIONS
   ========================================================= */

body[data-sitename="booksgateway"]
.widget-instance-books_home-self-serve-feature-4 {
    width: 100% !important;
    grid-column: 1 / -1;
}


/* Remove inherited homepage panel behaviour if feature 4
   is still sitting inside the standard Silverchair wrapper */
body[data-sitename="booksgateway"]
.widget-instance-books_home-self-serve-feature-4
.homepage-panel-wrap,
body[data-sitename="booksgateway"]
.widget-instance-books_home-self-serve-feature-4
.homepage-panel-text {
    display: block !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
}


/* =========================================================
   SECTION
   ========================================================= */

body[data-sitename="booksgateway"]
.books-collections {
    width: 100%;
    margin-top: 28px;
}


body[data-sitename="booksgateway"]
.books-collections > h2 {
    margin: 0 0 16px;
    padding: 0;
    font-size: 1.75rem;
    line-height: 1.2;
    font-weight: 400;
    color: #000000;
}


/* =========================================================
   TWO COLUMN LAYOUT
   ========================================================= */

body[data-sitename="booksgateway"]
.books-collections__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}


/* =========================================================
   COLLECTION CARD
   ========================================================= */

body[data-sitename="booksgateway"]
.books-collections__card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #ffffff;
    border: 1px solid #8581f3;
}


/* =========================================================
   PURPLE HEADER
   ========================================================= */

body[data-sitename="booksgateway"]
.books-collections__header {
    padding: 11px 18px;
    background: #8581f3;
}


body[data-sitename="booksgateway"]
.books-collections__header h3 {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 1.2rem;
    line-height: 1.25;
    font-weight: 500;
    color: #000000;
}


/* =========================================================
   CARD CONTENT
   ========================================================= */

body[data-sitename="booksgateway"]
.books-collections__content {
    flex: 1;
    padding: 14px 18px 16px;
}


body[data-sitename="booksgateway"]
.books-collections__content p {
    margin: 0 0 16px;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #333333;
}


body[data-sitename="booksgateway"]
.books-collections__content p:last-of-type {
    margin-bottom: 14px;
}


/* =========================================================
   LINK LISTS
   ========================================================= */

body[data-sitename="booksgateway"]
.books-collections__links {
    list-style: none;
    margin: 0;
    padding: 0;
}


body[data-sitename="booksgateway"]
.books-collections__links ul {
    list-style: none;
    margin: 0;
    padding: 0;
}


body[data-sitename="booksgateway"]
.books-collections__links li {
    position: relative;
    margin: 0 0 3px;
    padding-left: 23px;
    font-size: 0.875rem;
    line-height: 1.15;
}


body[data-sitename="booksgateway"]
.books-collections__links li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 11px;
    height: 7px;
    background: #ef6065;
    transform: translateY(-50%);
}


body[data-sitename="booksgateway"]
.books-collections__links a {
    color: #0e4751;
    text-decoration: underline;
    text-underline-offset: 2px;
}


body[data-sitename="booksgateway"]
.books-collections__links a:hover {
    text-decoration-thickness: 2px;
}


/* =========================================================
   SUBJECT AREAS - TWO LINK COLUMNS
   ========================================================= */

body[data-sitename="booksgateway"]
.books-collections__links--two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 38px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

    body[data-sitename="booksgateway"]
    .books-collections__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

}


@media (max-width: 600px) {

    body[data-sitename="booksgateway"]
    .books-collections__links--two-column {
        grid-template-columns: 1fr;
        gap: 0;
    }


    body[data-sitename="booksgateway"]
    .books-collections__header {
        padding: 12px 16px;
    }


    body[data-sitename="booksgateway"]
    .books-collections__content {
        padding: 14px 16px 16px;
    }

}

/* =========================================================
   BOOKS GATEWAY - FINAL PANEL OVERRIDES
   Fix header specificity + force all action panels full width
   ========================================================= */

body[data-sitename="booksgateway"].pg_index
.theme-homepage-layout.gateway
.home-row2
.widget-SelfServeContent {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

body[data-sitename="booksgateway"].pg_index
.theme-homepage-layout.gateway
.home-row2
.widget-SelfServeContent
.homepage-panel-wrap {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

body[data-sitename="booksgateway"].pg_index
.theme-homepage-layout.gateway
.widget-instance-books_home-self-serve-feature-1
.books-panel--browse
.homepage-panel-header {
    background-color: #ef6065 !important;
    color: #000000 !important;
}

body[data-sitename="booksgateway"].pg_index
.theme-homepage-layout.gateway
.widget-instance-books_home-self-serve-feature-2
.books-panel--publish
.homepage-panel-header {
    background-color: #14555d !important;
    color: #ffffff !important;
}

body[data-sitename="booksgateway"].pg_index
.theme-homepage-layout.gateway
.widget-instance-books_home-self-serve-feature-3
.books-panel--librarians
.homepage-panel-header {
    background-color: #98cf2d !important;
    color: #000000 !important;
}

body[data-sitename="booksgateway"].pg_index
.theme-homepage-layout.gateway
.widget-instance-books_home-self-serve-feature-1
.books-panel--browse,
body[data-sitename="booksgateway"].pg_index
.theme-homepage-layout.gateway
.widget-instance-books_home-self-serve-feature-2
.books-panel--publish,
body[data-sitename="booksgateway"].pg_index
.theme-homepage-layout.gateway
.widget-instance-books_home-self-serve-feature-3
.books-panel--librarians {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 100% !important;
    box-sizing: border-box !important;
}