@media screen and (max-width: 1200px) {
    .hero .hero-slide {
        background-position: center 15%;
    }

    header {
        width: 90%;
        margin: 0 auto;
    }

    .intro-content {
        display: inline-block;
        width: 70%;
    }

}

@media screen and (max-width: 1024px) {
    .hero .hero-content {
        padding-top: 50%;
    }
}

/* Responsive nav kicks in */
@media screen and (max-width: 991px) {
    .hero .hero-rsvp-btn {
        display: none !important;
    }

    header {
        width: 90%;
        padding-left: 25px;
    }

    .hero .hero-content {
        padding-top: 50%;
    }

    .header-nav {
        position: fixed;
        background-color: #000;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        z-index: 10001;
        visibility: hidden;
        opacity: 0;
        -webkit-transition: opacity 0.5s, visibility 0s 0.5s;
        transition: opacity 0.5s, visibility 0s 0.5s;
    }

    .header-nav.open {
        visibility: visible;
        opacity: 1;
        -webkit-transition: opacity 0.5s;
        transition: opacity 0.5s;
    }

    ul.member-actions {
        position: static;
    }

    .navicon {
        visibility: visible;
    }

    body.nav-open {
        overflow: hidden;
    }

    header nav {
        position: relative;
        top: 45%;
        -moz-transform: translatey(-45%);
        -ms-transform: translatey(-45%);
        -o-transform: translatey(-45%);
        -webkit-transform: translatey(-45%);
        transform: translatey(-45%);
    }

    nav ul li a {
        color: #fff;
        font-size: 25px;
        text-transform: uppercase;
        font-weight: 600;
        -moz-transition: all 300ms ease-in-out;
        -o-transition: all 300ms ease-in-out;
        -webkit-transition: all 300ms ease-in-out;
        transition: all 300ms ease-in-out;
        display: inline-block;
        padding: 8px 16px;
        min-height: 44px;
        line-height: 1.2;
        box-sizing: border-box;
    }

    nav ul li {
        margin-bottom: 25px
    }

    nav ul.primary-nav li {
        display: block;
    }

    nav ul.member-actions li {
        display: block;
    }

    nav a.login {
        margin-right: 0px;
    }

    nav ul.primary-nav {
        margin: 0;
        padding: 0;
        text-align: center;
    }

    nav ul.primary-nav li a {
        padding-right: 0;
    }

    nav .member-actions {
        position: static;
        padding: 0;
        text-align: center;
    }

    nav ul.primary-nav li,
    nav ul.member-actions li {
        -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
        filter: alpha(opacity=0);
        opacity: 0;
        -moz-transform: translate3d(0, -80px, 0);
        -ms-transform: translate3d(0, -80px, 0);
        -o-transform: translate3d(0, -80px, 0);
        -webkit-transform: translate3d(0, -80px, 0);
        transform: translate3d(0, -80px, 0);
        -moz-transition: -moz-transform 0.5s, opacity 0.5s;
        -o-transition: -o-transform 0.5s, opacity 0.5s;
        -webkit-transition: -webkit-transform 0.5s, opacity 0.5s;
        transition: transform 0.5s, opacity 0.5s;
        -moz-transition: -moz-transform 0.5s, opacity 0.5s;
        -o-transition: -o-transform 0.5s, opacity 0.5s;
        -webkit-transition: -webkit-transform 0.5s, opacity 0.5s;
        transition: transform 0.5s, opacity 0.5s
    }

    header .header-nav.open ul.primary-nav li,
    header .header-nav.open ul.member-actions li {
        -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
        filter: alpha(opacity=100);
        opacity: 1;
        -moz-transform: translate3d(0, 0, 0);
        -ms-transform: translate3d(0, 0, 0);
        -o-transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0)
    }

    nav ul.primary-nav li:first-child {
        -moz-transition-delay: 0.05s;
        -o-transition-delay: 0.05s;
        -webkit-transition-delay: 0.05s;
        transition-delay: 0.05s
    }

    nav ul.primary-nav li:nth-child(2) {
        -moz-transition-delay: 0.1s;
        -o-transition-delay: 0.1s;
        -webkit-transition-delay: 0.1s;
        transition-delay: 0.1s
    }

    nav ul.primary-nav li:nth-child(3) {
        -moz-transition-delay: 0.15s;
        -o-transition-delay: 0.15s;
        -webkit-transition-delay: 0.15s;
        transition-delay: 0.15s
    }

    nav ul.primary-nav li:nth-child(4) {
        -moz-transition-delay: 0.2s;
        -o-transition-delay: 0.2s;
        -webkit-transition-delay: 0.2s;
        transition-delay: 0.2s
    }

    nav ul.member-actions li:first-child {
        -moz-transition-delay: 0.25s;
        -o-transition-delay: 0.25s;
        -webkit-transition-delay: 0.25s;
        transition-delay: 0.25s
    }

    nav ul.member-actions li:nth-child(2) {
        -moz-transition-delay: 0.30s;
        -o-transition-delay: 0.30s;
        -webkit-transition-delay: 0.30s;
        transition-delay: 0.30s
    }

    .intro-content {
        display: inline-block;
        width: 75%;
        margin-bottom: 30px;
    }

    .last {
        margin: 0;
    }

    .features {
        padding-bottom: 0;
    }

    .features .device-showcase,
    .features-extra .macbook-wrap {
        display: none;
    }

    .features .responsive-feature-img,
    .features-extra .responsive-feature-img {
        display: block;
        width: 85%;
        margin: 15% auto 0;
    }

    .features .responsive-feature-img img,
    .features-extra .responsive-feature-img img {
        width: 100%;
    }

    .hero-strip {
        margin-top: 0;
    }

    .events .leftcol {
        padding: 0 15px;
        margin-bottom: 15px;
        border-right: none;
    }

    .events .rightcol {
        padding: 0 20px;
    }
    
    #eng-pics .img-wrap {
        border-radius: 0;
    }

    #map-content-wrapper {
        margin-bottom: 40px;
    }
    
    #map-content {
        margin-top: 0;
        padding: 35px;
    }

    .rsvp {
        padding-top: 40px;
    }

    footer .social-share {
        display: none;
    }

    footer .footer-links {
        margin: 120px 0 120px 0;
    }
}

@media screen and (max-width: 640px) {
    .hero .hero-content {
        padding-top: 100%;
    }

    #eng-pics .img-wrap i {
        font-size: 25px;
        position: absolute;
        width: 25px;
        height: 25px;
        top: 10px;
        right: 10px; }

    #map-content-wrapper {
        margin-bottom: 0;
    }
    
    footer ul.footer-group {
        border-top: none;
    }

    footer ul.footer-group li a {
        font-size: 13px;
        text-transform: uppercase;
        padding: 20px 0;
        display: block;
        border-bottom: dashed 1px #4E566C;
    }

    footer ul.footer-group li {
        display: block;
    }

    footer .footer-links {
        margin: 50px 0 50px 0;
    }

}

@media screen and (max-width: 480px) {
    .hero .hero-content {
        padding-top: 110%;
    }
    
    .hero .hero-content img {
        width: 90%;
    }

    .hero .btn {
        display: block;
        width: 80%;
        margin: 0 auto;
    }

    .hero .btn:first-of-type {
        margin-bottom: 20px;
    }

    .hero h1 {
        font-size: 50px;
    }

    .btn-margin-right {
        margin-right: 0px;
    }

    .features .device-showcase-left {
        position: absolute;
        bottom: -392px;
        left: 41%;
        right: auto;
        transform: translateX(-50%);
    }

    .features .ipad-wrap {
        width: 706px;
        height: 1002px;
        background: url("../img/ipad-device.png") no-repeat center center;
        z-index: 1;
        background-size: 40%;
    }

    .features .iphone-wrap {
        width: 304px;
        height: 617px;
        background: url("../img/iphone6.png") no-repeat center center;
        position: absolute;
        left: 350px;
        bottom: 129px;
        z-index: 2;
        background-size: 40%;
    }

    .features {
        padding-bottom: 0;
    }

    .down-arrow {
        display: none;
    }

    #map-canvas {
        height: 300px;
    }

    #map-content-wrapper {
        margin-top: -275px;
        margin-bottom: 50px;
    }
}

@media screen and (max-width: 320px) {
    .hero .hero-content {
        padding-top: 130%;
    }

    .rsvp {
        padding-top: 20px;
    }
}

/* --------------------------------------------------------------------------
   Mobile optimization (phones & small tablets): readability, touch, map, hero
   Loaded last so these rules win over legacy breakpoint tweaks above.

   Hero padding for phones: see max-width 640/480/320 blocks above. For 641–767px
   only, see the (min-width: 641px) and (max-width: 767px) rule after this block.
   -------------------------------------------------------------------------- */
@media screen and (max-width: 767px) {
    html {
        -webkit-text-size-adjust: 100%;
        touch-action: manipulation;
    }

    body {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    /* Notched phones: keep header clear of status bar */
    section.navigation {
        padding-top: env(safe-area-inset-top, 0);
    }

    section.navigation header {
        padding-left: max(12px, env(safe-area-inset-left, 0));
        padding-right: max(12px, env(safe-area-inset-right, 0));
    }

    .container {
        padding-left: max(15px, env(safe-area-inset-left, 0px));
        padding-right: max(15px, env(safe-area-inset-right, 0px));
    }

    img {
        max-width: 100%;
        height: auto;
    }

    .flexslider .slides img {
        max-width: 100%;
        height: auto;
    }

    /* Hero: shorter vertical footprint, logo still prominent */
    .hero {
        min-height: 0;
        min-height: 85vh;
        min-height: 85dvh;
    }

    .hero .hero-content img {
        width: min(92%, 420px);
    }

    /* Body copy: minimum 16px for comfortable reading */
    body p,
    #intro p,
    section.events p,
    #invitation p {
        font-size: 16px;
        line-height: 1.65;
        overflow-wrap: break-word;
    }

    section.events h5 {
        font-size: 15px;
        line-height: 1.45;
    }

    section.events h5 .time {
        display: inline-block;
        margin-top: 4px;
    }

    h3.header {
        font-size: 20px;
        letter-spacing: 2px;
        line-height: 1.35;
    }

    /* RSVP: 16px inputs avoid iOS zoom-on-focus; larger tap targets */
    .rsvp .rsvp-form .form-input-group {
        height: auto;
        min-height: 52px;
        margin-bottom: 14px;
    }

    .rsvp .rsvp-form .form-input-group input {
        font-size: 16px !important;
        line-height: 1.35;
        padding-top: 13px;
        padding-bottom: 13px;
        min-height: 48px;
        box-sizing: border-box;
    }

    .rsvp .rsvp-form .rsvp-btn {
        font-size: 16px;
        min-height: 48px;
        padding: 14px 16px;
        line-height: 1.2;
    }

    .rsvp #alert-wrapper .alert {
        font-size: 15px;
        line-height: 1.45;
    }

    /* Map: shorter on small screens; keep overlay aligned to map height */
    #map-canvas {
        height: 300px;
    }

    #map-content-wrapper {
        margin-top: -275px;
        margin-bottom: 90px;
    }

    #map-content {
        /* Reduce overall panel size (mobile) */
        padding: 11px 9px !important;
    }

    /* Tighten typography so the whole panel feels ~2x more compact */
    #map-content h5 {
        font-size: 12px;
        margin: 0 0 4px;
        line-height: 1.2;
    }

    #map-content p {
        font-size: 12px;
        line-height: 1.3;
        margin: 0 0 6px;
    }

    /* Touch targets: keep ≥40px height; do not shrink below (was 28px — unusable on phones) */
    #btn-show-content,
    #map-content .btn {
        min-height: 44px;
        min-width: 44px;
        padding-left: 14px;
        padding-right: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        font-size: 13px;
        line-height: 1.2;
    }

    #btn-show-content {
        min-height: 44px;
        padding: 12px 16px;
    }

    /* Menu button: minimum touch target ~44px */
    .navicon {
        padding: 10px;
        margin: -10px -10px -10px 0;
    }

    .navicon .nav-toggle {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Modals: scroll long content (dress code) without trapping the viewport */
    .modal-dialog {
        margin: 12px auto;
        max-width: calc(100% - 24px);
    }

    .modal-body {
        max-height: min(78vh, 560px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 20px 18px 28px;
    }

    .modal-body h5 {
        font-size: 14px;
        margin-top: 1em;
    }

    .modal-body p {
        font-size: 15px;
        line-height: 1.55;
    }

    /* Engagement grid: let Bootstrap columns (col-xs/col-sm/col-md) control layout */

    footer {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
}

/*
 * Fixed nav + notch: 100px (styles.min.css) is too small on many phones — #invitation
 * and other hash targets sit under the bar in Safari/Chrome. Tie offset to safe-area.
 * Applies to phones and small tablets (≤991px).
 */
@media screen and (max-width: 991px) {
    html {
        scroll-padding-top: max(118px, calc(72px + env(safe-area-inset-top, 0px)));
    }

    #intro,
    #invitation,
    #events,
    #instagram,
    #eng-pics,
    #video-bg,
    #map,
    #rsvp {
        scroll-margin-top: max(118px, calc(72px + env(safe-area-inset-top, 0px)));
    }
}

/* Hero padding: only mid-range widths (641–767px). Narrower phones use 640/480/320 rules above. */
@media screen and (min-width: 641px) and (max-width: 767px) {
    .hero .hero-content {
        padding-top: 52%;
    }
}

/* Dress code + RSVP thank-you (add to calendar): vertically centered above fixed nav */
#dc-modal,
#rsvp-modal {
    z-index: 10001; /* above fixed header/nav (z-index: 10000) */
}

#dc-modal .modal-dialog,
#rsvp-modal .modal-dialog {
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 24px);
    max-width: 650px;
}