/* Research Blue: original light header and blue menu, with Search above the menu.
   Upload in the TAR journal's Website > Appearance > Advanced > Journal Style Sheet.
   Desktop menu styling is scoped so the mobile menu stays usable. */

.pkp_structure_head {
    background: linear-gradient(103deg, #eee2d9 0%, #fff 28%, #f9faff 51%, #e9f2f8 77%, #e8e8e8 100%) !important;
    border-bottom: 0 !important;
}

.pkp_structure_head .pkp_site_name .is_text {
    color: #123e91 !important;
}

@media (min-width: 992px) {
    .pkp_structure_head .pkp_head_wrapper {
        padding: 18px 2.1% 0 !important;
    }

    .pkp_structure_head .pkp_site_name_wrapper {
        height: auto !important;
        min-height: 82px !important;
        padding-bottom: 12px !important;
    }

    .pkp_structure_head .pkp_navigation_user_wrapper {
        top: 8px !important;
    }

    .pkp_structure_head .pkp_navigation_primary_row {
        min-height: 50px !important;
    }

    .pkp_structure_head .pkp_navigation_primary_wrapper {
        position: static !important;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 6px 18px !important;
        width: 100% !important;
    }

    .pkp_structure_head .pkp_navigation_primary {
        display: flex !important;
        flex-wrap: wrap !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
        max-width: none !important;
        justify-content: flex-start !important;
    }

    .pkp_structure_head .pkp_navigation_primary > li > a {
        padding: 6px 18px !important;
        color: #fff !important;
    }

    /* Position against .pkp_head_wrapper, outside the navigation row. */
    .pkp_structure_head .pkp_navigation_search_wrapper {
        position: absolute !important;
        top: 22px !important;
        left: 50% !important;
        right: auto !important;
        width: min(34vw, 460px) !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: translateX(-50%) !important;
        z-index: 4;
    }

    .pkp_structure_head .pkp_navigation_search_wrapper a {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box;
        margin: 0 !important;
        padding: 8px 14px !important;
        border: 1px solid #b5c8de !important;
        border-radius: 5px;
        background: rgba(255, 255, 255, .9) !important;
        color: #123e91 !important;
        font-size: 16px !important;
        text-align: left;
        white-space: nowrap !important;
    }

    .pkp_structure_head::after {
        display: none !important;
        content: none !important;
        height: 0 !important;
    }

    .pkp_structure_head .pkp_site_nav_menu,
    .pkp_structure_head .pkp_navigation_primary_row {
        background: #315a8b !important;
        background-image: none !important;
    }

    .pkp_structure_head .pkp_navigation_primary > li,
    .pkp_structure_head .pkp_navigation_primary > li:last-child {
        border-color: rgba(255, 255, 255, .35) !important;
    }

    .pkp_structure_head .pkp_navigation_primary > li > a:hover,
    .pkp_structure_head .pkp_navigation_primary > li > a:focus {
        background: #24476e !important;
        color: #fff !important;
        border-bottom-color: #fff !important;
    }

    .pkp_structure_head .pkp_navigation_search_wrapper a:hover,
    .pkp_structure_head .pkp_navigation_search_wrapper a:focus {
        background: #fff !important;
        border-color: #123e91 !important;
        color: #123e91 !important;
    }

    /* Dropdowns have white backgrounds, so their text must remain blue. */
    .pkp_structure_head .pkp_navigation_primary ul a,
    .pkp_structure_head .pkp_navigation_primary ul a:hover,
    .pkp_structure_head .pkp_navigation_primary ul a:focus {
        color: #123e91 !important;
    }

    .pkp_structure_head .pkp_navigation_primary ul a:hover,
    .pkp_structure_head .pkp_navigation_primary ul a:focus {
        background: #eff5fb !important;
    }
}

/* One desktop content width for all public journal pages. */
@media (min-width: 992px) {
    .pkp_structure_content {
        box-sizing: border-box;
        width: calc(100% - 48px) !important;
        max-width: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Keep the sidebar layout when one exists; fill the frame otherwise. */
    .pkp_structure_content:not(.has_sidebar) > .pkp_structure_main:first-child:last-child {
        box-sizing: border-box;
        width: 100% !important;
        max-width: none !important;
    }

    .pkp_structure_content:not(.has_sidebar) > .pkp_structure_main:first-child:last-child::before {
        left: 0 !important;
    }

    .pkp_structure_content:not(.has_sidebar) > .pkp_structure_main:first-child:last-child::after {
        left: auto !important;
        right: 0 !important;
    }

    /* Leave the cover just below the full-height navigation bar. */
    .pkp_page_index .pkp_structure_content {
        padding-top: 54px !important;
        margin-top: 0 !important;
    }

    .pkp_page_index .pkp_structure_main,
    .pkp_page_index .page_index_journal {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
}

/* Homepage cover and title. These words also appear in the journal itself. */
.pkp_page_index .page_index_journal .homepage_image {
    position: relative;
    overflow: hidden;
    background: #21354a;
}

.pkp_page_index .page_index_journal .homepage_image img {
    display: block;
    width: 100% !important;
    max-width: none !important;
    height: 350px !important;
    object-fit: cover;
    object-position: center center;
}

/* Restore the visible cover copy without relying on an Additional Content field. */
.pkp_page_index .page_index_journal .homepage_image::before {
    content: "The Antigonish Review";
    position: absolute;
    z-index: 1;
    inset: 0;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    padding: 0 clamp(24px, 5vw, 80px);
    background: linear-gradient(90deg, rgba(14, 31, 51, .82), rgba(14, 31, 51, .30) 58%, transparent 85%);
    color: #fff;
    font-family: Georgia, serif;
    font-size: clamp(28px, 3.4vw, 54px);
    font-weight: 700;
    line-height: 1.15;
    text-shadow: 0 2px 5px rgba(0, 0, 0, .6);
    pointer-events: none;
}

.pkp_page_index .page_index_journal .homepage_image::after {
    content: "Poetry, fiction, essays, and reviews.";
    position: absolute;
    z-index: 2;
    top: calc(50% + 46px);
    left: clamp(24px, 5vw, 80px);
    max-width: min(600px, 70%);
    color: #fff;
    font-size: clamp(16px, 1.55vw, 23px);
    line-height: 1.4;
    text-shadow: 0 2px 5px rgba(0, 0, 0, .75);
    pointer-events: none;
}

@media (max-width: 767px) {
    .pkp_page_index .page_index_journal .homepage_image img {
        height: 260px !important;
    }

    .pkp_page_index .page_index_journal .homepage_image::before {
        align-items: flex-start;
        padding-top: 68px;
        background: linear-gradient(90deg, rgba(14, 31, 51, .85), rgba(14, 31, 51, .32));
    }

    .pkp_page_index .page_index_journal .homepage_image::after {
        top: 163px;
        max-width: calc(100% - 48px);
    }
}

/* TAR footer: matches the existing Research Blue colour scheme */
.pkp_structure_footer_wrapper {
  background: #315a8b !important;
  border-top: 4px solid #24476e;
}

.pkp_structure_footer {
  width: calc(100% - 48px) !important;
  max-width: 1350px !important;
}

.pkp_footer_content {
  padding: 38px 0 26px !important;
  color: #fff;
}

.tar-footer {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.tar-footer h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 19px;
}

.tar-footer p {
  margin: 0 0 10px;
  color: #fff;
  line-height: 1.6;
}

.tar-footer a {
  color: #fff !important;
  text-decoration: none;
}

.tar-footer a:hover,
.tar-footer a:focus {
  color: #fff !important;
  text-decoration: underline;
}

@media (max-width: 767px) {
  .pkp_structure_footer {
    width: calc(100% - 32px) !important;
  }

  .tar-footer {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

.pkp_structure_footer .pkp_brand_footer {
  display: none !important;
}

.pkp_footer_content img {
  max-width: 180px;
  height: auto;
}

/* Homepage: 4 article cards per row, maximum 8 */
.pkp_page_index .current_issue .cmp_article_list.articles {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  padding: 0;
  list-style: none;
}

.pkp_page_index .current_issue .cmp_article_list.articles > li {
  min-width: 0;
  margin: 0 !important;
  padding: 20px !important;
  background: #fff;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.pkp_page_index .current_issue .cmp_article_list.articles > li:nth-child(n+9) {
  display: none;
}

@media (min-width: 768px) and (max-width: 1199px) {
  .pkp_page_index .current_issue .cmp_article_list.articles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .pkp_page_index .current_issue .cmp_article_list.articles {
    grid-template-columns: 1fr;
  }
}
