html,
body {
    height: 100%;
}

:root {
    --footer-offset: 0px;
    --panel-max-height: 100vh;
}

body {
    font-family: Arial, sans-serif;
    background: #f8fafc;
    color: #222;
    margin: 0;
    min-height: 100%;
    overflow: hidden;
}

.app-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
}

.app-header {
    background: linear-gradient(135deg, #595959, #4d4d4d);
    color: #fff;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    margin: 0 auto;
    max-width: 960px;
}

.header-content h1 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.header-content p {
    margin: 0.4rem 0 0;
    font-size: clamp(1rem, 2vw, 1.2rem);
}

.app-main {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
    padding: 1rem 0 0;
    padding-bottom: calc(1rem + var(--footer-offset));
    min-height: 0;
    box-sizing: border-box;
}

.panel-scroller {
    --panel-width: min(960px, 90vw);
    width: 100%;
    max-height: 100%;
    display: flex;
    /* gap: clamp(1rem, 4vw, 2rem); */
    gap: clamp(1rem, 50vw, 50rem);
    align-items: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-inline: max(calc((100vw - var(--panel-width)) / 2), clamp(0px, 5vw, 50px));
    box-sizing: border-box;
    scroll-padding-inline: max(calc((100vw - var(--panel-width)) / 2), clamp(0px, 5vw, 50px));
}

.panel-scroller:focus-visible {
    outline: none;
}

.panel-scroller::-webkit-scrollbar {
    display: none;
}

.panel {
    flex: 0 0 var(--panel-width);
    max-width: var(--panel-width);
    background: rgba(255, 255, 255, 0.96);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    padding: 0.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    scroll-snap-align: center;
    min-width: 260px;
    position: relative;
    max-height: var(--panel-max-height);
    overflow: hidden;
    box-sizing: border-box;
    z-index: 6;
}

.panel-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: calc(var(--panel-max-height) - 2.5rem);
    overflow-y: auto;
    padding-right: 0.3rem;
    /* padding-bottom: calc(var(--footer-offset) + 1rem); */
    padding-bottom: 5em;
    min-height: 0;
    font-size: 1.1rem;
    line-height: 1.6;
}

.panel--form .panel-inner {
    max-height: calc(var(--panel-max-height) - 2.5rem);
    overflow-y: auto;
    padding-right: 0;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0;
    font-size: 1rem;
}

.panel-inner::-webkit-scrollbar {
    width: 6px;
}

.panel-inner::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.panel h2 {
    margin: 0;
    font-size: 1.4rem;
}

.panel-sign-btn {
    align-self: center;
    background: #0c6398;
    border: none;
    color: #fff;
    padding: 0.95rem 2.5rem;
    border-radius: 999px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.panel-sign-btn:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 12px rgba(12, 99, 152, 0.25);
}

.pledge-points {
    padding-left: 1rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.panel--context .panel-inner,
.panel--resources .panel-inner {
    line-height: 1.6;
}

.partner-list {
    list-style: disc;
    padding-left: 1.2rem;
    margin: 0 0 2em;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.resource-list {
    list-style: disc;
    padding-left: 1.2rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.panel-edge {
    position: absolute;
    top: 0;
    bottom: 0;
    width: clamp(5px, 5vw, 50px);
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1;
}

.panel-edge--prev {
    left: 0;
}

.panel-edge--next {
    right: 0;
}

.panel-edge:focus-visible {
    outline: 2px solid #939393;
}

.panel-edge[disabled] {
    pointer-events: none;
    opacity: 0;
}

.panel-edge-visual {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(5px, 5vw, 50px);
    height: 20vh;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    z-index: 1000;
    /* transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease; */
}

.panel-edge-visual--prev {
    left: 5px;
    /* border-radius: 0 1em 1em 0; */
}

.panel-edge-visual--next {
    right: 5px;
    /* border-radius: 1em 0 0 1em; */
}

.panel-edge-visual__chevron {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 99, 152, 1);
    opacity: 0.25;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.panel-edge-visual:hover:not([disabled]) .panel-edge-visual__chevron {
    opacity: 1 !important;
}

.panel-edge-visual__chevron--prev {
    clip-path: polygon(100% 100%,
            50% 50%,
            100% 0%,
            50% 0%,
            0% 50%,
            50% 100%,
            100% 100%);
}

.panel-edge-visual__chevron--next {
    clip-path: polygon(0% 100%,
            50% 50%,
            0% 0%,
            50% 0%,
            100% 50%,
            50% 100%,
            0% 100%);
    transform: translateX(0);
}

.panel-edge-visual__chevron--next.second-chevron {
    transform: translateX(-100%);
    opacity: 1;
}

.arrowFlow .panel-edge-visual__chevron--next {
    animation: wiggleChevron 0.6s ease-in-out 0s 1 forwards;
}

.arrowFlow .panel-edge-visual__chevron--next.second-chevron {
    display: none;
}

@keyframes wiggleChevron {
    0% {
        transform: translateX(0);
        opacity: 0.25;
    }
    12.5%{
        transform: translateX(-10%);
    }
    37.5% {
        transform: translateX(10%);
        opacity: 1;
    }
    62.5%{
        transform: translateX(-10%);
        opacity: 1;
    }
    87.5% {
        transform: translateX(10%);
    }
    100% {
        transform: translateX(0%);
        opacity: 0.25;
    }
}

/* .arrowFlow .panel-edge-visual__chevron--next {
    animation: slideChevron 0.3s ease-in-out 0s 2 forwards;
}

.arrowFlow .panel-edge-visual__chevron--next.second-chevron {
    animation: slideChevronClone 0.3s linear 0s 2 forwards;
}

@keyframes slideChevron {
    0% {
        transform: translateX(0);
    }
    49.9%{
        transform: translateX(100%);
    }
    50% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(0%);
    }
}

@keyframes slideChevronClone {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
} */

.panel-edge-visual:hover:not([disabled]) {
    /* background: rgba(12, 99, 152, 0.28); */
}

.panel-edge-visual:focus-visible {
    outline: 2px solid #939393;
    outline-offset: 4px;
}

.panel-edge-visual--prev:hover:not([disabled]) .panel-edge-visual__chevron {
    /* transform: rotate(-90deg) scale(1.08); */
}

.panel-edge-visual--next:hover:not([disabled]) .panel-edge-visual__chevron {
    /* transform: rotate(90deg) scale(1.08); */
}

.panel-edge-visual[disabled] {
    opacity: 0;
    pointer-events: none;
}

.printables-intro {
    margin-bottom: 1.75rem;
    font-size: 1.05rem;
}

.printables-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.printable-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    box-shadow: 0 10px 26px rgba(11, 40, 74, 0.12);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.05rem;
}

.printable-card h3 {
    margin: 0;
    font-size: 1.35rem;
}

.printable-media {
    width: 100%;
    aspect-ratio: 8.5 / 11;
    border-radius: 14px;
    overflow: hidden;
    background: #f5f7fb;
    box-shadow: inset 0 0 0 1px rgba(15, 52, 90, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.printable-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.printable-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.printable-notes {
    font-size: 0.97rem;
    color: #253347;
    line-height: 1.55;
}

@media (max-width: 1024px) {
    .printables-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.org-logos {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.75rem;
    margin: 1.75rem 0;
    align-items: center;
    justify-items: center;
}

.org-logo {
    display: block;
    width: 100%;
    max-width: 250px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    /* box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); */
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.org-logo img {
    display: block;
    width: 100%;
    height: auto;
}

.org-logo:hover,
.org-logo:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(12, 99, 152, 0.25);
}

@media (max-width: 900px) {
    .org-logos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .org-logos {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

form {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 252, 0.95));
    padding: 0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-sizing: border-box;
    flex: 1 1 auto;
}

label {
    display: block;
    margin-top: 0.75rem;
}

input,
textarea,
form textarea {
    height: 2.3em
}

.signature-canvas {
    width: 100%;
    height: 150px;
    border: 1px solid #777;
    display: block;
    margin-top: 5px;
    border-radius: 2px;
    background: #fff;
    box-sizing: border-box;
}

button#sign_pledge {
    background: #0c6398;
}

button#clear_sig {
    background: #575757;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65em 1.2em;
    width: 100%;
    border-radius: 6px;
    border: none;
    margin-top: 0.6em;
    transition: background 0.2s ease, transform 0.15s ease;
}

.primary-button,
button#sign_pledge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.65em 1.2em;
    border-radius: 6px;
    background: #0c6398;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    margin-top: 0.6em;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.2s ease, transform 0.15s ease;
}

.primary-button:visited {
    color: #fff;
}

.primary-button:hover,
button#sign_pledge:hover:not(.btn-disabled) {
    background: #0f88d3;
    text-decoration: none;
}

button#clear_sig:hover {
    background: #6d6d6d;
}

button.panel-edge:hover:not(.btn-disabled) {
    background: rgba(236, 243, 253, 0.218);
}

button.btn-disabled {
    background: #b3b3b3;
    cursor: not-allowed;
    opacity: 0.7;
}

.primary-button:focus-visible,
button#sign_pledge:focus-visible {
    outline: 2px solid #aed4ff;
    outline-offset: 2px;
}


.status {
    text-align: center;
    margin-top: 0.5em;
    font-weight: bold;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.status.hidden {
    display: none;
}

.status.is-hidden {
    opacity: 0;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.form-actions button {
    flex: 1 1 140px;
}

.form-actions .primary-button {
    flex: 1 1 140px;
}

.form-status {
    margin-top: 0.5em;
    font-weight: bold;
    text-align: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    min-height: 1.2em;
    color: #222;
}

.form-status.is-visible {
    opacity: 1;
}

.form-status.is-info {
    color: #222;
}

.form-status.is-success {
    color: #0c6398;
}

.form-status.is-error {
    color: #c0392b;
}

#districtMapBox .openClose {
    color: rgb(0, 0, 154);
    text-decoration: underline;
    cursor: pointer;
    margin-bottom: 0.75em;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    display: inline;
}

#visibleMapBox {
    opacity: 0;
    width: 100%;
    height: 0;
    position: relative;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    transition: opacity 0.3s ease;
    flex: 0 0 auto;
}

#hiddenMapBox {
    opacity: 0.0;
    width: 700px;
    height: 450px;
    position: absolute;
    z-index: 0;
}

#visibleMapBox iframe {
    pointer-events: none;
}

#visibleMapBox.active {
    pointer-events: auto;
}

#visibleMapBox.active iframe {
    pointer-events: auto;
}

#visibleMapBox iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.app-footer {
    background: #1f2933;
    color: #fff;
    padding: 0.8rem 1.2rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    margin-top: auto;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-status {
    min-width: 160px;
}

.footer-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-nav a {
    color: #99ccff;
    text-decoration: none;
    font-weight: 500;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.required {
    color: red;
}

.rightJustified {
    text-align: right;
}

/* Optional signature line overlay (toggle via JS) */
.signature-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: none;
}

.sig-line {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    pointer-events: none;
    display: none;
    /* Hidden by default, JS can toggle it */
    width: calc(100% - 20px);
    max-width: 70%;
    color: #c5ccd8;
}



@media (max-width: 1200px) {
    .panel-scroller {
        --panel-width: min(680px, 88vw);
    }
}

@media (max-width: 900px) {
    .panel-scroller {
        --panel-width: calc(100vw - clamp(0px, 10vw, 80px));
        /* gap: 1.25rem; */
        padding: 0 clamp(0px, 7vw, 40px);
        scroll-padding-inline: clamp(0px, 7vw, 40px);
    }

    .panel-edge {
        width: clamp(4px, 7vw, 44px);
    }

    .panel-edge-visual {
        /* width: clamp(4px, 7vw, 44px); */
    }
}

@media (max-width: 700px) {
    .app-main {
        padding: 0.5rem 0;
    }

    .panel-scroller {
        --panel-width: calc(100vw - clamp(0px, 12vw, 48px));
        padding: 0 clamp(0px, 8vw, 32px);
        /* gap: 0.75rem; */
        scroll-padding-inline: clamp(0px, 8vw, 32px);
    }

    .panel {
        min-height: calc(100vh - 210px);
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-nav {
        width: 100%;
        justify-content: space-between;
    }
}

.callout {
    font-weight: bold;
    font-size: 1.1rem;
    /* margin-bottom: 1rem; */
    color: #911;
    margin: 0;
}

.panel--pledge .panel-inner {
    justify-content: space-between;
}

.panel--pledge .panel-inner p,
.panel--parters .panel-inner p {
    font-size: 1.1rem;
    margin: 0.5em 0;
}

.panel--pledge .panel-inner p:last-of-type {
    margin-bottom: 1em;
}

.panel--pledge .panel-inner p.intro-text {
    font-weight: bold;
    font-size: 1.25rem;
}

.panel--pledge .panel-inner hr {
    border: none;
    border-top: 2px solid #ccc;
    margin: 1rem auto;
}

/* Pledge text icon and layout */
.pledge-text-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-align: center;
    margin-top: 1rem;
    padding: 0 1em;
}

.check-icon {
    width: 3rem;
    aspect-ratio: 1 / 1;
    margin-bottom: 1rem;
    color: #38b665;
    flex-shrink: 0;
}

.panel--pledge .panel-inner .pledgeText {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    margin-top: 0;
    text-align: left;
}

#petition-form input[type="text"],
#petition-form input[type="email"],
#petition-form textarea {
    padding: 1px 0.5em;
}

#signature {
    font-family: "Brush Script MT", cursive;
    font-size: 1.5rem;
    text-align: left;
    line-height: 2.3em;
    vertical-align: middle;
    padding: 0 0.5em;
    box-sizing: border-box;
    color: darkblue
}

#signature::placeholder {
    font-family: Arial, sans-serif;
    font-size: 1rem;
    color: #999;
    font-style: normal;
}


input,
#pledgeText,
#pledgeTextMobile,
.pledgeText {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: left;
}

.nomargin {
    margin: 0 !important;
}

.centered {
    text-align: center !important;
    margin: auto !important;
}

.checkbox-option {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    line-height: 1.4;
}

.checkbox-option input[type="checkbox"] {
    width: auto;
    height: 1.1rem;
    flex: 0 0 auto;
    margin: 0;
}

.flyer-text {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.flyer-text h3 {
    margin: 0;
    font-size: 1.15rem;
}

.flyer-points {
    list-style: disc;
    padding-left: 1.2rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    line-height: 1.3em;
}

.flyer-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.flyer-thumbnail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: min(220px, 65%);
    margin-bottom: 1em;
}

.flyer-thumbnail:hover {
    text-decoration: none;
}

#VAB_flyer {
    width: 100%;
    margin: 0 auto;
    border: solid 1px lightgray;
    border-radius: 4px;
}

.flyer-dl-btn {
    margin-bottom: 2rem;
}

/* Share Drawer */
.share-section {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.35rem 0 0.45rem;
}

.share-header {
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-toggle {
    background: none;
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
}

.share-toggle:hover,
.share-toggle:focus-visible {
    /* background: rgba(255,255,255,0.16); */
    outline: none;
}

.share-toggle-icon {
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.share-section:not(.is-collapsible) .share-toggle {
    cursor: default;
    background: none;
}

.share-section:not(.is-collapsible) .share-toggle:hover,
.share-section:not(.is-collapsible) .share-toggle:focus-visible {
    background: none;
}

.share-section:not(.is-collapsible) .share-toggle-icon {
    display: none;
}

.share-buttons {
    width: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    overflow: hidden;
    max-height: 260px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 0.4rem;
    padding-bottom: 0.35rem;
    pointer-events: auto;
    transition: max-height 0.35s ease, opacity 0.3s ease, transform 0.35s ease, margin 0.35s ease, padding 0.35s ease;
}

.share-section.is-collapsed .share-buttons {
    max-height: 0;
    opacity: 0;
    transform: translateY(12px);
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.share-section.is-collapsed #copy-feedback {
    display: none !important;
}

#copy-feedback {
    margin: 0;
    font-size: 0.9rem;
}

.share-btn {
    background: #555;
    color: #fff;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 2em;
    transition: background 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3em;
    font-size: 1rem;
    box-sizing: border-box;
    border: 1px solid transparent;
}

.share-btn svg {
    display: inline-block;
    vertical-align: middle;
    color: inherit;
    fill: currentColor;
}

.share-btn:hover,
.share-btn:focus {
    background: #666;
    border: 1px solid #888;
}

.bigScreens {
    display: block;
}

.smallScreens {
    display: none;
}

hr {
    width: 90%;
}

.hidden {
    display: none;
}

@media (max-width: 640px) {
    .panel {
        padding: 0.5rem;
    }

    .panel--pledge .panel-inner p {
        margin-bottom: 0;
    }

    .panel--pledge .panel-inner>p:last-of-tyoe {
        margin-bottom: 1em;
    }

    .panel--pledge .panel-inner p.intro-text {
        font-size: 1.1rem;
    }

    .share-section {
        flex-direction: column;
        align-items: center;
        gap: 0.3rem;
        padding: 0;
    }

    .share-toggle {
        padding: 0;
    }

    .share-label-text {
        padding: 0.25rem 0;
    }

    .footer-inner {
        display: block;
    }

    .share-buttons {
        width: 100%;
    }

    .bigScreens {
        display: none;
    }

    .smallScreens {
        display: block;
    }
}
