:root{
  --rib-accent:#ed462f;
  --rib-accent-dark:#c93624;
  --rib-ink:#171717;
  --rib-text:#2d3748;
  --rib-muted:#626262;
  --rib-bg:#ffffff;
  --rib-soft:#f6f2e4;
  --rib-line:#e6e6e6;
  --rib-max:1180px;
  --rib-gutter:24px;
  --rib-copy:72ch;
  --rib-content-top-mobile:28px;
  --rib-h1-mobile:30px;
  --rib-h2-mobile:26px;
  --rib-h3-mobile:22px;
}

html,body{overflow-x:hidden}
body{
  color:var(--rib-text);
  background:var(--rib-bg);
  font-family:Arial,"Helvetica Neue",system-ui,sans-serif;
}
img,svg,video,iframe{max-width:100%}
img{height:auto}
a{color:var(--rib-accent)}
a:hover,a:focus{color:var(--rib-accent-dark)}

h1,h2,h3,h4{
  color:var(--rib-ink);
  text-align:left;
  hyphens:none;
  -webkit-hyphens:none;
  word-break:normal;
  overflow-wrap:normal;
}

.site-main{background:var(--rib-bg)}
.entry-content{max-width:none}

/* Shared site shell / gutters. */
.rib3-wrap,
.elementor > .elementor-section.elementor-top-section > .elementor-container{
  box-sizing:border-box;
}

/* Content links always use the brand palette. */
body:not(.rib-kadence-preview) main a:not(.button):not(.elementor-button),
body:not(.rib-kadence-preview) .entry-content a:not(.button):not(.elementor-button){
  color:var(--rib-accent)!important;
  text-decoration-thickness:1px;
  text-underline-offset:2px;
}

/* Only genuine long-form paragraphs are justified; class is assigned globally. */
html[lang^="de"] .rib-prose{
  text-align:justify!important;
  text-align-last:left!important;
  hyphens:auto!important;
  -webkit-hyphens:auto!important;
  hyphenate-limit-chars:6 3 3;
}
html[lang^="ru"] .rib-prose{
  text-align:justify!important;
  text-align-last:left!important;
  hyphens:none!important;
  -webkit-hyphens:none!important;
}

/* Lists, short labels and UI are never justified. */
main li,nav,form,button,input,textarea,summary,
.entry-content p:not(.rib-prose){
  text-align:left;
}
.entry-content p > a:only-child,
main p > a:only-child{
  display:inline-block;
  text-align:left!important;
  text-align-last:left!important;
  hyphens:none!important;
  -webkit-hyphens:none!important;
}

.wp-custom-logo .site-branding .site-title-wrap{display:none!important}
#masthead .site-branding a.brand{display:flex;align-items:center}
#masthead .site-branding img.custom-logo{
  height:auto!important;
  object-fit:contain;
}

/* Elementor is only a content engine; layout follows the shared site system. */
.elementor-section .elementor-container{
  max-width:100%!important;
}
.elementor-column,
.elementor-widget-wrap,
.elementor-widget-container{
  min-width:0!important;
}
.elementor-widget-text-editor,
.elementor-widget-text-editor p,
.elementor-widget-text-editor li{
  font-family:Arial,"Helvetica Neue",system-ui,sans-serif;
}
.elementor-widget-text-editor p{max-width:var(--rib-copy)}
.elementor-button{
  background:var(--rib-accent)!important;
  color:#fff!important;
  border-radius:0!important;
  box-shadow:none!important;
}
table{max-width:100%}

@media(max-width:767px){
  :root{--rib-gutter:20px}

  #masthead .site-main-header-inner-wrap{min-height:68px!important}
  #masthead .site-branding{max-width:150px}
  #masthead .site-branding img.custom-logo{
    width:128px!important;
    max-width:128px!important;
    max-height:48px!important;
  }
  #masthead .mobile-toggle-open-container{display:flex!important}
  #masthead .menu-toggle-open{font-size:18px!important;padding:10px!important}

  .elementor > .elementor-section.elementor-top-section > .elementor-container{
    width:calc(100% - (2 * var(--rib-gutter)))!important;
    max-width:calc(100% - (2 * var(--rib-gutter)))!important;
    margin-left:auto!important;
    margin-right:auto!important;
    padding-left:0!important;
    padding-right:0!important;
  }
  .elementor-section .elementor-container{flex-wrap:wrap!important}
  .elementor-column{
    width:100%!important;
    max-width:100%!important;
  }
  .elementor-top-section>.elementor-container>.elementor-column>.elementor-widget-wrap,
  .elementor-top-section>.elementor-container>.elementor-column>.elementor-element-populated{
    padding-left:0!important;
    padding-right:0!important;
  }

  .elementor-widget-heading h1.elementor-heading-title,
  .elementor-widget-heading .elementor-heading-title.elementor-size-default{
    color:var(--rib-ink)!important;
    font-size:30px!important;
    line-height:1.12!important;
    letter-spacing:-.025em!important;
    text-transform:none!important;
    hyphens:none!important;
    -webkit-hyphens:none!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
  }
  .elementor-widget-heading h2.elementor-heading-title{
    color:var(--rib-ink)!important;
    font-size:28px!important;
    line-height:1.12!important;
  }
  .elementor-widget-heading h3.elementor-heading-title{
    color:var(--rib-ink)!important;
    font-size:23px!important;
    line-height:1.18!important;
  }

  .elementor-widget-text-editor,
  .elementor-widget-text-editor p,
  .elementor-widget-text-editor li{
    font-size:16px!important;
    line-height:1.55!important;
  }
  .elementor-widget-text-editor p{margin-bottom:18px}
  .elementor-widget-text-editor strong,
  .elementor-widget-text-editor b{font-weight:600!important}
  .elementor-widget-text-editor ul,
  .elementor-widget-text-editor ol{
    margin-left:0!important;
    margin-right:0!important;
    padding-left:22px!important;
  }
  .elementor-widget-text-editor li{
    margin:0 0 8px!important;
    padding-left:2px!important;
  }
  .elementor-widget-image img{width:auto;max-width:100%!important;height:auto!important}
  .elementor-button,button,input[type="submit"]{min-height:46px}
  .elementor-spacer-inner{max-height:48px}
  table{display:block;overflow-x:auto}

  .site-footer{margin-top:0!important}
  .site-footer .site-info{
    font-size:13px!important;
    line-height:1.45!important;
    text-align:center!important;
  }
  .site-footer .site-info p{margin:0!important}

  .rib3-wrap{
    width:calc(100% - (2 * var(--rib-gutter)))!important;
    max-width:var(--rib-max)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
}

@media(max-width:360px){
  .elementor-widget-heading h1.elementor-heading-title,
  .elementor-widget-heading .elementor-heading-title.elementor-size-default{
    font-size:28px!important;
  }
}

/* Structural fallback: some pages render prose directly in #inner-wrap. */
@media(max-width:767px){
  body:not(.rib-kadence-preview) #inner-wrap > :where(h1,h2,h3,h4,p,ul,ol,blockquote,table){
    margin-left:var(--rib-gutter)!important;
    margin-right:var(--rib-gutter)!important;
  }

  /* Mobile heading scale is global, regardless of content engine. */
  body:not(.rib-kadence-preview) main h1{
    font-size:30px!important;
    line-height:1.12!important;
    letter-spacing:-.025em!important;
  }
  body main h2{
    font-size:var(--rib-h2-mobile)!important;
    line-height:1.12!important;
  }
  body main h3{
    font-size:var(--rib-h3-mobile)!important;
    line-height:1.18!important;
  }
}
@media(max-width:360px){
  body:not(.rib-kadence-preview) main h1{font-size:28px!important}
}

/* Unified mobile content typography. */
@media(max-width:767px){
  body main h1{
    font-size:var(--rib-h1-mobile)!important;
    line-height:1.13!important;
    margin-bottom:24px!important;
  }
  body:not(.rib-kadence-preview) main p,
  body:not(.rib-kadence-preview) main li{
    font-size:16px!important;
    line-height:1.55!important;
  }
  body:not(.rib-kadence-preview) main p{
    margin-top:0;
    margin-bottom:16px;
  }
  body:not(.rib-kadence-preview) main p.rib-prose{
    margin-bottom:20px;
  }

  body:not(.rib-kadence-preview) #inner-wrap > ul,
  body:not(.rib-kadence-preview) #inner-wrap > ol{
    padding-left:22px!important;
    margin-top:8px!important;
    margin-bottom:22px!important;
  }
  body:not(.rib-kadence-preview) #inner-wrap > ul > li,
  body:not(.rib-kadence-preview) #inner-wrap > ol > li{
    margin-bottom:7px!important;
    padding-left:1px!important;
  }

  body:not(.rib-kadence-preview) .entry-content p > a:only-child,
  body:not(.rib-kadence-preview) main p > a:only-child{
    color:var(--rib-ink)!important;
    font-weight:600;
    text-decoration:none!important;
    border-bottom:1px solid var(--rib-accent);
    line-height:1.4;
  }
}
@media(max-width:360px){
  :root{--rib-h1-mobile:28px}
}

/* Global top spacing for page titles that render directly below the site shell. */
@media(max-width:767px){
  #inner-wrap > h1{
    margin-top:var(--rib-content-top-mobile)!important;
  }
}

/* Calm long headings without changing their wording or SEO text. */
.rib-heading-detail{
  display:block;
  margin-top:18px;
  color:var(--rib-text);
  font-size:18px;
  line-height:1.5;
  font-weight:500;
  letter-spacing:0;
}
.rib-heading-long{
  font-size:20px!important;
  line-height:1.4!important;
  font-weight:600!important;
  letter-spacing:0!important;
}
@media(max-width:767px){
  body main h4{font-size:20px!important;line-height:1.25!important}
  body main h5{font-size:18px!important;line-height:1.3!important}
  body main h6{font-size:17px!important;line-height:1.35!important}
  .rib-heading-detail{
    margin-top:16px;
    font-size:16px;
    line-height:1.5;
  }
  .rib-heading-long{
    font-size:18px!important;
    line-height:1.4!important;
  }
}
