/* ==========================================================================
   Editor content: HTML written in the admin's WordPress-style editor
   (TinyMCE, admins.partials.wp-editor) as shown on the site.

   - .editor-content wraps every rich-text field in the frontend views
     (page / section content, service & DJ package descriptions, FAQs ...).
     Element styles (lists, tables, quotes, images ...) only apply inside it,
     so the theme's own menus, cards and forms are not touched.
   - The editor's Layouts (.ed-layout, .ed-index-layout, .ed-section) and the
     old Quill classes (.ql-*) are unique names and work anywhere.
   - Colours follow the text colour of the section (dark or light background);
     the accent is the site's pink.
   ========================================================================== */

.editor-content {
    --ec-accent: #E20081;
    --ec-line: rgba(127, 127, 127, .35);
    --ec-soft: rgba(127, 127, 127, .12);
    overflow-wrap: break-word;
}
.editor-content::after { content: ""; display: table; clear: both; }  /* contain floated images */

/* ---------- Text ---------- */
.editor-content p { margin: 0 0 1rem; }
.editor-content > :last-child,
.editor-content .ed-layout > :last-child,
.editor-content [class*="col-"] > :last-child { margin-bottom: 0; }
.editor-content h1, .editor-content h2, .editor-content h3,
.editor-content h4, .editor-content h5, .editor-content h6 { margin: 1.5rem 0 .75rem; line-height: 1.25; color: inherit; }
.editor-content > h1:first-child, .editor-content > h2:first-child, .editor-content > h3:first-child,
.editor-content > h4:first-child, .editor-content > h5:first-child, .editor-content > h6:first-child { margin-top: 0; }
.editor-content strong, .editor-content b { font-weight: 700; }
.editor-content em, .editor-content i:not([class]) { font-style: italic; }
.editor-content u { text-decoration: underline; }
.editor-content s, .editor-content del { text-decoration: line-through; }
.editor-content sup, .editor-content sub { font-size: 75%; line-height: 0; position: relative; }
.editor-content sup { top: -.5em; }
.editor-content sub { bottom: -.25em; }
.editor-content mark { background: rgba(255, 252, 0, .35); color: inherit; padding: 0 .15em; }

/* ---------- Links ---------- */
.editor-content a:not(.btn) { color: var(--ec-accent); text-decoration: underline; text-underline-offset: 2px; }
.editor-content a:not(.btn):hover, .editor-content a:not(.btn):focus { color: var(--ec-accent); text-decoration: none; }

/* ---------- Lists (the theme resets list styles) ---------- */
.editor-content ul, .editor-content ol { margin: 0 0 1rem; padding-left: 1.6rem; }
.editor-content ul { list-style: disc; }
.editor-content ol { list-style: decimal; }
.editor-content ul ul { list-style: circle; }
.editor-content ul ul ul { list-style: square; }
.editor-content ol ol { list-style: lower-alpha; }
.editor-content ol ol ol { list-style: lower-roman; }
.editor-content ul ul, .editor-content ol ol, .editor-content ul ol, .editor-content ol ul { margin: .35rem 0 0; }
.editor-content li { margin: 0 0 .35rem; padding: 0; }
.editor-content li::before { display: none; }       /* theme bullets drawn with ::before */
/* TinyMCE "advlist" styles set list-style-type inline; keep them */
.editor-content ul[style*="list-style-type"], .editor-content ol[style*="list-style-type"] { list-style-position: outside; }

/* ---------- Quote, code, line ---------- */
.editor-content blockquote {
    margin: 1.25rem 0; padding: .75rem 1.25rem;
    border-left: 4px solid var(--ec-accent); background: var(--ec-soft);
    font-style: italic; font-size: 1.05em;
}
.editor-content blockquote > :last-child { margin-bottom: 0; }
.editor-content pre {
    margin: 0 0 1rem; padding: 1rem; overflow-x: auto;
    background: var(--ec-soft); border: 1px solid var(--ec-line); border-radius: 4px;
    font-size: .9em; white-space: pre-wrap; color: inherit;
}
.editor-content code { padding: .1em .35em; background: var(--ec-soft); border-radius: 3px; font-size: .9em; color: inherit; }
.editor-content pre code { padding: 0; background: none; }
.editor-content hr { margin: 1.5rem 0; border: 0; border-top: 1px solid var(--ec-line); }

/* ---------- Images ---------- */
.editor-content img { max-width: 100%; height: auto; }
.editor-content img[style*="float: left"], .editor-content img[style*="float:left"] { margin: .25rem 1.25rem 1rem 0; }
.editor-content img[style*="float: right"], .editor-content img[style*="float:right"] { margin: .25rem 0 1rem 1.25rem; }
/* Centred image (TinyMCE: display block + auto margins) */
.editor-content img[style*="margin-left: auto"] { display: block; }
.editor-content figure { margin: 0 0 1rem; max-width: 100%; }
.editor-content figure.image { display: table; }
.editor-content figure.align-center { margin-left: auto; margin-right: auto; }
.editor-content figure.align-left { float: left; margin: .25rem 1.25rem 1rem 0; }
.editor-content figure.align-right { float: right; margin: .25rem 0 1rem 1.25rem; }
.editor-content figcaption { display: table-caption; caption-side: bottom; padding-top: .4rem; font-size: .875em; opacity: .8; text-align: center; }
@media (max-width: 575px) {
    /* Phones: no text squeezed beside a floated image */
    .editor-content img[style*="float"], .editor-content figure.align-left, .editor-content figure.align-right {
        float: none !important; display: block; margin: 0 auto 1rem !important;
    }
}

/* ---------- Video / embeds (Insert > Media) ---------- */
.editor-content iframe, .editor-content video, .editor-content embed, .editor-content object { max-width: 100%; }
.editor-content iframe[src*="youtube"], .editor-content iframe[src*="youtu.be"],
.editor-content iframe[src*="vimeo"], .editor-content video {
    display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; margin: 0 0 1rem; border: 0;
}

/* ---------- Tables ---------- */
.editor-content table {
    width: 100%; max-width: 100%; margin: 0 0 1.25rem;
    border-collapse: collapse; color: inherit; background: transparent;
}
.editor-content table[style*="width"] { max-width: 100%; }
.editor-content th, .editor-content td { padding: .6rem .75rem; border: 1px solid var(--ec-line); vertical-align: top; text-align: left; }
.editor-content th, .editor-content thead td { font-weight: 700; background: rgba(226, 0, 129, .14); }
.editor-content tbody tr:nth-child(even) td { background: var(--ec-soft); }
.editor-content caption { caption-side: top; padding: 0 0 .5rem; color: inherit; font-weight: 600; }
.editor-content table[border="0"] th, .editor-content table[border="0"] td { border-color: transparent; }
@media (max-width: 767px) {
    /* Wide tables scroll sideways instead of breaking the page */
    .editor-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ---------- Text alignment / indent from the editor ---------- */
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }
.ql-size-small { font-size: .75em; }
.ql-size-large { font-size: 1.5em; }
.ql-size-huge { font-size: 2.5em; }
.ql-indent-1 { padding-left: 3em; }
.ql-indent-2 { padding-left: 6em; }
.ql-indent-3 { padding-left: 9em; }
.ql-indent-4 { padding-left: 12em; }
.ql-video { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }

/* ==========================================================================
   Layouts (editor toolbar > Layouts)
   ========================================================================== */

/* Title / Image / Text blocks; columns use the Bootstrap grid (.row / .col-md-6) */
.ed-layout { margin: 0 0 2rem; }
.ed-layout.row { margin-left: -15px; margin-right: -15px; }   /* Bootstrap 4 gutter */
.ed-layout > [class*="col-"] > :first-child { margin-top: 0; }
.ed-layout img { max-width: 100%; height: auto; }
.ed-layout h3 { margin-top: 0; }
@media (max-width: 767px) {
    /* Stacked columns: space between the image and the text */
    .ed-layout.row > [class*="col-"] + [class*="col-"] { margin-top: 1.25rem; }
}

/* Index (1/4) - Content (3/4): links beside the sections; on phones the index on top */
.ed-index-layout { align-items: flex-start; }
.ed-index > h4 { margin: 0 0 .5rem; color: #E20081; }
.ed-index > p { margin: 0 0 .9rem; }
.ed-index-list { list-style: none !important; margin: 0 0 1.5rem !important; padding: 0 !important; border-left: 3px solid rgba(127, 127, 127, .35); }
.ed-index-list li { margin: 0; padding: 0; }
.ed-index-list li::before { display: none; }
.ed-index-list a {
    display: block; margin-left: -3px; padding: .5rem .9rem;
    border-left: 3px solid transparent; color: inherit; font-weight: 600; line-height: 1.35; text-decoration: none !important;
}
.ed-index-list a:hover, .ed-index-list a:focus-visible { border-left-color: #E20081; color: #E20081; outline: none; }
.ed-section { margin: 0 0 2rem; scroll-margin-top: 140px; }   /* lands below the sticky header */
.ed-section:target > h3:first-child { color: #E20081; }
@media (min-width: 768px) {
    .ed-index-layout > .ed-index { position: sticky; top: 140px; }   /* index stays in view while the sections scroll */
}
html:has(.ed-index-layout) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html:has(.ed-index-layout) { scroll-behavior: auto; }
}
