/**
 * T3 Krav Maga — Child Theme Styles
 * Purpose: consolidate the ~15 KB of Customizer Additional CSS into a
 * version-controlled, maintainable stylesheet.
 *
 * Organized by component:
 *  1. Tokens / variables
 *  2. Logo SVG theming
 *  3. Typography
 *  4. Instructors
 *  5. Courses / queries
 *  6. Schools list
 *  7. Forms (Contact Form 7)
 *  8. Layout utilities
 *  9. Landing-page navigation
 * 10. Event utilities
 * 11. Responsive overrides
 */

/* --------------------------------------------------------------------------
 * 1. Tokens
 * -------------------------------------------------------------------------- */
:root {
    --t3-red: #c41212;
    --t3-white: #ffffff;
    --t3-grey-444: #444444;
    --t3-grey-777: #777777;
    --t3-grey-888: #888888;
    --t3-form-text: #b3b3b3;
    --t3-form-placeholder: #666666;
    --t3-form-submit-bg: #333333;
    --t3-form-submit-hover: #404040;
    --t3-access-yes: #1ea131;
    --t3-access-no: #ff0000;
}

/* --------------------------------------------------------------------------
 * 2. Logo SVG theming
 * -------------------------------------------------------------------------- */
.t3logo_maschera {
    fill: none;
}

.clr_gr_444 {
    fill: #444;
}

.clr_gr_777 {
    fill: #777;
    fill: url(#radial-gradient);
}

.clr_white {
    fill: #fff;
}

.clr_red {
    fill: #c41212;
}

.reduced_opacity {
    opacity: 0.7;
}

.clr_gr_888 {
    fill: #888;
}

.clip_mask {
    clip-path: url(#t3logo_maschera);
}

.t3logo_txt_right,
.t3logo_outline_right {
    fill: #fff;
}

.t3logo_outline_left,
.t3logo_txt_left {
    fill: #c41212;
}

footer .t3logo_txt_right,
footer .t3logo_outline_right,
footer .t3logo_outline_left,
footer .t3logo_txt_left {
    fill: #fff;
}

header#header .t3logo_outline_left,
header#header .t3logo_txt_left {
    fill: #fff;
}

body.home.page header#header .t3logo_txt_left,
body.home.page header#header .t3logo_outline_left,
body.single-istruttore.single header#header .t3logo_txt_left,
body.single-istruttore.single header#header .t3logo_outline_left {
    fill: var(--wp--preset--color--palette-color-1, var(--theme-palette-color-1, #c41212));
}

/* --------------------------------------------------------------------------
 * 3. Typography
 * -------------------------------------------------------------------------- */
h1.page-title {
    text-transform: uppercase;
}

.ct-query-template-grid h2.ct-dynamic-data a {
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
 * 4. Instructors
 * -------------------------------------------------------------------------- */
article.entry-card.istruttore.type-istruttore li.meta-custom-field[data-field="nome"] {
    margin-right: 8px;
}

article.istruttore .gspb_row > .gspb_row__content > div > p {
    margin-bottom: 8px;
}

/* Instructor info bubbles */
@media (max-width: 900px) {
    div.istr_info .separatore {
        display: none;
    }

    div.istr_info {
        flex-direction: column;
    }

    .ct-dynamic-data.date-readmore {
        text-align: center;
        margin-block-start: 1em;
        padding-bottom: 1em;
    }
}

@media (max-width: 800px) {
    article.wp-block-post.is-layout-flow.istruttore > div {
        padding-bottom: 20px;
    }
}

/* Instructor list cards */
article.wp-block-post.is-layout-flow.istruttore > div {
    margin: 0;
    padding: 0;
    border-radius: 32px !important;
    overflow: hidden;
}

article.wp-block-post.is-layout-flow.istruttore > div > div {
    padding: 0;
}

article.wp-block-post.is-layout-flow.istruttore > div > div:last-child {
    padding: 10px;
}

article.wp-block-post.is-layout-flow.istruttore > div > div:last-child * {
    margin-block-end: 4px;
}

.wp-block-blocksy-query.istruttori.grid > div {
    display: grid;
    grid-template: 1fr / 1fr 1fr;
    gap: 30px;
    align-items: stretch;
    justify-items: stretch;
    align-content: space-evenly;
    justify-content: space-evenly;
}

/* Instructor photo on mobile */
@media (max-width: 799px) {
    .istruttori.foto,
    .istruttori.foto figure.ct-dynamic-media.alignright {
        float: unset;
        margin-inline-start: unset;
        text-align: center;
        width: 100% !important;
    }
}

/* Instructor certification / discipline bubbles */
.ct-dynamic-data.istruttori.elencoAltreDiscipline,
.ct-dynamic-data.istruttori.elencoCertKM {
    font-weight: bold;
}

.ct-dynamic-data.istruttori.elencoAltreDiscipline > ul,
.ct-dynamic-data.istruttori.elencoCertKM > ul {
    font-weight: normal;
    list-style-type: none;
    padding-left: 0;
}

.ct-dynamic-data.istruttori.elencoAltreDiscipline > ul > li,
.ct-dynamic-data.istruttori.elencoCertKM > ul > li {
    background-color: var(--wp--preset--color--palette-color-1);
    display: inline-block;
    border-radius: 8px;
    padding: 4px 8px;
    margin: 3px 1px;
}

.ct-dynamic-data.istruttori.elencoAltreDiscipline > ul > li {
    background-color: var(--wp--preset--color--palette-color-3);
}

.ct-dynamic-data.istruttori.elencoAltreDiscipline > ul > li,
.ct-dynamic-data.istruttori.elencoCertKM.minimizza > ul > li {
    font-size: 70%;
}

/* Read-more buttons */
.ct-dynamic-data.date-readmore a {
    font-size: 0;
    color: transparent;
}

.ct-dynamic-data.date-readmore a:after {
    content: "Apri";
    background-color: #444;
    padding: 8px 13px;
    border-radius: 8px;
    font-weight: 800;
    font-size: var(--theme-font-size);
    color: #fff;
}

/* --------------------------------------------------------------------------
 * 5. Courses
 * -------------------------------------------------------------------------- */
.single-corso main article ul {
    list-style-type: none;
    padding-left: unset;
    margin-block-end: 42px;
}

.single-corso main article ul li {
    margin-block-end: 8px;
}

/* Course cards on home */
.wp-block-blocksy-query.elencocorsi .ct-query-template-grid > article {
    padding: 45px 35px;
    border-radius: 40px;
    transition: all 0.2s ease;
    border: none;
    background-color: var(--wp--preset--color--palette-color-1);
}

.wp-block-blocksy-query.elencocorsi .ct-query-template-grid {
    display: grid;
    gap: 30px;
    grid-template: repeat(7, 1fr) / 1fr;
}

@media (min-width: 800px) {
    .wp-block-blocksy-query.elencocorsi .ct-query-template-grid {
        grid-template: repeat(3, 1fr) / repeat(3, 1fr);
    }

    .wp-block-blocksy-query.elencocorsi .ct-query-template-grid > article:first-child,
    .wp-block-blocksy-query.elencocorsi .ct-query-template-grid > article:last-child {
        grid-column: span 2 / span 1;
    }
}

/* Slider card links */
.ct-query-template.is-layout-slider .flexy-items .flexy-item h2.ct-dynamic-data a:after {
    content: 'apri';
    margin-left: 8px;
    font-size: 60%;
    padding: 4px 6px;
    border: 0.6px solid #fff;
    border-radius: 6px;
}

.ct-query-template.is-layout-slider .flexy-items .flexy-item:hover h2.ct-dynamic-data a:after {
    color: var(--wp--preset--color--palette-color-1);
    background-color: var(--wp--preset--color--palette-color-8);
}

/* Section card links */
main article > .entry-content .wp-block-blocksy-query.elencocorsi .ct-query-template-grid article.corso.type-corso h2.ct-dynamic-data a:after,
main article > .entry-content .wp-block-blocksy-query .ct-query-template-grid article h2.ct-dynamic-data a:after {
    content: 'apri';
    margin-left: 8px;
    font-size: 60%;
    padding: 4px 6px;
    border: 0.6px solid #fff;
    border-radius: 6px;
}

main article > .entry-content .wp-block-blocksy-query.elencocorsi .ct-query-template-grid article.corso.type-corso:hover h2.ct-dynamic-data a:after,
main article > .entry-content .wp-block-blocksy-query .ct-query-template-grid article:hover h2.ct-dynamic-data a:after {
    color: var(--wp--preset--color--palette-color-1);
    background-color: var(--wp--preset--color--palette-color-8);
}

/* --------------------------------------------------------------------------
 * 6. Schools list
 * -------------------------------------------------------------------------- */
.wp-block-query.listascuole ul.is-layout-grid {
    grid-template: repeat(1, 1fr) / repeat(8, 1fr);
    gap: 20px;
    width: 100%;
}

@media (max-width: 800px) {
    .wp-block-query.listascuole ul.is-layout-grid {
        grid-template: repeat(4, 1fr) / repeat(2, 1fr) !important;
        gap: 20px;
        width: 100%;
    }
}

/* --------------------------------------------------------------------------
 * 7. Slider / flexy arrows
 * -------------------------------------------------------------------------- */
[class*="flexy-arrow"] {
    color: #c41212;
}

/* --------------------------------------------------------------------------
 * 8. Two-column list utility
 * -------------------------------------------------------------------------- */
@media (min-width: 800px) {
    article#post-857 ul.wp-block-list {
        column-count: 2;
        column-gap: 40px;
    }

    article#post-857 ul.wp-block-list li {
        margin-block-end: 16px;
    }
}

@media (max-width: 800px) {
    article#post-857 ul.wp-block-list > li {
        margin-block-end: 25px;
    }
}

ul.nobullet,
ul.lista-nobullet {
    list-style-type: none;
    padding-left: 0;
}

/* --------------------------------------------------------------------------
 * 9. ACF relationship lists (from plugin shortcode/block)
 * -------------------------------------------------------------------------- */
.no_results ~ .heading_relations {
    display: none;
}

ul.cj_rel > li > a {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

ul.cj_rel {
    font-weight: normal;
    list-style-type: none;
    padding-left: 0;
}

ul.cj_rel.cj_rel_istruttore1 > li,
ul.cj_rel.cj_rel_scuola > li {
    color: var(--wp--preset--color--palette-color-1);
    background-color: var(--wp--preset--color--palette-color-8);
    display: inline-block;
    border-radius: 8px;
    padding: 4px 8px;
    margin: 0 8px 0 0;
}

/* --------------------------------------------------------------------------
 * 10. Forms (Contact Form 7)
 * -------------------------------------------------------------------------- */
form .legal {
    margin-top: 1rem;
}

form .legal a {
    text-decoration: underline;
}

::placeholder {
    color: #666;
    opacity: 1;
}

input::-webkit-input-placeholder {
    opacity: 1 !important;
}

::-ms-input-placeholder {
    opacity: 1 !important;
}

.wpcf7-form {
    background-color: #1a1a1abf;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
}

.wpcf7-form :is(h2, h3) {
    text-transform: uppercase;
}

.wpcf7-form,
.wpcf7-form :is(p, h2, h3),
.wpcf7 label:not(.wpcf7-form-control-wrap),
.wpcf7-acceptance .wpcf7-list-item-label {
    color: #b3b3b3;
    font-size: 13px;
}

.wpcf7-form-control.wpcf7-text,
.wpcf7-form-control.wpcf7-email,
.wpcf7-form-control.wpcf7-tel,
.wpcf7-form-control.wpcf7-select,
.wpcf7-form-control.wpcf7-textarea {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #333;
    border-radius: 3px;
    background-color: #2b2b2b;
    color: #e0e0e0;
    font-size: 14px;
}

.wpcf7-form-control.wpcf7-textarea {
    height: 120px;
}

textarea.textarea_corto {
    height: 88px;
}

select.wpcf7-select {
    max-width: 220px;
}

.wpcf7-acceptance input[type="checkbox"] {
    margin-right: 10px;
}

.wpcf7-submit {
    background-color: #333;
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.wpcf7-submit:hover {
    background-color: #404040;
}

.wpcf7 .wpcf7-submit {
    background: var(--theme-palette-color-1);
}

.wpcf7 .wpcf7-submit:disabled {
    background: #444;
}

.wpcf7-form select {
    max-width: unset;
    width: 100%;
}

.wpcf7-form a {
    color: inherit;
    text-decoration: underline;
}

/* Form grid */
form.wpcf7-form div:nth-child(2) {
    display: grid;
    grid-column-gap: 22px;
    grid-row-gap: 22px;
}

form.wpcf7-form > div:nth-child(2) {
    grid-template: 1fr / 1fr;
}

@media (max-width: 800px) {
    form.wpcf7-form > div:nth-child(2) > :is(div, span) {
        grid-column: 1 / span 2;
    }
}

@media (min-width: 800px) {
    form.wpcf7-form > div:nth-child(2) {
        grid-template: 1fr / 1fr 1fr;
    }

    .grid-terzi form.wpcf7-form > div:nth-child(2) {
        grid-template: 1fr / 1fr 1fr 1fr;
    }

    div.pieno {
        grid-column: 1 / span 2;
    }

    .grid-terzi form div.pieno {
        grid-column: 1 / span 3;
    }
}

@media (max-width: 768px) {
    .wpcf7-form div:nth-child(2) {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .wpcf7-form span:has(.pieno),
    .wpcf7-form :is(h2, h3, h4),
    .wpcf7-form [type="submit"],
    .wpcf7-form [data-name="messaggio"],
    .wpcf7-form [data-name*="consenso_"],
    .wpcf7-form px,
    .col-md-12,
    .wpcf7 .fr {
        grid-column: 1 / span 2;
    }
}

/* Checkbox / radio groups */
@media (max-width: 800px) {
    .wpcf7-checkbox {
        display: grid;
        gap: 20px;
    }

    .wpcf7-checkbox span.wpcf7-list-item {
        margin: unset;
    }

    .wpcf7-checkbox span.wpcf7-list-item label {
        padding: 16px 0;
    }
}

[data-name="Preferenza_contatto"] {
    width: 100%;
    display: inline-block;
}

@media (min-width: 800px) {
    [data-name="Preferenza_contatto"] > span {
        display: grid;
        grid-template: 1fr / auto auto auto;
        justify-content: space-between;
        padding: 8px 16px;
    }
}

/* Access radios */
[data-name="accesso"] span.wpcf7-radio {
    display: grid;
    grid-template: 1fr / 1fr;
    gap: 16px;
}

@media (min-width: 800px) {
    [data-name="accesso"] span.wpcf7-radio {
        grid-template: 1fr / 1fr 1fr 1fr;
    }
}

[data-name="accesso"] span.wpcf7-radio > span label span {
    color: #fff;
}

.wpcf7 [data-name="accesso"] .wpcf7-list-item,
.wpcf7 [data-name="accesso"] .wpcf7-list-item.first,
.wpcf7 [data-name="accesso"] .wpcf7-list-item:first-child,
.wpcf7 [data-name="accesso"] .wpcf7-list-item.last,
.wpcf7 [data-name="accesso"] .wpcf7-list-item:last-child {
    margin: 0 !important;
    margin-left: 0 !important;
}

[data-name="accesso"] span.wpcf7-radio > span {
    padding: 16px;
    border-radius: 8px;
}

[data-name="accesso"] span.wpcf7-radio > span label {
    color: #333;
}

[data-name="accesso"] span.wpcf7-radio > span:nth-child(-n+3) {
    background: #1ea131;
}

[data-name="accesso"] span.wpcf7-radio > span:nth-last-child(-n+3) {
    background: #ff0000;
}

.early-bird {
    background: #1ea131 !important;
}

/* Validation */
div.wpcf7-validation-errors {
    background: #ffe2e2;
    border: 1px solid #ff0000;
    color: #ff0000;
}

div.wpcf7-response-output {
    margin: 2em 0;
    padding: 15px;
    border-radius: 5px;
    box-sizing: border-box;
}

span .wpcf7-not-valid {
    border: 1px solid #ff0000 !important;
}

.wpcf7-not-valid-tip::before {
    content: "^";
    padding-right: 0.4rem;
}

.wpcf7-not-valid-tip {
    color: #ffffff;
    font-size: 0.8rem !important;
    font-weight: normal;
    display: inline;
    background-color: #f00;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-style: normal !important;
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.payment-required .wpcf7-response-output {
    border-color: #f00;
    background-color: #f00;
    font-style: normal;
    font-weight: bold;
    text-align: center;
}

.wpcf7-checkbox.wpcf7-not-valid {
    border: none !important;
}

/* --------------------------------------------------------------------------
 * 11. Utility classes
 * -------------------------------------------------------------------------- */
.nascosto,
.nascondi {
    visibility: hidden;
    opacity: 0;
    display: none;
}

.wpcf7 .nascosto {
    height: 0;
    visibility: hidden;
    opacity: 0;
}

/* --------------------------------------------------------------------------
 * 12. Landing-page navigation
 * -------------------------------------------------------------------------- */
.LandingPage-Navigation .wp-block-button:not(.risalto) a.wp-block-button__link.wp-element-button {
    background-color: var(--theme-palette-color-3);
    border: 2px solid var(--theme-palette-color-3);
}

.LandingPage-Navigation .wp-block-button a.wp-block-button__link.wp-element-button {
    font-size: 70%;
}

/* --------------------------------------------------------------------------
 * 13. Layout helpers
 * -------------------------------------------------------------------------- */
@media (max-width: 999.98px) {
    #gspb_col-id-gsbp-b58ba0d.gspb_row__col--12 {
        width: 100%;
    }
}

@media (min-width: 800px) {
    .wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* --------------------------------------------------------------------------
 * 14. Event pre-registration expired state
 * Use .preiscrizione-scaduta on the form wrapper instead of hard-coded IDs.
 * -------------------------------------------------------------------------- */
.preiscrizione-scaduta [data-name="accesso"] span.wpcf7-radio > span:nth-child(-n+3),
.preiscrizione-scaduta [data-name="accesso"] span.wpcf7-radio > span:nth-child(-n+3) input[type="radio"] {
    pointer-events: none;
    opacity: 0.5;
}

/* --------------------------------------------------------------------------
 * 15. Language switcher
 * -------------------------------------------------------------------------- */
.t3-lang-switcher {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}

.t3-lang-switcher ul {
    display: flex;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.t3-lang-switcher a {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.t3-lang-switcher a:hover,
.t3-lang-switcher .current-lang a {
    opacity: 1;
}
