/* ==========================================================================
   mobile.css — mobile-first corrections for the PetitionPro landing page.

   Loads LAST, after style.css / responsive.css / dark.css, so nothing may be
   added to _Layout.cshtml after it.

   The purchased theme was built for desktop-width headlines of two or three
   words. Our marketing copy is full sentences, which the theme's 60px
   uppercase hero type cannot hold on a phone. Everything below either caps
   that type, kills horizontal overflow, or rebuilds the navigation bar for
   touch.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. No sideways scrolling, ever
   -------------------------------------------------------------------------- */

/* Only `body` may carry this. Setting overflow-x on BOTH html and body stops
   body propagating its overflow to the viewport, which turns body into its own
   scroll container and breaks vertical scrolling of the page. */
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Bootstrap 3 rows use negative margins; combined with the theme's padded
   wrappers they push past the viewport on narrow screens. */
img,
video,
iframe,
table {
    max-width: 100%;
}

img {
    height: auto;
}

/* Long unbroken strings (URLs, e-mail addresses) are the other overflow
   source once the type is capped. */
.home-texts .slide,
.home-fixed-text,
.header,
.description,
h1, h2, h3, h4 {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* --------------------------------------------------------------------------
   2. Navigation bar — shared structure
   -------------------------------------------------------------------------- */

.nav-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.nav-inner .logo {
    /* Replaces the theme's float + translateY centering, which fights flex. */
    top: auto;
    float: none;
    flex: 0 1 auto;
    min-width: 0;
    -webkit-transform: none;
    -moz-transform: none;
    transform: none;
}

.nav-inner .logo a {
    display: inline-block;
    line-height: 0;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

/* Desktop: logo left, menu right, action pills furthest right. The markup puts
   .nav-actions before .nav-menu so the two stay adjacent on a phone. */
@media only screen and (min-width: 1001px) {

    .nav-inner {
        justify-content: flex-end;
    }

    .nav-inner .logo {
        margin-right: auto;
    }

    .nav-inner .nav-menu {
        order: 1;
        float: none;
    }

    .nav-inner .nav-actions {
        order: 2;
        margin-left: 22px;
    }
}

.nav-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.32);
    -webkit-transition: all 0.25s;
    transition: all 0.25s;
}

.nav-action:hover,
.nav-action:focus {
    color: #fff;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.6);
}

.nav-action img {
    width: 18px;
    height: 18px;
    border-radius: 4px;
}

.nav-action i {
    font-size: 14px;
}

.nav-action-login {
    background: dodgerblue;
    border-color: dodgerblue;
}

.nav-action-login:hover,
.nav-action-login:focus {
    background: #1573d6;
    border-color: #1573d6;
}

/* Hamburger: a real <button>, drawn with three bars so it does not depend on
   an icon font that may not have painted yet. */
.mobile-nav-button {
    display: none; /* Shown by the <= 1000px block below. */
    position: static;
    width: 42px;
    height: 38px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.32);
    color: #fff;
    cursor: pointer;
    -webkit-transform: none;
    -moz-transform: none;
    transform: none;
    -webkit-transition: background 0.25s, border-color 0.25s;
    transition: background 0.25s, border-color 0.25s;
}

.mobile-nav-button:hover,
.mobile-nav-button:focus,
.mobile-nav-button[aria-expanded="true"] {
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.6);
    outline: none;
}

.hamburger-bars {
    display: block;
    width: 20px;
    margin: 0 auto;
}

.hamburger-bars span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    -webkit-transition: -webkit-transform 0.25s, opacity 0.2s;
    transition: transform 0.25s, opacity 0.2s;
}

.hamburger-bars span + span {
    margin-top: 5px;
}

/* Bars morph into an X while the menu is open. */
.mobile-nav-button[aria-expanded="true"] .hamburger-bars span:nth-child(1) {
    -webkit-transform: translateY(7px) rotate(45deg);
    transform: translateY(7px) rotate(45deg);
}

.mobile-nav-button[aria-expanded="true"] .hamburger-bars span:nth-child(2) {
    opacity: 0;
}

.mobile-nav-button[aria-expanded="true"] .hamburger-bars span:nth-child(3) {
    -webkit-transform: translateY(-7px) rotate(-45deg);
    transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   3. Navigation bar — phone and small tablet (matches the theme's 1000px
      breakpoint, where .nav-menu collapses)
   -------------------------------------------------------------------------- */

@media only screen and (max-width: 1000px) {

    #navigation,
    #navigation-sticky {
        height: 64px;
        background: rgba(20, 20, 20, 0.92);
        box-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
    }

    .nav-inner {
        padding-left: 14px;
        padding-right: 14px;
    }

    .nav-inner .logo a img {
        max-height: 36px;
    }

    .mobile-nav-button {
        display: inline-block;
    }

    /* The theme's collapsed menu was a fixed 400px scroll box hanging under a
       transparent bar. Make it a solid, self-sizing drop panel instead. */
    .nav-inner div.nav-menu {
        top: 100%;
        left: 0;
        width: 100%;
        height: auto;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        float: none;
        position: absolute;
        background: rgba(20, 20, 20, 0.98);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    }

    .nav-inner div.nav-menu ul.nav {
        width: 100%;
        height: auto;
        padding: 6px 0;
    }

    .nav-inner div.nav-menu ul.nav li a {
        display: block;
        width: 100%;
        padding: 0 20px;
        height: auto;
        line-height: 52px; /* 52px tap target */
        font-size: 15px;
        letter-spacing: 0.06em;
        color: #fff;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .nav-inner div.nav-menu ul.nav li:first-child a {
        border-top: 0;
    }

    .nav-inner div.nav-menu ul.nav li a:hover,
    .nav-inner div.nav-menu ul.nav li a:focus {
        background: rgba(255, 255, 255, 0.07);
    }
}

/* Narrow phones: keep the bar from wrapping by dropping the button labels. */
@media only screen and (max-width: 560px) {

    .nav-action {
        height: 36px;
        padding: 0 10px;
        gap: 6px;
    }

    .nav-action-proactive .nav-action-label {
        display: none;
    }

    .nav-inner .logo a img {
        max-height: 32px;
    }
}

@media only screen and (max-width: 380px) {

    .nav-action-login .nav-action-label {
        display: none;
    }

    .nav-action {
        padding: 0 11px;
    }
}

/* --------------------------------------------------------------------------
   4. Hero
   -------------------------------------------------------------------------- */

/* responsive.css pads .nav-inner and .inner below 1185px but never the v2
   hero, so the headline ran edge to edge on laptops and tablets. */
#home .home-elements {
    padding-left: 25px;
    padding-right: 25px;
}

/* `background-attachment: fixed` is either ignored or badly janky on iOS and
   Android, and it is what makes the hero images jump while scrolling. */
@media only screen and (max-width: 1000px) {

    body.parallax .slides-container div,
    body.parallax .image-bg,
    .parallax1, .parallax2, .parallax3,
    .parallax4, .parallax5, .parallax6 {
        background-attachment: scroll !important;
    }
}

@media only screen and (max-width: 1000px) {

    /* The theme centres .home-inner with top:50% + translateY(-50%). With
       sentence-length copy the block grows past the hero and clips, so on
       phones lay the hero out as a padded flex column instead. */
    #home .home-elements {
        display: flex;
        align-items: center;
        padding: 74px 20px 34px;
    }

    #home .home-elements .home-inner {
        top: auto;
        width: 100%;
        -webkit-transform: none;
        -moz-transform: none;
        transform: none;
    }

    #home .home-elements .home-inner.v2 {
        padding: 0;
    }

    .home-inner.v2 .home-text-slider {
        margin-bottom: 4px;
    }

    /* The rotating headline. Sentence case, because 8 lines of shouting caps
       is unreadable on a 390px screen. */
    .home-inner.v2 .text-slider .home-texts .slide {
        font-size: 21px;
        line-height: 1.35;
        letter-spacing: 0;
        text-transform: none;
        max-width: 34em;
        margin: 0 auto;
    }

    /* The fixed strapline underneath. */
    .home-inner.v2 .home-fixed-text {
        font-size: 14px;
        line-height: 1.5;
        max-width: 30em;
        margin: 14px auto 0;
        color: #c4c4c4;
    }

    /* Slider arrows: big enough to hit with a thumb. */
    .home-inner.v2 .text-slider .flex-direction-nav {
        margin: 16px auto 14px;
    }

    .home-inner.v2 .text-slider .flex-direction-nav li a {
        width: 44px;
        height: 44px;
        background-color: rgba(0, 0, 0, 0.35);
    }

    /* Call-to-action buttons stack and fill the width. */
    #home .home-elements .home-inner .home-button-1 {
        display: block;
        width: 100%;
        max-width: 280px;
        margin: 10px auto 0;
        padding: 13px 20px;
        border-radius: 6px;
        font-size: 14px;
        letter-spacing: 0.08em;
        color: #e8e8e8;
        background: rgba(0, 0, 0, 0.45);
        border-color: rgba(255, 255, 255, 0.25);
    }

    /* The theme pins the arrows over the hero edges; they collide with the
       stacked content and are redundant next to the text-slider arrows. */
    #home .slides-navigation {
        display: none;
    }
}

@media only screen and (max-width: 560px) {

    #home .home-elements {
        padding: 70px 18px 30px;
    }

    .home-inner.v2 .text-slider .home-texts .slide {
        font-size: 19px;
    }

    .home-inner.v2 .home-fixed-text {
        font-size: 13px;
        margin-top: 12px;
    }
}

@media only screen and (max-width: 380px) {

    .home-inner.v2 .text-slider .home-texts .slide {
        font-size: 17px;
        line-height: 1.32;
    }

    .home-inner.v2 .home-fixed-text {
        font-size: 12.5px;
    }

    #home .home-elements .home-inner .home-button-1 {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Short landscape phones: the hero is 100vh, so trim the type further rather
   than letting it overflow. */
@media only screen and (max-width: 1000px) and (max-height: 520px) {

    .home-inner.v2 .text-slider .home-texts .slide {
        font-size: 16px;
    }

    .home-inner.v2 .home-fixed-text {
        display: none;
    }

    #home .home-elements .home-inner .home-button-1 {
        display: inline-block;
        width: auto;
        margin: 8px 4px 0;
    }
}

/* --------------------------------------------------------------------------
   5. Section rhythm and headings
   -------------------------------------------------------------------------- */

/* The navigation bar is fixed, so an in-page anchor would otherwise park its
   heading underneath it. */
@media only screen and (max-width: 1000px) {

    #home, #user-roles, #about, #features, #prices, #contact {
        scroll-margin-top: 64px;
    }
}

@media only screen and (max-width: 767px) {

    section.container > .inner,
    #features .inner,
    #contact .inner {
        padding-left: 18px;
        padding-right: 18px;
    }

    .header {
        font-size: 26px;
        line-height: 1.25;
    }

    .description {
        font-size: 15px;
        line-height: 1.6;
    }
}

/* --------------------------------------------------------------------------
   6. Feature tabs — the theme renders these as a horizontal tab strip, which
      shatters on a phone. Stack them into a full-width list.
   -------------------------------------------------------------------------- */

@media only screen and (max-width: 767px) {

    #features .tabs ul.nav-tabs {
        display: block;
        width: 100%;
        float: none;
        border: 0;
    }

    #features .tabs ul.nav-tabs > li {
        display: block;
        width: 100%;
        float: none;
        margin: 0 0 6px;
    }

    #features .tabs ul.nav-tabs > li > a {
        display: block;
        width: 100%;
        margin: 0;
        padding: 13px 16px;
        border: 1px solid rgba(0, 0, 0, 0.12);
        border-radius: 6px;
        font-size: 13px;
        line-height: 1.3;
    }

    #features .tabs ul.nav-tabs > li.active > a,
    #features .tabs ul.nav-tabs > li.active > a:hover,
    #features .tabs ul.nav-tabs > li.active > a:focus {
        color: #fff;
        background: dodgerblue;
        border-color: dodgerblue;
    }

    #features .tabs .tab-content {
        width: 100%;
        float: none;
        padding: 18px 0 0;
    }

    #features .tabs .tab-text {
        font-size: 15px;
        line-height: 1.65;
    }
}

/* --------------------------------------------------------------------------
   7. Contact form — the markup uses col-xs-6, which keeps a 50/50 split all
      the way down to 320px. Stack it.
   -------------------------------------------------------------------------- */

@media only screen and (max-width: 767px) {

    #contact .contact form > .col-xs-6.left,
    #contact .contact form > .col-xs-6.right {
        width: 100%;
        float: none;
        padding-left: 0;
        padding-right: 0;
    }

    #contact .contact form > .col-xs-12 {
        padding-left: 0;
        padding-right: 0;
    }

    #contact .contact .form {
        width: 100%;
        height: 48px;
        /* 16px keeps iOS Safari from zooming the page on focus. */
        font-size: 16px;
    }

    #contact .contact .form.textarea {
        height: 160px;
        padding-top: 12px;
    }

    /* The theme's submit button is grey-on-grey, which reads as disabled. */
    #contact .contact .contact-form-button {
        width: 100%;
        height: 52px;
        color: #fff;
        font-size: 15px;
        letter-spacing: 0.06em;
        background: dodgerblue;
        border: 1px solid dodgerblue;
    }
}

/* --------------------------------------------------------------------------
   8. Footer and back-to-top
   -------------------------------------------------------------------------- */

@media only screen and (max-width: 767px) {

    footer.footer {
        padding: 34px 18px;
    }

    footer.footer img {
        max-height: 44px;
    }

    footer.footer p {
        font-size: 11px;
        line-height: 1.6;
    }

    #back-top a {
        width: 44px;
        height: 44px;
        line-height: 44px;
    }
}
