/* Download hub. */
.download-hub-page .download-intro {
    max-width: 54rem;
    margin-bottom: 2.25rem;
    color: var(--q-text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}
.download-directory-page .download-section-index .wp-block-list {
    list-style: disc;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(10, auto);
    grid-auto-flow: column;
    gap: 0.75rem 2.5rem;
    box-sizing: border-box;
    max-width: none;
    padding: 0 1.25rem 0 2.5rem;
    margin-block: 2rem 0;
}
.download-directory-page .download-section-index li {
    margin: 0;
    padding: 0.25rem 0;
    min-width: 0;
    break-inside: avoid;
}
.download-directory-page .download-section-index {
    margin-block: 2.5rem 3rem;
    padding-inline: 0;
}
.download-directory-page .download-section-index a {
    color: var(--q-primary-dark);
    text-underline-offset: 0.15em;
}
.download-directory-page .archive-list-item {
    align-items: flex-start;
    gap: 1rem !important;
    padding: 0.9rem 0 !important;
    border-bottom: 1px solid var(--q-border);
}
.download-directory-page .archive-horizontal-thumb,
.download-directory-page .archive-horizontal-thumb img {
    width: 132px !important;
    height: 74px !important;
    flex: 0 0 132px;
    object-fit: cover;
    border-radius: 4px;
}
.download-directory-page .archive-list-item .wp-block-post-title {
    margin: 0 0 0.25rem !important;
}
.download-directory-page .archive-list-item .template-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    width: 100%;
    max-width: none;
}
.download-directory-page .template-card-heading > .wp-block-post-title {
    flex: 1 1 0;
    min-width: 0;
    overflow-wrap: anywhere;
}
.download-directory-page .template-card-heading > [class^="bap-"] {
    flex: 0 0 auto;
    margin: 0.15rem 0 0;
}
.download-directory-page .archive-list-item .wp-block-post-excerpt {
    margin: 0;
    color: var(--q-text-secondary);
    width: 100% !important;
    max-width: none !important;
}
.download-directory-page .archive-list-item > .wp-block-group:last-child {
    flex: 1 1 auto;
    min-width: 0;
}
.download-directory-page .download-section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
/* Keep archive links beside the heading while leaving the H2 text semantic. */
.download-category-page .download-section-heading.category-section-title + .download-section-archive-link-wrap {
    position: relative;
    z-index: 1;
    height: 0;
    margin: -3.55rem 0 3.55rem;
    text-align: right;
    top: -1.8rem;
}
.download-category-page .download-section-archive-link-wrap .download-section-archive-link {
    display: inline-block;
}
.download-section-more-link {
    margin: 0.75rem 0 2.5rem;
    text-align: right;
}
.download-section-more-link a {
    color: var(--q-primary-dark);
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}
.download-directory-page .download-section-archive-link {
    flex: 0 0 auto;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--q-primary);
    border-radius: 4px;
    background: var(--q-primary);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.download-directory-page .download-section-archive-link:hover,
.download-directory-page .download-section-archive-link:focus-visible {
    border-color: var(--q-primary);
    background: #fff;
    color: var(--q-primary);
    text-decoration: none !important;
}
.download-directory-page .download-section-heading.category-section-title,
.download-directory-page .download-section-index > h2 {
    width: auto;
    padding: 0.8rem 1.25rem;
    max-width: none;
    border-left: 4px solid var(--q-primary);
    background: linear-gradient(to right, #eef5fb, transparent);
    color: var(--q-primary-dark);
    font-weight: 400;
}
.download-directory-page .download-section-heading.category-section-title {
    margin: 2.5rem 0 1.5rem;
}
.download-directory-page .download-section-index > h2 {
    margin: 0;
}
/* Override the shared page rule that removes heading side padding. */
body.page.download-directory-page .support-page-content .wp-block-post-content > h2.download-section-heading {
    padding-inline: 1.25rem !important;
}
.download-directory-page .download-section-heading.category-section-title::after,
.download-directory-page .download-section-index > h2::after {
    content: none;
}
.download-directory-page .download-section-index > .wp-block-list {
    margin-inline: 0;
    width: 100%;
}
.download-hub-page .download-start-guide {
    margin: 2rem 0 3.5rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid var(--q-primary);
    border-left-width: 4px;
    border-radius: 8px;
    background: var(--wp--preset--color--white);
    box-shadow: var(--q-shadow-1);
}
.download-hub-page .download-start-guide > :first-child {
    margin-top: 0;
}
.download-hub-page .download-start-guide > :last-child {
    margin-bottom: 0;
}
.download-hub-page .download-start-guide h2 {
    color: var(--q-text);
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    letter-spacing: 0;
}
.download-hub-page .download-start-guide .wp-block-buttons {
    gap: 0.75rem;
}
.download-hub-page .download-start-guide .wp-block-button__link {
    min-height: 2.75rem;
    border: 1px solid var(--q-primary);
    border-radius: 6px;
    background: var(--wp--preset--color--white);
    color: var(--q-primary-dark);
    font-weight: 700;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.download-hub-page .download-start-guide .wp-block-button__link:hover {
    background: var(--q-primary);
    color: var(--wp--preset--color--white);
    transform: translateY(-1px);
}
.download-hub-page .download-section-heading {
    margin-top: 0;
    margin-bottom: 1.25rem;
    color: var(--q-text);
    font-size: clamp(1.35rem, 2vw, 1.75rem);
}
.download-hub-page .download-item {
    display: grid;
    grid-template-columns: minmax(150px, 23%) minmax(0, 1fr);
    gap: clamp(1.25rem, 3vw, 2.25rem);
    margin: 1rem 0;
    overflow: hidden;
    border: 1px solid var(--q-primary);
    border-left: 4px solid var(--download-item-color);
    border-radius: 8px;
    background: var(--wp--preset--color--white);
    box-shadow: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.download-hub-page .download-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--q-shadow-1);
}
.download-hub-page .download-item .wp-block-media-text__media {
    display: flex;
    min-height: 176px;
    height: 100%;
    align-items: center;
    align-self: stretch;
    justify-content: center;
    margin: 0;
    padding: 1.5rem;
    background: var(--download-item-color);
    box-sizing: border-box;
}
.download-hub-page .download-item .wp-block-media-text__media img {
    width: 88px;
    max-width: 70%;
    height: 88px;
    object-fit: contain;
}
.download-hub-page .download-item .wp-block-media-text__content {
    align-self: center;
    padding: 1.5rem 1.75rem 1.5rem 0;
}
.download-hub-page .download-item .wp-block-media-text__content > :first-child {
    margin-top: 0;
}
.download-hub-page .download-item .wp-block-media-text__content > :last-child {
    margin-bottom: 0;
}
.download-hub-page .download-item h3 {
    margin-bottom: 0.75rem;
    font-size: clamp(1.35rem, 2vw, 1.7rem);
}
.download-hub-page .download-item h3 a {
    color: var(--q-primary-dark);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}
.download-hub-page .download-item-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
}
.download-hub-page .download-item-link a::after {
    content: "\2192";
}
.download-hub-page .download-item--template { --download-item-color: #009900; }
.download-hub-page .download-item--service { --download-item-color: #607d8b; }
.download-hub-page .download-item--options { --download-item-color: #558b2f; }
.download-hub-page .download-item--pdf { --download-item-color: #c62828; }

.download-hub-page .download-item-link a::after {
    transition: transform 160ms ease;
}
.download-hub-page .download-item-link a:hover::after {
    transform: translateX(3px);
}
.download-hub-page .download-start-guide a:focus-visible,
.download-hub-page .download-item a:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--q-primary) 35%, transparent);
    outline-offset: 3px;
}

/* Add-on fixed pages reuse the native download-card layout. */
.download-addons-page .download-section-heading {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: var(--q-text);
    font-size: clamp(1.35rem, 2vw, 1.75rem);
}
.download-addons-page .download-item {
    display: grid;
    grid-template-columns: minmax(96px, 18%) minmax(0, 1fr);
    gap: clamp(1rem, 2.5vw, 1.75rem);
    margin: 1rem 0;
    overflow: hidden;
    border: 1px solid var(--q-primary);
    border-left: 4px solid var(--q-primary);
    border-radius: 8px;
    background: var(--wp--preset--color--white);
}
.download-addons-page .download-item .wp-block-media-text__media {
    display: flex;
    min-height: 112px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 1rem;
    background: #f2f7fb;
}
.download-addons-page .download-item .wp-block-media-text__media img {
    width: 72px;
    max-width: 100%;
    height: 72px;
    object-fit: contain;
}
.download-addons-page .download-item .wp-block-media-text__content {
    align-self: center;
    padding: 1rem 1.25rem 1rem 0;
}
.download-addons-page .download-item h3 {
    margin: 0 0 0.6rem;
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
}
.download-addons-page .download-item li > a:first-child {
    font-weight: 700;
}
.download-addons-page .addon-section-icon {
    display: flex !important;
    flex: 0 0 6rem !important;
    width: 6rem !important;
    max-width: 6rem !important;
    height: 6rem !important;
    margin: 0 !important;
    justify-content: flex-start;
    overflow: hidden;
    align-items: center;
}
.download-addons-page .addon-section-icon img {
    display: block;
    width: 6rem !important;
    height: 6rem !important;
    object-fit: contain;
}

/* Add-on directory chapter headings: normalize icon, heading and optional note. */
.download-addons-page .wp-block-post-content .wp-block-group:has(> .wp-block-image):has(> h2.wp-block-heading) {
    display: flex !important;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 0 !important;
    min-height: 9rem;
    margin-block-end: 2rem !important;
    padding: 1.25rem 2rem !important;
    background-color: #398f3d !important;
    border-radius: 18px !important;
}
.download-addons-page .wp-block-post-content .wp-block-group:has(> .wp-block-image):has(> h2.wp-block-heading) > .wp-block-image {
    display: flex !important;
    flex: 0 0 6rem !important;
    align-self: center !important;
    align-items: center !important;
    justify-content: center !important;
    width: 6rem !important;
    max-width: 6rem !important;
    height: 6rem !important;
    margin: 0 !important;
    overflow: hidden;
}
.download-addons-page .wp-block-post-content .wp-block-group:has(> .wp-block-image):has(> h2.wp-block-heading) > .wp-block-image img {
    display: block;
    width: 6rem !important;
    max-width: 6rem !important;
    height: 6rem !important;
    object-fit: contain;
}
.download-addons-page .wp-block-post-content .wp-block-group:has(> .wp-block-image):has(> h2.wp-block-heading) > h2.wp-block-heading {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    color: #fff !important;
    text-align: left;
}
.download-addons-page .wp-block-post-content .wp-block-group:has(> .wp-block-image):has(> h2.wp-block-heading) > p {
    flex: 0 0 auto;
    margin: 0 0 0 auto !important;
    color: #fff !important;
    text-align: right !important;
}
.download-addons-page .wp-block-post-content .wp-block-group:has(> .wp-block-image):has(> h2.wp-block-heading) > p a {
    color: inherit !important;
}
/* Keep the task-reference note visible and close to its chapter header. */
.download-addons-page .wp-block-post-content .wp-block-group:has(> .wp-block-image):has(> h2.wp-block-heading) + p {
    display: block !important;
    margin: 0.5rem 0 0 !important;
    color: inherit !important;
    font-size: 1rem;
    line-height: 1.5;
}
.download-addons-page .wp-block-post-content .wp-block-group:has(> .wp-block-image):has(> h2.wp-block-heading) + p + .wp-block-group.addon-article-item,
.download-addons-page .wp-block-post-content .wp-block-group:has(> .wp-block-image):has(> h2.wp-block-heading) + p + .wp-block-group,
.download-addons-page .wp-block-post-content .wp-block-group:has(> .wp-block-image):has(> h2.wp-block-heading) + .wp-block-group.addon-article-item {
    margin-block-start: 0 !important;
}
@media (max-width: 600px) {
    .download-addons-page .wp-block-post-content .wp-block-group:has(> .wp-block-image):has(> h2.wp-block-heading) {
        flex-wrap: wrap;
    }
    .download-addons-page .wp-block-post-content .wp-block-group:has(> .wp-block-image):has(> h2.wp-block-heading) > p {
        flex-basis: 100%;
    }
}

