/* All page selectors are namespaced to avoid interfering with Divi or IDD. */
.dancentra-app-home {box-sizing:border-box;max-width:980px;margin:14px auto 60px;padding:12px 15px 25px;font-family:inherit;color:#092e59}
.dancentra-app-home * {box-sizing:border-box}
.dcp-home-brand {max-width:580px;margin:0 auto 14px;text-align:center}
.dcp-home-brand img {display:block;width:100%;height:auto;max-height:240px;object-fit:contain;mix-blend-mode:multiply}
.dcp-home-heading {text-align:center;margin:0 auto 28px}
.dcp-home-heading .dcp-eyebrow {margin:0 0 7px;font-size:12px;text-transform:uppercase;letter-spacing:.17em;color:#087fc2;font-weight:700}
.dcp-home-heading h1 {margin:0 0 10px;color:#082c5a;font-size:clamp(27px,5vw,40px);font-weight:750;line-height:1.15}
.dcp-home-heading p {margin:0;color:#4f6782;line-height:1.55;font-size:15px}
.dcp-home-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.dcp-home-card {min-height:130px;display:flex;align-items:center;gap:14px;background:#fff;border:1px solid #dceaf6;border-radius:17px;padding:19px;box-shadow:0 5px 18px rgba(5,47,96,.055);text-decoration:none!important;color:#0a3568!important;transition:transform .15s,border-color .15s}
.dcp-home-card:hover,.dcp-home-card:focus-visible {border-color:#1b8bd0;transform:translateY(-2px)}
.dcp-home-card-icon {display:flex;align-items:center;justify-content:center;min-width:46px;width:46px;height:46px;background:#edf7ff;border-radius:13px;color:#087ac1}
.dcp-home-card-content {display:flex;flex-direction:column;flex:1;gap:6px}
.dcp-home-card-content strong {font-size:17px;line-height:1.22}
.dcp-home-card-content small {color:#54708a;line-height:1.4;font-size:13px}
.dcp-home-card-arrow {font-size:29px;color:#6b96b6;align-self:center}
.dcp-main-action {display:flex;width:fit-content;max-width:100%;margin:24px auto 0;align-items:center;justify-content:center;gap:9px;padding:13px 25px;border-radius:12px;background:#087abd;color:white!important;font-weight:700;text-decoration:none!important}
.dcp-main-action:hover {background:#063e7a;color:white!important}
.dcp-home-register {margin:18px 0 0;text-align:center;color:#526b85;font-size:14px}
.dcp-home-register a {font-weight:700}
.dancentra-pwa-tabs {display:none}
@media(max-width:620px){
  .dancentra-app-home {padding:8px 12px 20px;margin:0 auto 32px}
  .dcp-home-brand {max-width:400px;margin-bottom:8px}
  .dcp-home-brand img {max-height:165px}
  .dcp-home-grid {grid-template-columns:1fr;gap:11px}
  .dcp-home-card {min-height:90px;padding:15px;border-radius:13px}
  .dcp-home-card-icon {min-width:42px;width:42px;height:42px}
  .dcp-home-heading {margin-bottom:21px}
  .dcp-home-heading h1 {font-size:27px}
}
@media (display-mode: standalone) and (max-width:850px) {
  .dancentra-pwa-tabs {display:flex!important;position:fixed;bottom:0;left:0;right:0;z-index:999999;background:rgba(255,255,255,.97);border-top:1px solid #dce7f3;min-height:64px;padding:6px 6px calc(7px + env(safe-area-inset-bottom));box-shadow:0 -3px 22px rgba(10,53,104,.09)}
  .dancentra-pwa-tabs a {flex:1;min-width:0;display:flex;align-items:center;flex-direction:column;justify-content:center;gap:3px;color:#54718d!important;text-decoration:none!important;font-size:11px;font-weight:600;line-height:1.2}
  .dancentra-pwa-tabs a[aria-current="page"] {color:#087abd!important}
  .dcp-tab-symbol {line-height:1;display:flex;align-items:center}
  body {padding-bottom:calc(78px + env(safe-area-inset-bottom))!important}
}
/* iOS navigator.standalone fallback when display-mode matching is inconsistent. */
@media (max-width:850px) {
  html.dancentra-app-installed .dancentra-pwa-tabs {display:flex;position:fixed;bottom:0;left:0;right:0;z-index:999999;background:#fff;border-top:1px solid #dce7f3;min-height:65px;padding:7px 7px calc(7px + env(safe-area-inset-bottom));box-shadow:0 -3px 22px rgba(10,53,104,.09)}
  html.dancentra-app-installed .dancentra-pwa-tabs a {flex:1;display:flex;align-items:center;flex-direction:column;justify-content:center;gap:3px;text-decoration:none!important;color:#54718d;font-size:11px;font-weight:600}
  html.dancentra-app-installed .dancentra-pwa-tabs a[aria-current="page"] {color:#087abd!important}
  html.dancentra-app-installed body {padding-bottom:calc(78px + env(safe-area-inset-bottom))!important}
}

/* --------------------------------------------------------------------------
 * v1.0.1: installed-app-only Divi / WordPress cleanup.
 * The ordinary website, browser tabs, desktop and tablet browsing are untouched.
 * Class is applied only when the page is truly running as an installed PWA.
 * -------------------------------------------------------------------------- */
@media (max-width:850px) {
  /* Hide Divi's normal header (classic and Theme Builder), plus common WP headers. */
  html.dancentra-app-installed body #top-header,
  html.dancentra-app-installed body #main-header,
  html.dancentra-app-installed body .et-l--header,
  html.dancentra-app-installed body header#masthead,
  html.dancentra-app-installed body header.site-header {
    display:none!important;
  }

  /* Fixed-header themes still reserve the header's height when it is hidden. */
  html.dancentra-app-installed body #page-container,
  html.dancentra-app-installed body.et_fixed_nav #page-container,
  html.dancentra-app-installed body.et_fixed_nav.et_show_nav #page-container {
    padding-top:0!important;
    margin-top:0!important;
  }
  html.dancentra-app-installed body #main-content {
    margin-top:0!important;
    padding-top:max(10px, env(safe-area-inset-top))!important;
  }
  html.dancentra-app-installed body .et-l--body {margin-top:0!important}

  /* Hide only the WP page's own title, not the heading inside the PWA shortcode. */
  html.dancentra-app-installed body.dancentra-pwa-home-page #main-content h1.entry-title,
  html.dancentra-app-installed body.dancentra-pwa-home-page #main-content .et_post_meta_wrapper > h1,
  html.dancentra-app-installed body.dancentra-pwa-home-page #main-content .page-title,
  html.dancentra-app-installed body.dancentra-pwa-home-page #main-content .wp-block-post-title {
    display:none!important;
  }
  html.dancentra-app-installed body.dancentra-pwa-home-page #main-content .et_post_meta_wrapper {
    padding-top:0!important;
    margin-top:0!important;
  }
  html.dancentra-app-installed body.dancentra-pwa-home-page #main-content .container {padding-top:0!important}
  html.dancentra-app-installed body.dancentra-pwa-home-page #main-content article {margin-bottom:0!important}

  /* Remove the classic WordPress sidebar, retaining content full-width. */
  html.dancentra-app-installed body #sidebar,
  html.dancentra-app-installed body #secondary,
  html.dancentra-app-installed body aside#secondary,
  html.dancentra-app-installed body #main-content .container:before {
    display:none!important;
  }
  html.dancentra-app-installed body #left-area,
  html.dancentra-app-installed body .et_right_sidebar #left-area,
  html.dancentra-app-installed body .et_left_sidebar #left-area {
    float:none!important;
    width:100%!important;
    padding-right:0!important;
    padding-left:0!important;
    margin-right:0!important;
  }

  /* Theme footer is replaced by the PWA's compact legal footer (app.js). */
  html.dancentra-app-installed body #main-footer,
  html.dancentra-app-installed body #footer,
  html.dancentra-app-installed body #et-footer-nav,
  html.dancentra-app-installed body #footer-bottom,
  html.dancentra-app-installed body .et-l--footer,
  html.dancentra-app-installed body footer#colophon,
  html.dancentra-app-installed body footer.site-footer {
    display:none!important;
  }

  /* Minimal legal footer, outside the hidden theme footer. */
  html.dancentra-app-installed #dancentra-pwa-legal {
    box-sizing:border-box;
    display:block!important;
    position:relative;
    width:100%;
    padding:23px max(18px,env(safe-area-inset-right)) 28px max(18px,env(safe-area-inset-left));
    margin:16px 0 0;
    background:#082b5d;
    color:#d3e4f7;
    font-family:inherit;
    text-align:center;
    z-index:1;
  }
  html.dancentra-app-installed #dancentra-pwa-legal .dcp-legal-links {
    display:flex;
    justify-content:center;
    flex-wrap:wrap;
    align-items:center;
    gap:10px 25px;
    margin:0 0 16px;
  }
  html.dancentra-app-installed #dancentra-pwa-legal a,
  html.dancentra-app-installed #dancentra-pwa-legal a:visited {
    text-decoration:none!important;
    font-size:14px;
    font-weight:600;
    color:white!important;
  }
  html.dancentra-app-installed #dancentra-pwa-legal a:focus-visible {
    outline:2px solid #fbc447;
    outline-offset:4px;
  }
  html.dancentra-app-installed #dancentra-pwa-legal .dcp-legal-tagline {
    font-size:12px;
    line-height:1.55;
    letter-spacing:.01em;
    color:#c1d5ed;
    margin:0;
    padding:13px 0 0;
    border-top:1px solid rgba(255,255,255,.2);
  }
  /* Always reserve space below the custom footer for the bottom app tabs. */
  html.dancentra-app-installed body {
    padding-bottom:calc(78px + env(safe-area-inset-bottom))!important;
    overflow-x:hidden;
  }
}

/* --------------------------------------------------------------------------
 * v1.0.2: Hide the WordPress admin toolbar ONLY in the installed PWA.
 *
 * This rule is intentionally NOT filtered through PHP show_admin_bar(false),
 * because that would also change the normal WordPress website. The JS-applied
 * dancentra-app-installed class is present only in standalone display mode.
 * Works for logged-in admins as well as ordinary users, at any screen width.
 * -------------------------------------------------------------------------- */
html.dancentra-app-installed {
  /* WordPress injects `html { margin-top:32px/46px!important }` via wp_head.
     Higher specificity ensures the app never keeps the vacant toolbar gap. */
  margin-top:0!important;
}
html.dancentra-app-installed body #wpadminbar,
html.dancentra-app-installed body .wp-admin-bar {
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
html.dancentra-app-installed body.admin-bar {
  margin-top:0!important;
  top:0!important;
}
/* Some Divi/third-party themes apply admin-bar offsets to page wrappers. */
html.dancentra-app-installed body.admin-bar #page-container {
  margin-top:0!important;
  top:0!important;
}
