/* Part zw-pagehead: the title band on interior pages (11/15 /ui round). Every interior page opened with the same
   plain title on white, while the home page had the photo, the gold county map, and the curve. The band gives each
   page's first screen the same navy, a piece of a plat map at its right edge, and the home hero's curved foot.
   It has no row in gl_part_map(), so it loads on every page. zw-pagehead.php sets body.gl-ph; without that class
   nothing here applies, which is the switch back to the plain titles.

   The band is the page's own title element, so the heading stays the one H1 and no markup moves. Four elements
   hold a title: a page's header, the blog's, an archive's or the search's, and the 404 page's. The equipment catalog
   prints its title with no element around it, so there the title itself is the band. A border image paints the navy
   out to both screen edges at the band's own height, with nothing to clip. */

body.gl-ph {
  --gl-ph-bg: var(--gl-navy-deep);
  /* The space over the title, the height of the curved foot, the space under the title (the foot included), and
     the space between the band and the page. */
  --gl-ph-pt: 58px;
  --gl-ph-foot: 26px;
  --gl-ph-pb: 44px;
  --gl-ph-gap: 28px;
  /* The plat map and the foot: scripts/plat_head_svg.py draws them and prints these two lines. */
  --gl-ph-plat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='415' height='276' viewBox='0 0 415 276'%3E%3Cpath d='M253.5 46v46M230 69.5h46M299.5 46v46M276 69.5h46M345.5 46v46M322 69.5h46M299.5 92v46M276 115.5h46M345.5 92v46M322 115.5h46M253.5 0v46M230 23.5h46M299.5 0v46M276 23.5h46' fill='none' stroke='%23fff' stroke-opacity='.2' stroke-dasharray='2 3'/%3E%3Cpath d='M0.5 0V276M46.5 0V276M92.5 0V276M184.5 0V276M230.5 0V276M276.5 0V276M322.5 0V276M368.5 0V276M414.5 0V276M0 46.5H415M0 92.5H415M0 138.5H415M0 184.5H415M0 230.5H415' fill='none' stroke='%23fff' stroke-opacity='.26'/%3E%3Cpath d='M138 0V276' fill='none' stroke='%23fff' stroke-opacity='.5' stroke-width='2'/%3E%3Cpath d='M398 0c-14 20 6 38-22 58s-58 14-70 44 4 50-30 68-64 10-84 42-6 46-30 64' fill='none' stroke='%238a9dcd' stroke-opacity='.75' stroke-width='1.5'/%3E%3Cg font-family='Segoe UI,Arial,sans-serif' font-size='12' fill='%23fff' fill-opacity='.42' text-anchor='middle'%3E%3Ctext x='23' y='28'%3E3%3C/text%3E%3Ctext x='69' y='28'%3E2%3C/text%3E%3Ctext x='115' y='28'%3E1%3C/text%3E%3Ctext x='161' y='28'%3E6%3C/text%3E%3Ctext x='207' y='28'%3E5%3C/text%3E%3Ctext x='253' y='28'%3E4%3C/text%3E%3Ctext x='299' y='28'%3E3%3C/text%3E%3Ctext x='345' y='28'%3E2%3C/text%3E%3Ctext x='391' y='28'%3E1%3C/text%3E%3Ctext x='23' y='74'%3E10%3C/text%3E%3Ctext x='69' y='74'%3E11%3C/text%3E%3Ctext x='115' y='74'%3E12%3C/text%3E%3Ctext x='161' y='74'%3E7%3C/text%3E%3Ctext x='207' y='74'%3E8%3C/text%3E%3Ctext x='345' y='74'%3E11%3C/text%3E%3Ctext x='391' y='74'%3E12%3C/text%3E%3Ctext x='23' y='120'%3E15%3C/text%3E%3Ctext x='69' y='120'%3E14%3C/text%3E%3Ctext x='115' y='120'%3E13%3C/text%3E%3Ctext x='161' y='120'%3E18%3C/text%3E%3Ctext x='207' y='120'%3E17%3C/text%3E%3Ctext x='253' y='120'%3E16%3C/text%3E%3Ctext x='299' y='120'%3E15%3C/text%3E%3Ctext x='391' y='120'%3E13%3C/text%3E%3Ctext x='23' y='166'%3E22%3C/text%3E%3Ctext x='69' y='166'%3E23%3C/text%3E%3Ctext x='115' y='166'%3E24%3C/text%3E%3Ctext x='161' y='166'%3E19%3C/text%3E%3Ctext x='207' y='166'%3E20%3C/text%3E%3Ctext x='253' y='166'%3E21%3C/text%3E%3Ctext x='299' y='166'%3E22%3C/text%3E%3Ctext x='345' y='166'%3E23%3C/text%3E%3Ctext x='391' y='166'%3E24%3C/text%3E%3Ctext x='23' y='212'%3E27%3C/text%3E%3Ctext x='69' y='212'%3E26%3C/text%3E%3Ctext x='115' y='212'%3E25%3C/text%3E%3Ctext x='161' y='212'%3E30%3C/text%3E%3Ctext x='207' y='212'%3E29%3C/text%3E%3Ctext x='253' y='212'%3E28%3C/text%3E%3Ctext x='299' y='212'%3E27%3C/text%3E%3Ctext x='345' y='212'%3E26%3C/text%3E%3Ctext x='391' y='212'%3E25%3C/text%3E%3Ctext x='23' y='258'%3E34%3C/text%3E%3Ctext x='69' y='258'%3E35%3C/text%3E%3Ctext x='115' y='258'%3E36%3C/text%3E%3Ctext x='161' y='258'%3E31%3C/text%3E%3Ctext x='207' y='258'%3E32%3C/text%3E%3Ctext x='253' y='258'%3E33%3C/text%3E%3Ctext x='299' y='258'%3E34%3C/text%3E%3Ctext x='345' y='258'%3E35%3C/text%3E%3Ctext x='391' y='258'%3E36%3C/text%3E%3C/g%3E%3Crect x='323' y='116' width='45' height='22' fill='%238a9dcd' fill-opacity='.8'/%3E%3Cpath d='M254 47H299V92H277V69H254Z' fill='%23c8952b'/%3E%3C/svg%3E");
  --gl-ph-foot-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 100' preserveAspectRatio='none'%3E%3Cg fill='%23fff'%3E%3Cpath opacity='.15' d='M0 14C0 14 88.64 17.48 300 50C560 90 814 77 1003 40L1015 68L1018 104H0V14Z'/%3E%3Cpath opacity='.3' d='M0 45C0 45 271 90.13 500 77C657 68 830 30 1015 14V100H0V45Z'/%3E%3Cpath d='M0 58C0 58 188.29 90 508 90C798 90 1002 55 1002 55V100H0V58Z'/%3E%3C/g%3E%3C/svg%3E");
}
@media (min-width: 850px) {
  body.gl-ph { --gl-ph-pt: 44px; --gl-ph-foot: 44px; --gl-ph-pb: 68px; --gl-ph-gap: 44px; }
}

body.gl-ph.page #main header.entry-header,
body.gl-ph.blog #main .gl-blog-head,
body.gl-ph #main .blog-archive > header.archive-page-header,
body.gl-ph.error404 #main .error-404 header.page-title,
body.gl-ph #main h1.gl-d-shop-title {
  position: relative;
  margin-top: -30px;
  margin-bottom: var(--gl-ph-gap);
  padding-top: var(--gl-ph-pt);
  padding-bottom: var(--gl-ph-pb);
  background: var(--gl-ph-bg);
  border-image: conic-gradient(var(--gl-ph-bg) 0 0) fill 0 / 0 / 0 100vw;
}
body.gl-ph.page #main header.entry-header > h1.entry-title,
body.gl-ph.blog #main .gl-blog-head > h1.entry-title,
body.gl-ph #main .blog-archive > header.archive-page-header h1.page-title,
body.gl-ph.error404 #main .error-404 header.page-title > h1.page-title {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #fff;
}
/* The equipment catalog's title is the band and the words at once: its own stacking order keeps the map under the
   words. */
body.gl-ph #main h1.gl-d-shop-title { isolation: isolate; color: #fff; }
body.gl-ph #main h1.gl-d-shop-title::before { z-index: -1; }
/* An archive's or the search's title: the small line over the name stays quieter than the name. */
body.gl-ph #main .blog-archive > header.archive-page-header h1.page-title { color: #c9d1e8; }
body.gl-ph #main .blog-archive > header.archive-page-header h1.page-title > span { color: #fff; }

/* The plat map. It fades toward the title, so a long title never runs into hard lines. */
body.gl-ph.page #main header.entry-header::before,
body.gl-ph.blog #main .gl-blog-head::before,
body.gl-ph #main .blog-archive > header.archive-page-header::before,
body.gl-ph.error404 #main .error-404 header.page-title::before,
body.gl-ph #main h1.gl-d-shop-title::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 415px;
  background: var(--gl-ph-plat) right top no-repeat;
  -webkit-mask-image: linear-gradient(to left, #000 50%, transparent);
  mask-image: linear-gradient(to left, #000 50%, transparent);
  pointer-events: none;
}
/* The blog's title sits in a padded container, and an archive's header spans the screen: the map keeps to the
   page's right edge on both. */
body.gl-ph.blog #main .gl-blog-head::before { right: 15px; }
body.gl-ph #main .blog-archive > header.archive-page-header::before { right: max(15px, calc(50% - 540px)); }

/* The curved foot: the home hero's three curves, drawn over the map. */
body.gl-ph.page #main header.entry-header::after,
body.gl-ph.blog #main .gl-blog-head::after,
body.gl-ph #main .blog-archive > header.archive-page-header::after,
body.gl-ph.error404 #main .error-404 header.page-title::after,
body.gl-ph #main h1.gl-d-shop-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 100vw;
  height: var(--gl-ph-foot);
  translate: -50% 0;
  background: var(--gl-ph-foot-img) center / 100% 100% no-repeat;
  pointer-events: none;
}

/* The 404 page keeps its text to 46 em; its title's band reaches the page's right edge like the others. */
body.gl-ph.error404 .error-404 .col.medium-9 { max-width: none; }
body.gl-ph.error404 .error-404 .page-content { max-width: 46em; }

@media (min-width: 850px) {
  /* Room for the map: a long title wraps before it reaches the gold farm. */
  body.gl-ph.page #main header.entry-header > h1.entry-title,
  body.gl-ph.blog #main .gl-blog-head > h1.entry-title,
  body.gl-ph #main .blog-archive > header.archive-page-header h1.page-title,
  body.gl-ph.error404 #main .error-404 header.page-title > h1.page-title { max-width: calc(100% - 300px); }
  body.gl-ph #main h1.gl-d-shop-title { padding-right: 300px; }

  /* Pages with a side column (the service pages): the title sits in the text column, so the band reaches across the
     side column to the page's right edge, and the side column starts under the band. The column is 30% of the row
     (25% on a page b-services doesn't lay out), and the title's column has 46 px of padding and rule. */
  body.gl-ph.page .page-right-sidebar > .row > #content.large-9 > .page-inner > header.entry-header {
    margin-right: calc(-1 * ((100% + 46px) / 3 + 16px));
  }
  body.gl-ph.page.gl-b-service .page-right-sidebar > .row > #content.large-9 > .page-inner > header.entry-header {
    margin-right: calc(-1 * ((100% + 46px) * 3 / 7 + 16px));
  }
  body.gl-ph.page .page-right-sidebar > .row > #content.large-9 > .page-inner > header.entry-header > h1.entry-title { white-space: nowrap; }
  body.gl-ph.page .page-right-sidebar > .row > .large-3 {
    margin-top: calc(var(--gl-ph-pt) + var(--gl-h1) * 1.2 + var(--gl-ph-pb) + var(--gl-ph-gap) - 30px);
  }
  /* The listing index pages use the same template with the side column hidden: nothing to reach across. */
  body.gl-ph.page.gl-h-listings .page-right-sidebar > .row > #content.large-9 > .page-inner > header.entry-header { margin-right: 0; }

  /* Private Transactions builds its side column in a grid: the band takes the whole first row. */
  body.gl-ph.gl-bs-private #content .col-inner > .entry-header { grid-column: 1 / -1; }
  body.gl-ph.gl-bs-private #content .col-inner > .gl-bs-side { grid-row: 2; }
}
@media (min-width: 850px) and (max-width: 1023px) {
  /* The Fold's inner screen: b-services gives the side column 36% there. */
  body.gl-ph.page.gl-b-service .page-right-sidebar > .row > #content.large-9 > .page-inner > header.entry-header {
    margin-right: calc(-1 * ((100% + 46px) * 9 / 16 + 16px));
  }
}

/* The four listing index pages, from 850 px: the row under the title holds the count or the links to the map and
   to email alerts, and from 1024 px d-listings.css pulls that row up beside the title, where the map is. With the
   band, the row sits under the title, inside the band, in white. The band grows by 40 px for it, and the row hands
   the same space back under itself, so the page starts one gap under the band. */
@media (min-width: 850px) {
  body.gl-ph:is(.page-id-19574, .page-id-20116, .page-id-19592, .page-id-19594) #main header.entry-header { padding-bottom: calc(var(--gl-ph-pb) + 40px); }
  body.gl-ph:is(.page-id-19574, .page-id-20116, .page-id-19592, .page-id-19594) #main .gl-index .gl-ihead {
    position: relative;
    z-index: 2;
    justify-content: flex-start;
    margin-top: calc(-1 * (var(--gl-ph-gap) + var(--gl-ph-pb) + 40px - 2px));
    margin-bottom: calc(var(--gl-ph-pb) - 6px + var(--gl-ph-gap));
    padding-bottom: 0;
    border-bottom: 0;
  }
  body.gl-ph:is(.page-id-19574, .page-id-20116, .page-id-19592, .page-id-19594) #main .gl-index .gl-ihead-count { color: #c9d1e8; }
  body.gl-ph:is(.page-id-19574, .page-id-20116, .page-id-19592, .page-id-19594) #main .gl-index .gl-ihead a.gl-ilink,
  body.gl-ph:is(.page-id-19574, .page-id-20116, .page-id-19592, .page-id-19594) #main .gl-index .gl-ihead a.gl-ilink:hover,
  body.gl-ph:is(.page-id-19574, .page-id-20116, .page-id-19592, .page-id-19594) #main .gl-index .gl-ihead a.gl-ilink:focus { color: #fff; }
}

@media (max-width: 849px) {
  /* Phones and small tablets: the map is a strip across the band's top, over the title, so a title that fills the
     line never crosses the gold farm. The strip shows the township's second row, where the farm is. */
  body.gl-ph.page #main header.entry-header::before,
  body.gl-ph.blog #main .gl-blog-head::before,
  body.gl-ph #main .blog-archive > header.archive-page-header::before,
  body.gl-ph.error404 #main .error-404 header.page-title::before,
  body.gl-ph #main h1.gl-d-shop-title::before {
    width: min(369px, 92%);
    bottom: auto;
    height: 48px;
    background-position: right -46px;
    -webkit-mask-image: linear-gradient(to left, #000 46%, transparent);
    mask-image: linear-gradient(to left, #000 46%, transparent);
  }
}

@media print {
  body.gl-ph.page #main header.entry-header,
  body.gl-ph.blog #main .gl-blog-head,
  body.gl-ph #main .blog-archive > header.archive-page-header,
  body.gl-ph.error404 #main .error-404 header.page-title,
  body.gl-ph #main h1.gl-d-shop-title { margin: 0 0 16pt; padding: 0; background: none; border-image: none; }
  body.gl-ph.page #main header.entry-header > h1.entry-title,
  body.gl-ph.blog #main .gl-blog-head > h1.entry-title,
  body.gl-ph #main .blog-archive > header.archive-page-header h1.page-title,
  body.gl-ph #main .blog-archive > header.archive-page-header h1.page-title > span,
  body.gl-ph.error404 #main .error-404 header.page-title > h1.page-title,
  body.gl-ph #main h1.gl-d-shop-title { color: #000; max-width: none; }
  body.gl-ph.page #main header.entry-header::before, body.gl-ph.page #main header.entry-header::after,
  body.gl-ph.blog #main .gl-blog-head::before, body.gl-ph.blog #main .gl-blog-head::after,
  body.gl-ph #main .blog-archive > header.archive-page-header::before, body.gl-ph #main .blog-archive > header.archive-page-header::after,
  body.gl-ph.error404 #main .error-404 header.page-title::before, body.gl-ph.error404 #main .error-404 header.page-title::after,
  body.gl-ph #main h1.gl-d-shop-title::before, body.gl-ph #main h1.gl-d-shop-title::after { display: none; }
}
