@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
    html {
        font-family: Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        'Helvetica Neue',
        Arial,
        'Noto Sans',
        sans-serif,
        'Apple Color Emoji',
        'Segoe UI Emoji',
        'Segoe UI Symbol',
        'Noto Color Emoji';
    }
}

@layer components {
    .desktop-h1 {
        font-family: Inter;
        font-size: 48px;
        line-height: 56.16px;
        letter-spacing: 0.005em;
        text-align: left;
        text-underline-position: from-font;
        text-decoration-skip-ink: none;
    }

    .mobile-caption {
        font-family: Inter;
        font-size: 12px;
        font-weight: 700;
        line-height: 18px;
        text-underline-position: from-font;
        text-decoration-skip-ink: none;
    }

    .mobile-h4 {
        font-size: 20px;
        font-weight: 600;
        line-height: 28px;
        text-underline-position: from-font;
        text-decoration-skip-ink: none;
    }

    .mobile-h6 {
        font-size: 16px;
        font-weight: 500;
        line-height: 24px;
        text-align: left;
        text-underline-position: from-font;
        text-decoration-skip-ink: none;
    }

    .h6 {
        font-size: 32px;
        font-weight: 600;
        line-height: 44.8px;
        text-align: left;
        text-underline-position: from-font;
        text-decoration-skip-ink: none;
    }

    .desktop-h4 {
        font-family: Inter;
        font-size: 28px;
        line-height: 36.12px;
        text-align: left;
        text-underline-position: from-font;
        text-decoration-skip-ink: none;
    }

    .desktop-h6 {
        font-family: Inter;
        font-size: 20px;
        font-weight: 500;
        line-height: 28px;
        text-align: center;
        text-underline-position: from-font;
        text-decoration-skip-ink: none;
    }

    .desktop-body-large {
        font-family: Inter;
        font-size: 16px;
        font-weight: 400;
        line-height: 24.96px;
        text-align: center;
        text-underline-position: from-font;
        text-decoration-skip-ink: none;
    }

    .mobile-body-regular {
        font-family: Inter;
        font-size: 14px;
        font-weight: 400;
        line-height: 21.98px;
        text-align: center;
        text-underline-position: from-font;
        text-decoration-skip-ink: none;
    }

    .mobile-subtitle {
        font-family: Inter;
        font-size: 14px;
        font-weight: 600;
        line-height: 21.98px;
        text-align: center;
        text-underline-position: from-font;
        text-decoration-skip-ink: none;
    }

    .mobile-overline {
        @apply text-xs;
        @layer mobile-overline-font;
        /*  TODO: Use tailwind for this? */
        /*font-size: 10px;*/
        font-weight: 400;
        color: #adadad;
        line-height: 15px;
        letter-spacing: 0.015em;
        text-align: left;
        text-underline-position: from-font;
        text-decoration-skip-ink: none;
    }
}

@layer components {
    /*
     * Tailwind's Preflight strips list markers, heading sizes and blockquote
     * spacing. That is harmless for the app's own markup, which restyles
     * everything with utilities, but the rich editor's output is injected
     * verbatim and carries no classes of its own. Restore the tags its toolbar
     * can emit. The publication emails render correctly without this because
     * they ship their own stylesheet and never load Preflight.
     */
    .rich-text > :first-child {
        @apply mt-0;
    }

    .rich-text > :last-child {
        @apply mb-0;
    }

    .rich-text p {
        @apply my-2;
    }

    .rich-text ul,
    .rich-text ol {
        @apply my-2 pl-6;
    }

    .rich-text ul {
        @apply list-disc;
    }

    .rich-text ol {
        @apply list-decimal;
    }

    .rich-text ul ul {
        list-style-type: circle;
    }

    .rich-text ol ol {
        list-style-type: lower-alpha;
    }

    .rich-text li {
        @apply my-1;
    }

    .rich-text h2 {
        @apply mb-2 mt-4 text-xl font-semibold;
    }

    .rich-text h3 {
        @apply mb-2 mt-3 text-lg font-semibold;
    }

    .rich-text blockquote {
        @apply my-3 border-l-4 border-gray-200 pl-4 italic dark:border-gray-700;
    }

    .rich-text pre {
        @apply my-3 overflow-x-auto rounded bg-gray-100 p-3 text-sm dark:bg-gray-800;
    }
}

.fade-out {
    animation: fadeOut 0.5s forwards;
}

.custom-map-control-button {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    padding: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.custom-map-control-button:hover {
    background-color: #f5f5f5;
}

.custom-map-control-button:active {
    background-color: #eee;
}

.custom-map-control-button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.dark .custom-map-control-button {
    background-color: #111827;
    border-color: #374151;
    color: #e5e7eb;
}
