/* ==========================================================================
   Ninechain – Responsive Stylesheet & Device Optimization
   Pure Class-Only Selectors (No *, No ::, No ID, No Bare Tag Selectors)
   Supports Mobile (320px - 480px), Phablets (481px - 768px),
   Tablets (769px - 1024px), Laptops & Large Desktops (1025px+)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Global Layout & Fluid Resets (Classes Only)
   -------------------------------------------------------------------------- */
.page_html,
.page_body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Image & Icon Elements */
.hero_image,
.column_image {
  max-width: 100%;
  height: auto;
  display: block;
}

.header_logo {
  height: 40px;
  width: 187px;
  display: block;
  max-width: 100%;
}

.footer_logo,
.footer_logo_light {
  height: 36px;
  width: 168px;
  display: block;
  max-width: 100%;
}

.card_icon {
  width: 48px;
  height: 48px;
  display: block;
}

.preloader_logo {
  height: 60px;
  width: auto;
  display: block;
}

.back_to_top_icon {
  width: 20px;
  height: 20px;
}

.faq_icon {
  width: 20px;
  height: 20px;
}

/* German word hyphens & text wrapping for narrow viewports */
.hero_heading,
.section_heading,
.section_subheading,
.content_heading,
.content_text,
.card_title,
.card_text,
.step_title,
.step_text,
.faq_question,
.faq_answer,
.disclaimer_title,
.disclaimer_text,
.affiliate_cta_heading,
.affiliate_cta_text,
.external_link_note,
.legal_heading,
.legal_text,
.contact_info_label,
.contact_info_value,
.contact_form_heading,
.form_label,
.form_input,
.form_textarea,
.form_note,
.form_error,
.footer_heading,
.footer_description,
.footer_address,
.footer_link,
.copyright_text,
.cookie_heading,
.cookie_text,
.cookie_button,
.thankyou_heading,
.thankyou_text,
.thankyou_close,
.primary_button,
.header_cta_button,
.nav_link,
.disclosure_banner {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Navigation backdrop overlay */
.nav_backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(16, 35, 63, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
}

.nav_backdrop.nav_backdrop_visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Lock body scroll when mobile menu is open */
.menu_drawer_open {
  overflow-y: hidden;
}

/* Mobile CTA wrapper hidden on desktop */
.mobile_nav_cta_wrapper {
  display: none;
}

/* --------------------------------------------------------------------------
   Desktop Refinements (1025px - 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) and (min-width: 993px) {
  .header_inner {
    padding: 0 1rem;
    gap: 1rem;
  }

  .nav_list {
    gap: 0.85rem;
  }

  .nav_link {
    font-size: 0.88rem;
  }

  .header_cta_button {
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
  }

  .hero_inner {
    gap: 2rem;
    padding: 0 1rem;
  }
}

/* --------------------------------------------------------------------------
   Tablet & Mobile Navigation Breakpoint (<= 992px)
   Hamburger Menu Activates Here
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  /* Header Container & Inner */
  .header_container {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #FFFFFF;
    box-shadow: 0 2px 10px rgba(16, 35, 63, 0.05);
    padding: 0.75rem 0;
  }

  .header_inner {
    position: relative;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
  }

  /* Hamburger Menu Button Visible */
  .mobile_menu_button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    order: 2;
    margin-left: auto;
  }

  .header_logo_link {
    order: 1;
  }

  /* Hide Desktop CTA Button in Header Bar */
  .header_inner .header_cta_button {
    display: none !important;
  }

  /* Navigation Drawer Container */
  .nav_container {
    position: static;
  }

  .nav_list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #FFFFFF;
    flex-direction: column;
    padding: 0.75rem 1.25rem 1.5rem;
    border-bottom: 3px solid var(--color-teal);
    box-shadow: 0 18px 40px rgba(16, 35, 63, 0.16);
    max-height: calc(100vh - 75px);
    overflow-y: auto;
    z-index: 999;
    gap: 0;
    animation: navSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .nav_list.nav_list_open {
    display: flex !important;
  }

  .nav_item {
    width: 100%;
    border-bottom: 1px solid #E2E8F0;
    list-style: none;
  }

  .nav_item:last-child {
    border-bottom: none;
  }

  .nav_link {
    display: flex;
    align-items: center;
    padding: 0.95rem 0.5rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--color-navy);
    border-radius: 6px;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  .nav_link:hover,
  .nav_link:active {
    background-color: rgba(22, 166, 161, 0.08);
    color: var(--color-teal);
  }

  .nav_link.nav_link_active {
    color: var(--color-teal) !important;
    font-weight: 700 !important;
    background-color: rgba(22, 166, 161, 0.08);
    border-left: 3px solid var(--color-teal);
    border-bottom: none !important;
    padding-left: 0.75rem;
  }

  /* Mobile CTA Item Inside Drawer */
  .mobile_nav_cta_wrapper {
    display: block !important;
    list-style: none;
    width: 100%;
    padding-top: 1rem;
    border-bottom: none !important;
  }

  .mobile_nav_cta_button {
    width: 100% !important;
    text-align: center;
    display: block !important;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(22, 166, 161, 0.3);
  }

  /* Hero Section on Tablet */
  .hero_inner {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    text-align: center;
    padding: 0 1.25rem;
  }

  .hero_content {
    max-width: 640px;
    margin: 0 auto;
  }

  .hero_heading {
    font-size: clamp(1.85rem, 4.5vw, 2.4rem);
  }

  .hero_image_wrapper {
    text-align: center;
    max-width: 540px;
    margin: 0 auto;
  }

  /* Two Column Layouts */
  .two_column {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .two_column_media {
    width: 100%;
  }

  .two_column_text {
    width: 100%;
  }

  .column_image {
    max-width: 100%;
    margin: 0 auto;
    max-height: 360px;
    object-fit: cover;
  }

  /* Contact Page Layout */
  .contact_layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Cards Grid */
  .cards_grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
  }

  /* Footer Layout */
  .footer_inner {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

/* --------------------------------------------------------------------------
   Medium Mobile & Small Tablet (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Main Content Spacing */
  .main_content {
    padding: 1.5rem 1rem;
    width: 100%;
    overflow-x: hidden;
  }

  /* Hero Section Full Width Containment */
  .hero_section {
    margin: -1.5rem -1rem 2rem;
    padding: 2.5rem 1rem;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }

  .hero_inner {
    padding: 0;
  }

  .hero_heading {
    font-size: 1.9rem;
    line-height: 1.25;
    margin-bottom: 0.85rem;
  }

  .hero_text {
    font-size: 1rem;
    line-height: 1.55;
    margin-bottom: 1.75rem;
  }

  .section_heading {
    font-size: 1.65rem;
    margin-bottom: 0.75rem;
  }

  .section_subheading {
    font-size: 0.98rem;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
  }

  .content_heading {
    font-size: 1.45rem;
    margin-bottom: 0.75rem;
  }

  .content_text {
    font-size: 0.98rem;
    line-height: 1.65;
  }

  /* Steps Section */
  .steps_container {
    gap: 1.25rem;
    margin-bottom: 2rem;
  }

  .step_item {
    padding: 1.25rem;
    gap: 1rem;
    border-radius: var(--radius-sm);
  }

  .step_number {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }

  .step_title {
    font-size: 1.05rem;
  }

  .step_text {
    font-size: 0.92rem;
  }

  /* Cards Grid */
  .cards_grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
  }

  .finance_card {
    padding: 1.35rem;
  }

  .card_title {
    font-size: 1.15rem;
  }

  /* Contact Form */
  .form_row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .contact_form_card,
  .contact_info_card {
    padding: 1.5rem 1.25rem;
    border-radius: 12px;
  }

  .form_input,
  .form_textarea {
    font-size: 16px !important;
    padding: 0.75rem 0.85rem;
  }

  /* Info Grid in Finanzwissen */
  .info_grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Affiliate Section */
  .affiliate_cta_section {
    padding: 2rem 1.25rem;
    margin: 2.5rem 0;
    border-radius: var(--radius-md);
  }

  .affiliate_cta_heading {
    font-size: 1.35rem;
  }

  .affiliate_cta_text {
    font-size: 0.95rem;
  }

  .disclaimer_box {
    padding: 1.25rem;
    margin: 1.5rem 0;
  }

  /* FAQ Items */
  .faq_question {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }

  .faq_answer {
    padding: 0 1.25rem 1.25rem;
    font-size: 0.92rem;
  }

  /* Cookie Banner Responsive */
  .cookie_overlay {
    padding: 1rem 0.75rem;
  }

  .cookie_inner {
    padding: 1.5rem 1.25rem;
    border-radius: 14px;
    margin: 0 auto;
    width: 100%;
    max-width: 600px;
  }

  .cookie_heading {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }

  .cookie_text {
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
  }

  .cookie_buttons {
    flex-direction: column;
    width: 100%;
    gap: 0.6rem;
  }

  .cookie_button {
    width: 100%;
    min-width: auto;
    padding: 0.75rem;
    font-size: 0.95rem;
  }

  /* Thank You Modal */
  .thankyou_content {
    margin: 1rem;
    padding: 2rem 1.25rem;
    max-width: 380px;
  }

  /* Footer on Mobile */
  .footer_container {
    padding: 2.5rem 0 1.5rem;
  }

  .footer_inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0 1rem;
  }

  .footer_logo,
  .footer_logo_light {
    height: 32px;
    width: 150px;
  }

  .footer_description,
  .footer_address {
    font-size: 0.88rem;
  }

  .footer_heading {
    font-size: 1.1rem;
    margin-bottom: 0.85rem;
  }

  .footer_links {
    gap: 0.5rem;
  }

  .footer_link {
    font-size: 0.92rem;
    padding: 0.25rem 0;
    display: inline-block;
  }

  /* Back to Top Button */
  .back_to_top {
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
  }
}

/* --------------------------------------------------------------------------
   Small Mobile Devices (<= 480px down to 320px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  /* Disclosure Banner */
  .disclosure_banner {
    font-size: 0.76rem;
    padding: 0.55rem 0.65rem;
    line-height: 1.4;
  }

  /* Header */
  .header_inner {
    padding: 0 0.85rem;
  }

  .header_logo {
    height: 30px;
    width: 140px;
  }

  .footer_logo,
  .footer_logo_light {
    height: 28px;
    width: 130px;
  }

  .mobile_menu_button {
    width: 40px;
    height: 40px;
    padding: 6px;
  }

  .nav_list {
    padding: 0.5rem 1rem 1.25rem;
  }

  .nav_link {
    padding: 0.85rem 0.35rem;
    font-size: 0.98rem;
  }

  /* Hero Section */
  .hero_section {
    margin: -1.5rem -1rem 1.75rem;
    padding: 2rem 0.85rem;
  }

  .hero_heading {
    font-size: 1.6rem;
    line-height: 1.25;
  }

  .hero_text {
    font-size: 0.92rem;
  }

  .hero_content .primary_button,
  .affiliate_cta_section .primary_button,
  .contact_form .primary_button {
    width: 100%;
    text-align: center;
    padding: 0.85rem 1rem;
  }

  .section_heading {
    font-size: 1.45rem;
  }

  .content_heading {
    font-size: 1.3rem;
  }

  /* Cards */
  .finance_card {
    padding: 1.2rem;
  }

  .finance_card .primary_button {
    width: 100%;
    text-align: center;
  }

  .card_icon {
    width: 40px;
    height: 40px;
    margin-bottom: 0.75rem;
  }

  /* Steps on Small Mobile */
  .step_item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
  }

  /* Contact Card on Small Mobile */
  .contact_form_card,
  .contact_info_card {
    padding: 1.25rem 0.85rem;
  }

  .contact_info_value {
    font-size: 0.95rem;
  }

  /* Cookie Banner */
  .cookie_inner {
    padding: 1.25rem 1rem;
  }

  .cookie_heading {
    font-size: 1.15rem;
  }

  .cookie_text {
    font-size: 0.85rem;
  }

  /* Thank you modal */
  .thankyou_content {
    padding: 1.5rem 1rem;
  }

  .thankyou_heading {
    font-size: 1.35rem;
  }

  .thankyou_close {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes navSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
