/* === 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;
}

/* =========================================================
   REMOVE SILVERCHAIR OUTER PANEL OUTLINES
   ========================================================= */

/* Main action widgets */
body[data-sitename="booksgateway"]
.home-row2
.widget-SelfServeContent {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}


/* Remove inherited wrapper styling */
body[data-sitename="booksgateway"]
.home-row2
.widget-SelfServeContent
.homepage-panel-wrap {
    outline: 0 !important;
    box-shadow: none !important;
}


/* Feature 4 / Our collections outer wrapper */
body[data-sitename="booksgateway"]
.widget-instance-books_home-self-serve-feature-4 {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}


/* Make sure the custom collections section itself
   doesn't pick up an inherited border */
body[data-sitename="booksgateway"]
.books-collections {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

/* =========================================================
   ALIGN ACTION PANEL DIVIDERS
   ========================================================= */

body[data-sitename="booksgateway"]
.home-row2
.books-panel
.books-link-list--primary {
    min-height: 82px;
}

/* =========================================================
   BOOKS GATEWAY - HERO LAYOUT
   ========================================================= */

body[data-sitename="booksgateway"].pg_index
.widget-instance-Home_MainContentB0B0
.hero-row {
    background-color: #eb5e6233 !important;
    padding: 22px 0 24px !important;
}


/* Two-column hero */
body[data-sitename="booksgateway"].pg_index
.widget-instance-Home_MainContentB0B0
.hero-row
.widget-dynamic-inner-wrap {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(480px, 0.95fr) !important;
    gap: 48px !important;
    align-items: end !important;
}


/* =========================================================
   LEFT - HERO COPY
   ========================================================= */

body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-feature {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}


body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-feature
.homepage-panel-wrap,
body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-feature
.homepage-panel-text {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}


/* Hero title */
body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-feature h1 {
    margin: 0 0 10px !important;
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 400;
}


/* Hero intro copy */
body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-feature p {
    max-width: 760px;
    margin: 0 !important;
    font-size: 0.95rem;
    line-height: 1.35;
}


/* =========================================================
   RIGHT - SEARCH AREA
   ========================================================= */

body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-search-bar {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    align-self: end;
}


/* Container for search + advanced search + button */
body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-search-bar
.hero-search-container {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "search advanced"
        "button button";
    column-gap: 14px;
    row-gap: 16px;

    width: 100%;
    margin: 0;
}


/* Search bar */
body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-search-bar
.navbar-search {
    grid-area: search;
    width: 100%;
}


/* Actual Silverchair search form */
body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-search-bar
#MicrositeSearch {
    display: flex !important;
    width: 100% !important;
}


/* Search input gets remaining space */
body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-search-bar
.navbar-search-input_wrap {
    flex: 1 1 auto;
    min-width: 0;
}


/* Search filter */
body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-search-bar
.navbar-search-filter_wrap {
    flex: 0 0 auto;
}


/* Search submit */
body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-search-bar
.navbar-search-submit_wrap {
    flex: 0 0 auto;
}


/* Advanced search */
body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-search-bar
.navbar-search-advanced {
    grid-area: advanced;
    display: flex !important;
    align-items: center;
}


body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-search-bar
.advanced-search {
    font-size: 0.85rem;
    line-height: 1.15;
    color: #222;
    text-decoration: none;
}


/* =========================================================
   FIND A BOOK BUTTON
   ========================================================= */

body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-search-bar
.home-btn-wrap {
    grid-area: button;
    margin: 0 !important;
}


body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-search-bar
.home-btn-wrap .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;
    padding: 8px 22px;

    border: 0;
    border-radius: 24px;

    background: #14555d;
    color: #ffffff;

    text-decoration: none;
    font-size: 0.9rem;
}


body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-search-bar
.home-btn-wrap .button:hover {
    background: #0e4751;
    color: #ffffff;
}


/* =========================================================
   REMOVE DEFAULT SELFSERVE PANEL STYLING
   ========================================================= */

body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-search-bar,
body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-search-bar
.homepage-panel-wrap,
body[data-sitename="booksgateway"]
.widget-instance-books_home-hero-search-bar
.homepage-panel-text {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1000px) {

    body[data-sitename="booksgateway"].pg_index
    .widget-instance-Home_MainContentB0B0
    .hero-row
    .widget-dynamic-inner-wrap {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }


    body[data-sitename="booksgateway"]
    .widget-instance-books_home-hero-search-bar
    .hero-search-container {
        grid-template-columns: 1fr auto;
    }

}


@media (max-width: 600px) {

    body[data-sitename="booksgateway"]
    .widget-instance-books_home-hero-search-bar
    .hero-search-container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "search"
            "advanced"
            "button";
        gap: 12px;
    }


    body[data-sitename="booksgateway"]
    .widget-instance-books_home-hero-feature h1 {
        font-size: 1.65rem;
    }

}