/*
 * HKB Publications — publisher homepage only
 *
 * This deliberately targets main.pkp_page_site_index. That element exists
 * only on the publisher landing page, so JAM and DDD are not affected.
 */

body:has(main.pkp_page_site_index) {
  --hkb-navy: #103d70;
  --hkb-deep: #092b51;
  --hkb-red: #b5121b;
  --hkb-ink: #1f2933;
  --hkb-muted: #667282;
  --hkb-line: #dfe6ec;
  background: #edf1f4 !important;
  color: var(--hkb-ink);
}

/* Remove only the Default Manuscript theme's two decorative grid rules. */
body:has(main.pkp_page_site_index) .pkp_structure_main,
body:has(main.pkp_page_site_index) .pkp_structure_content,
body:has(main.pkp_page_site_index) main.pkp_page_site_index {
  background-image: none !important;
  border-inline: 0 !important;
  box-shadow: none !important;
}

body:has(main.pkp_page_site_index) .pkp_structure_main::before,
body:has(main.pkp_page_site_index) .pkp_structure_main::after,
body:has(main.pkp_page_site_index) .pkp_structure_main:first-child:last-child::before,
body:has(main.pkp_page_site_index) .pkp_structure_main:first-child:last-child::after,
body:has(main.pkp_page_site_index) .pkp_structure_content::before,
body:has(main.pkp_page_site_index) .pkp_structure_content::after {
  content: none !important;
  display: none !important;
  width: 0 !important;
  background: transparent !important;
}

/* A predictable location for Register and Login. The original links remain
   in OJS, so logged-in visitors continue to see their account menu instead. */
body:has(main.pkp_page_site_index) .pkp_structure_head {
  position: relative !important;
}

body:has(main.pkp_page_site_index) .pkp_site_nav_menu {
  position: static !important;
}

body:has(main.pkp_page_site_index) .pkp_navigation_user_wrapper {
  display: block !important;
  position: absolute !important;
  top: 24px !important;
  right: 30px !important;
  z-index: 50 !important;
  width: auto !important;
  height: auto !important;
}

body:has(main.pkp_page_site_index) .pkp_navigation_user {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: #fff !important;
}

body:has(main.pkp_page_site_index) .pkp_navigation_user > li {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

body:has(main.pkp_page_site_index) .pkp_navigation_user > li > a {
  display: block !important;
  padding: 8px 12px !important;
  border: 1px solid #d7e1ea !important;
  border-radius: 6px !important;
  background: #fff !important;
  color: var(--hkb-navy) !important;
  font-size: .8rem !important;
  font-weight: 750 !important;
  line-height: 1.15 !important;
  text-decoration: none !important;
}

body:has(main.pkp_page_site_index) .pkp_navigation_user > li:last-child > a {
  border-color: var(--hkb-navy) !important;
  background: var(--hkb-navy) !important;
  color: #fff !important;
}

/* Homepage content. */
.hkb-site-home {
  color: var(--hkb-ink);
}

.hkb-site-home .hkb-journals {
  position: relative;
  max-width: 1160px;
  margin: 0 auto;
  padding: 30px 34px 38px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.hkb-site-home .hkb-journals::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, var(--hkb-navy) 0 72%, var(--hkb-red) 72% 100%);
}

.hkb-site-home .hkb-section-heading { margin: 0 0 21px; padding-top: 5px; }
.hkb-site-home .hkb-section-heading p,
.hkb-site-home .hkb-eyebrow {
  margin: 0 0 8px;
  color: var(--hkb-red);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.hkb-site-home .hkb-section-heading h2,
.hkb-site-home .hkb-benefits h2,
.hkb-site-home .hkb-about h2 {
  margin: 0;
  color: var(--hkb-ink);
  font-weight: 750;
  letter-spacing: -.03em;
  line-height: 1.12;
}
.hkb-site-home .hkb-section-heading h2 { font-size: clamp(2.1rem, 4vw, 3.25rem); }
.hkb-site-home .hkb-journal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.hkb-site-home .hkb-journal-card {
  --journal-accent: var(--hkb-navy);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dfe7ed;
  border-top: 4px solid var(--journal-accent);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(22,41,61,.06);
  color: var(--hkb-ink);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.hkb-site-home .hkb-journal-card:nth-child(1) { --journal-accent: #292257; }
.hkb-site-home .hkb-journal-card:nth-child(2) { --journal-accent: #c61722; }
.hkb-site-home .hkb-journal-card:nth-child(3) { --journal-accent: #e98722; }
.hkb-site-home .hkb-journal-card:nth-child(1) .hkb-journal-card__cover {
  background: linear-gradient(135deg, #f4f1fb 0%, #edf6f7 100%);
}
.hkb-site-home .hkb-journal-card:nth-child(2) .hkb-journal-card__cover {
  background: linear-gradient(135deg, #fff3f3 0%, #fff7ee 100%);
}
.hkb-site-home .hkb-journal-card:nth-child(3) .hkb-journal-card__cover {
  background: linear-gradient(135deg, #fff8ed 0%, #fff3e3 100%);
}
.hkb-site-home .hkb-journal-card:hover,
.hkb-site-home .hkb-journal-card:focus {
  border-color: var(--journal-accent);
  box-shadow: 0 15px 30px rgba(19,42,65,.13);
  color: var(--hkb-ink);
  text-decoration: none;
  transform: translateY(-4px);
}
.hkb-site-home .hkb-journal-card__cover {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 232px;
  padding: 17px 22px;
  background: linear-gradient(180deg,#fafcfd,#eef3f7);
}
.hkb-site-home .hkb-journal-card__cover img {
  display: block;
  max-width: 100%;
  max-height: 205px;
  filter: drop-shadow(0 10px 9px rgba(18,35,54,.18));
}
.hkb-site-home .hkb-journal-card__body { padding: 19px 22px 20px; }
.hkb-site-home .hkb-journal-card h3 { min-height: 2.5em; margin: 0 0 9px; color: var(--hkb-ink); font-size: 1.16rem; line-height: 1.25; }
.hkb-site-home .hkb-journal-card__description { min-height: 4.65em; margin: 0 0 15px; color: var(--hkb-muted); font-size: .9rem; line-height: 1.5; }
.hkb-site-home .hkb-journal-card__link { color: var(--journal-accent); font-size: .88rem; font-weight: 800; }

@media (max-width: 860px) {
  .hkb-site-home .hkb-journals { padding: 32px 24px 38px; }
  .hkb-site-home .hkb-journal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}
@media (max-width: 600px) {
  body:has(main.pkp_page_site_index) .pkp_navigation_user_wrapper { top: 14px !important; right: 14px !important; }
  body:has(main.pkp_page_site_index) .pkp_navigation_user > li > a { padding: 7px 9px !important; font-size: .74rem !important; }
  .hkb-site-home .hkb-journals { padding: 29px 18px 32px; }
  .hkb-site-home .hkb-section-heading h2 { font-size: 2rem; }
  .hkb-site-home .hkb-journal-grid { grid-template-columns: 1fr; }
  .hkb-site-home .hkb-journal-card__cover { min-height: 220px; }
  .hkb-site-home .hkb-journal-card__cover img { max-height: 198px; }
  .hkb-site-home .hkb-journal-card h3,
  .hkb-site-home .hkb-journal-card__description { min-height: 0; }
}
