/**
 * Info page template (templates/page-info.html)
 * Max width from ACF “Content width” (info_page_content_width) via body classes.
 */

body.bb-info-page .info-page {
    box-sizing: border-box;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.info-page .info-page__inner {
    margin-left: auto;
    margin-right: auto;
}

.info-page .wp-block-post-title,
.info-page h1.wp-block-post-title {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .info-page .wp-block-post-title,
    .info-page h1.wp-block-post-title {
        margin-bottom: 2rem;
    }
}

.info-page .wp-block-post-content {
    max-width: 100%;
}

.info-page .wp-block-post-content > *:first-child {
    margin-top: 0;
}

.info-page .wp-block-post-content > *:last-child {
    margin-bottom: 0;
    text-align: justify;
}

/* Tables: barely visible borders, keep thead structure */
body.bb-info-page .info-page .wp-block-post-content .wp-block-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.bb-info-page .info-page .wp-block-post-content table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

body.bb-info-page .info-page .wp-block-post-content th,
body.bb-info-page .info-page .wp-block-post-content td {
    padding: 0.75rem 1rem;
    vertical-align: top;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border: 1px solid color-mix(in srgb, currentColor 11%, transparent);
}

/* Core block table adds a thick thead border-bottom — strip it on info pages */
body.bb-info-page .info-page .wp-block-post-content .wp-block-table table > thead {
    border: 0 !important;
}

body.bb-info-page .info-page .wp-block-post-content .wp-block-table thead th {
    font-weight: 600;
    text-align: left;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: rgba(255, 255, 255, 0.09);
    border-bottom-color: color-mix(in srgb, currentColor 11%, transparent);
}

body.bb-info-page .info-page .wp-block-post-content tbody th {
    font-weight: 600;
}

/* Ordered lists: restore numbering (preflight / resets often strip list-style) */
body.bb-info-page .info-page .wp-block-post-content ol,
body.bb-info-page .info-page .wp-block-post-content ol.wp-block-list {
    list-style-type: decimal;
    list-style-position: outside;
    padding-left: 2em;
    padding-inline-start: 2em;
    line-height: 1.55;
    margin-top: 0.75rem;
    margin-bottom: 2rem;
}

body.bb-info-page .info-page .wp-block-post-content :is(h2, h3, h4) + ol {
    margin-top: 1rem;
}

body.bb-info-page .info-page .wp-block-post-content ol > li:not(:last-child),
body.bb-info-page .info-page .wp-block-post-content ul > li:not(:last-child) {
    margin-bottom: 0.45rem;
}

body.bb-info-page .info-page .wp-block-post-content ol ol {
    list-style-type: lower-alpha;
}

body.bb-info-page .info-page .wp-block-post-content ol ol ol {
    list-style-type: lower-roman;
}

/* Unordered lists: restore bullets for consistency */
body.bb-info-page .info-page .wp-block-post-content ul,
body.bb-info-page .info-page .wp-block-post-content ul.wp-block-list {
    list-style-type: disc;
    list-style-position: outside;
    padding-left: 2em;
    padding-inline-start: 2em;
    line-height: 1.55;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
}

body.bb-info-page .info-page .wp-block-post-content :is(h2, h3, h4) + ul {
    margin-top: 1rem;
}

body.bb-info-page .info-page .wp-block-post-content ul ul {
    list-style-type: circle;
}

/* Contact Form 7 — CF7 wraps fields in <p>; reset + match global .secondary-button */
body.bb-info-page .info-page .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

body.bb-info-page .info-page .wpcf7-form fieldset.hidden-fields-container {
    margin: 0;
    padding: 0;
    border: 0;
    min-height: 0;
}

body.bb-info-page .info-page .wpcf7-form > p {
    margin: 0;
}

body.bb-info-page .info-page .wpcf7-form > p .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

body.bb-info-page .info-page .wpcf7 .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0;
}

body.bb-info-page .info-page .wpcf7 .form-row > p {
    flex: 1 1 calc(50% - 10px);
    margin: 0;
    min-width: min(100%, 240px);
}

body.bb-info-page .info-page .wpcf7 .form-row .wpcf7-form-control {
    width: 100%;
}

body.bb-info-page .info-page .wpcf7 .wpcf7-form-control:not(.wpcf7-submit) {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    background: transparent;
    border: 1px solid #444;
    color: #fff;
}

body.bb-info-page .info-page .wpcf7 .wpcf7-form-control::placeholder {
    color: #aaa;
}

body.bb-info-page .info-page .wpcf7 textarea.wpcf7-form-control {
    height: 140px;
    resize: none;
    vertical-align: top;
}

/* Submit row: align with secondary button width + spinner */
body.bb-info-page .info-page .wpcf7-form > p:has(.wpcf7-submit) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    align-self: flex-start;
    width: auto;
    max-width: 100%;
}

/* Match global.css .secondary-button */
body.bb-info-page .info-page .wpcf7 .wpcf7-submit {
    border: 1px solid var(--neautral-300);
    background-color: #0f0e12;
    display: flex;
    width: 200px;
    height: 48px;
    align-items: center;
    justify-content: center;
    padding: 3px;
    background-image: url('../../images/button-bg-left-2.svg'), url('../../images/button-bg-right-2.svg');
    background-position: 4px center, calc(100% - 4px) center;
    background-repeat: no-repeat, no-repeat;
    background-size: 28px 100%, 28px 100%;
    font-weight: 350;
    font-size: 1rem;
    color: var(--neautral-200);
    transition: background-color 0.25s ease-in-out, color 0.25s ease-in-out;
    cursor: pointer;
    flex-shrink: 0;
}

body.bb-info-page .info-page .wpcf7 .wpcf7-submit:hover {
    color: var(--neautral-200);
    background-color: var(--wp--preset--color--accent-4) !important;
}

body.bb-info-page .info-page .wpcf7 .wpcf7-spinner {
    margin: 0;
}

body.bb-info-page .info-page .wpcf7 form.sent .wpcf7-response-output {
    border-color: var(--wp--preset--color--contrast);
}

/* The Newsletter Plugin — profile / embedded forms (match CF7 info-page treatment) */
body.bb-info-page .info-page .tnp.tnp-form {
    margin: 0;
}

body.bb-info-page .info-page .tnp.tnp-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

body.bb-info-page .info-page .tnp.tnp-form .tnp-field {
    margin: 0;
}

body.bb-info-page .info-page .tnp.tnp-form .tnp-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 400;
    color: var(--neautral-200);
}

body.bb-info-page .info-page .tnp.tnp-form .tnp-field input[type="text"],
body.bb-info-page .info-page .tnp.tnp-form .tnp-field input[type="email"],
body.bb-info-page .info-page .tnp.tnp-form .tnp-field input[type="url"],
body.bb-info-page .info-page .tnp.tnp-form .tnp-field select,
body.bb-info-page .info-page .tnp.tnp-form .tnp-field textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    background: transparent;
    border: 1px solid #444;
    color: #fff;
    font: inherit;
    line-height: 1.35;
}

body.bb-info-page .info-page .tnp.tnp-form .tnp-field input::placeholder,
body.bb-info-page .info-page .tnp.tnp-form .tnp-field textarea::placeholder {
    color: #aaa;
}

body.bb-info-page .info-page .tnp.tnp-form .tnp-field select {
    cursor: pointer;
}

body.bb-info-page .info-page .tnp.tnp-form .tnp-field select option {
    background-color: #0f0e12;
    color: #fff;
}

body.bb-info-page .info-page .tnp.tnp-form .tnp-field textarea {
    min-height: 140px;
    resize: vertical;
    vertical-align: top;
}

/* Two columns for email + name on wider screens (same rhythm as CF7 .form-row) */
@media (min-width: 768px) {
    body.bb-info-page .info-page .tnp.tnp-profile form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 20px;
        row-gap: 1rem;
    }

    body.bb-info-page .info-page .tnp.tnp-profile .tnp-field-list,
    body.bb-info-page .info-page .tnp.tnp-profile .tnp-field-lists,
    body.bb-info-page .info-page .tnp.tnp-profile .tnp-field-privacy,
    body.bb-info-page .info-page .tnp.tnp-profile .tnp-field-profile,
    body.bb-info-page .info-page .tnp.tnp-profile .tnp-field-sex,
    body.bb-info-page .info-page .tnp.tnp-profile .tnp-field-preferences,
    body.bb-info-page .info-page .tnp.tnp-profile .tnp-field-language,
    body.bb-info-page .info-page .tnp.tnp-profile .tnp-field-button,
    body.bb-info-page .info-page .tnp.tnp-profile .tnp-field-html,
    body.bb-info-page .info-page .tnp.tnp-profile .tnp-field-checkbox {
        grid-column: 1 / -1;
    }
}

body.bb-info-page .info-page .tnp.tnp-form .tnp-field-button {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    align-self: flex-start;
    width: auto;
    max-width: 100%;
}

body.bb-info-page .info-page .tnp.tnp-form .tnp-field-button label {
    display: none;
}

/* TNP submits — profile form + standalone button forms (unsubscribe, GDPR export, …) */
body.bb-info-page .info-page .wp-block-post-content .tnp-button-form {
    margin: 0;
}

body.bb-info-page .info-page .tnp.tnp-form .tnp-submit,
body.bb-info-page .info-page .tnp.tnp-form input[type="submit"].tnp-submit,
body.bb-info-page .info-page .tnp.tnp-form button.tnp-submit,
body.bb-info-page .info-page .wp-block-post-content .tnp-button-form .tnp-submit,
body.bb-info-page .info-page .wp-block-post-content .tnp-button-form button.tnp-submit {
    border: 1px solid var(--neautral-300);
    background-color: #0f0e12;
    display: inline-flex;
    box-sizing: border-box;
    min-width: 200px;
    width: auto;
    max-width: 100%;
    height: 48px;
    align-items: center;
    justify-content: center;
    padding: 3px 20px;
    background-image: url('../../images/button-bg-left-2.svg'), url('../../images/button-bg-right-2.svg');
    background-position: 4px center, calc(100% - 4px) center;
    background-repeat: no-repeat, no-repeat;
    background-size: 28px 100%, 28px 100%;
    font: inherit;
    font-weight: 350;
    font-size: 1rem;
    line-height: 1.2;
    text-align: center;
    color: var(--neautral-200);
    transition: background-color 0.25s ease-in-out, color 0.25s ease-in-out;
    cursor: pointer;
    flex-shrink: 0;
}

body.bb-info-page .info-page .tnp.tnp-form .tnp-submit:hover,
body.bb-info-page .info-page .tnp.tnp-form input[type="submit"].tnp-submit:hover,
body.bb-info-page .info-page .tnp.tnp-form button.tnp-submit:hover,
body.bb-info-page .info-page .wp-block-post-content .tnp-button-form .tnp-submit:hover,
body.bb-info-page .info-page .wp-block-post-content .tnp-button-form button.tnp-submit:hover {
    color: var(--neautral-200);
    background-color: var(--wp--preset--color--accent-4) !important;
}
