/*
 * Help pages ([friendly_planter_help]). The site theme sets the fonts and text; this only adds
 * the pictures, tips, the page lists and the planner button.
 */

.fp-help {
  --fp-help-green: #08803e;
  --fp-help-tint: #eef5ea;
  --fp-help-border: #e2e2e2;
  /* The sidebar goes beside the page when the help column is wide enough (not the screen). */
  container-type: inline-size;
}

.fp-help-body {
  min-width: 0;
}

/*
 * Links in the planner's green, whatever the theme's link color (Newspaper's default is a light
 * blue). "body" makes this win over the theme's own link rules.
 */
body .fp-help a:not(.fp-help-button),
body .fp-help a:not(.fp-help-button):visited {
  color: var(--fp-help-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

body .fp-help a:not(.fp-help-button):hover,
body .fp-help a:not(.fp-help-button):focus-visible {
  color: #065f30;
}

.fp-help img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px 0 20px;
  border: 1px solid var(--fp-help-border);
  border-radius: 8px;
}

/* A tip: a quote in the Markdown ("> Tip: ..."). */
/*
 * Themes style quotes their own way (Newspaper: big, italic, uppercase, centered, light blue);
 * a tip box looks like the rest of the page's text instead.
 */
body .fp-help blockquote {
  margin: 16px 0 !important;
  padding: 10px 16px !important;
  border: 0 !important;
  border-left: 4px solid var(--fp-help-green) !important;
  border-radius: 0 6px 6px 0;
  background: var(--fp-help-tint);
  quotes: none;
}

body .fp-help blockquote::before,
body .fp-help blockquote::after {
  content: none !important;
}

body .fp-help blockquote,
body .fp-help blockquote p,
body .fp-help blockquote strong {
  color: inherit !important;
  font-family: inherit !important;
  font-size: inherit !important;
  font-style: normal !important;
  line-height: inherit !important;
  letter-spacing: normal !important;
  text-align: left !important;
  text-transform: none !important;
}

body .fp-help blockquote p {
  margin: 0 !important;
  padding: 0 !important;
}

body .fp-help blockquote strong {
  font-weight: 700 !important;
}

/* Phone screenshots: shown at about a phone's size, not stretched across the page. */
.fp-help img.fp-help-phone {
  width: 300px;
}

.fp-help kbd {
  padding: 1px 6px;
  border: 1px solid #ccc;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #f7f7f7;
  font-family: inherit;
  font-size: 0.9em;
}

.fp-help table {
  border-collapse: collapse;
  margin: 12px 0 20px;
}

.fp-help th,
.fp-help td {
  padding: 6px 10px;
  border: 1px solid var(--fp-help-border);
  text-align: left;
  vertical-align: top;
}

.fp-help-topics {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.fp-help-topics li {
  margin: 0 0 16px;
}

.fp-help-topics a {
  font-weight: 600;
  font-size: 1.1em;
}

.fp-help-topics p {
  margin: 2px 0 0;
}

.fp-help-open {
  margin: 28px 0;
}

body .fp-help a.fp-help-button,
body .fp-help a.fp-help-button:visited {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--fp-help-green);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

body .fp-help a.fp-help-button:hover,
body .fp-help a.fp-help-button:focus-visible {
  background: #066b34;
  color: #fff;
}

/* ---------- Sidebar: the help pages, and this page's sections ---------- */

.fp-help-nav {
  box-sizing: border-box;
  margin: 32px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--fp-help-border);
  border-radius: 8px;
  font-size: 0.92em;
  line-height: 1.4;
}

.fp-help-nav .fp-help-nav-title {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 1.05em;
}

body .fp-help-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

body .fp-help-nav li {
  margin: 0;
  padding: 0;
}

body .fp-help-nav li::before {
  content: none;
}

body .fp-help-nav a:not(.fp-help-button),
.fp-help-nav [aria-current='page'] {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  text-decoration: none;
}

body .fp-help-nav a:not(.fp-help-button):hover {
  background: var(--fp-help-tint);
}

/* The page being read: darker and bolder than the links. */
body .fp-help-nav [aria-current='page'] {
  background: #dcebd3;
  color: #05532a;
  font-weight: 800;
}

/* A thin line between the pages (not between a page's sections). */
body .fp-help-nav > ul > li {
  padding: 3px 0;
}

body .fp-help-nav > ul > li + li {
  border-top: 1px solid var(--fp-help-border);
}

/* This page's sections, under its name. */
body .fp-help-nav .fp-help-sections {
  margin: 2px 0 6px 10px;
  padding-left: 8px;
  border-left: 2px solid var(--fp-help-tint);
  font-size: 0.95em;
}

body .fp-help-nav .fp-help-sections a:not(.fp-help-button) {
  padding: 3px 8px;
}

.fp-help-nav .fp-help-nav-all {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--fp-help-border);
}

/* ---------- Columns: help pages list | page | right column (widgets, e.g. ads) ---------- */

/* The right column: only as wide as what's in it, up to 300px. */
.fp-help-aside {
  margin: 32px 0 0;
  max-width: 300px;
}

.fp-help-widget + .fp-help-widget {
  margin-top: 24px;
}

.fp-help-widget-title {
  margin: 0 0 8px;
  font-weight: 700;
}

/*
 * The list beside the page once the help column is about 660px wide (Newspaper's page column
 * beside its own sidebar is 696px). On a full-width page there's room for the right column too.
 */
@container (min-width: 660px) {
  .fp-help-layout.fp-help-has-nav {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
  }

  /* No room for a third column yet: the right column goes under the page. */
  .fp-help-has-nav > .fp-help-aside {
    grid-column: 2;
    grid-row: 2;
  }

  /* Kept in view while the page scrolls; help.js sets "top" below a pinned site menu. */
  .fp-help-layout > .fp-help-nav {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
    margin: 0;
  }

  .fp-help-layout > .fp-help-body {
    grid-column: 2;
    grid-row: 1;
  }
}

@container (min-width: 900px) {
  .fp-help-layout.fp-help-has-nav {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 36px;
  }
}

/* The page at a comfortable reading width; the right column beside it when there's room. */
.fp-help-body {
  max-width: 760px;
}

@container (min-width: 760px) {
  .fp-help-layout.fp-help-has-aside:not(.fp-help-has-nav) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 36px;
    align-items: start;
  }

  .fp-help-layout.fp-help-has-aside:not(.fp-help-has-nav) > .fp-help-aside {
    margin: 0;
  }
}

@container (min-width: 1000px) {
  .fp-help-layout.fp-help-has-nav.fp-help-has-aside {
    grid-template-columns: 230px minmax(0, 1fr) auto;
  }

  .fp-help-has-nav > .fp-help-aside {
    grid-column: 3;
    grid-row: 1;
    margin: 0;
  }
}
