/*
Additional shared CSS specifically for the content pages e.g. blog and help
*/

/**********/
/* Search */
/**********/

body#alfred_search section > div { max-width: 800px; margin: 0 auto; padding: 40px 20px; text-align: center;}
body#alfred_search ul { list-style: none; }
body#alfred_search #alfred_searchblock  { background: hsl(0 100% 100% / 4%); }
body#alfred_search .alfred_searchresult { text-align: left; margin-bottom: 30px; padding-bottom: 30px; border-bottom: 1px solid transparent; border-image: linear-gradient(to right, rgba(0, 0, 0, 0), var(--site-main-box-divider) 10%, var(--site-main-box-divider) 90%, rgba(0, 0, 0, 0)) 1; }
body#alfred_search .alfred_searchresult h2 { margin-bottom: 3px; }
body#alfred_search .alfred_searchresult p a { color: #888; }
body#alfred_search .alfred_searchresult p a:hover { color: var(--alfred-link); }

.alfred_searchbar form                    { width: calc(100% - 4px); border: solid 1px #404040; border-radius: 5px; overflow: hidden; margin: 20px auto; display: -webkit-flex; display: flex; -webkit-flex-flow: nowrap; flex-flow: nowrap; }
.alfred_searchbar form input              { outline: none; font-family: inherit; font-size: 1.2em; height: 40px; border: 0; margin: 0; padding: 1px 10px 0 10px; color: #ddd; -webkit-flex: 1; flex: 1; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; background: #1c1c1c; min-width: 100px; }
.alfred_searchbar form input::placeholder { color: #45454a; }
.alfred_searchbar form button             { font-family: inherit; font-size: 1.2em; height: 40px; border: 0; margin: 0; padding: 1px 22px 0 22px; color: #fff; background: #5c1f87; }
.alfred_searchbar p                       { max-width: 600px; margin: 0 auto; }

.alfred_sidebarsearch                    { display: flex; margin-bottom: 20px; border: solid 1px var(--site-main-box-divider); border-radius: 4px; overflow: hidden; }
.alfred_sidebarsearch input              { outline: none; border: 0; color: #fff; background: var(--site-main); min-width: 0; flex: 3; font-size: 1em; padding-left: 5px; }
.alfred_sidebarsearch input::placeholder { color: #707077; }
.alfred_sidebarsearch button             { flex: 1; font-family: inherit; font-size: 1em; height: 30px; border: 0; margin: 0; padding: 1px 10px; background: var(--site-main-box-divider); color: #fff; }

/*********************/
/* Alfred Main Block */
/*********************/

main.alfred_grid > nav { background: var(--site-main-box); padding: 20px; }
main.alfred_grid > nav > div { margin: 0 auto; max-width: var(--site-main-max-width) }

main.alfred_grid > div               { display: flex; gap: 40px; max-width: var(--site-main-max-width); margin: 0px auto; padding: 30px 20px; }

main.alfred_grid > div > article     { max-width: 740px; flex: 3; }
main.alfred_grid > div > article img { display: block; margin: 1.4em auto; }

main.alfred_grid > div > aside       { min-width: 240px; flex: 1; padding: 20px; background: var(--site-main-box); border-radius: 8px; }
main.alfred_grid > div > aside h2    { padding: 0; margin: 0 0 0.3em 0; }
main.alfred_grid > div > aside ul    { list-style: none; }
main.alfred_grid > div > aside li    { padding: 0; margin: 0.5em 0; }
main.alfred_grid > div > aside hr    { margin: 0; }

/****************************/
/* Details and Page Indexes */
/****************************/

aside nav > div > h3 { font-size: 1.4em; }

.alfred_pageindex ul ul { margin: 0.2em 0 0 14px; }
.alfred_pageindex li { list-style: none; margin: 0.2em 0 0 0; }
main.alfred_grid article .alfred_pageindex { display: none; }

.alfred_relatedpages li { margin-top: 16px !important; }
.alfred_relatedpages p  { color: #aaa; margin-top: 4px; line-height: 1.45em; }
.alfred_relatedpages a  { display: block; }

/********/
/* Blog */
/********/

.alfred_blogpost > header > h1       { margin-bottom: 18px; }
.alfred_blogpost > header > p        { font-style: italic; margin-bottom: 20px; color: #999; }
.alfred_blogpost > footer            { padding: 10px 14px; margin-top: 20px; border-radius: 4px; background: var(--site-main-box-lighter); }
.alfred_blogpost + .alfred_blogpost,
.alfred_blogpagination               { border-top: solid 3px; border-image: linear-gradient(to right, rgba(0, 0, 0, 0), var(--site-main-box-divider) 10%, var(--site-main-box-divider) 90%, rgba(0, 0, 0, 0)) 1; margin-top: 30px; padding-top: 20px; }
.alfred_blogpagination a             { display: inline-block; padding: 10px 20px; background: var(--site-main-box-lighter); margin: 0 20px 0 0; border-radius: 3px; }
.alfred_blogcategoryintro            { font-style: italic; margin: 0 auto 30px auto; padding: 10px 20px; max-width: 550px; text-align: center; line-height: 1.6em; background: var(--site-main-box-lighter); }

/********/
/* Help */
/********/

#alfred_help main article > #alfred_page_icon { max-width: 48px; float: left; margin: 1px 16px 0 0; }
#alfred_help main article > h2,
#alfred_help main article > nav > h2 { border-top: solid 1px; border-image: linear-gradient(to right, rgba(0, 0, 0, 0), var(--site-main-box-divider) 10%, var(--site-main-box-divider) 90%, rgba(0, 0, 0, 0)) 1; margin-top: 1.2em; padding-top: 1.2em; }

/*************/
/* Changelog */
/*************/

#changelog > div { max-width:1134px; padding: 30px 20px; margin: 0 auto; }
#changelog > div h2 { background: #222; padding: 10px; }
#changelogprevious { background: #141414; }
#changelogprevious > div { max-width:1134px; padding: 30px 20px; margin: 0 auto; text-align: center; }

/********************/
/* Properties */
/********************/

.alfred_pdef              { margin: 30px 0; background: hsl(0 100% 100% / 0.035); border-radius: 8px; overflow: hidden; position: relative; }
.alfred_pdef .alfred_pdef { margin: 20px 0; background: hsl(0 100% 100% / 0.025); }

.alfred_pdef dl         { background:#2b3c40; padding: 16px; display: grid; grid-template-columns: max-content 1fr; grid-template-rows: auto auto; column-gap: 16px; }
.alfred_pdef > div dl   { background:#342f38; }

.alfred_pdef dl > dt { grid-row: span 2; align-self: start; display: inline-block; font-family: "Menlo", monospace; font-size: 1.5em; background:  hsl(0 100% 100% / 0.12); padding: 8px; border-radius: 4px; }
.alfred_pdef dl > dt > a { color: inherit; }
.alfred_pdef dl > dd:nth-child(2) { font-size: 1.1em; font-weight: 600; }
.alfred_pdef dl > dd:nth-child(3) { font-size: 1em; color: #999; }
.alfred_pdef > div > :first-child { margin-top: 0 !important; }
.alfred_pdef > div > :last-child  { margin-bottom: 0 !important; }
.alfred_pdef > div h3 { font-size: 1.4em; }
.alfred_pdef > div h4 { font-size: 1.2em; }
.alfred_pdef > div:first-of-type       { padding: 16px; }
.alfred_pdef > div:not(:first-of-type) { margin: 16px; }
.alfred_pdef > div table { width: 100%; corner-radius: 8px; }
.alfred_pdef > div table th { background: hsl(0 100% 100% / 0.04); }
.alfred_pdef > div table td:first-child { width: 15%; white-space: nowrap; vertical-align: top; }
.alfred_pdef > div table td > :last-child { margin-bottom: 0; }

/* `ul.alfred_parameter_definition` is deprecated, it is only used on the deprecated Script Filter XML page */
ul.alfred_parameter_definition { list-style: none; font-size: 1.2em; }
ul.alfred_parameter_definition li { padding: 0; margin: 1px 0 0 0; }
ul.alfred_parameter_definition li:nth-child(1) { font-weight: bold; }
ul.alfred_parameter_definition li:nth-child(2) { font-style: italic; color: #888; }

/********************/
/* Workflow Objects */
/********************/

.alfred_workflowobjects         { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 30px 0; }
.alfred_workflowobjects a       { display: block; background: var(--site-main-box); border-radius: 16px; text-align: center; padding: 20px; }
.alfred_workflowobjects a:hover { background: hsl(from var(--site-main-box) h s calc(l * 1.2)); }
.alfred_workflowobjects a h2    { padding: 0; margin: 0 0 10px 0; font-size: 1.4em; }
.alfred_workflowobjects a img   { max-width: 64px; margin: 4px auto 20px auto !important; }
.alfred_workflowobjects a p     { color: #ddd; }

.alfred_summaryblock_2         { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 30px 0; }
.alfred_summaryblock_2 a       { display: block; background: var(--site-main-box); border-radius: 16px; text-align: center; padding: 24px; }
.alfred_summaryblock_2 a:hover { background: hsl(from var(--site-main-box) h s calc(l * 1.2)); }
.alfred_summaryblock_2 a img   { padding: 0; margin: 0 auto !important; }
.alfred_summaryblock_2 a h2    { margin: 20px 0 16px 0; }
.alfred_summaryblock_2 a p     { color: #ddd; }

@media screen and (max-width: 900px) {
  .alfred_summaryblock_2 { grid-template-columns: repeat(1, 1fr); }
}

/*****************/
/* Gallery Links */
/*****************/

.alfred_galleryworkflowlink { display: flex; align-items: center; gap: 30px; background: var(--site-main-box-lighter); border-radius: 8px; padding: 20px; margin: 20px 0; }
.alfred_galleryworkflowlink img { max-width: 128px; flex-grow: 0; margin: 0 !important; }
.alfred_galleryworkflowlink div { flex-grow: 1; }
.alfred_galleryworkflowlink h3 { margin: 0; padding: 0; font-size: 1.7em; }
.alfred_galleryworkflowlink p { margin-top: 6px; padding: 0; color: #ddd; }
.alfred_galleryworkflowlink p.workflowgallerycreator { margin-top: 4px; }
.alfred_galleryworkflowlink nav a { display: inline-block; padding: 8px 12px; border-radius: 3px; margin: 12px 8px 0 0; background: hsl(from var(--site-main-box-lighter) h s calc(l * 1.4)); }
.alfred_galleryworkflowlink nav a:hover { background: hsl(from var(--site-main-box-lighter) h s calc(l * 1.8)); }
.alfred_galleryworkflowmissing { background: var(--site-main-box-lighter); margin-top: 20px; padding: 20px; border-radius: 5px; }
/* Don't show creator on help pages, as these are generally internal workflows */
#alfred_help .alfred_galleryworkflowlink p.alfred_workflowgallerycreator { display: none; }

/*************************/
/* Decorated Blockquotes */
/*************************/

.emphasis { font-weight: bold; margin-bottom: 16px; }
.emphasis:before { vertical-align:bottom; content: ''; display: inline-block; width: 24px; height: 17px; background-repeat: no-repeat; }
/* note */
.emphasis-note { color: #478be6; }
.emphasis-note:before { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill="%23478be6" d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>'); }
blockquote:has(.emphasis-note) { border-color: #478be6; }
/* tip */
.emphasis-tip { color: #57ab5a; }
.emphasis-tip:before { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill="%2357ab5a" d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></svg>'); }
blockquote:has(.emphasis-tip) { border-color: #57ab5a; }
/* important */
.emphasis-important { color: #986ee2; }
.emphasis-important:before { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill="%23986ee2" d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>'); }
blockquote:has(.emphasis-important) { border-color: #986ee2; }
/* warning */
.emphasis-warning { color: #c69026; }
.emphasis-warning:before { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill="%23c69026" d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>'); }
blockquote:has(.emphasis-warning) { border-color: #c69026; }
/* caution */
.emphasis-caution { color: #c93c37; }
.emphasis-caution:before { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill="%23c93c37" d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>'); }
blockquote:has(.emphasis-caution) { border-color: #c93c37; }
/* deprecated */
.emphasis-deprecated { color: #c54399; }
.emphasis-deprecated:before { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill="%23c54399" d="M4.467.22a.749.749 0 0 1 .53-.22h6.006c.199 0 .389.079.53.22l4.247 4.247c.141.14.22.331.22.53v6.006a.749.749 0 0 1-.22.53l-4.247 4.247a.749.749 0 0 1-.53.22H4.997a.749.749 0 0 1-.53-.22L.22 11.533a.749.749 0 0 1-.22-.53V4.997c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.308v5.384L5.308 14.5h5.384l3.808-3.808V5.308L10.692 1.5ZM4 7.75A.75.75 0 0 1 4.75 7h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 7.75Z"></path></svg>'); }
blockquote:has(.emphasis-deprecated) { border-color: #c54399; }

blockquote.tweet { position: relative; padding: 0; border: none; border-radius: 8px; overflow: hidden; }
blockquote.tweet p { padding: 20px 20px 20px 90px; margin: 0; }
blockquote.tweet p:first-of-type { min-height: 40px; }
blockquote.tweet > cite { display: block; background: rgba(255, 255, 255, 0.08); padding: 10px 20px; margin: 0; }
blockquote.tweet::before {
  content: "“";
  position: absolute;
  left: 0.05em;
  top: -0.2rem;
  font-size: 11rem;
  font-family: Georgia, serif;
  line-height: 1;
  color: #fff;
  opacity: 0.1;
  pointer-events: none;
}

/*************************************************/
/* Hover buttons for copying code and ID anchors */
/*************************************************/

.alfred_pdef > a, .alfred_copyblock { position: absolute; top: 8px; right: 8px; background: hsl(0 100% 100% / 0.1); border: 1px solid hsl(0 100% 100% / 0.2); border-radius: 4px; cursor: pointer; opacity: 0; transition: opacity 0.15s ease; }
main.alfred_grid .alfred_pdef img { width: 14px; height: 14px; margin: 6px 6px; }
main.alfred_grid .alfred_copyblock > img { width: 14px; height: 14px; margin: 4px 0 !important; }
.alfred_pdef:hover > a, pre:hover .alfred_copyblock { opacity: 0.8; }

/**********************************/
/* Highlight lines in code blocks */
/**********************************/

pre.tutorial > code > span { background-color: hsl(from var(--alfred-purple) h calc(s * 0.4) l); border-radius: 0.1rem; padding: 0.1rem 0.2rem; margin-left: -0.2rem; }

/**************/
/* Responsive */
/**************/

@media screen and (max-width: 900px) {

  /* allow inline code to wrap and not push page width out */
  code { white-space: normal; }

}

@media screen and (max-width: 780px) {

  /* Move the sidebar below the content */
  main.alfred_grid > div         { display: block; }
  main.alfred_grid > div > aside { margin-top: 20px; max-width: 100%; }

  /* Move the page index into the article */
  aside .alfred_pageindex        { display: none; }
  main.alfred_grid article .alfred_pageindex { display: block; }

}
