/*
 * Morocco Travel Experts Suite — front-end foundation
 *
 * This file contains only shared tokens and small cross-page primitives.
 * Feature-specific components stay with their owning module until they are
 * migrated deliberately. Keep selectors scoped so this plugin remains safe
 * alongside the active WordPress theme and page builder.
 */

:root {
    --mte-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mte-color-ink: #161616;
    --mte-color-ink-soft: #393939;
    --mte-color-muted: #525252;
    --mte-color-paper: #ffffff;
    --mte-color-surface: #f4f4f4;
    --mte-color-warm: #fcf8f5;
    --mte-color-border: #e0e0e0;
    --mte-color-border-soft: #f4f4f4;
    --mte-color-brand: #d04d00;
    --mte-color-brand-dark: #b23b00;
    --mte-color-brand-soft: #fff4ec;
    --mte-color-accent: #ffbd21;
    --mte-color-accent-hover: #e9aa16;
    --mte-radius-sm: 2px;
    --mte-radius-md: 8px;
    --mte-radius-pill: 999px;
    --mte-shadow-soft: 0 4px 16px rgba(0, 0, 0, .08);
    --mte-content-width: 1200px;
}

/* Shared cross-page primitives. Keep one source of truth for repeated UI. */
:is(.mte-v2-tour-card__body, .mte-simple-activity-card__body, .mte-tour-card .mte-cc-body) {
    background-image: url("../zellige-light.svg") !important;
    background-size: 96px 96px;
}

.mte-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mte-filter-label {
    color: var(--mte-color-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

/* Shared tour-card treatment. Keep this class on tour cards only so city,
 * hotel, editorial, and admin cards can keep their own surfaces. */
.mte-tour-card {
    background: #eef0f2 !important;
    border-color: #d9dde0;
}

.mte-tour-card:hover {
    background: #f4f5f5 !important;
    border-color: var(--mte-color-brand);
}

.mte-tour-card .mte-cc-location > i,
.mte-tour-card .mte-cc-meta > i,
.mte-tour-card .mte-citywk-tcard-meta > i {
    display: inline-flex;
    width: 1.15em;
    min-width: 1.15em;
    align-items: center;
    justify-content: center;
    color: var(--mte-color-brand);
    font-size: 18px;
    line-height: 1;
}

.mte-hero-reviews {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 40px;
    margin-bottom: 28px;
}

.mte-hero-review {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    cursor: default;
}

.mte-hero-stars {
    display: inline-flex;
    gap: 2px;
    line-height: 0;
}

.mte-hero-stars .mte-star3d {
    display: block;
    width: 18px;
    height: 18px;
}

.mte-hero-review-q {
    color: var(--mte-color-ink-soft);
    font-size: 14px;
    font-style: italic;
    font-weight: 700;
}

.mte-hero-review-p {
    color: var(--mte-color-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.mte-handwritten {
    position: relative;
    display: inline-block;
    color: var(--mte-color-brand);
}

.mte-handwritten svg {
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 10px;
    pointer-events: none;
}

.mte-handwritten path {
    stroke: currentColor;
    stroke-width: 4;
    fill: none;
    stroke-linecap: round;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: mte-draw-line 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes mte-draw-line {
    to { stroke-dashoffset: 0; }
}

@media (max-width: 560px) {
    .mte-hero-reviews {
        flex-wrap: nowrap;
        gap: 10px 14px;
    }

    .mte-hero-review {
        flex: 1 1 0;
        min-width: 0;
        gap: 3px;
    }

    .mte-hero-stars { gap: 1px; }
    .mte-hero-stars .mte-star3d { width: 13px; height: 13px; }
    .mte-hero-review-q { font-size: 11px; }
    .mte-hero-review-p { font-size: 9px; letter-spacing: 1px; }
}

@media (max-width: 380px) {
    .mte-hero-review-q { display: none; }
    .mte-hero-stars .mte-star3d { width: 12px; height: 12px; }
}

/* 404 landing page ------------------------------------------------------- */
.mte-404-page,
.mte-404-page * {
    box-sizing: border-box;
}

.mte-404-page {
    --mte-404-paper: var(--mte-color-paper);
    --mte-404-soft: var(--mte-color-surface);
    --mte-404-warm: var(--mte-color-warm);
    --mte-404-ink: var(--mte-color-ink);
    --mte-404-muted: var(--mte-color-muted);
    --mte-404-brand: var(--mte-color-brand);
    --mte-404-accent: var(--mte-color-accent);
    --mte-404-border: var(--mte-color-border);
    background: var(--mte-404-paper);
    color: var(--mte-404-ink);
    font-family: var(--mte-font-sans);
    line-height: 1.5;
    overflow: hidden;
}

.mte-404-page a {
    color: inherit;
}

.mte-404-shell {
    width: min(var(--mte-content-width), calc(100% - 48px));
    margin: 0 auto;
}

.mte-404-hero {
    border-bottom: 1px solid var(--mte-404-border);
    background: var(--mte-404-paper);
}

.mte-404-hero__grid {
    padding: clamp(72px, 10vw, 140px) 0;
}

.mte-404-hero__copy {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.mte-404-hero h1 {
    max-width: 760px;
    margin: 0;
    color: var(--mte-404-ink);
    font-size: clamp(42px, 5.8vw, 76px);
    font-weight: 800;
    letter-spacing: -.045em;
    line-height: 1.02;
}

.mte-404-hero__lead {
    max-width: 570px;
    margin: 24px auto 0;
    color: var(--mte-404-muted);
    font-size: clamp(16px, 1.7vw, 19px);
    line-height: 1.65;
}

.mte-404-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    justify-content: center;
}

.mte-404-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: var(--mte-radius-pill);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}

.mte-404-button--primary {
    background: var(--mte-404-accent);
    color: var(--mte-404-ink) !important;
}

.mte-404-button--primary:hover {
    background: var(--mte-color-accent-hover);
    transform: translateY(-2px);
}

.mte-404-button--secondary {
    border-color: var(--mte-404-border);
    background: var(--mte-404-paper);
    color: var(--mte-404-ink) !important;
}

.mte-404-button--secondary:hover {
    border-color: var(--mte-404-brand);
    color: var(--mte-404-brand) !important;
}

.mte-404-section {
    padding: clamp(64px, 8vw, 104px) 0;
}

.mte-404-section--reviews {
    background: var(--mte-404-paper);
}

.mte-404-section--warm {
    background: var(--mte-404-warm);
}

.mte-404-section-head {
    max-width: 680px;
    margin-bottom: 36px;
}

.mte-404-section-head--center {
    max-width: 900px;
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

.mte-404-section-head h2 {
    margin: 0;
    color: var(--mte-404-ink);
    font-size: clamp(30px, 4vw, 48px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.08;
}

.mte-404-section-head p {
    max-width: 600px;
    margin: 14px 0 0;
    color: var(--mte-404-muted);
    font-size: 16px;
    line-height: 1.65;
}

.mte-404-review-grid,
.mte-404-tour-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.mte-404-review-card {
    display: flex;
    min-height: 268px;
    flex-direction: column;
    padding: 28px 30px 24px;
    border: 1px solid #cfcfcf;
    border-radius: 12px;
    background: var(--mte-404-soft);
}

.mte-404-review-card__topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(22, 22, 22, .12);
}

.mte-404-review-card__label {
    color: var(--mte-404-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.mte-404-stars {
    color: var(--mte-404-accent);
    font-size: 14px;
    letter-spacing: .1em;
}

.mte-404-review-card__quote {
    flex: 1;
    margin: 22px 0 20px;
    color: var(--mte-404-muted);
    font-size: 15px;
    line-height: 1.55;
}

.mte-404-review-card__link {
    align-self: flex-start;
    color: var(--mte-404-brand);
    font-size: 13px;
    font-weight: 800;
    text-decoration: underline;
    text-decoration-color: rgba(208, 77, 0, .45);
    text-underline-offset: 4px;
}

.mte-404-review-card__link:hover {
    color: var(--mte-404-ink);
}

.mte-404-tour-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--mte-404-border);
    border-radius: 8px;
    background: var(--mte-404-paper);
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.mte-404-tour-card:hover {
    border-color: var(--mte-404-accent);
    box-shadow: 0 16px 32px rgba(22, 22, 22, .12);
    transform: translateY(-4px);
}

.mte-404-tour-card__tag {
    align-self: flex-start;
    padding: 6px 9px;
    border-radius: var(--mte-radius-pill);
    background: var(--mte-404-accent);
    color: var(--mte-404-ink);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.mte-404-tour-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 28px;
}

.mte-404-tour-card__meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 16px 0 12px;
    color: var(--mte-404-brand);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.mte-404-tour-card h3 {
    margin: 0;
    color: var(--mte-404-ink);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.25;
}

.mte-404-tour-card__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 24px;
    color: var(--mte-404-ink);
    font-size: 13px;
    font-weight: 800;
}

.mte-404-endcap {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.mte-404-endcap h2 {
    margin: 0;
    color: var(--mte-404-ink);
    font-size: clamp(30px, 4vw, 50px);
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1.08;
}

.mte-404-endcap p {
    margin: 16px auto 0;
    color: var(--mte-404-muted);
    font-size: 16px;
    line-height: 1.65;
}

.mte-404-endcap .mte-404-actions {
    justify-content: center;
}

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

@media (max-width: 680px) {
    .mte-404-shell {
        width: min(100% - 32px, var(--mte-content-width));
    }

    .mte-404-hero__grid {
        padding: 72px 0;
    }

    .mte-404-hero h1 {
        font-size: clamp(38px, 12vw, 58px);
    }

    .mte-404-review-grid,
    .mte-404-tour-grid {
        grid-template-columns: 1fr;
    }

    .mte-404-section {
        padding: 60px 0;
    }

    .mte-404-review-card {
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mte-404-page * {
        transition: none;
    }
}
