/* =========================================================
   1. LOMAKKEET & KENTÄT
   ========================================================= */

form, .wpforms-form, .gform_wrapper, .forminator-ui, .ff-el-form, .contact-form, .jetpack-contact-form {
    background-color: rgba(0, 0, 0, 0.6) !important;
    color: #ffffff !important;
    padding: 0;
}

form input, form textarea, form select,
.wpforms-field input, .wpforms-field textarea, .wpforms-field select,
.gfield input, .gfield textarea, .gfield select,
.forminator-field input, .forminator-field textarea, .forminator-field select,
.ff-step input, .ff-step textarea, .ff-step select {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
    border: 1px solid red !important;
    padding: 0.5em 1em;
    width: 100%;
    box-sizing: border-box;
    border-radius: 0;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: none !important;
    position: relative;
    z-index: 1;
}

form input:focus, form textarea:focus, form select:focus,
.wpforms-field input:focus, .gfield input:focus, .forminator-field input:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid #ff0000 !important;
    box-shadow: 0 0 2px #ff0000 !important;
    outline: 1px solid #ff0000 !important;
}

.wpforms-field-label, .wpforms-field-sublabel, .wpforms-description,
.gfield_label, .gfield_description, .forminator-label, .forminator-description,
.contact-form label, .jetpack-contact-form .grunion-field-label {
    color: #ffffff !important;
}

::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

.contact-form label.grunion-radio-label {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}

.contact-form .jetpack-other-text-input-wrapper {
    width: 100% !important;
    max-width: 333px !important;
}

/* =========================================================
   2. SELECT & DROPDOWN FIXIT
   ========================================================= */

select, form select, .wpforms-form select, .gform_wrapper select, .forminator-field select, .ff-el-form select {
    background-color: rgba(255,255,255,0.06) !important;
    color: #ffffff !important;
    border: 1px solid red !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: none !important;
    background-clip: padding-box !important;
}

select option {
    background-color: #000000 !important;
    color: #ffffff !important;
}

select:invalid {
    color: rgba(255,255,255,0.6) !important;
}

.ff-step.active select, .ff-step select, .ff-el-form select {
    background: rgba(255,255,255,0.06) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 1px solid red !important;
}

.ff-step.active select option {
    background: #000000 !important;
    color: #ffffff !important;
}

.ff-step.active select:not(:focus), .ff-step.active .ff-el-input--content select {
    background:rgba(255,255,255,0.6) !important;
}

.contact-form__select-wrapper {
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid red !important;
}

.contact-form__select-element-wrapper {
    background: transparent !important;
}

.contact-form__select-wrapper select {
    background: transparent !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: none !important;
}

.contact-form__select-wrapper select option[value=""] {
    color: rgba(255,255,255,0.6) !important;
}

/* =========================================================
   3. AUTOFILL & RADIO & SUBMIT
   ========================================================= */

input:-webkit-autofill, textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.06) inset !important;
    box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.06) inset !important;
    -webkit-text-fill-color: #ffffff !important;
    color: #ffffff !important;
    border: 1px solid red !important;
}

input:-webkit-autofill:hover, input:-webkit-autofill:focus, textarea:-webkit-autofill:hover, textarea:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.06) inset !important;
    box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.06) inset !important;
    -webkit-text-fill-color: #ffffff !important;
}

input:-webkit-autofill {
    transition: background-color 9999s ease-in-out 0s;
}

input[type="radio"] {
    border: 1px solid red !important;
    outline: 1px solid red !important;
    outline-offset: -1px;
    background: transparent !important;
    box-shadow: none !important;
}

input[type="radio"]:checked::before {
    content: "";
    background-color: red !important;
}

.contact-submit button {
    background-color: #999999;
    border-radius: 0;
}

/* =========================================================
   4. PAINIKKEET & ANIMAATIOT
   ========================================================= */

@keyframes flash-white {
    0% { box-shadow: 0 0 0 2px white inset; }
    100% { box-shadow: 0 0 0 2px red inset; }
}

.wp-block-button__link, .wp-element-button, button, .button, .read-more .more-link {
    border-radius: 0;
    background-color: rgba(0, 0, 0, 0.6);
    border: none !important;
    transition: background-color 0.3s ease;
}

.wp-block-button__link:hover, .wp-element-button:hover, button:hover, .button:hover,
input[type="button"]:hover, input[type="submit"]:hover, .read-more .more-link:hover {
    background-color: rgba(0, 0, 0, 0.3);
    animation: flash-white 0.1s forwards !important;
    text-decoration: none !important;
}

button:focus, .wp-block-button__link:focus {
    outline: 1px solid #ff0000 !important;
    outline-offset: 2px;
    box-shadow: none !important;
}

.wp-block-coblocks-social__button {
    outline: 2px solid transparent !important;
    outline-offset: 0;
    transition: background-color 0.3s ease, outline-color 0.15s ease !important;
}

.wp-block-coblocks-social__button:hover {
    background-color: rgba(0, 0, 0, 0.3) !important;
    outline-color: #ff0000 !important;
    animation: flash-white 0.15s forwards !important;
}

/* Estetään siniset värit (Active/Focus) */
.wp-block-button__link:active, .wp-element-button:active, button:active, .button:active,
input[type="button"]:active, input[type="submit"]:active, .read-more .more-link:active,
.wp-block-button__link:focus, .wp-block-button__link:focus-visible, .wp-element-button:focus, 
.wp-element-button:focus-visible, button:focus, button:focus-visible, .button:focus,
input[type="submit"]:focus, input[type="button"]:focus, .read-more .more-link:focus, 
.read-more .more-link:focus-visible {
    background-color: #ff0000 !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    transition: 0s !important;
}

* { -webkit-tap-highlight-color: transparent !important; }

/* =========================================================
   5. READ MORE - ARKKIIVI
   ========================================================= */

.read-more .more-link {
    display: inline-block !important;
    padding: 15px 30px !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    font-size: 0 !important;
    line-height: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease, outline-color 0.2s ease !important;
    position: relative !important;
    font-family: 'Epilogue', sans-serif !important;
}

.read-more .more-link::before {
    content: "LUE LISÄÄ" !important;
    font-family: 'Epilogue', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    color: #ff0000 !important;
    -webkit-text-fill-color: #ff0000 !important;
    display: inline-block !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
    margin-right: 6px;
    vertical-align: middle !important;
}

.read-more .more-link::after {
    display: inline-block !important;
    font-size: 14px !important;
    color: #ff0000 !important;
    -webkit-text-fill-color: #ff0000 !important;
    margin-left: 2px;
    transform: translateY(-2px) !important;
    vertical-align: middle !important;
    line-height: 1.2 !important;
}

.read-more .more-link:hover {
    background-color: rgba(0, 0, 0, 0.3) !important;
    outline: 2px solid red !important;
    outline-offset: -2px;
}

.read-more .more-link:focus::before, .read-more .more-link:active::before,
.read-more .more-link:focus::after, .read-more .more-link:active::after {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
}

/* =========================================================
   6. NAVIGOINTI & LINKIT
   ========================================================= */

.entry-title a, .wp-block-heading.has-link-color a {
    position: relative;
    color: red !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

.entry-title a::after, .wp-block-heading.has-link-color a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: red;
    transition: width 0.3s ease;
}

.entry-title a:hover::after, .wp-block-heading.has-link-color a:hover::after {
    width: 100%;
}

.menu-item-type-post_type > a:hover, .widget_pages .page_item > a:hover {
    outline: 2px solid #ff0000;
    outline-offset: 0;
}

.widget_pages .page_item > a:hover { background-color: transparent !important; }

.wp-block-navigation-item__content:active, .wp-block-navigation a:active,
.wp-block-pages-list__item__link:active, .widget_pages a:active,
.menu-item a:active, .nav-menu a:active, .main-navigation a:active {
    color: red !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

.wp-block-navigation-item__content:focus, .wp-block-navigation a:focus,
.wp-block-pages-list__item__link:focus, .widget_pages a:focus,
.menu-item a:focus, .nav-menu a:focus, .main-navigation a:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* =========================================================
   7. YLEISTYYLIT (SITE-WIDE)
   ========================================================= */

.site-footer::before { background: rgba(0, 0, 0, 0.7); }
h1.entry-title { display: none !important; }
.wp-block-post-carousel .entry-title { display: block !important; }
.site-title a, .site-description { color: #900 !important; }
.site { background-color: rgba(0, 0, 0, 0.7) !important; }

header#masthead.site-header, .home header#masthead.site-header {
    height: 170px !important;
    min-height: 170px !important;
    max-height: 170px !important;
    padding: 0 !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    line-height: 10px !important;
}

#primary-menu, .nav-menu, .menu, .main-navigation, .site-header, .navigation-wrapper {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

.single-post .wp-post-image, .single-post .post-thumbnail, .single-post .entry-header img, .single-post .attachment-post-thumbnail {
    display: none !important;
}

.home p, .home span, .home li { font-style: normal !important; }

table { width: 100%; border-collapse: collapse; }

.no-padding {
  gap: 0 !important;
}
/* =========================================================
   8. SCROLL-NUOLET (FIXED – alkuperäinen säilyy)
   ========================================================= */

.scroll-arrow {
    display: block !important;
    width: 50px;
    height: 50px;

    /* 🔒 lukitaan viivat */
    border-left: 3px solid #e00000 !important;
    border-bottom: 3px solid #e00000 !important;
    border-top: none !important;
    border-right: none !important;

    opacity: 1 !important;
    visibility: visible !important;
    cursor: pointer;

    box-sizing: border-box;

    /* 🔧 tasaisempi renderöinti */
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* 🔥 estää hoverissa tapahtuvan “ohentumisen” */
.scroll-arrow:hover {
    border-left: 3px solid #e00000 !important;
    border-bottom: 3px solid #e00000 !important;
    border-top: none !important;
    border-right: none !important;
}

/* Fade */
@keyframes fadeIn {
    to { opacity: 1; }
}

/* Bounce */
@keyframes bounceDown {
    0%,100% { transform: rotate(-45deg) translate(0,0); }
    50% { transform: rotate(-45deg) translate(-7px,7px); }
}

@keyframes bounceUp {
    0%,100% { transform: rotate(135deg) translate(0,0); }
    50% { transform: rotate(135deg) translate(-7px,7px); }
}

/* ↓ */
.scroll-arrow.down {
    margin: -30px auto;
    transform: rotate(-45deg);
    animation:
        fadeIn 1.5s ease forwards,
        bounceDown 2s ease-in-out infinite 1.5s !important;
}

/* ↑ */
.scroll-arrow.up {
    margin: -30px auto;
    transform: rotate(-135deg);
    animation:
        fadeIn 1.5s ease forwards,
        bounceUp 2s ease-in-out infinite 1.5s !important;
}

html {
    scroll-behavior: smooth;
}
/* =========================================================
   9. ACCORDION / TOGGLE
   ========================================================= */

.wp-block-accordion-heading__toggle, .wp-block-accordion-heading__toggle * {
    color: white !important;
    -webkit-text-fill-color: white !important;
    text-decoration: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.wp-block-accordion-heading__toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px !important;
    width: 100%;
    transition: outline 0.2s ease;
}

@keyframes accordion-hover-flash {
    0% { background-color: rgba(255, 0, 0, 0.8) !important; }
    100% { background-color: transparent !important; }
}

.wp-block-accordion-heading__toggle:hover {
    animation: accordion-hover-flash 0.5s ease-out forwards !important;
    outline: 2px solid #ff0000 !important;
    outline-offset: -2px;
}

.wp-block-accordion-heading__toggle:active, .wp-block-accordion-heading__toggle:focus {
    background-color: transparent !important;
    color: white !important;
    -webkit-text-fill-color: white !important;
}

.wp-block-accordion-heading__toggle-icon { color: #ff0000 !important; font-weight: bold !important; }

.wp-block-accordion-panel p {
    text-align: left !important;
    margin: 15px 0 !important;
    font-family: 'Exo 2', sans-serif !important;
    color: white !important;
}

/* Home Accordion (Avaa/Sulje) */
.home .wp-block-coblocks-accordion-item__title {
    background-color: rgba(0,0,0,0.6) !important;
    outline: none !important;
    transition: all 0.2s ease;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    min-height: 20px !important;
    max-width: 180px !important;
    margin: 0 auto !important;
    position: relative;
    border-radius: 0 !important;
    overflow: hidden;
    color: transparent !important;
    font-size: 0 !important;
    text-shadow: none !important;
}

.home .wp-block-coblocks-accordion-item__title::after {
    content: "AVAA TÄSTÄ";
    font-family: 'Epilogue', sans-serif !important;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #ff0000 !important;
    position: absolute;
    top: 50%;
    left: 0; right: 0; text-align: center;
    transform: translateY(-50%);
}

.home details[open] > .wp-block-coblocks-accordion-item__title::after {
    content: "SULJE TÄSTÄ";
    color: #000000 !important;
}

.home .wp-block-coblocks-accordion-item__title:hover {
    background-color: rgba(0,0,0,0.3) !important;
    outline: 2px solid red !important;
    outline-offset: -2px !important;
    animation: flash-white 0.15s ease-out !important;
}

.home details[open] > .wp-block-coblocks-accordion-item__title {
    background-color: #ff0000 !important;
    outline: none !important;
}

/* =========================================================
   10. OTSIKOIDEN ALLEVIIVAUS-FIXIT
   ========================================================= */

.entry-title a, .wp-block-post-title a, .wp-block-heading a {
    position: relative;
    text-decoration: none !important;
}

.entry-title a::after, .wp-block-post-title a::after, .wp-block-heading a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background-color: red;
    transition: width 0.3s ease;
}

.home .entry-title a:hover::after, .blog .entry-title a:hover::after, 
.archive .entry-title a:hover::after, .category .entry-title a:hover::after, 
.tag .entry-title a:hover::after, .date .entry-title a:hover::after, 
.tax-category .entry-title a:hover::after {
    width: 100% !important;
}

.wp-block-post-carousel .entry-title a::after, .wp-block-jetpack-post-carousel .entry-title a::after, 
.wp-block-post-carousel .wp-block-post-title a::after, .wp-block-post-carousel a::after {
    display: none !important;
}

#ville-nissinen a {
    display: inline-block !important;
    position: relative !important;
    width: auto !important;
    padding-bottom: 4px !important;
    text-decoration: none !important;
}

.archive .entry-title a, .blog .entry-title a {
    display: inline-block !important;
    position: relative !important;
    text-decoration: none !important;
    padding-bottom: 4px !important;
}

.archive .entry-title a::after, .blog .entry-title a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: #ff0000;
    transition: width 0.3s ease-in-out;
}

.archive .entry-title a:hover::after, .blog .entry-title a:hover::after {
    width: 100% !important;
}

/* =========================================================
   11. ARKISTOSIVUN PANEELIT & KUVA-OVERLAY
   ========================================================= */

.archive .pique-panel, .blog .pique-panel {
    height: auto !important; 
    min-height: 40vh !important; 
    overflow: visible !important;
}

.archive .pique-panel-content, .blog .pique-panel-content {
    padding-top: 80px !important;
    padding-bottom: 80px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 40vh !important;
    position: relative;
    z-index: 2;
}

.archive .pique-panel-background::before, .blog .pique-panel-background::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.4) !important;
    z-index: 1;
}

/* =========================================================
   12. MOBIILI & MEDIA QUERIES
   ========================================================= */

@media screen and (max-width: 768px) {
    .wp-block-jetpack-contact-form label, .wp-block-jetpack-contact-form input,
    .wp-block-jetpack-contact-form select, .wp-block-jetpack-contact-form textarea,
    .wp-block-jetpack-contact-form legend, .wp-block-jetpack-contact-form .grunion-field-label,
    .wp-block-jetpack-contact-form .grunion-field-text, .wp-block-jetpack-contact-form .contact-form__error-message,
    .wp-block-jetpack-contact-form .contact-form__input-error, .wp-block-jetpack-contact-form .wp-block-button__link {
        font-size: 14px !important;
        line-height: 1.4;
    }

    .wp-block-jetpack-contact-form input::placeholder, .wp-block-jetpack-contact-form textarea::placeholder {
        font-size: 14px !important;
    }

    .wp-block-button .wp-block-button__link { width: 100%; }

    .read-more .more-link {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 18px 20px !important;
    }

    .wp-block-jetpack-form-step-navigation {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
    }

    .wp-block-jetpack-form-step-navigation .wp-block-button {
        width: 48% !important;
        flex: 0 0 48% !important;
    }

    .wp-block-jetpack-form-step-navigation .wp-block-button__link { width: 100% !important; }

    .home .site-header { top: 0 !important; min-height: auto !important; }
    .home .site-branding { padding-top: 6px !important; height: auto !important; }
    .home .site-content { padding-top: 97px !important; }
    .home .pique-panel-content { padding-top: 0 !important; min-height: auto !important; }
    .site-branding { padding-top: 0 !important; height: auto !important; }
    .site-content { padding-top: 0 !important; }
    body:not(.home) .site-content { padding-top: 0 !important; }
    body:not(.home) .entry-content { margin-top: -20px !important; }
    .home #primary-menu { margin-top: 14px !important; }
    body:not(.home) #primary-menu { margin-top: 0 !important; }

    .wp-block-paragraph { font-size: 80%; }
    body.home .wp-block-paragraph { font-size: 85% !important; }

    table { font-size: 3vw; }
    th, td { padding: 1.5vw; }

    #ville-nissinen a { padding-bottom: 4px !important; }

    .archive .pique-panel, .blog .pique-panel {
        min-height: 250px !important;
        height: auto !important;
    }
    .archive .pique-panel-content, .blog .pique-panel-content {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
}