/* ============================================================
   ncp-layout-fix.css — DEFINITIVE v6
   Last updated: 2026-06-17

   DESIGN SYSTEM:
   Cardinal bar (full bleed #8C1515)   Login | Register right
   White header bar (full bleed)        Logo left
   Homepage hero: full bleed
   Inner pages: max-width 1140px, centred, padded
   Footer: full bleed

   BREAKPOINTS (match OMP):
   Mobile  < 768px  : 1rem side padding
   Tablet  768px+   : 1.5rem side padding
   Desktop 992px+   : max-width 1140px centred
   Large   1200px+  : same

   LOAD ORDER: LAST — overrides OMP compiled stylesheet
   RULE: !important only on .pkp_* selectors vs OMP.
         Never on custom .ncp-* classes.
   ============================================================ */


/* ══ 1. FULL-BLEED WRAPPERS ══════════════════════════════════
   Must span 100% at every OMP breakpoint (768/992/1200px).
   ═══════════════════════════════════════════════════════════ */
html, body { overflow-x: hidden; }

.pkp_structure_content,
.has_site_logo .pkp_head_wrapper,
.pkp_structure_footer {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}
@media (min-width: 768px) {
  .pkp_structure_content,
  .has_site_logo .pkp_head_wrapper {
    width: 100% !important; max-width: 100% !important;
    padding-left: 0 !important; padding-right: 0 !important;
  }
}
@media (min-width: 992px) {
  .pkp_structure_content,
  .has_site_logo .pkp_head_wrapper {
    width: 100% !important; max-width: 100% !important;
    padding-left: 0 !important; padding-right: 0 !important;
  }
}
@media (min-width: 1200px) {
  .pkp_structure_content,
  .has_site_logo .pkp_head_wrapper {
    width: 100% !important; max-width: 100% !important;
    padding-left: 0 !important; padding-right: 0 !important;
  }
}


/* ══ 2. SIDEBAR — hidden everywhere ═══════════════════════════ */
.pkp_structure_sidebar,
.pkp_block.block_language {
  display: none !important;
  width: 0 !important;
  visibility: hidden !important;
}


/* ══ 3. MAIN CONTENT COLUMN ══════════════════════════════════
   Reset OMP float layout. Inner pages get centred container.
   ═══════════════════════════════════════════════════════════ */
.pkp_structure_main,
.pkp_structure_content.has_sidebar .pkp_structure_main {
  float: none !important;
  clear: both !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}
.pkp_structure_main:before,
.pkp_structure_main:after {
  display: none !important;
  content: none !important;
}

/* Inner pages — centred, padded */
.pkp_structure_main .page:not(.page_homepage):not(.page_book) {
  max-width: 1140px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  box-sizing: border-box;
}
@media (min-width: 768px) {
  .pkp_structure_main .page:not(.page_homepage):not(.page_book) {
    padding: 2rem 1.5rem 3rem;
  }
}
@media (min-width: 992px) {
  .pkp_structure_main .page:not(.page_homepage):not(.page_book) {
    padding: 3rem 2.5rem 4rem;
  }
}

/* Homepage — full bleed */
body.pkp_page_index .pkp_structure_content,
body.pkp_page_index .pkp_structure_main,
body.pkp_page_index .page,
body.pkp_page_index .page_homepage,
body.pkp_page_index .additional_content {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}
body.pkp_page_index .pkp_structure_content { padding-top: 0 !important; }


/* ══ 4. WHITE HEADER BAR ═════════════════════════════════════
   Logo left, flex row, full bleed.
   ═══════════════════════════════════════════════════════════ */
.pkp_head_wrapper,
.has_site_logo .pkp_head_wrapper {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: .75rem 2rem !important;
  box-sizing: border-box !important;
  min-height: 68px !important;
  background: #fff;
}
.has_site_logo .pkp_site_name_wrapper {
  position: static !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  width: auto !important;
}
.has_site_logo .pkp_site_name {
  position: static !important;
  left: auto !important; right: auto !important;
  top: auto !important; transform: none !important;
  width: auto !important;
  padding: 0 !important; margin: 0 !important;
}
.pkp_site_name .is_img img,
.pkp_site_name_wrapper img {
  height: 44px !important;
  width: auto !important;
  max-height: 44px !important;
  max-width: 200px !important;
  object-fit: contain !important;
  display: block !important;
}


/* ══ 5. CARDINAL NAV BAR (#8C1515) ══════════════════════════
   Full bleed. Login + Register right-aligned only.
   ═══════════════════════════════════════════════════════════ */
/* Nav bar is the flex container — user_wrapper is a sibling of primary_row */
nav.pkp_site_nav_menu {
  background: #8C1515 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  position: static !important;
  padding: 0 2rem !important;
  box-sizing: border-box !important;
  min-height: 40px !important;
  margin: 0 !important;
  width: 100% !important;
}
/* primary_row: flex:1 pushes user_wrapper to the right */
.pkp_navigation_primary_row {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  min-height: 40px !important;
  padding: 0 !important;
}
.pkp_navigation_primary_wrapper,
.pkp_navigation_search_wrapper,
.pkp_search.pkp_search_desktop {
  display: none !important;
}
/* user_wrapper: sits at right end of the flex nav */
.pkp_navigation_user_wrapper {
  position: static !important;
  transform: none !important;
  left: auto !important;
  top: auto !important;
  display: flex !important;
  align-items: center !important;
  padding: .35rem 0 !important;
  flex-shrink: 0 !important;
  height: auto !important;
}
.ncp_nav_auth {
  display: flex !important;
  align-items: center !important;
  gap: .4rem !important;
}
.ncp_nav_btn {
  display: inline-block !important;
  padding: .3rem .9rem !important;
  font-size: .78rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  border-radius: 3px !important;
  line-height: 1.5 !important;
}
.ncp_nav_btn--in {
  background: transparent !important;
  color: #fff !important;
  border: 1.5px solid rgba(255,255,255,.7) !important;
}
.ncp_nav_btn--in:hover { background: rgba(255,255,255,.15) !important; text-decoration: none !important; }
.ncp_nav_btn--reg {
  background: #fff !important;
  color: #6B1010 !important;
  border: 1.5px solid #fff !important;
}
.ncp_nav_btn--reg:hover { background: #f5e0e0 !important; text-decoration: none !important; }
.ncp_nav_btn--out {
  background: transparent !important;
  color: rgba(255,255,255,.85) !important;
  border: 1.5px solid rgba(255,255,255,.5) !important;
}
.ncp_nav_link {
  color: rgba(255,255,255,.85) !important;
  font-size: .78rem !important;
  text-decoration: none !important;
  padding: .3rem .5rem !important;
}


/* ══ 6. HOMEPAGE SECTIONS (below hero) ═══════════════════════ */
body.pkp_page_index .np-section,
body.pkp_page_index .np-adv,
body.pkp_page_index .np-why2,
body.pkp_page_index .np-fgrid {
  padding-left: 2rem;
  padding-right: 2rem;
  box-sizing: border-box;
}


/* ══ 7. BOOK PAGE ════════════════════════════════════════════ */
.pkp_page_catalog.pkp_op_book .pkp_structure_main,
.pkp_page_catalog.pkp_op_book .pkp_structure_content.has_sidebar {
  float: none !important; width: 100% !important;
  max-width: 100% !important; padding: 0 !important;
}
.pkp_page_catalog.pkp_op_book .pkp_structure_sidebar { display: none !important; }
.page_book { padding: 0 !important; }
.ncp-book-page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  box-sizing: border-box;
}
@media (min-width: 768px) { .ncp-book-page { padding: 2rem 1.5rem 3rem; } }
@media (min-width: 992px) { .ncp-book-page { padding: 2.5rem 2.5rem 4rem; } }


/* ══ 8. CATALOG PAGE ═════════════════════════════════════════ */
.pkp_page_catalog .pkp_structure_main,
.page_catalog {
  max-width: 1140px !important;
  margin: 0 auto !important;
  padding: 2rem 1rem !important;
  box-sizing: border-box !important;
  float: none !important;
}
@media (min-width: 992px) {
  .pkp_page_catalog .pkp_structure_main,
  .page_catalog { padding: 2.5rem 2.5rem !important; }
}


/* ══ 9. FOOTER ═══════════════════════════════════════════════ */
.pkp_structure_footer {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.pkp_footer_content {
  max-width: 1140px;
  margin: 0 auto;
  padding: 2rem 1rem;
  box-sizing: border-box;
}
@media (min-width: 992px) {
  .pkp_footer_content { padding: 2.5rem 2.5rem; }
}


/* ══ 10. CALL FOR CHAPTERS PAGE ══════════════════════════════ */
.ncp-cfc-page { max-width: 860px; margin: 0 auto; }
.ncp-cfc-header { margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 3px solid #8C1515; }
.ncp-cfc-header h1 { font-size: 2rem; font-weight: 800; color: #1E293B; margin: 0 0 .5rem; }
.ncp-cfc-lead { font-size: .95rem; color: #64748B; margin: 0; line-height: 1.6; }
.ncp-cfc-volume { border: 1px solid #E2E8F0; border-radius: 6px; padding: 2rem; margin-bottom: 1.75rem; background: #fff; }
.ncp-cfc-badge { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; padding: 3px 10px; border-radius: 20px; margin-bottom: .75rem; }
.ncp-cfc-badge--open { background: #F0FDF4; color: #166534; }
.ncp-cfc-volume h2 { font-size: 1.2rem; font-weight: 700; color: #1E293B; margin: 0 0 .3rem; }
.ncp-cfc-subtitle { font-size: .85rem; color: #64748B; font-style: italic; margin: 0 0 1rem !important; }
.ncp-cfc-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.ncp-cfc-tags span { background: #F1F5F9; color: #475569; font-size: .75rem; padding: 3px 10px; border-radius: 3px; }
.ncp-cfc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1.5rem; font-size: .82rem; color: #374151; margin: 1.25rem 0; padding: 1.25rem; background: #F8F6F3; border-radius: 4px; }
.ncp-cfc-meta strong { display: block; color: #6B7280; font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.ncp-cfc-btn { display: inline-block; background: #8C1515; color: #fff !important; font-weight: 700; font-size: .85rem; padding: .65rem 1.5rem; border-radius: 4px; text-decoration: none !important; margin-top: .25rem; }
.ncp-cfc-btn:hover { background: #6B1010; }
.ncp-cfc-howto { background: #F8F6F3; border-radius: 6px; padding: 1.75rem; margin-top: 2rem; }
.ncp-cfc-howto h2 { font-size: 1.05rem; font-weight: 700; color: #1E293B; margin: 0 0 1rem; }
.ncp-cfc-howto ol { font-size: .88rem; color: #374151; line-height: 1.8; margin: 0; padding-left: 1.25rem; }
.ncp-cfc-howto p { font-size: .82rem; color: #6B7280; margin: 1rem 0 0; }


/* ══ 11. MOBILE (< 768px) ════════════════════════════════════ */
@media (max-width: 767px) {
  .pkp_head_wrapper,
  .has_site_logo .pkp_head_wrapper { padding: .5rem 1rem !important; }
  nav.pkp_site_nav_menu { padding: 0 1rem !important; }
  .pkp_structure_main .page:not(.page_homepage):not(.page_book) { padding: 1.5rem 1rem 2rem !important; }
  .ncp-book-page { padding: 1.5rem 1rem 2rem; }
  .pkp_footer_content { padding: 1.5rem 1rem; }
  .ncp-cfc-meta { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   REGISTRATION PAGE  —  sourced from real template classes
   page_register / cmp_form.register / registrationForm.tpl
   ══════════════════════════════════════════════════════════════ */

/* 1. Page padding — stops content flushing to edge */
.page_register {
    padding: 0 28px;
}

/* 2. Constrain and centre the form */
.page_register .cmp_form.register {
    max-width: 580px;
    margin: 0 auto;
}

/* 3. ORCID button — brand green, icon + text, tight gap */
#connect-orcid-button.pkp_button {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background-color: #A6CE39 !important;
    border: 2px solid #8aad1e !important;
    color: #fff !important;
    padding: 10px 20px !important;
    font-weight: 600;
    border-radius: 4px;
    font-size: 0.95rem;
    margin-top: 8px !important;
    margin-bottom: 6px !important;
    cursor: pointer;
}
#connect-orcid-button.pkp_button:hover {
    background-color: #8aad1e !important;
    border-color: #709215 !important;
}
/* ORCID icon inside button — force white */
#connect-orcid-button.pkp_button svg,
#connect-orcid-button.pkp_button img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}
/* "What is ORCID?" link */
.page_register a[href*="orcid"] {
    font-size: 0.85rem;
    color: #5a8a0a;
    display: block;
    margin-bottom: 20px;
}

/* 4. Reduce inter-field spacing  ~35px → 14px */
.page_register .fields > div {
    margin-bottom: 14px !important;
}

/* 5. Section headings — bold with divider line */
.page_register fieldset {
    border: none !important;
    padding: 0 !important;
    margin: 0 0 20px 0 !important;
}
.page_register fieldset > legend {
    font-size: 1rem;
    font-weight: 700;
    color: #3D0000;
    width: 100%;
    padding-bottom: 8px;
    margin-bottom: 14px;
    border-bottom: 2px solid #e8e8e8;
    display: block;
}

/* 6. Inputs — full width, consistent */
.page_register input[type="text"],
.page_register input[type="email"],
.page_register input[type="password"],
.page_register select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    margin-top: 4px;
}
.page_register input:focus,
.page_register select:focus {
    outline: 2px solid #8C1515;
    border-color: #8C1515;
}

/* 7. Submit button — full width, prominent */
.page_register .buttons {
    margin-top: 24px;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
}
.page_register button.submit {
    width: 100%;
    padding: 13px 24px !important;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
}
/* Login link — above button, subtle */
.page_register a.login {
    font-size: 0.875rem;
    color: #555;
    text-align: center;
}
.page_register a.login::before {
    content: "Already have an account? ";
}

/* ── REGISTER PAGE BUTTON FIXES ─────────────────────────────── */
/* Text was invisible (inheriting dark color on dark bg) */
.page_register button.submit {
    color: #ffffff !important;
    text-shadow: none !important;
}
/* Close the large gap between last field/checkbox and buttons */
.page_register .buttons {
    margin-top: 16px !important;
}
/* Close gap between reviewer checkbox section and buttons */
.page_register fieldset.reviewer,
.page_register fieldset.consent {
    margin-bottom: 8px !important;
}

/* ── REGISTER BUTTON TEXT FIX ────────────────────────────────
   ncp-frontend-brand-v2.css line 9:
   .cmp_form .buttons button { color:#8C1515 !important }  → spec 0,0,2,1
   beats our button.submit { color:#fff }                  → spec 0,0,1,1
   Fix: .cmp_form.register .buttons button = 0,0,3,1 wins
   ─────────────────────────────────────────────────────────── */
.cmp_form.register .buttons button,
.cmp_form.register .buttons button.submit,
.page_register .cmp_form .buttons button { color: #ffffff !important; }

/* ── ORCID LOGIN SECTION ─────────────────────────────────────── */
.ncp_orcid_login {
    margin: 16px 0 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.ncp_orcid_btn {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background-color: #A6CE39 !important;
    border: 2px solid #8aad1e !important;
    color: #fff !important;
    padding: 10px 18px !important;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 0.9rem;
}
.ncp_orcid_btn:hover { background-color: #8aad1e !important; }
.ncp_orcid_btn svg { flex-shrink: 0; }
.ncp_orcid_what { font-size: 0.85rem; color: #5a8a0a; }
.ncp_divider { border: none; border-top: 1px solid #e8e8e8; margin: 16px 0; }

/* ── ORCID DIVIDER BETWEEN ORCID LOGIN AND FORM ────────────── */
.ncp_orcid_divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: #999;
    font-size: 0.85rem;
}
.ncp_orcid_divider::before,
.ncp_orcid_divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid #e0e0e0;
}

.ncp_orcid_prefill_notice {
    background: #f0f7e6; border: 1px solid #A6CE39;
    border-left: 4px solid #A6CE39; padding: 10px 14px;
    margin-bottom: 16px; border-radius: 4px;
    font-size: 0.9rem; color: #3a5a0a;
}
.ncp_orcid_complete_panel{background:#fff;border:1px solid #ddd;border-top:4px solid #A6CE39;border-radius:6px;padding:24px;margin:16px 0 24px}
.ncp_orcid_complete_header{display:flex;align-items:center;gap:14px;margin-bottom:12px}
.ncp_orcid_complete_header h2{margin:0;color:#1a1a1a}
.ncp_orcid_input{width:100%;padding:10px 12px;border:1px solid #ccc;border-radius:4px;font-size:1rem;box-sizing:border-box;margin-bottom:4px}
.ncp_orcid_submit{width:100%;padding:13px;font-size:1rem;font-weight:600;color:#fff !important;background:#8C1515;border:none;border-radius:4px;cursor:pointer;margin-top:16px}

/* ══════════════════════════════════════════════════════════════

/* ══════════════════════════════════════════════════════════════

/* ══════════════════════════════════════════════════════════════
   MOBILE-FIRST — CLEAN REWRITE
   Rule: target NCP custom classes only.
   OMP sidebar/layout handled separately at the bottom.
   ══════════════════════════════════════════════════════════════ */

/* ── NCP CONTENT NAV BAR ──────────────────────────────────────── */
@media (max-width: 600px) {
  .ncp-content-nav {
    flex-direction: column !important;
    gap: 10px !important;
    padding: 10px 16px !important;
  }
  .ncp-content-nav > div { flex-wrap: wrap; }
  .ncp-content-nav form { width: 100% !important; max-width: 100% !important; }
}

/* ── HERO SECTION ─────────────────────────────────────────────── */
@media (max-width: 767px) {
  .ncp-hero-grid {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }
  .ncp-hero-grid > div:last-child { display: none !important; }
}
@media (min-width: 768px) and (max-width: 991px) {
  .ncp-hero-grid {
    grid-template-columns: 1fr 1fr !important;
    min-height: 360px !important;
  }
}

/* ── ADVANTAGE 3-COL CARDS ────────────────────────────────────── */
@media (max-width: 767px) {
  .ncp-adv-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}
@media (min-width: 768px) and (max-width: 991px) {
  .ncp-adv-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ── 2-COL SECTIONS ───────────────────────────────────────────── */
@media (max-width: 767px) {
  .ncp-two-col {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* ── PILLAR STRIP ─────────────────────────────────────────────── */
@media (max-width: 991px) {
  /* Step 1: hide infographic, make pillar nav full width */
  .ncp-pillar-wrap {
    display: flex !important;        /* switch from grid to flex */
    flex-direction: column !important;
    overflow: visible !important;
    border-radius: 8px !important;
  }
  .ncp-infographic-col { display: none !important; }
  .ncp-pillar-nav {
    width: 100% !important;
    flex-direction: column !important;
  }
  /* Panel content — no scroll constraint */
  .ncp-panel-content {
    overflow-y: visible !important;
    height: auto !important;
    flex: 1 1 auto !important;
  }
  .ncp-panel { height: auto !important; }
}
@media (max-width: 767px) {
  /* Horizontal scrolling tabs */
  .ncp-pillar-nav nav > div {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
  }
  .ncp-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    width: auto !important;
    padding: 7px 12px !important;
    font-size: 11px !important;
  }
}

/* ── CFC SECTION ──────────────────────────────────────────────── */
@media (max-width: 767px) {
  .ncp-cfc-meta { grid-template-columns: 1fr !important; }
}

/* ── AUTH BUTTONS ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .ncp_nav_auth { gap: 4px !important; }
  .ncp_nav_btn { padding: 5px 10px !important; font-size: 11px !important; }
}

/* ── REGISTRATION / LOGIN ─────────────────────────────────────── */
@media (max-width: 767px) {
  .page_register { padding: 0 14px !important; }
  .page_register .cmp_form.register { max-width: 100% !important; }
  #connect-orcid-button.pkp_button { width: 100% !important; justify-content: center !important; }
  .page_login .buttons { flex-direction: column !important; gap: 10px !important; }
}

/* ── FOOTER ───────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .ncp-sitefooter .ncp-cols {
    grid-template-columns: 1fr 1fr !important;
    padding: 28px 16px 0 !important;
  }
}
@media (max-width: 460px) {
  .ncp-sitefooter .ncp-cols { grid-template-columns: 1fr !important; }
}

/* ── OMP SIDEBAR ──────────────────────────────────────────────── */
/* OMP compiled: .pkp_structure_sidebar{float:right;width:300px} — no mobile rule */
@media (max-width: 767px) {
  .pkp_structure_sidebar { display: none !important; float: none !important; }
  .pkp_structure_main { float: none !important; width: 100% !important; }
}


/* ══════════════════════════════════════════════════════════════
   CRITICAL MOBILE FIX — MAXIMUM SPECIFICITY
   ══════════════════════════════════════════════════════════════ */

/* 1. Prevent any horizontal overflow from distorting layout */
html, body {
  overflow-x: hidden !important;
  max-width: 100% !important;
}

/* 2. Sidebar: hide with maximum specificity */
@media (max-width: 767px) {
  html body .pkp_structure_page .pkp_structure_content .pkp_structure_sidebar,
  html body .pkp_structure_page .pkp_structure_content .pkp_structure_sidebar.left {
    display: none !important;
    float: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
  }
  /* Main content: full width, no float */
  html body .pkp_structure_page .pkp_structure_content .pkp_structure_main {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: .5rem !important;
    box-sizing: border-box !important;
  }
  /* Content wrapper */
  html body .pkp_structure_page .pkp_structure_content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    overflow: visible !important;
  }
}

/* ── CONTENT TABLES — HORIZONTAL SCROLL ON MOBILE ─────────────── */
@media (max-width: 767px) {
  /* Wrap all content tables in scrollable container */
  .pkp_structure_main table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    white-space: nowrap;
    font-size: 13px;
  }
  .pkp_structure_main table th,
  .pkp_structure_main table td {
    padding: 8px 10px !important;
    min-width: 100px;
  }
  /* Price tables specifically */
  .ncp-price-table {
    font-size: 12px !important;
    min-width: 500px;
  }
  /* Wrap table in a scrollable div via CSS (no JS needed) */
  .pkp_structure_main .page {
    overflow-x: hidden;
  }
}


/* ══ REGISTER/LOGIN FORM FIXES (2026-06-28) ═══════════════════════════════ */

/* ORCID button: full-width to match 580px form */
#connect-orcid-button.pkp_button {
  width: 100% !important;
  box-sizing: border-box !important;
  justify-content: center !important;
}

/* Reset Password button: fix maroon-on-maroon contrast (WCAG AA) */
.page_lost_password .buttons button.submit,
.page_lost_password .buttons button[type="submit"] {
  color: #ffffff !important;
}

/* Show/hide password toggle button */
.ncp_pw_field_wrap {
  position: relative;
  display: block;
}
.ncp_pw_toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: #5a5a5a;
  padding: 4px 8px;
  line-height: 1;
}
.ncp_pw_toggle:hover,
.ncp_pw_toggle:focus {
  color: #8C1515;
  outline: none;
}

/* Field hint text (username, password requirements) */
.ncp_field_hint {
  display: block;
  font-size: 0.78rem;
  color: #64748B;
  margin-top: 4px;
  margin-bottom: 2px;
  line-height: 1.4;
}

/* Password match message */
.ncp_pw_match_msg {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 4px;
  min-height: 1.2em;
}

/* Already have an account? CTA (moved below Register button) */
.ncp_login_cta {
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
  color: #555;
}
.ncp_login_cta a {
  color: #8C1515;
  text-decoration: underline;
}
.ncp_login_cta a:hover {
  color: #6a0f0f;
}

/* Placeholder text — subtle grey */
.page_register input::placeholder,
.page_login input::placeholder {
  color: #a0a0a0;
  opacity: 1;
}

/* Reduce spacing between form rows slightly */
.page_register .fields > div,
.page_register .fields > label {
  margin-bottom: 12px !important;
}

/* ══ LOGIN BUTTON FALLBACK (2026-06-28) ════════════════════════════════════
   Template had no class="submit" on button — this ensures styling regardless */
.page_login .buttons button[type="submit"],
.page_login .buttons button:not(.ncp_pw_toggle) {
  background: #8C1515 !important;
  border-color: #8C1515 !important;
  color: #ffffff !important;
  width: auto !important;
  padding: 10px 28px !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  border-radius: 4px !important;
  cursor: pointer !important;
}
.page_login .buttons button[type="submit"]:hover,
.page_login .buttons button[type="submit"]:focus {
  background: #6B1010 !important;
  border-color: #6B1010 !important;
  color: #ffffff !important;
}

/* Register link — styled as secondary button */
.page_login .buttons a:not(.ncp_btn_secondary) {
  font-size: 0.875rem;
  color: #8C1515;
  text-decoration: underline;
  line-height: 2.4;
}

/* Layout: Login button right-aligned, Register link left */
.page_login .buttons {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-top: 20px !important;
}

/* ══ LOGIN PAGE BUTTON LAYOUT FIX (2026-06-28) ════════════════════════════
   Override side-by-side layout: Login full-width, Register below as text link */
.page_login .buttons {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 14px !important;
  margin-top: 24px !important;
}
.page_login .buttons button[type="submit"],
.page_login .buttons button.submit {
  width: 100% !important;
  order: 1 !important;
  padding: 12px 24px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  background: #8C1515 !important;
  color: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
}
.page_login .buttons button[type="submit"]:hover,
.page_login .buttons button.submit:hover {
  background: #6B1010 !important;
}
/* Register link: below the button, centered, plain text */
.page_login .buttons a,
.page_login .buttons a.ncp_btn_secondary {
  order: 2 !important;
  display: block !important;
  text-align: center !important;
  font-size: 0.875rem !important;
  color: #555 !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  text-decoration: none !important;
  line-height: 1.5 !important;
}
.page_login .buttons a::before {
  content: "Don't have an account? " !important;
  color: #555 !important;
}
.page_login .buttons a:hover,
.page_login .buttons a.ncp_btn_secondary:hover {
  background: transparent !important;
  text-decoration: underline !important;
  color: #8C1515 !important;
}

/* ══ LOGIN PAGE OVERHAUL (2026-06-28 v3) ══════════════════════════════════
   Replaces all previous .page_login .buttons rules */

/* Form container */
.page_login .cmp_form {
  max-width: 480px !important;
  margin: 0 auto !important;
}

/* Reduce gap between "Forgot your password?" and Login button */
.page_login p:has(a[href*="lostPassword"]),
.page_login form > p {
  margin-bottom: 8px !important;
  margin-top: 4px !important;
}

/* Buttons container: column stack, no inherited box/border */
.page_login .buttons {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0 !important;
  margin-top: 8px !important;
  border: none !important;
  background: none !important;
  padding: 0 !important;
}

/* Login button: full-width, prominent */
.page_login .buttons button,
.page_login .buttons button.submit,
.page_login .buttons button[type="submit"] {
  order: 1 !important;
  display: block !important;
  width: 100% !important;
  padding: 12px 24px !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  border-radius: 4px !important;
  background: #8C1515 !important;
  color: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
  margin-bottom: 16px !important;
}
.page_login .buttons button:hover,
.page_login .buttons button.submit:hover {
  background: #6B1010 !important;
  color: #ffffff !important;
}

/* Register link: plain centered text below button — no border, no box */
.page_login .buttons a,
.page_login .buttons a.ncp_btn_secondary {
  order: 2 !important;
  display: block !important;
  text-align: center !important;
  font-size: 0.875rem !important;
  color: #666 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1.5 !important;
  text-decoration: none !important;
}
.page_login .buttons a::before {
  content: "Don't have an account? " !important;
  color: #666 !important;
}
.page_login .buttons a span,
.page_login .buttons a {
  font-weight: normal !important;
}
/* The Register word itself in maroon underline */
.page_login .buttons a:hover {
  background: none !important;
  color: #8C1515 !important;
  text-decoration: underline !important;
}

/* Show/Hide toggle: lighter, smaller */
.page_login .ncp_pw_toggle {
  font-size: 0.8rem !important;
  font-weight: 400 !important;
  color: #888 !important;
}
.page_login .ncp_pw_toggle:hover {
  color: #8C1515 !important;
}

/* Keep me logged in checkbox area: tighten spacing */
.page_login .fields + div,
.page_login fieldset ~ div {
  margin-top: 12px !important;
}

/* ══ LOGIN PAGE FINAL FIX (2026-06-28 v4) ════════════════════════════════ */

/* Login button: full-width, standalone in its own div */
.page_login .ncp_login_buttons {
  margin-top: 16px !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  display: block !important;
}
.page_login .ncp_login_buttons button.submit {
  display: block !important;
  width: 100% !important;
  padding: 13px 24px !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  border-radius: 4px !important;
  background: #8C1515 !important;
  color: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.18) !important;
}
.page_login .ncp_login_buttons button.submit:hover {
  background: #6B1010 !important;
}

/* "Don't have an account?" CTA — plain text, centered */
.page_login .ncp_login_cta {
  text-align: center !important;
  margin-top: 14px !important;
  margin-bottom: 32px !important;
  font-size: 0.875rem !important;
  color: #666 !important;
}
.page_login .ncp_login_cta a {
  color: #8C1515 !important;
  text-decoration: underline !important;
  font-weight: 600 !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
}
.page_login .ncp_login_cta a:hover {
  color: #6B1010 !important;
}

/* Tighten spacing above the button section */
.page_login .pkp_form p:has(a[href*="lostPassword"]) {
  margin-bottom: 4px !important;
}


/* ── ORCID icon visibility fix ─────────────────────────────────────────────
   The ORCID SVG outer ring is #A6CE39 (identical to button background).
   Adding white circular background makes the green ring visible again.     */
svg.orcid_icon {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    vertical-align: middle !important;
}
#connect-orcid-button .orcid_button_container {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    justify-content: center !important;
}

/* ORCID SVG path fill fix — external CSS was overriding internal SVG fill:
   fill:currentColor (white on green button) was hiding the green ring.      */
#connect-orcid-button svg.orcid_icon path.st0 {
    fill: #A6CE39 !important;
}
#connect-orcid-button svg.orcid_icon path.st1,
#connect-orcid-button svg.orcid_icon g path {
    fill: #ffffff !important;
}
