/* WordPress and reusable AJAX form integration. */
:root {
    --theme-red: #f10100;
    --theme-red-deep: #b90201;
    --theme-ink: #171717;
    --theme-copy: #5d5d5d;
    --theme-surface: #f7f7f5;
    --theme-warm: #fffaf5;
    --theme-line: #e8e8e4;
    --theme-radius: 7px;
}

::selection {
    color: #fff;
    background: var(--theme-red);
}

:focus-visible {
    outline: 3px solid rgba(241, 1, 0, 0.35);
    outline-offset: 3px;
}

html {
    scrollbar-color: var(--theme-red) var(--theme-surface);
    scrollbar-width: thin;
}

body {
    accent-color: var(--theme-red);
}

/* Form card and responsive field grid. */
.theme-form-shell {
    width: 100%;
    padding: clamp(24px, 4vw, 42px);
    color: var(--theme-ink);
    background: #fff;
    border-radius: var(--theme-radius);
    box-shadow: 0 12px 36px rgba(17, 24, 39, 0.1);
}

.theme-form-shell h2 {
    margin: 0 0 12px;
    font-family: "Metromedium", "Roboto", sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.08;
}

.theme-form-intro {
    max-width: 68ch;
    margin: 0 0 28px;
    color: var(--theme-copy);
}

.theme-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.theme-form-field--full {
    grid-column: 1 / -1;
}

.theme-form-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.86rem;
    font-weight: 800;
}

.theme-form-field input,
.theme-form-field select,
.theme-form-field textarea {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    color: var(--theme-ink);
    background: #fff;
    border: 1px solid #cacac5;
    border-radius: var(--theme-radius);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.theme-form-field textarea {
    min-height: 140px;
    resize: vertical;
}

.theme-form-field input:focus,
.theme-form-field select:focus,
.theme-form-field textarea:focus {
    border-color: var(--theme-red);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(241, 1, 0, 0.12);
}

.theme-form-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 24px;
}

.theme-form-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 24px;
    color: #fff;
    font-size: 0.84rem;
    font-weight: 900;
    text-transform: uppercase;
    background: var(--theme-red);
    border: 0;
    border-radius: var(--theme-radius);
    transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.theme-form-submit:hover,
.theme-form-submit:focus-visible {
    color: #fff;
    background: var(--theme-red-deep);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(185, 2, 1, 0.2);
}

.theme-form-submit:disabled {
    cursor: wait;
    opacity: 0.65;
    transform: none;
}

.theme-form-privacy {
    margin: 0;
    color: var(--theme-copy);
    font-size: 0.82rem;
}

/* Form status uses a full outline and icon so state is never conveyed by color alone. */
.theme-form-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
    padding: 14px 16px;
    background: var(--theme-surface);
    border: 1px solid var(--theme-line);
    border-radius: var(--theme-radius);
}

.theme-form-status[hidden] {
    display: none;
}

.theme-form-status-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.theme-form-status.is-sending .theme-form-status-icon {
    border-right-color: transparent;
    animation: theme-form-spin 700ms linear infinite;
}

.theme-form-status.is-success {
    color: #155724;
    background: #f3fbf5;
    border-color: #84c996;
}

.theme-form-status.is-error {
    color: #8a1010;
    background: #fff5f5;
    border-color: #dc8a8a;
}

.theme-form-trap {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    white-space: nowrap !important;
}

/* WordPress menu fallbacks and conventional nested mobile navigation. */
.csp-standard-submenu {
    position: absolute;
    z-index: 40;
    top: 100%;
    left: 0;
    min-width: 260px;
    margin: 0;
    padding: 12px;
    list-style: none;
    visibility: hidden;
    opacity: 0;
    background: #fff;
    border-radius: var(--theme-radius);
    box-shadow: 0 28px 80px rgba(9, 16, 21, 0.24);
    transform: translateY(8px);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.csp-menu-item:hover > .csp-standard-submenu,
.csp-menu-item:focus-within > .csp-standard-submenu,
.csp-menu-item.is-menu-open > .csp-standard-submenu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Desktop custom panels replace, rather than duplicate, the ordinary submenu. */
@media (min-width: 992px) {
    .csp-main-menu > .has-theme-mega-panel > .csp-standard-submenu {
        display: none;
    }
}

.csp-standard-submenu a {
    display: block;
    padding: 10px 12px;
    color: var(--theme-ink);
    text-decoration: none;
    border-radius: var(--theme-radius);
}

.csp-standard-submenu a:hover,
.csp-standard-submenu a:focus-visible {
    color: var(--theme-red);
    background: var(--theme-surface);
}

/* Utility and footer WordPress menu resets. */
.csp-utility-menu,
.ps-footer-social-menu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.csp-utility-menu {
    display: flex;
    align-items: center;
    gap: 1.35rem;
}

/* Footer social navigation remains a real WordPress menu. */
.ps-footer-social-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.ps-footer-social-menu a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 8px 12px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--theme-radius);
}

.ps-footer-social-menu a:hover,
.ps-footer-social-menu a:focus-visible {
    color: #fff;
    background: var(--theme-red);
    border-color: var(--theme-red);
}

/* Generic archives, single views and not-found page. */
.theme-loop-hero,
.theme-not-found {
    padding: clamp(72px, 10vw, 132px) 0;
    color: #fff;
    background: var(--theme-ink);
}

.theme-loop-hero h1,
.theme-not-found h1,
.theme-single h1 {
    font-family: "Metromedium", "Roboto", sans-serif;
    font-size: clamp(2.3rem, 6vw, 4.8rem);
    line-height: 1.04;
}

.theme-loop-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    padding-top: 72px;
    padding-bottom: 48px;
}

.theme-loop-card {
    overflow: hidden;
    background: #fff;
    border-radius: var(--theme-radius);
    box-shadow: 0 4px 18px rgba(17, 24, 39, 0.06);
}

.theme-loop-card-media,
.theme-loop-card-media img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.theme-loop-card-copy {
    padding: 24px;
}

.theme-loop-card-copy h2 {
    font-family: "Metromedium", "Roboto", sans-serif;
    font-size: 1.5rem;
}

.theme-loop-card-copy h2 a,
.theme-loop-card-link {
    color: var(--theme-ink);
    text-decoration: none;
}

.theme-loop-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--theme-red-deep);
    font-weight: 900;
}

.theme-pagination {
    padding-bottom: 72px;
}

.theme-single {
    padding: 64px 0 96px;
}

.theme-single article {
    max-width: 900px;
    margin: 0 auto;
}

.theme-single-hero img {
    width: 100%;
    height: auto;
    border-radius: var(--theme-radius);
}

/* ACF-driven tour details introduced by the WordPress conversion. */
.tour-facts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 28px 0;
}

.tour-facts-grid > div {
    padding: 16px;
    background: var(--theme-surface);
    border-radius: var(--theme-radius);
}

.tour-facts-grid dt {
    margin-bottom: 5px;
    color: var(--theme-copy);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.tour-facts-grid dd {
    margin: 0;
    font-weight: 800;
}

.tour-editor-columns ul {
    columns: 2;
    column-gap: 32px;
}

.tour-photo-grid,
.tour-extend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.tour-photo-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--theme-radius);
}

/* Tour lodging slider: restore the source card and let Bootstrap own the two-column row. */
.tour-itinerary-main > .tour-lodging-card {
    padding: clamp(1.75rem, 2.5vw, 2.5rem);
    background: #fff;
    border: 1px solid #e8e8e4;
    border-radius: var(--theme-radius);
}

.tour-lodging-grid {
    display: flex;
    grid-template-columns: none;
    gap: 0;
}

.tour-lodging-tab:focus-visible {
    outline: 3px solid rgba(241, 1, 0, 0.5);
    outline-offset: 2px;
}

@keyframes theme-form-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 767.98px) {
    .theme-form-grid {
        grid-template-columns: 1fr;
    }

    .theme-form-field--full,
    .theme-form-field--half {
        grid-column: 1;
    }

    .theme-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .theme-form-submit {
        width: 100%;
    }

    .theme-loop-grid,
    .tour-photo-grid,
    .tour-extend-grid,
    .tour-facts-grid {
        grid-template-columns: 1fr;
    }

    .tour-editor-columns ul {
        columns: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .theme-form-submit,
    .theme-form-field input,
    .theme-form-field select,
    .theme-form-field textarea,
    .csp-standard-submenu {
        scroll-behavior: auto;
        transition: none;
    }
}
