.modal-cacsp-backdrop,
.modal-cacsp-position {
  z-index: 99998 !important;
  width: 0;
  height: 0;
}

.modal-cacsp-backdrop {
  overflow: hidden;
}

.modal-cacsp-position .modal-cacsp-box {
  overflow: hidden;
}

.read-more-full {
  width: 100%;
  padding: 5px 0 !important;
  text-align: center;
}

.text-shadow {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.52);
}

.transparent {
  background-color: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none;
}

.d-block {
  display: block;
}
@media (max-width: 1023px) {
  .md-w-100 {
    width: 100% !important;
  }
}

@media (max-width: 767px) {
    .mobile-left, .mobile-left p, .mobile-left h1, .mobile-left h2, .mobile-left h3, .mobile-left h4 {
        text-align: left !important;
    }
    .mobile-small, .mobile-small p {
        font-size: var(--wp--preset--font-size--small) !important;
    }

    /* Reverse grid order on mobile */
    .reverse-on-mobile {
        display: flex !important;
        flex-direction: column;
    }
    .reverse-on-mobile .first-child {
        order: 2;
    }
    .reverse-on-mobile .second-child {
        order: 1;
    }

    /* Center all buttons on mobile */
    .wp-block-button, 
    .wp-block-buttons {
        text-align: center !important;
        justify-content: center !important;
    }
    .wp-block-button__link {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Utility: center anything with class .center-on-mobile */
    .center-on-mobile {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    /* Utility: hide any element on mobile */
    .hide-on-mobile {
        display: none !important;
    }
}

.trp-language-switcher > div {
  padding: 0px;
  border: 0;
  background-image: none;
  width: auto !important;
  background-color: transparent;
}

.trp-language-switcher:focus .trp-ls-shortcode-language,
.trp-language-switcher:hover .trp-ls-shortcode-language {
  background-color: var(--wp--preset--color--accent-5);
  width: auto !important;
  padding: 0;
}

/* Contact Form 7 Styles */
.wpcf7 {
  width: 100%;
}

.wpcf7 form {
  display: flex;
  flex-direction: column;
  gap: 10px; /* Small gap between form fields */
}

/* Reset margins on CF7 wrapper elements */
.wpcf7 p,
.wpcf7 .wpcf7-form-control-wrap,
.wpcf7 div {
  margin: 0 !important;
  margin-bottom: 0 !important;
}

/* Ensure form fields don't have extra margins */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea,
.wpcf7 input[type="submit"] {
  margin: 0;
}

.wpcf7 label {
  display: flex;
  flex-direction: column;
  gap: 5px; /* Reduced from 8px to 5px for tighter spacing between label and input */
  color: #555;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 300;
  letter-spacing: 0.5px;
  position: relative;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
  width: 100%;
  padding: 8px 8px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  box-sizing: border-box;
}

.wpcf7 input[type="text"]:hover,
.wpcf7 input[type="email"]:hover,
.wpcf7 input[type="tel"]:hover,
.wpcf7 textarea:hover {
  border-color: #b0b0b0;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 textarea:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.wpcf7 textarea {
  min-height: 60px;
  resize: vertical;
}

/* Submit button */
.wpcf7 input[type="submit"] {
  background-color: #40acdf;
  color: white;
  border: none;
  padding: 12px 12px;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 300;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.5px;
  margin-top: 0px;
  position: relative;
  overflow: hidden;
}

.wpcf7 input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.wpcf7 input[type="submit"]:active {
  transform: translateY(0);
}

/* Loading spinner */
.wpcf7 .ajax-loader {
  display: none;
  margin-left: 10px;
}

.wpcf7.submitting .ajax-loader {
  display: inline-block;
}

/* Response messages */
.wpcf7-response-output {
  margin: 20px 0 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wpcf7-mail-sent-ok {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.wpcf7-mail-sent-ng,
.wpcf7-spam-blocked,
.wpcf7-validation-errors,
.wpcf7-acceptance-missing {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

/* Validation errors */
.wpcf7-not-valid-tip {
  color: #dc3545;
  font-size: 13px;
  margin-top: 5px;
  animation: shake 0.3s ease-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.wpcf7-not-valid {
  border-color: #dc3545 !important;
}

/* Placeholder styling */
.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
  color: #999;
  opacity: 1;
}

/* Autofill styling */
.wpcf7 input:-webkit-autofill,
.wpcf7 input:-webkit-autofill:hover,
.wpcf7 input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 30px white inset !important;
  box-shadow: 0 0 0 30px white inset !important;
  -webkit-text-fill-color: #333 !important;
}

/* Required asterisk - positioned inline after label text */
.wpcf7 label {
  position: relative;
}

/* Create inline asterisk using a span approach */
.wpcf7 label .label-text:has(+ input[aria-required="true"])::after,
.wpcf7 label .label-text:has(+ textarea[aria-required="true"])::after {
  content: " *";
  color: #dc3545;
  font-weight: bold;
}

/* Alternative approach for when HTML structure doesn't support :has() */
.wpcf7 label[data-required="true"]::before {
  content: attr(data-label) " *";
  color: inherit;
}

.wpcf7 label[data-required="true"] .label-text {
  display: none;
}

/* Fallback: If neither approach works, use this simpler method */
.wpcf7 label:has(input[aria-required="true"]) .wpcf7-form-control-wrap::before,
.wpcf7 label:has(textarea[aria-required="true"]) .wpcf7-form-control-wrap::before {
  content: "*";
  color: #dc3545;
  font-weight: bold;
  position: absolute;
  top: -20px;
  right: 0;
}

/* Most compatible approach - target the label text directly */
.wpcf7 label > span:first-child::after {
  content: "";
}

.wpcf7 label:has(input[aria-required="true"]) > span:first-child::after,
.wpcf7 label:has(textarea[aria-required="true"]) > span:first-child::after {
  content: " *";
  color: #dc3545;
  font-weight: bold;
}

/* NEW CONTAINER STYLES */

/* Contact Information Container */
.yhteystiedot-container {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.yhteystiedot-container h2 {
  color: #333;
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #40acdf;
}

/* Taksa Containers */
.taksa-container {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.taksa-container h3 {
  color: #333;
  font-size: 1.4rem;
  font-weight: 500;
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #40acdf;
}

.taksa-container h4 {
  color: #555;
  font-size: 1.2rem;
  font-weight: 400;
  margin: 20px 0 15px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #ddd;
}

.taksa-container h4:first-of-type {
  margin-top: 10px;
}

/* Form Row Layouts */
.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.form-row.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-row.three-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
}

.form-row.four-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 15px;
}

.form-column {
  flex: 1;
}

/* Single column form rows (full width) */
.form-row:not(.two-columns):not(.three-columns):not(.four-columns) {
  flex-direction: column;
}

/* Taksa Section Styling */
.taksa-section {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

/* Radio button styling */
.wpcf7 input[type="radio"] {
  margin-right: 8px;
  margin-top: 2px;
}

.wpcf7 label:has(input[type="radio"]) {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

/* Checkbox styling for acceptance */
.wpcf7 input[type="checkbox"] {
  margin-right: 8px;
  margin-top: 2px;
}

.wpcf7 label:has(input[type="checkbox"]) {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .form-container {
    padding: 30px 20px;
  }

  .yhteystiedot-container,
  .taksa-container {
    padding: 20px 15px;
    margin-bottom: 20px;
  }

  .form-row.two-columns,
  .form-row.three-columns,
  .form-row.four-columns {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .wpcf7 input[type="submit"] {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .yhteystiedot-container,
  .taksa-container {
    padding: 15px 10px;
  }

  .yhteystiedot-container h2,
  .taksa-container h3 {
    font-size: 1.2rem;
  }

  .taksa-container h4 {
    font-size: 1.1rem;
  }
}

/* Force marquee animations to keep running even on hover */
.wp-block-boldblocks-marquee-block:hover,
.wp-block-boldblocks-marquee-block:hover * {
  -webkit-animation-play-state: running !important;
  animation-play-state: running !important;
}

:root {
    color-scheme: light only;
}

html {
    color-scheme: light only;
}