/* ==========================================================================
   FILAMENT 3 - RICH EDITOR CONTENT - EDITORIAL (CLEAN)
   ========================================================================== */

.filament-rich-editor-content {
    --re-font-body: "Source Sans 3", "Noto Sans", "Open Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --re-font-head: "Oswald", "Montserrat", "Raleway", "PT Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --re-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    --re-text: #0f172a;
    --re-body: #1f2937;
    --re-muted: #475569;
    --re-soft: #64748b;
    --re-border: rgba(15, 23, 42, 0.10);
    --re-border-soft: rgba(15, 23, 42, 0.06);

    --re-accent: #3061AF;
    --re-accent-rgb: 48, 97, 175;

    font-family: var(--re-font-body) !important;
    font-size: 1rem;
    line-height: 1.85;
    letter-spacing: -0.003em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    color: var(--re-body);
    background: transparent;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.dark .filament-rich-editor-content,
[data-theme="dark"] .filament-rich-editor-content {
    --re-text: #e5e7eb;
    --re-body: #cbd5e1;
    --re-muted: #94a3b8;
    --re-soft: #94a3b8;
    --re-border: rgba(148, 163, 184, 0.18);
    --re-border-soft: rgba(148, 163, 184, 0.12);

    --re-accent: #8FAEE0;
    --re-accent-rgb: 143, 174, 224;
}

.filament-rich-editor-content > :first-child { margin-top: 0 !important; }
.filament-rich-editor-content > :last-child  { margin-bottom: 0 !important; }

/* Text */
.filament-rich-editor-content p {
    margin: 0.95rem 0;
    color: var(--re-body);
    line-height: inherit;
}

.filament-rich-editor-content > p:first-of-type {
    font-size: 1.05rem;
    color: var(--re-muted);
}

.filament-rich-editor-content :where(p, li) {
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    line-height: inherit;
}

.filament-rich-editor-content strong,
.filament-rich-editor-content b {
    font-weight: 800;
    color: var(--re-text);
}

.filament-rich-editor-content em,
.filament-rich-editor-content i {
    font-style: italic;
    color: var(--re-body);
}

.filament-rich-editor-content small {
    color: var(--re-soft);
}

/* Links */
.filament-rich-editor-content a {
    color: var(--re-accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--re-accent-rgb), 0.30);
    padding-bottom: 1px;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.filament-rich-editor-content a:hover {
    border-bottom-color: rgba(var(--re-accent-rgb), 0.65);
    background: rgba(var(--re-accent-rgb), 0.06);
}

/* Headings */
.filament-rich-editor-content h1,
.filament-rich-editor-content h2,
.filament-rich-editor-content h3,
.filament-rich-editor-content h4,
.filament-rich-editor-content h5,
.filament-rich-editor-content h6 {
    margin: 2.2rem 0 0.85rem;
    line-height: 1.12;
    letter-spacing: 0.02em;
    color: var(--re-text);
    font-weight: 600;
    font-family: var(--re-font-head) !important;
    text-transform: none !important;
    scroll-margin-top: 6rem;
    text-decoration: none !important;
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
}

.filament-rich-editor-content h1 *,
.filament-rich-editor-content h3 *,
.filament-rich-editor-content h4 *,
.filament-rich-editor-content h5 *,
.filament-rich-editor-content h6 * {
    text-transform: none !important;
}

.filament-rich-editor-content h2,
.filament-rich-editor-content h2 * {
    text-transform: none !important;
}

.filament-rich-editor-content h1 {
    font-size: clamp(2rem, 3vw, 2.8rem);
    letter-spacing: 0.03em;
    text-wrap: balance;
}

.filament-rich-editor-content h2 {
    font-size: clamp(1.9rem, 2.9vw, 2.6rem) !important;
    letter-spacing: 0.03em;
    text-wrap: balance;
    font-weight: 600;
}

.filament-rich-editor-content h3 {
    font-size: clamp(1.2rem, 1.7vw, 1.55rem) !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: color-mix(in srgb, var(--re-text) 88%, var(--re-muted));
    text-wrap: balance;
}

.filament-rich-editor-content h4 { font-size: 1.15rem; font-weight: 600; letter-spacing: 0.02em; }
.filament-rich-editor-content h5 { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.02em; }
.filament-rich-editor-content h6 { font-size: 0.98rem; color: var(--re-muted); font-weight: 600; letter-spacing: 0.02em; }

.filament-rich-editor-content :where(h1,h2,h3,h4,h5,h6) + * {
    margin-top: 0.55rem;
}

.filament-rich-editor-content h2 + p,
.filament-rich-editor-content h3 + p {
    color: var(--re-muted);
}

/* Lists */
.filament-rich-editor-content ul,
.filament-rich-editor-content ol {
    margin: 1.05rem 0;
    padding-left: 1.75rem;
    list-style-position: outside;
    list-style-image: none !important;
}

.filament-rich-editor-content ul { list-style-type: disc; }
.filament-rich-editor-content ol { list-style-type: decimal; }

.filament-rich-editor-content li {
    margin: 0.42rem 0;
    padding-left: 0.15rem;
    color: var(--re-body);
}

.filament-rich-editor-content li::marker {
    color: rgba(var(--re-accent-rgb), 0.85);
    font-weight: 900;
}

.filament-rich-editor-content li > ul,
.filament-rich-editor-content li > ol {
    margin: 0.60rem 0;
    padding-left: 1.45rem;
}

.filament-rich-editor-content ul ul { list-style-type: circle; }
.filament-rich-editor-content ul ul li::marker { color: rgba(var(--re-accent-rgb), 0.60); font-weight: 800; }

.filament-rich-editor-content ul ul ul { list-style-type: square; }
.filament-rich-editor-content ul ul ul li::marker { color: rgba(var(--re-accent-rgb), 0.45); font-weight: 750; }

.filament-rich-editor-content ol ol { list-style-type: lower-alpha; }
.filament-rich-editor-content ol ol li::marker { color: rgba(var(--re-accent-rgb), 0.60); }

.filament-rich-editor-content ol ol ol { list-style-type: lower-roman; }
.filament-rich-editor-content ol ol ol li::marker { color: rgba(var(--re-accent-rgb), 0.45); }

.filament-rich-editor-content li > p { margin: 0.55rem 0; }

.filament-rich-editor-content ul { list-style: disc outside !important; }
.filament-rich-editor-content ol { list-style: decimal outside !important; }
.filament-rich-editor-content li { list-style: inherit !important; }

/* Blockquote */
.filament-rich-editor-content blockquote {
    margin: 1.6rem 0;
    padding: 1rem 1.1rem 1rem 1.2rem;
    border-radius: 14px;
    border: 1px solid var(--re-border-soft);
    background: rgba(var(--re-accent-rgb), 0.04);
    color: var(--re-muted);
}

.dark .filament-rich-editor-content blockquote,
[data-theme="dark"] .filament-rich-editor-content blockquote {
    background: rgba(var(--re-accent-rgb), 0.08);
    border-color: rgba(148, 163, 184, 0.16);
}

/* Code */
.filament-rich-editor-content code {
    font-family: var(--re-mono);
    font-size: 0.95em;
    background: rgba(var(--re-accent-rgb), 0.07);
    border: 1px solid var(--re-border-soft);
    padding: 0.15rem 0.40rem;
    border-radius: 0.55rem;
    color: var(--re-text);
}

.dark .filament-rich-editor-content code,
[data-theme="dark"] .filament-rich-editor-content code {
    background: rgba(15, 23, 42, 0.45);
    border-color: rgba(148, 163, 184, 0.16);
}

.filament-rich-editor-content pre {
    margin: 1.65rem 0;
    padding: 1rem 1.05rem;
    border-radius: 14px;
    overflow-x: auto;
    background: #0b1220;
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.10);
    line-height: 1.65;
    font-size: 0.92rem;
}

.filament-rich-editor-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
}

/* Media */
.filament-rich-editor-content img,
.filament-rich-editor-content video {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.35rem auto;
    border-radius: 14px;
    border: 1px solid var(--re-border);
    box-shadow: 0 10px 26px rgba(2, 6, 23, 0.10);
}

.filament-rich-editor-content figcaption {
    margin-top: 0.55rem;
    font-size: 0.92rem;
    color: var(--re-soft);
    text-align: center;
}

/* Tables */
.filament-rich-editor-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.8rem 0;
    border: 1px solid var(--re-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
}

.filament-rich-editor-content th,
.filament-rich-editor-content td {
    padding: 0.85rem 0.95rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--re-border-soft);
    white-space: normal;
}

.filament-rich-editor-content th {
    background: rgba(var(--re-accent-rgb), 0.06);
    color: var(--re-text);
    font-weight: 900;
}

.dark .filament-rich-editor-content th,
[data-theme="dark"] .filament-rich-editor-content th {
    background: rgba(15, 23, 42, 0.55);
}

.filament-rich-editor-content tr:last-child td { border-bottom: none; }

.filament-rich-editor-content tbody tr:nth-child(even) td {
    background: rgba(241, 245, 251, 0.45);
}

.dark .filament-rich-editor-content tbody tr:nth-child(even) td,
[data-theme="dark"] .filament-rich-editor-content tbody tr:nth-child(even) td {
    background: rgba(15, 23, 42, 0.30);
}

/* HR */
.filament-rich-editor-content hr {
    border: none;
    height: 1px;
    margin: 2.1rem 0;
    background: linear-gradient(
        90deg,
        rgba(148,163,184,0),
        rgba(148,163,184,0.75),
        rgba(148,163,184,0)
    );
}

.filament-rich-editor-content ::selection { background: rgba(var(--re-accent-rgb), 0.18); }
.dark .filament-rich-editor-content ::selection,
[data-theme="dark"] .filament-rich-editor-content ::selection { background: rgba(var(--re-accent-rgb), 0.22); }

.filament-rich-editor-content .text-left    { text-align: left; }
.filament-rich-editor-content .text-center  { text-align: center; }
.filament-rich-editor-content .text-right   { text-align: right; }
.filament-rich-editor-content .text-justify { text-align: justify; }

/* Species modal: avoid nested scrollbars and use full-width media */
.species-modal-rich-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.species-modal-rich-content table {
    width: max-content;
    min-width: 100%;
}

.species-modal-rich-content .species-modal-title {
    margin-top: 0 !important;
    margin-bottom: 0.9rem !important;
}

.species-modal-rich-content .species-modal-title + * {
    margin-top: 0 !important;
}

/* Unified Rich Editor WYSIWYG: editor and frontend use the same typography rhythm */
trix-editor.fi-fo-rich-editor-editor {
    --re-font-body: "Source Sans 3", "Noto Sans", "Open Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --re-font-head: "Oswald", "Montserrat", "Raleway", "PT Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --re-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    --re-text: #0f172a;
    --re-body: #1f2937;
    --re-muted: #475569;
    --re-soft: #64748b;
    --re-border: rgba(15, 23, 42, 0.10);
    --re-border-soft: rgba(15, 23, 42, 0.06);
    --re-accent: #3061AF;
    --re-accent-rgb: 48, 97, 175;

    font-family: var(--re-font-body) !important;
    font-size: 1rem !important;
    line-height: 1.85 !important;
    letter-spacing: -0.003em !important;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--re-body) !important;
    background: transparent;
}

.dark trix-editor.fi-fo-rich-editor-editor,
[data-theme="dark"] trix-editor.fi-fo-rich-editor-editor {
    --re-text: #e5e7eb;
    --re-body: #cbd5e1;
    --re-muted: #94a3b8;
    --re-soft: #94a3b8;
    --re-border: rgba(148, 163, 184, 0.18);
    --re-border-soft: rgba(148, 163, 184, 0.12);
    --re-accent: #8FAEE0;
    --re-accent-rgb: 143, 174, 224;
}

trix-editor.fi-fo-rich-editor-editor.prose > :first-child { margin-top: 0 !important; }
trix-editor.fi-fo-rich-editor-editor.prose > :last-child  { margin-bottom: 0 !important; }

trix-editor.fi-fo-rich-editor-editor.prose p,
trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):not(:where([class~="not-prose"] *)) {
    margin: 0.95rem 0 !important;
    color: var(--re-body) !important;
    line-height: inherit !important;
}

trix-editor.fi-fo-rich-editor-editor.prose :where(strong, b) {
    font-weight: 800 !important;
    color: var(--re-text) !important;
}

trix-editor.fi-fo-rich-editor-editor.prose :where(em, i) {
    font-style: italic !important;
    color: var(--re-body) !important;
}

trix-editor.fi-fo-rich-editor-editor.prose a {
    color: var(--re-accent) !important;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(var(--re-accent-rgb), 0.30) !important;
    padding-bottom: 1px !important;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease !important;
}

trix-editor.fi-fo-rich-editor-editor.prose a:hover {
    border-bottom-color: rgba(var(--re-accent-rgb), 0.65) !important;
    background: rgba(var(--re-accent-rgb), 0.06) !important;
}

trix-editor.fi-fo-rich-editor-editor.prose :where(h1, h2, h3, h4, h5, h6) {
    margin: 2.2rem 0 0.85rem !important;
    line-height: 1.12 !important;
    letter-spacing: 0.02em !important;
    color: var(--re-text) !important;
    font-weight: 600 !important;
    font-family: var(--re-font-head) !important;
    text-transform: none !important;
    text-decoration: none !important;
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
}

trix-editor.fi-fo-rich-editor-editor.prose h2 {
    font-size: clamp(1.9rem, 2.9vw, 2.6rem) !important;
    letter-spacing: 0.03em !important;
}

trix-editor.fi-fo-rich-editor-editor.prose h3 {
    font-size: clamp(1.2rem, 1.7vw, 1.55rem) !important;
    color: color-mix(in srgb, var(--re-text) 88%, var(--re-muted)) !important;
}

trix-editor.fi-fo-rich-editor-editor.prose :where(h1, h2, h3, h4, h5, h6) + * {
    margin-top: 0.55rem !important;
}

trix-editor.fi-fo-rich-editor-editor.prose :where(ul, ol) {
    margin: 1.05rem 0 !important;
    padding-left: 1.75rem !important;
    list-style-position: outside !important;
    list-style-image: none !important;
}

trix-editor.fi-fo-rich-editor-editor.prose ul { list-style: disc outside !important; }
trix-editor.fi-fo-rich-editor-editor.prose ol { list-style: decimal outside !important; }

trix-editor.fi-fo-rich-editor-editor.prose li {
    margin: 0.42rem 0 !important;
    padding-left: 0.15rem !important;
    color: var(--re-body) !important;
    line-height: inherit !important;
    list-style: inherit !important;
}

trix-editor.fi-fo-rich-editor-editor.prose li::marker {
    color: rgba(var(--re-accent-rgb), 0.85) !important;
    font-weight: 900 !important;
}

trix-editor.fi-fo-rich-editor-editor.prose li > :where(ul, ol) {
    margin: 0.60rem 0 !important;
    padding-left: 1.45rem !important;
}

trix-editor.fi-fo-rich-editor-editor.prose blockquote {
    margin: 1.6rem 0 !important;
    padding: 1rem 1.1rem 1rem 1.2rem !important;
    border-radius: 14px !important;
    border: 1px solid var(--re-border-soft) !important;
    background: rgba(var(--re-accent-rgb), 0.04) !important;
    color: var(--re-muted) !important;
}

trix-editor.fi-fo-rich-editor-editor.prose code {
    font-family: var(--re-mono) !important;
    font-size: 0.95em !important;
    background: rgba(var(--re-accent-rgb), 0.07) !important;
    border: 1px solid var(--re-border-soft) !important;
    padding: 0.15rem 0.40rem !important;
    border-radius: 0.55rem !important;
    color: var(--re-text) !important;
}

trix-editor.fi-fo-rich-editor-editor.prose pre {
    margin: 1.65rem 0 !important;
    padding: 1rem 1.05rem !important;
    border-radius: 14px !important;
    overflow-x: auto !important;
    background: #0b1220 !important;
    color: #e5e7eb !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    line-height: 1.65 !important;
    font-size: 0.92rem !important;
}

trix-editor.fi-fo-rich-editor-editor.prose pre code {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    color: inherit !important;
}

/* Final frontend parity: reading-first rhythm and consistent colors across all rich content */
.filament-rich-editor-content {
    font-size: 1rem !important;
    line-height: 1.5 !important;
    letter-spacing: 0 !important;
}

.filament-rich-editor-content :where(p, div),
.filament-rich-editor-content > p:first-of-type,
.filament-rich-editor-content h2 + p,
.filament-rich-editor-content h3 + p,
.filament-rich-editor-content h2 + div,
.filament-rich-editor-content h3 + div {
    margin: 0 !important;
    line-height: inherit !important;
    font-size: inherit !important;
    color: var(--re-body) !important;
}

.filament-rich-editor-content :where(p, div) + :where(p, div) {
    margin-top: 0.34rem !important;
}

.filament-rich-editor-content li > p {
    margin: 0.14rem 0 !important;
}

.filament-rich-editor-content :where(h1, h2, h3, h4, h5, h6) {
    margin: 0.9rem 0 0.42rem !important;
    line-height: 1.2 !important;
    letter-spacing: 0.015em !important;
}

.filament-rich-editor-content h1 {
    font-size: clamp(1.72rem, 2.2vw, 2.05rem) !important;
}

.filament-rich-editor-content h2 {
    font-size: clamp(1.38rem, 1.8vw, 1.72rem) !important;
}

.filament-rich-editor-content h3 {
    font-size: clamp(1.2rem, 1.35vw, 1.4rem) !important;
    color: var(--re-text) !important;
}

.filament-rich-editor-content :where(h1, h2, h3, h4, h5, h6) + * {
    margin-top: 0.08rem !important;
}

.filament-rich-editor-content :where(ul, ol) {
    margin: 0.48rem 0 !important;
    padding-left: 1.9rem !important;
}

.filament-rich-editor-content li {
    margin: 0.12rem 0 !important;
}

.filament-rich-editor-content li > :where(ul, ol) {
    margin-top: 0.32rem !important;
    padding-left: 1.45rem !important;
}

/* Frontend reading scale by device (web readability recommendations) */
@media (min-width: 1280px) {
    .filament-rich-editor-content {
        font-size: 1.0625rem !important;
        line-height: 1.56 !important;
    }
}

@media (max-width: 1023px) {
    .filament-rich-editor-content {
        font-size: 1rem !important;
        line-height: 1.5 !important;
    }
}

@media (max-width: 767px) {
    .filament-rich-editor-content {
        font-size: 1rem !important;
        line-height: 1.48 !important;
    }

    .filament-rich-editor-content h1 {
        font-size: 1.52rem !important;
    }

    .filament-rich-editor-content h2 {
        font-size: 1.3rem !important;
    }

    .filament-rich-editor-content h3 {
        font-size: 1.14rem !important;
    }
}

/* Editor remains stable; frontend responsive scale does not alter authoring size */
trix-editor.fi-fo-rich-editor-editor {
    font-size: 1rem !important;
    line-height: 1.6 !important;
    letter-spacing: 0 !important;
}

trix-editor.fi-fo-rich-editor-editor.prose p,
trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):not(:where([class~="not-prose"] *)) {
    margin: 0 0 0.55rem !important;
    line-height: inherit !important;
}

trix-editor.fi-fo-rich-editor-editor.prose li > p {
    margin: 0.22rem 0 !important;
}

trix-editor.fi-fo-rich-editor-editor.prose :where(h1, h2, h3, h4, h5, h6) {
    margin: 1.1rem 0 0.42rem !important;
    line-height: 1.2 !important;
    letter-spacing: 0.015em !important;
}

trix-editor.fi-fo-rich-editor-editor.prose h1 {
    font-size: clamp(1.72rem, 2.2vw, 2.05rem) !important;
}

trix-editor.fi-fo-rich-editor-editor.prose h2 {
    font-size: clamp(1.38rem, 1.8vw, 1.72rem) !important;
}

trix-editor.fi-fo-rich-editor-editor.prose h3 {
    font-size: clamp(1.2rem, 1.35vw, 1.4rem) !important;
    color: var(--re-text) !important;
}

trix-editor.fi-fo-rich-editor-editor.prose :where(h1, h2, h3, h4, h5, h6) + * {
    margin-top: 0.12rem !important;
}

trix-editor.fi-fo-rich-editor-editor.prose :where(ul, ol) {
    margin: 0.62rem 0 !important;
    padding-left: 1.9rem !important;
}

trix-editor.fi-fo-rich-editor-editor.prose li {
    margin: 0.18rem 0 !important;
}

trix-editor.fi-fo-rich-editor-editor.prose li > :where(ul, ol) {
    margin-top: 0.32rem !important;
    padding-left: 1.45rem !important;
}

/* Canonical parity: frontend and editor keep the same paragraph rhythm */
.filament-rich-editor-content :where(p, div) {
    margin: 0 !important;
    line-height: inherit !important;
}

.filament-rich-editor-content :where(p, div) + :where(p, div) {
    margin-top: 0.56em !important;
}

.filament-rich-editor-content :where(p, div):has(> br:only-child) {
    display: block !important;
    min-height: 1em !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.filament-rich-editor-content :where(p, div) + :where(p, div):has(> br:only-child) {
    margin-top: 0 !important;
}

.filament-rich-editor-content :where(p, div):has(> br:only-child) + :where(p, div) {
    margin-top: 0 !important;
}

.filament-rich-editor-content > p:first-of-type,
.filament-rich-editor-content h2 + p,
.filament-rich-editor-content h3 + p,
.filament-rich-editor-content h2 + div,
.filament-rich-editor-content h3 + div {
    font-size: inherit !important;
    color: var(--re-body) !important;
}

.filament-rich-editor-content :where(h1, h2, h3, h4, h5, h6) + :where(p, div, ul, ol, blockquote, pre, table) {
    margin-top: 0 !important;
}

.filament-rich-editor-content :where(ul, ol) {
    margin: 0.56em 0 !important;
}

trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):not(:where([class~="not-prose"] *)) {
    margin: 0 !important;
    line-height: inherit !important;
}

trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):not(:where([class~="not-prose"] *))
    + :where(p, div):not(:where([class~="not-prose"] *)) {
    margin-top: 0.56em !important;
}

trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):has(> br:only-child):not(:where([class~="not-prose"] *)) {
    display: block !important;
    min-height: 1em !important;
    margin: 0 !important;
    line-height: 1 !important;
    padding: 0 !important;
}

trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):not(:where([class~="not-prose"] *))
    + :where(p, div):has(> br:only-child):not(:where([class~="not-prose"] *)) {
    margin-top: 0 !important;
}

trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):has(> br:only-child):not(:where([class~="not-prose"] *))
    + :where(p, div):not(:where([class~="not-prose"] *)) {
    margin-top: 0 !important;
}

trix-editor.fi-fo-rich-editor-editor.prose :where(h1, h2, h3, h4, h5, h6)
    + :where(p, div, ul, ol, blockquote, pre, table):not(:where([class~="not-prose"] *)) {
    margin-top: 0 !important;
}

/* Processing indicator */
.processing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #b45309;
}

.processing-indicator__spinner {
    width: 0.9rem;
    height: 0.9rem;
    border: 2px solid rgba(180, 83, 9, 0.2);
    border-top-color: rgba(180, 83, 9, 0.9);
    border-radius: 9999px;
    animation: processing-spin 0.9s linear infinite;
}

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


/* ==========================================================================
   WORD-LIKE RHYTHM (ONLY INSIDE FILAMENT RICH EDITOR / TRIX)
   - Enter      => paragraph spacing
   - Shift+Enter=> line break (no extra spacing)
   - Optional first-line indent (Word-like)
   ========================================================================== */

trix-editor.fi-fo-rich-editor-editor {
    /* Ajusta aquí el "feeling Word" */
    --word-line-height: 1.45;             /* Word suele ser ~1.15–1.5 según config; aquí queda natural */
    --word-paragraph-gap: 0.85em;         /* separación entre párrafos (Enter) */
    --word-first-line-indent: 0;          /* pon 1.5em si quieres sangría tipo Word */

    line-height: var(--word-line-height) !important;
}

/* En Trix, los párrafos suelen ser <div> directos dentro del editor */
trix-editor.fi-fo-rich-editor-editor > div {
    margin: 0 0 var(--word-paragraph-gap) 0 !important; /* Enter = separación */
    padding: 0 !important;
    line-height: inherit !important;

    /* Sangría Word (primera línea) */
    text-indent: var(--word-first-line-indent) !important;
}

/* Último párrafo sin “aire” extra al final */
trix-editor.fi-fo-rich-editor-editor > div:last-child {
    margin-bottom: 0 !important;
}

/* Shift+Enter: Trix mete <br> dentro del MISMO <div> -> no añadimos nada aquí.
   Pero “párrafo vacío” (solo <br>) debe comportarse como línea en blanco (Word) */
trix-editor.fi-fo-rich-editor-editor > div:has(> br:only-child) {
    margin: 0 !important;                       /* línea en blanco sin gap de párrafo */
    min-height: calc(1em * var(--word-line-height)) !important;
    text-indent: 0 !important;
}

/* Word no aplica sangría a: primer párrafo, tras títulos, ni dentro de listas/bloques */
trix-editor.fi-fo-rich-editor-editor > div:first-child {
    text-indent: 0 !important;
}

/* Si el editor usa headings reales dentro */
trix-editor.fi-fo-rich-editor-editor > :where(h1,h2,h3,h4,h5,h6),
trix-editor.fi-fo-rich-editor-editor > :where(ul,ol,blockquote,pre,table,figure) {
    margin: 0 0 var(--word-paragraph-gap) 0 !important;
    text-indent: 0 !important;
}

/* Párrafo inmediatamente después de un título: sin sangría (Word-like) */
trix-editor.fi-fo-rich-editor-editor > :where(h1,h2,h3,h4,h5,h6) + div {
    text-indent: 0 !important;
}

/* Listas: sangría propia de lista, no de párrafo */
trix-editor.fi-fo-rich-editor-editor :where(ul,ol) {
    margin: 0 0 var(--word-paragraph-gap) 0 !important;
    padding-left: 1.9rem !important; /* parecido a Word */
}

trix-editor.fi-fo-rich-editor-editor :where(li) {
    margin: 0.25em 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
}

/* Párrafos dentro de listas: sin sangría extra y sin márgenes raros */
trix-editor.fi-fo-rich-editor-editor li > div,
trix-editor.fi-fo-rich-editor-editor li > p {
    margin: 0.25em 0 !important;
    text-indent: 0 !important;
}

/* Evita que tus reglas anteriores “prose” vuelvan a imponer márgenes raros */
trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):not(:where([class~="not-prose"] *)) {
    margin: 0 0 var(--word-paragraph-gap) 0 !important;
    line-height: inherit !important;
    text-indent: var(--word-first-line-indent) !important;
}

trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):has(> br:only-child):not(:where([class~="not-prose"] *)) {
    margin: 0 !important;
    min-height: calc(1em * var(--word-line-height)) !important;
    text-indent: 0 !important;
}

/* ==========================================================================
   FILAMENT 3 RICH EDITOR (TIPTAP / PROSEMIRROR) - WORD-LIKE PARAGRAPHS
   Solo afecta al texto dentro del editor (no frontend).
   ========================================================================== */

/* Variables "Word feel" solo para el editor */
.fi-fo-rich-editor .ProseMirror {
    --word-line-height: 1.45;
    --word-paragraph-gap: 0.85em;   /* Enter -> separación de párrafo */
    --word-first-line-indent: 0;    /* pon 1.5em si quieres sangría tipo Word */

    line-height: var(--word-line-height) !important;
}

/* ProseMirror crea párrafos como <p> (y a veces <div>) */
.fi-fo-rich-editor .ProseMirror :where(p, div) {
    margin: 0 0 var(--word-paragraph-gap) 0 !important;
    padding: 0 !important;
    line-height: inherit !important;

    /* Sangría tipo Word (opcional) */
    text-indent: var(--word-first-line-indent) !important;
}

/* Último bloque sin aire final */
.fi-fo-rich-editor .ProseMirror :where(p, div):last-child {
    margin-bottom: 0 !important;
}

/* Shift+Enter en Tiptap suele ser <br> dentro del mismo párrafo: no añadimos márgenes extra.
   Pero el párrafo vacío (<p><br></p>) debe comportarse como “línea en blanco” (Word). */
.fi-fo-rich-editor .ProseMirror :where(p, div):has(> br:only-child) {
    margin: 0 !important; /* evita que un “párrafo vacío” tenga el gap de párrafo */
    min-height: calc(1em * var(--word-line-height)) !important;
    text-indent: 0 !important;
}

/* Sin sangría en el primer párrafo y justo después de un título */
.fi-fo-rich-editor .ProseMirror :where(p, div):first-child {
    text-indent: 0 !important;
}

.fi-fo-rich-editor .ProseMirror :where(h1,h2,h3,h4,h5,h6) + :where(p, div) {
    text-indent: 0 !important;
}

/* Listas: que mantengan sangría propia, no la de párrafo */
.fi-fo-rich-editor .ProseMirror :where(ul, ol) {
    margin: 0 0 var(--word-paragraph-gap) 0 !important;
    padding-left: 1.9rem !important;
}

.fi-fo-rich-editor .ProseMirror li {
    margin: 0.25em 0 !important;
    text-indent: 0 !important;
}

.fi-fo-rich-editor .ProseMirror li :where(p, div) {
    margin: 0.25em 0 !important;
    text-indent: 0 !important;
}

/* Si Tailwind Typography / prose te mete márgenes raros dentro del editor, esto los anula */
.fi-fo-rich-editor .ProseMirror.prose :where(p, div) {
    margin: 0 0 var(--word-paragraph-gap) 0 !important;
}

/* ==========================================================================
   FILAMENT RICH EDITOR - FINAL WORD METRICS (EDITOR ONLY)
   Isolated to authoring area. Does not affect frontend rich content.
   ========================================================================== */

trix-editor.fi-fo-rich-editor-editor,
.fi-fo-rich-editor .ProseMirror {
    --word-line-height: 1.15;
    --word-paragraph-gap: 0.42em;
    --word-list-indent: 2.25em;

    line-height: var(--word-line-height) !important;
}

/* Paragraph rhythm: Enter = paragraph gap, no exaggerated margins */
trix-editor.fi-fo-rich-editor-editor > div,
trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):not(:where([class~="not-prose"] *)),
.fi-fo-rich-editor .ProseMirror :where(p, div),
.fi-fo-rich-editor .ProseMirror.prose :where(p, div) {
    margin: 0 !important;
    padding: 0 !important;
    line-height: inherit !important;
    text-indent: 0 !important;
}

trix-editor.fi-fo-rich-editor-editor > div + div,
trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):not(:where([class~="not-prose"] *))
    + :where(p, div):not(:where([class~="not-prose"] *)),
.fi-fo-rich-editor .ProseMirror :where(p, div) + :where(p, div),
.fi-fo-rich-editor .ProseMirror.prose :where(p, div) + :where(p, div) {
    margin-top: var(--word-paragraph-gap) !important;
}

/* Shift+Enter/empty paragraph: single blank line without extra paragraph gap */
trix-editor.fi-fo-rich-editor-editor > div:has(> br:only-child),
trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):has(> br:only-child):not(:where([class~="not-prose"] *)),
.fi-fo-rich-editor .ProseMirror :where(p, div):has(> br:only-child),
.fi-fo-rich-editor .ProseMirror.prose :where(p, div):has(> br:only-child) {
    margin: 0 !important;
    min-height: 1em !important;
    line-height: 1 !important;
    text-indent: 0 !important;
}

trix-editor.fi-fo-rich-editor-editor > div + div:has(> br:only-child),
trix-editor.fi-fo-rich-editor-editor > div:has(> br:only-child) + div,
trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):not(:where([class~="not-prose"] *))
    + :where(p, div):has(> br:only-child):not(:where([class~="not-prose"] *)),
trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):has(> br:only-child):not(:where([class~="not-prose"] *))
    + :where(p, div):not(:where([class~="not-prose"] *)),
.fi-fo-rich-editor .ProseMirror :where(p, div) + :where(p, div):has(> br:only-child),
.fi-fo-rich-editor .ProseMirror :where(p, div):has(> br:only-child) + :where(p, div),
.fi-fo-rich-editor .ProseMirror.prose :where(p, div) + :where(p, div):has(> br:only-child),
.fi-fo-rich-editor .ProseMirror.prose :where(p, div):has(> br:only-child) + :where(p, div) {
    margin-top: 0 !important;
}

/* Headings and lists with Word-like spacing/indent inside the editor */
trix-editor.fi-fo-rich-editor-editor :where(h1, h2, h3, h4, h5, h6),
trix-editor.fi-fo-rich-editor-editor.prose :where(h1, h2, h3, h4, h5, h6),
.fi-fo-rich-editor .ProseMirror :where(h1, h2, h3, h4, h5, h6),
.fi-fo-rich-editor .ProseMirror.prose :where(h1, h2, h3, h4, h5, h6) {
    margin: 0.95em 0 0.35em !important;
    line-height: 1.2 !important;
}

trix-editor.fi-fo-rich-editor-editor :where(h1, h2, h3, h4, h5, h6) + :where(div, p, ul, ol, blockquote, pre, table),
trix-editor.fi-fo-rich-editor-editor.prose :where(h1, h2, h3, h4, h5, h6) + :where(div, p, ul, ol, blockquote, pre, table),
.fi-fo-rich-editor .ProseMirror :where(h1, h2, h3, h4, h5, h6) + :where(div, p, ul, ol, blockquote, pre, table),
.fi-fo-rich-editor .ProseMirror.prose :where(h1, h2, h3, h4, h5, h6) + :where(div, p, ul, ol, blockquote, pre, table) {
    margin-top: 0.2em !important;
}

trix-editor.fi-fo-rich-editor-editor :where(ul, ol),
trix-editor.fi-fo-rich-editor-editor.prose :where(ul, ol),
.fi-fo-rich-editor .ProseMirror :where(ul, ol),
.fi-fo-rich-editor .ProseMirror.prose :where(ul, ol) {
    margin: 0.42em 0 !important;
    padding-left: var(--word-list-indent) !important;
}

trix-editor.fi-fo-rich-editor-editor :where(li),
trix-editor.fi-fo-rich-editor-editor.prose :where(li),
.fi-fo-rich-editor .ProseMirror :where(li),
.fi-fo-rich-editor .ProseMirror.prose :where(li) {
    margin: 0.14em 0 !important;
    line-height: inherit !important;
    text-indent: 0 !important;
}

trix-editor.fi-fo-rich-editor-editor li > :where(div, p),
trix-editor.fi-fo-rich-editor-editor.prose li > :where(div, p),
.fi-fo-rich-editor .ProseMirror li > :where(div, p),
.fi-fo-rich-editor .ProseMirror.prose li > :where(div, p) {
    margin: 0 !important;
    text-indent: 0 !important;
}

/* ==========================================================================
   CANONICAL 1:1 PARITY LOCK (EDITOR <-> FRONTEND)
   Single source of truth for spacing and rhythm.
   ========================================================================== */

.filament-rich-editor-content,
trix-editor.fi-fo-rich-editor-editor,
.fi-fo-rich-editor .ProseMirror {
    --rt-font-size: 1rem;
    --rt-line-height: 1.52;
    --rt-paragraph-gap: 0;
    --rt-heading-top: 0.95em;
    --rt-heading-bottom: 0.35em;
    --rt-list-indent: 2.25em;
    --rt-list-item-gap: 0.14em;

    font-size: var(--rt-font-size) !important;
    line-height: var(--rt-line-height) !important;
}

/* Responsive reading scale (kept 1:1 between editor and frontend) */
@media (min-width: 640px) {
    .filament-rich-editor-content,
    trix-editor.fi-fo-rich-editor-editor,
    .fi-fo-rich-editor .ProseMirror {
        --rt-font-size: 1.0625rem;  /* 17px */
        --rt-line-height: 1.56;
        --rt-paragraph-gap: 0;
    }
}

@media (min-width: 1024px) {
    .filament-rich-editor-content,
    trix-editor.fi-fo-rich-editor-editor,
    .fi-fo-rich-editor .ProseMirror {
        --rt-font-size: 1.125rem;   /* 18px */
        --rt-line-height: 1.6;
        --rt-paragraph-gap: 0;
    }
}

/* Base block text in both contexts */
.filament-rich-editor-content :where(p, div),
trix-editor.fi-fo-rich-editor-editor > div,
trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):not(:where([class~="not-prose"] *)),
.fi-fo-rich-editor .ProseMirror :where(p, div),
.fi-fo-rich-editor .ProseMirror.prose :where(p, div) {
    margin: 0 !important;
    padding: 0 !important;
    line-height: inherit !important;
    font-size: inherit !important;
    text-indent: 0 !important;
}

/* Enter => paragraph gap (same editor/frontend) */
.filament-rich-editor-content :where(p, div) + :where(p, div),
trix-editor.fi-fo-rich-editor-editor > div + div,
trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):not(:where([class~="not-prose"] *))
    + :where(p, div):not(:where([class~="not-prose"] *)),
.fi-fo-rich-editor .ProseMirror :where(p, div) + :where(p, div),
.fi-fo-rich-editor .ProseMirror.prose :where(p, div) + :where(p, div) {
    margin-top: var(--rt-paragraph-gap) !important;
}

/* Shift+Enter / explicit empty line => one blank line, no extra paragraph gap */
.filament-rich-editor-content :where(p, div):has(> br:only-child),
trix-editor.fi-fo-rich-editor-editor > div:has(> br:only-child),
trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):has(> br:only-child):not(:where([class~="not-prose"] *)),
.fi-fo-rich-editor .ProseMirror :where(p, div):has(> br:only-child),
.fi-fo-rich-editor .ProseMirror.prose :where(p, div):has(> br:only-child) {
    margin: 0 !important;
    min-height: calc(1em * var(--rt-line-height)) !important;
    line-height: var(--rt-line-height) !important;
    text-indent: 0 !important;
}

.filament-rich-editor-content :where(p, div) + :where(p, div):has(> br:only-child),
.filament-rich-editor-content :where(p, div):has(> br:only-child) + :where(p, div),
trix-editor.fi-fo-rich-editor-editor > div + div:has(> br:only-child),
trix-editor.fi-fo-rich-editor-editor > div:has(> br:only-child) + div,
trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):not(:where([class~="not-prose"] *))
    + :where(p, div):has(> br:only-child):not(:where([class~="not-prose"] *)),
trix-editor.fi-fo-rich-editor-editor.prose :where(p, div):has(> br:only-child):not(:where([class~="not-prose"] *))
    + :where(p, div):not(:where([class~="not-prose"] *)),
.fi-fo-rich-editor .ProseMirror :where(p, div) + :where(p, div):has(> br:only-child),
.fi-fo-rich-editor .ProseMirror :where(p, div):has(> br:only-child) + :where(p, div),
.fi-fo-rich-editor .ProseMirror.prose :where(p, div) + :where(p, div):has(> br:only-child),
.fi-fo-rich-editor .ProseMirror.prose :where(p, div):has(> br:only-child) + :where(p, div) {
    margin-top: 0 !important;
}

/* Headings parity */
.filament-rich-editor-content :where(h1, h2, h3, h4, h5, h6),
trix-editor.fi-fo-rich-editor-editor :where(h1, h2, h3, h4, h5, h6),
trix-editor.fi-fo-rich-editor-editor.prose :where(h1, h2, h3, h4, h5, h6),
.fi-fo-rich-editor .ProseMirror :where(h1, h2, h3, h4, h5, h6),
.fi-fo-rich-editor .ProseMirror.prose :where(h1, h2, h3, h4, h5, h6) {
    margin: var(--rt-heading-top) 0 var(--rt-heading-bottom) !important;
    line-height: 1.2 !important;
}

.filament-rich-editor-content :where(h1, h2, h3, h4, h5, h6) + :where(p, div, ul, ol, blockquote, pre, table),
trix-editor.fi-fo-rich-editor-editor :where(h1, h2, h3, h4, h5, h6) + :where(div, p, ul, ol, blockquote, pre, table),
trix-editor.fi-fo-rich-editor-editor.prose :where(h1, h2, h3, h4, h5, h6) + :where(div, p, ul, ol, blockquote, pre, table),
.fi-fo-rich-editor .ProseMirror :where(h1, h2, h3, h4, h5, h6) + :where(div, p, ul, ol, blockquote, pre, table),
.fi-fo-rich-editor .ProseMirror.prose :where(h1, h2, h3, h4, h5, h6) + :where(div, p, ul, ol, blockquote, pre, table) {
    margin-top: 0.2em !important;
}

/* Lists parity */
.filament-rich-editor-content :where(ul, ol),
trix-editor.fi-fo-rich-editor-editor :where(ul, ol),
trix-editor.fi-fo-rich-editor-editor.prose :where(ul, ol),
.fi-fo-rich-editor .ProseMirror :where(ul, ol),
.fi-fo-rich-editor .ProseMirror.prose :where(ul, ol) {
    margin: var(--rt-paragraph-gap) 0 !important;
    padding-left: var(--rt-list-indent) !important;
}

.filament-rich-editor-content :where(li),
trix-editor.fi-fo-rich-editor-editor :where(li),
trix-editor.fi-fo-rich-editor-editor.prose :where(li),
.fi-fo-rich-editor .ProseMirror :where(li),
.fi-fo-rich-editor .ProseMirror.prose :where(li) {
    margin: var(--rt-list-item-gap) 0 !important;
    line-height: inherit !important;
    text-indent: 0 !important;
}

.filament-rich-editor-content li > :where(div, p),
trix-editor.fi-fo-rich-editor-editor li > :where(div, p),
trix-editor.fi-fo-rich-editor-editor.prose li > :where(div, p),
.fi-fo-rich-editor .ProseMirror li > :where(div, p),
.fi-fo-rich-editor .ProseMirror.prose li > :where(div, p) {
    margin: 0 !important;
    text-indent: 0 !important;
}

/* Hard parity lock:
   prevents host utility classes from changing Rich Editor spacing/wrapping in publication views. */
.filament-rich-editor-content.filament-rich-editor-content {
    font-size: var(--rt-font-size) !important;
    line-height: var(--rt-line-height) !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: manual !important;
}

/* ==========================================================================
   FILAMENT RICH EDITOR UX
   - Resizable writing area
   - Sticky toolbar while editing long content
   ========================================================================== */

/* Use Filament default toolbar/editor layout to avoid toolbar drift/overlap. */

/* ==========================================================================
   Premium link styling (only inside Rich Editor surfaces)
   - Frontend rendered content
   - Filament Trix editor
   - Filament TipTap/ProseMirror editor
   ========================================================================== */

:where(
    .filament-rich-editor-content,
    .news-show-content,
    .activity-show-content,
    .regulation-show-content,
    .species-modal-rich-content,
    trix-editor.fi-fo-rich-editor-editor,
    .fi-fo-rich-editor .ProseMirror
) a {
    color: var(--re-accent, #1d4ed8) !important;
    font-weight: 650 !important;
    letter-spacing: 0.01em;
    text-decoration: none !important;
    border: 1px solid rgba(var(--re-accent-rgb, 29 78 216), 0.26);
    border-radius: 0.45rem;
    padding: 0.04em 0.32em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    background-image:
        linear-gradient(
            120deg,
            rgba(var(--re-accent-rgb, 29 78 216), 0.17),
            rgba(var(--re-accent-rgb, 29 78 216), 0.06)
        ),
        linear-gradient(
            to right,
            rgba(var(--re-accent-rgb, 29 78 216), 0.95),
            rgba(var(--re-accent-rgb, 29 78 216), 0.55)
        ) !important;
    background-repeat: no-repeat !important;
    background-size: 100% 100%, 0 2px !important;
    background-position: 0 0, 0 100% !important;
    border-bottom: 0 !important;
    box-shadow: 0 1px 2px rgba(var(--re-accent-rgb, 29 78 216), 0.12);
    transition:
        color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease,
        background-size 0.18s ease,
        background-color 0.18s ease !important;
}

:where(
    .filament-rich-editor-content,
    .news-show-content,
    .activity-show-content,
    .regulation-show-content,
    .species-modal-rich-content,
    trix-editor.fi-fo-rich-editor-editor,
    .fi-fo-rich-editor .ProseMirror
) a:hover {
    color: var(--re-accent, #1d4ed8) !important;
    border-color: rgba(var(--re-accent-rgb, 29 78 216), 0.5) !important;
    background-size: 100% 100%, 100% 2px !important;
    background-color: rgba(var(--re-accent-rgb, 29 78 216), 0.06) !important;
    box-shadow: 0 8px 18px -12px rgba(var(--re-accent-rgb, 29 78 216), 0.8);
    transform: translateY(-1px);
}

:where(
    .filament-rich-editor-content,
    .news-show-content,
    .activity-show-content,
    .regulation-show-content,
    .species-modal-rich-content,
    trix-editor.fi-fo-rich-editor-editor,
    .fi-fo-rich-editor .ProseMirror
) a:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(var(--re-accent-rgb, 29 78 216), 0.28);
}

:where(
    .filament-rich-editor-content,
    .news-show-content,
    .activity-show-content,
    .regulation-show-content,
    .species-modal-rich-content,
    trix-editor.fi-fo-rich-editor-editor,
    .fi-fo-rich-editor .ProseMirror
) a:focus-visible {
    outline: 2px solid rgba(var(--re-accent-rgb, 29 78 216), 0.35);
    outline-offset: 2px;
}

:where(
    .filament-rich-editor-content,
    .news-show-content,
    .activity-show-content,
    .regulation-show-content,
    .species-modal-rich-content,
    trix-editor.fi-fo-rich-editor-editor,
    .fi-fo-rich-editor .ProseMirror
) a:visited {
    color: var(--re-accent, #1d4ed8) !important;
}

/* Hard safety fix: keep RichEditor toolbar above editor content with no overlap. */
.fi-fo-rich-editor trix-toolbar.fi-fo-rich-editor-toolbar,
.fi-fo-rich-editor .fi-fo-rich-editor-toolbar {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 0 !important;
    z-index: 1 !important;
}

/* ==========================================================================
   Diving spots resource tabs: avoid horizontal scrollbar without removing tabs
   ========================================================================== */
.fi-resource-list-records-page.fi-resource-diving-spots .fi-tabs {
    overflow-x: visible !important;
    flex-wrap: wrap;
    row-gap: 0.35rem;
}

.fi-resource-list-records-page.fi-resource-diving-spots .fi-tabs-item {
    padding: 0.4rem 0.7rem;
    font-size: 0.95rem;
}
