:root {
    --dtx-navy: #0f1f3d;
    --dtx-navy-dark: #0a1530;
    --dtx-blue: #2f6fb0;
    --dtx-blue-dark: #24567f;
    --dtx-gold: #d9a441;
    --dtx-bg: #f4f6f9;
    --dtx-card-bg: #eef1f6;
    --dtx-border: #dde3ec;
    --dtx-text: #1c2733;
    --dtx-text-muted: #5b6672;
    --dtx-radius: 10px;
}

* { box-sizing: border-box; }

body.dtx {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--dtx-text);
    background: #fff;
}

a { color: var(--dtx-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Hero / header ---------- */
.dtx-hero {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--dtx-navy-dark);
}

.dtx-hero__bg {
    position: absolute;
    inset: 0;
    background-image: url("../images/hero-earth.jpg");
    background-size: cover;
    background-position: center 70%;
}

.dtx-hero__inner {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 22px 24px;
    min-height: 150px;
}

.dtx-nav,
.dtx-search-btn {
    align-self: flex-end;
    margin-bottom: 4px;
}

.dtx-logo {
    font-size: 46px;
    font-weight: 300;
    letter-spacing: 1px;
    color: #000;
    white-space: nowrap;
    line-height: 1;
}
.dtx-logo:hover { text-decoration: none; opacity: .9; }
.dtx-logo__cross { position: relative; font-weight: 400; }

/* .dtx-nav is itself a flex row so that MULTIPLE menu modules dropped into the
   "menu" position (each renders its own <ul> under style="none") flow together
   as one bar instead of stacking. e.g. a second module for the Admin menu. */
.dtx-nav {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 8px 28px;
}
.dtx-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin: 0;
    padding: 0;
}
.dtx-nav li { position: relative; }
/* Top-level items come in three shapes:
   - <a> for component / URL items;
   - a bare <span class="mod-menu__heading|__separator"> for a heading or
     separator with NO children;
   - a <button class="mod-menu__toggle-sub"> wrapping that span plus a chevron,
     when the heading/separator HAS children (a dropdown parent, e.g. "Admin").
   All three must look identical in the bar. See modules/mod_menu default.php. */
.dtx-nav > ul > li > a,
.dtx-nav > ul > li > .mod-menu__separator,
.dtx-nav > ul > li > .mod-menu__heading,
.dtx-nav > ul > li > .mod-menu__toggle-sub {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0 0 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-bottom: 2px solid transparent;
}
/* The toggle parent is a <button> — strip its native chrome. */
.dtx-nav > ul > li > .mod-menu__toggle-sub {
    background: none;
    border-width: 0 0 2px;
    border-style: solid;
    border-color: transparent;
    font-family: inherit;
    cursor: pointer;
}
/* The heading/separator span lives inside the toggle button; inherit the bar
   styling rather than the dark body text colour. */
.dtx-nav .mod-menu__toggle-sub .mod-menu__heading,
.dtx-nav .mod-menu__toggle-sub .mod-menu__separator {
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}
/* A bare (childless) heading/separator is a non-clickable label. */
.dtx-nav > ul > li > .mod-menu__separator,
.dtx-nav > ul > li > .mod-menu__heading { cursor: default; }
/* No icon font is loaded, so hide the empty chevron span and draw our own
   down-caret on dropdown parents as the "has a menu" affordance. */
.dtx-nav [class^="icon-"]:empty,
.dtx-nav [class*=" icon-"]:empty { display: none; }
.dtx-nav > ul > li > .mod-menu__toggle-sub::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-left: 2px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    opacity: .85;
}
.dtx-nav > ul > li > a:hover,
.dtx-nav > ul > li.current > a,
.dtx-nav > ul > li.active > a,
.dtx-nav > ul > li:hover > .mod-menu__separator,
.dtx-nav > ul > li:hover > .mod-menu__heading,
.dtx-nav > ul > li:hover > .mod-menu__toggle-sub {
    border-bottom-color: var(--dtx-gold);
}

.dtx-nav li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    padding: 8px 0;
    min-width: 220px;
    flex-direction: column;
    gap: 0;
}
.dtx-nav li:hover > ul { display: flex; }
.dtx-nav li ul li a {
    color: var(--dtx-navy);
    text-transform: none;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    display: block;
    border-bottom: none;
}
.dtx-nav li ul li a:hover { background: var(--dtx-bg); text-decoration: none; }

.dtx-search-btn {
    color: #fff;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.dtx-search-btn:hover { background: rgba(255,255,255,.1); text-decoration: none; }

/* ---------- Breadcrumbs ---------- */
.dtx-breadcrumbs {
    background: var(--dtx-bg);
    border-bottom: 1px solid var(--dtx-border);
    font-size: 13px;
    color: var(--dtx-text-muted);
}
.dtx-breadcrumbs .breadcrumb,
.dtx-breadcrumbs ol,
.dtx-breadcrumbs ul {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 24px;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.dtx-breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.dtx-breadcrumbs a { color: var(--dtx-blue); }

/* ---------- Layout ---------- */
.dtx-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr);
    gap: 32px;
    align-items: start;
}
.dtx-main { min-width: 0; }

@media (max-width: 860px) {
    .dtx-layout { grid-template-columns: 1fr; }
    .dtx-nav > ul { justify-content: flex-start; }
    .dtx-logo { font-size: 36px; }
}

/* ---------- Sidebar ---------- */
.dtx-box {
    background: var(--dtx-card-bg);
    border: 1px solid var(--dtx-border);
    border-radius: var(--dtx-radius);
    padding: 20px;
    margin-bottom: 24px;
}
.dtx-box__title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--dtx-navy);
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--dtx-gold);
}
.dtx-box__content ul { list-style: none; margin: 0; padding: 0; }
.dtx-box__content li {
    border-bottom: 1px solid var(--dtx-border);
}
.dtx-box__content li:last-child { border-bottom: none; }
.dtx-box__content li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 2px;
    color: var(--dtx-navy);
    font-size: 14px;
}
.dtx-box__content li a:hover { color: var(--dtx-blue); text-decoration: none; }
.dtx-box__content li a::after {
    content: "\203A";
    color: var(--dtx-text-muted);
    font-size: 16px;
}

/* Latest Scripts (mod_articles_latest) list icons */
.dtx-box .latestnews li a::before,
.dtx-box .article-list li a::before {
    content: "\1F4C4";
    margin-right: 8px;
    font-size: 13px;
}
.dtx-box .latestnews li a,
.dtx-box .article-list li a {
    justify-content: flex-start;
    gap: 4px;
}
.dtx-box .latestnews li a::after,
.dtx-box .article-list li a::after { content: none; }

.dtx-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--dtx-blue);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 22px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}
.dtx-btn:hover { background: var(--dtx-blue-dark); color: #fff; text-decoration: none; }
.dtx-btn--outline {
    background: transparent;
    border: 1px solid var(--dtx-gold);
    color: var(--dtx-navy);
}
.dtx-btn--outline:hover { background: rgba(217,164,65,.1); color: var(--dtx-navy); }
.dtx-btn--block { width: 100%; justify-content: center; margin-top: 8px; }

/* ---------- Footer ---------- */
.dtx-footer {
    background: var(--dtx-navy-dark);
    color: rgba(255,255,255,.75);
}
.dtx-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
}
.dtx-footer__tagline { margin: 0; display: flex; align-items: center; gap: 8px; }
.dtx-cross { color: var(--dtx-gold); }

/* ---------- Home page cards ---------- */
.dtx-home-hero { padding: 40px 0 24px; text-align: center; }
.dtx-home-hero h1 { font-size: 38px; margin: 0 0 8px; color: var(--dtx-navy); }
.dtx-home-hero__rule { color: var(--dtx-gold); margin: 12px 0; font-size: 18px; }
.dtx-home-hero p { color: var(--dtx-text-muted); font-size: 16px; max-width: 640px; margin: 0 auto 20px; }

.dtx-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}
@media (max-width: 640px) { .dtx-card-grid { grid-template-columns: 1fr; } }

.dtx-card {
    background: var(--dtx-card-bg);
    border: 1px solid var(--dtx-border);
    border-radius: var(--dtx-radius);
    padding: 20px;
    display: flex;
    gap: 16px;
}
.dtx-card__icon {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #dce8f5;
    color: var(--dtx-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}
.dtx-card h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0 0 6px;
    color: var(--dtx-navy);
}
.dtx-card p { margin: 0 0 8px; color: var(--dtx-text-muted); font-size: 14px; }

.dtx-banner {
    margin-top: 20px;
    background: var(--dtx-card-bg);
    border: 1px solid var(--dtx-border);
    border-radius: var(--dtx-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.dtx-banner__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--dtx-border);
    color: var(--dtx-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.dtx-banner h3 { margin: 0 0 4px; color: var(--dtx-navy); font-size: 14px; text-transform: uppercase; }
.dtx-banner p { margin: 0; color: var(--dtx-text-muted); font-size: 14px; }

/* ---------- Script meta grid (blog list + article) ---------- */
.dtx-script {
    border: 1px solid var(--dtx-border);
    border-radius: var(--dtx-radius);
    padding: 20px 24px;
    margin-bottom: 28px;
}
.dtx-script__title { font-size: 22px; margin: 0 0 6px; }
.dtx-script__title a { color: var(--dtx-navy); }
.dtx-script__byline {
    font-size: 13px;
    color: var(--dtx-text-muted);
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}
.dtx-script__meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 24px;
    border-top: 1px solid var(--dtx-border);
    padding-top: 16px;
    margin-bottom: 16px;
}
@media (max-width: 640px) { .dtx-script__meta { grid-template-columns: 1fr; } }
.dtx-script__meta-item { font-size: 13px; }
.dtx-script__meta-item--full { grid-column: 1 / -1; }
.dtx-script__meta-label {
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--dtx-text-muted);
    font-size: 11px;
    letter-spacing: .5px;
    margin-bottom: 4px;
}
.dtx-script__meta-icon { color: var(--dtx-blue); flex: none; }
.dtx-script__meta-value { color: var(--dtx-text); }

.dtx-script__section {
    border-top: 1px solid var(--dtx-border);
    padding-top: 14px;
    margin-top: 14px;
}
.dtx-script__section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--dtx-text-muted);
    font-size: 11px;
    letter-spacing: .5px;
    margin-bottom: 8px;
}

.dtx-rating {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.dtx-rating .content_rating ul {
    list-style: none;
    display: inline-flex;
    gap: 2px;
    margin: 0 8px 0 0;
    padding: 0;
}
.dtx-rating .content_rating svg,
.dtx-rating .content_rating img { width: 16px; height: 16px; fill: var(--dtx-gold); }
.dtx-rating form.form-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.dtx-rating select { border: 1px solid var(--dtx-border); border-radius: 6px; padding: 6px 8px; }
.dtx-rating input[type="submit"] {
    border: 1px solid var(--dtx-border);
    background: #fff;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
}

.dtx-page-title {
    font-size: 32px;
    color: var(--dtx-navy);
    margin: 4px 0 4px;
    border-bottom: 3px solid var(--dtx-gold);
    display: inline-block;
    padding-bottom: 6px;
}
.dtx-cat-title {
    font-size: 28px;
    color: var(--dtx-navy);
    margin: 4px 0 20px;
}

.dtx-attachments {
    border-top: 1px solid var(--dtx-border);
    padding-top: 14px;
    margin-top: 14px;
}
.dtx-attachments ul { list-style: none; margin: 0; padding: 0; }
.dtx-attachments li { padding: 4px 0; font-size: 14px; }
.dtx-attachments a::before { content: "\2913"; margin-right: 6px; }

.dtx-readmore { margin-top: 14px; }

/* ---------- Utility ---------- */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

/* ---------- Smart Search page ---------- */
.dtx-search__head { margin-bottom: 22px; }
.dtx-search__lead {
    color: var(--dtx-text-muted);
    font-size: 15px;
    margin: 12px 0 0;
}

/* Search bar */
.dtx-search__bar { border: 0; margin: 0; padding: 0; }
.dtx-search__input-group {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--dtx-border);
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(15, 31, 61, .06);
    overflow: hidden;
    transition: box-shadow .15s, border-color .15s;
}
.dtx-search__input-group:focus-within {
    border-color: var(--dtx-blue);
    box-shadow: 0 4px 16px rgba(47, 111, 176, .18);
}
.dtx-search__icon {
    display: flex;
    align-items: center;
    padding-left: 20px;
    color: var(--dtx-text-muted);
    flex: none;
}
/* The autosuggest script wraps the input in a .awesomplete div, which becomes
   the flex child; make it grow so the submit button sits at the right edge. */
.dtx-search__input-group .awesomplete {
    flex: 1 1 auto;
    min-width: 0;
}
.dtx-search__field {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: var(--dtx-text);
    padding: 16px 14px;
    min-width: 0;
}
.dtx-search__field::placeholder { color: var(--dtx-text-muted); }
.dtx-search__submit {
    border-radius: 999px;
    margin: 5px;
    padding: 10px 26px;
    flex: none;
}

/* Advanced filters (native <details>) */
.dtx-search__advanced {
    margin-top: 16px;
    border: 1px solid var(--dtx-border);
    border-radius: var(--dtx-radius);
    background: var(--dtx-card-bg);
}
.dtx-search__advanced-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--dtx-navy);
    user-select: none;
}
.dtx-search__advanced-toggle::-webkit-details-marker { display: none; }
.dtx-search__advanced-toggle::after {
    content: "\203A";
    margin-left: auto;
    font-size: 20px;
    color: var(--dtx-text-muted);
    transform: rotate(90deg);
    transition: transform .2s;
}
.dtx-search__advanced[open] > .dtx-search__advanced-toggle::after { transform: rotate(-90deg); }
.dtx-search__advanced-icon { display: inline-flex; color: var(--dtx-blue); }
.dtx-search__advanced-body {
    padding: 4px 18px 20px;
    border-top: 1px solid var(--dtx-border);
}
.dtx-search__tips {
    font-size: 13px;
    color: var(--dtx-text-muted);
    line-height: 1.6;
    margin: 14px 0 18px;
}
.dtx-search__filters .filter-branch {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px 18px;
}
.dtx-search__filters .control-group { min-width: 0; }
.dtx-search__filters .control-label label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--dtx-text-muted);
    margin-bottom: 5px;
}
.dtx-search__filters select,
.dtx-search__filters input[type="text"] {
    width: 100%;
    border: 1px solid var(--dtx-border);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 14px;
    background: #fff;
    color: var(--dtx-text);
}

/* Explained / suggested query line */
.com-finder__explained {
    font-size: 14px;
    color: var(--dtx-text-muted);
    margin: 24px 0 4px;
}
.com-finder__explained p { margin: 0; }

/* No results */
.com-finder__empty {
    margin-top: 28px;
    padding: 32px 24px;
    text-align: center;
    background: var(--dtx-card-bg);
    border: 1px solid var(--dtx-border);
    border-radius: var(--dtx-radius);
}
.com-finder__empty h2 { margin: 0 0 8px; color: var(--dtx-navy); font-size: 20px; }
.com-finder__empty p { margin: 0; color: var(--dtx-text-muted); }

/* Sort control */
.com-finder__sorting {
    display: flex;
    justify-content: flex-end;
    margin: 20px 0 0;
}
.dtx-search__sort {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.dtx-search__sort label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--dtx-text-muted);
    margin: 0;
}
.dtx-search__sort-select {
    border: 1px solid var(--dtx-border);
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 14px;
    background: #fff;
    color: var(--dtx-text);
    cursor: pointer;
}

/* Results list */
.com-finder__results-list {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
}
.result__item {
    padding: 18px 0;
    border-bottom: 1px solid var(--dtx-border);
}
.result__item:first-child { padding-top: 6px; }
.result__title { margin: 0 0 6px; font-size: 18px; }
.result__title-link { color: var(--dtx-navy); font-weight: 600; }
.result__title-link:hover { color: var(--dtx-blue); }
.result__title-url {
    display: block;
    font-style: normal;
    font-size: 12px;
    color: #6c8a52;
    margin-top: 2px;
}
.result__description {
    margin: 0;
    color: var(--dtx-text-muted);
    font-size: 14px;
    line-height: 1.6;
}
.result__date { color: var(--dtx-navy); font-weight: 600; margin-right: 6px; }
.js-highlight .highlight,
.result__description .highlight {
    background: rgba(217, 164, 65, .28);
    border-radius: 2px;
    padding: 0 2px;
}
.result__taxonomy {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin: 10px 0 0;
    padding: 0;
}
.result__taxonomy-item {
    font-size: 11px;
    color: var(--dtx-text-muted);
    background: var(--dtx-card-bg);
    border: 1px solid var(--dtx-border);
    border-radius: 999px;
    padding: 3px 10px;
}
.result__taxonomy-item span { font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }

/* Search results pagination counter */
.com-finder__counter {
    text-align: center;
    color: var(--dtx-text-muted);
    font-size: 13px;
    margin-top: 10px;
}

/* ---------- Pagination ---------- */
.com-content-category-blog__navigation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}
.com-content-category-blog__counter {
    color: var(--dtx-text-muted);
    font-size: 13px;
    margin: 0;
}
.pagination__wrapper { display: flex; justify-content: center; }
ul.pagination {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin: 0;
    padding: 0;
}
ul.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid var(--dtx-border);
    color: var(--dtx-navy);
    font-size: 13px;
    background: #fff;
}
ul.pagination a.page-link:hover {
    background: var(--dtx-bg);
    text-decoration: none;
}
ul.pagination .active .page-link {
    background: var(--dtx-blue);
    border-color: var(--dtx-blue);
    color: #fff;
}
ul.pagination .disabled .page-link {
    color: var(--dtx-text-muted);
    opacity: .45;
    border-color: var(--dtx-border);
}
ul.pagination .icon-angle-left::before { content: "\2039"; }
ul.pagination .icon-angle-right::before { content: "\203A"; }
ul.pagination .icon-angle-double-left::before { content: "\00AB"; }
ul.pagination .icon-angle-double-right::before { content: "\00BB"; }

/* ---------- Scripts page search bar ---------- */
.dtx-scripts-search {
    display: flex;
    gap: 8px;
    margin: 4px 0 22px;
}
.dtx-scripts-search__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 16px;
    font-size: 16px;
    color: var(--dtx-navy);
    background: var(--dtx-card-bg);
    border: 1px solid var(--dtx-border);
    border-radius: var(--dtx-radius);
}
.dtx-scripts-search__input:focus {
    outline: none;
    border-color: var(--dtx-blue);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, .15);
}
.dtx-scripts-search__btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--dtx-blue);
    border: 0;
    border-radius: var(--dtx-radius);
    cursor: pointer;
    transition: background .15s ease;
}
.dtx-scripts-search__btn:hover { background: var(--dtx-navy); }
@media (max-width: 480px) {
    .dtx-scripts-search__btn span { display: none; }
    .dtx-scripts-search__btn { padding: 0 16px; }
}

/* ---------- Subcategory cards (category blog pages) ---------- */
.dtx-subcats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.dtx-subcat {
    position: relative;
    background: var(--dtx-card-bg);
    border: 1px solid var(--dtx-border);
    border-radius: var(--dtx-radius);
    padding: 18px 20px;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.dtx-subcat:hover,
.dtx-subcat:focus-within {
    border-color: var(--dtx-blue);
    box-shadow: 0 2px 10px rgba(28, 39, 51, .1);
    transform: translateY(-1px);
}

.dtx-subcat__title {
    font-size: 16px;
    line-height: 1.3;
    font-weight: 700;
    margin: 0;
}
.dtx-subcat__link { color: var(--dtx-navy); }
.dtx-subcat__link:hover { text-decoration: none; }
/* Whole card is the click target. The title stays the real link so the
   accessible name and keyboard focus order are unchanged. */
.dtx-subcat__link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--dtx-radius);
}
.dtx-subcat__link:focus-visible::after {
    outline: 2px solid var(--dtx-blue);
    outline-offset: 2px;
}

.dtx-subcat__count {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--dtx-text-muted);
}

.dtx-subcat__desc {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--dtx-text-muted);
}
.dtx-subcat__desc :first-child { margin-top: 0; }
.dtx-subcat__desc :last-child { margin-bottom: 0; }
/* Description links must stay clickable above the card-wide overlay. */
.dtx-subcat__desc a { position: relative; }

/* A nested level, if one ever exists, sits inside its parent card. */
.dtx-subcat .dtx-subcats {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 12px;
}
.dtx-subcat .dtx-subcat {
    padding: 10px 12px;
    background: #fff;
}

@media (max-width: 480px) {
    .dtx-subcats { grid-template-columns: 1fr; }
}

/* ---------- Home page blocks now rendered from modules ---------- */
/* The chromes (dtxHomeHero, dtxCard, dtxBanner) own the structure; the module
   body is ordinary paragraphs. These rules turn the final paragraph's link into
   the call-to-action button so nobody has to type a class in the editor. */

.dtx-card__body { min-width: 0; }

.dtx-home-hero p:last-child { margin-bottom: 0; }
.dtx-home-hero p:last-child a {
    display: inline-block;
    background: var(--dtx-blue);
    color: #fff;
    border: 1px solid var(--dtx-blue);
    border-radius: var(--dtx-radius);
    padding: 10px 20px;
    font-weight: 600;
    font-size: 15px;
}
.dtx-home-hero p:last-child a:hover { text-decoration: none; opacity: .92; }

/* Banner: heading takes the full width, the text and the button share the row
   below it, with the button pushed to the right edge. */
.dtx-banner__body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    flex: 1;
}
.dtx-banner__body h3 { flex: 0 0 100%; }
.dtx-banner__body p { margin: 0; }
.dtx-banner__body p:last-child { margin-left: auto; }
.dtx-banner__body p:last-child a {
    display: inline-block;
    border: 1px solid var(--dtx-blue);
    color: var(--dtx-blue);
    border-radius: var(--dtx-radius);
    padding: 8px 18px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}
.dtx-banner__body p:last-child a:hover { text-decoration: none; background: #dce8f5; }

@media (max-width: 560px) {
    .dtx-banner__body p:last-child { margin-left: 0; }
}

/* ---------- Front-end forms: user account views + article add/edit ----------
   Dramatix ships no Bootstrap, but core layouts are written for it
   (.control-group / .control-label / .controls, .btn*, .well, .list-group,
   .dl-horizontal, fieldset + legend). These rules re-create just enough, using
   the site's --dtx-* tokens so the forms match the rest of the site. Scoped via
   :is([class*="com-users-"], .edit) — the com_users views (login, profile,
   register, reset, remind) and the com_content front-end edit form (<div
   class="edit item-page">) — so the finder search page (which also uses
   .control-group) and the admin are left untouched. */

/* Centred, readable column per view */
.dtx .com-users-login,
.dtx .com-users-profile,
.dtx .com-users-profile__edit,
.dtx .com-users-registration,
.dtx .com-users-remind,
.dtx .com-users-reset {
    max-width: 640px;
    margin: 8px auto 32px;
}

.dtx :is([class*="com-users-"], .edit) .page-header h1 {
    color: var(--dtx-navy);
    margin: 0 0 18px;
    font-size: 28px;
}

/* The form itself becomes a card */
.dtx :is([class*="com-users-"], .edit) form {
    background: var(--dtx-card-bg);
    border: 1px solid var(--dtx-border);
    border-radius: var(--dtx-radius);
    padding: 24px;
    margin: 0;
}

.dtx :is([class*="com-users-"], .edit) fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.dtx :is([class*="com-users-"], .edit) legend {
    display: block;
    width: 100%;
    margin: 0 0 16px;
    padding: 0 0 8px;
    border-bottom: 2px solid var(--dtx-gold);
    color: var(--dtx-navy);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}

/* Field rows: label stacked above its control */
.dtx :is([class*="com-users-"], .edit) .control-group { margin-bottom: 16px; }
.dtx :is([class*="com-users-"], .edit) .control-label { margin-bottom: 5px; }
.dtx :is([class*="com-users-"], .edit) .control-label label {
    font-weight: 600;
    font-size: 13px;
    color: var(--dtx-navy);
}
.dtx :is([class*="com-users-"], .edit) .control-label label .star { color: var(--dtx-gold); margin-left: 2px; }

/* Inputs */
.dtx :is([class*="com-users-"], .edit) input[type="text"],
.dtx :is([class*="com-users-"], .edit) input[type="email"],
.dtx :is([class*="com-users-"], .edit) input[type="password"],
.dtx :is([class*="com-users-"], .edit) input[type="tel"],
.dtx :is([class*="com-users-"], .edit) input[type="url"],
.dtx :is([class*="com-users-"], .edit) input[type="number"],
.dtx :is([class*="com-users-"], .edit) input[type="date"],
.dtx :is([class*="com-users-"], .edit) select,
.dtx :is([class*="com-users-"], .edit) textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.4;
    color: var(--dtx-text);
    background: #fff;
    border: 1px solid var(--dtx-border);
    border-radius: var(--dtx-radius);
    transition: border-color .15s ease, box-shadow .15s ease;
}
/* Match single-line controls to the same height. A native <select> otherwise
   sizes shorter than a text input, so pin both to one min-height (the Options
   tab has selects sitting next to text/date fields). */
.dtx :is([class*="com-users-"], .edit) input:not([type="checkbox"]):not([type="radio"]),
.dtx :is([class*="com-users-"], .edit) select {
    min-height: 44px;
}
/* Read-only / disabled controls (e.g. custom fields the current user's group
   lacks "Edit Custom Field Value" permission for) should look inert. */
.dtx :is([class*="com-users-"], .edit) input:disabled,
.dtx :is([class*="com-users-"], .edit) select:disabled,
.dtx :is([class*="com-users-"], .edit) textarea:disabled,
.dtx :is([class*="com-users-"], .edit) input[readonly] {
    background: var(--dtx-bg);
    color: var(--dtx-text-muted);
    cursor: not-allowed;
}
.dtx :is([class*="com-users-"], .edit) input:focus,
.dtx :is([class*="com-users-"], .edit) select:focus,
.dtx :is([class*="com-users-"], .edit) textarea:focus {
    outline: none;
    border-color: var(--dtx-blue);
    box-shadow: 0 0 0 3px rgba(47, 111, 176, .15);
}

/* Client-side validation. The validator (media/system/js/fields/validate.js)
   appends a <span class="form-control-feedback"> inside the field's <label>
   and adds .invalid to the input. Without this the message inherits the bold
   navy label style and sits jammed against it ("Username *Please fill…"), so
   give it its own red line and flag the input with a red border. */
.dtx :is([class*="com-users-"], .edit) .control-label label .form-control-feedback {
    display: block;
    margin-top: 3px;
    color: #b02a2a;
    font-size: 12px;
    font-weight: 400;
}
.dtx :is([class*="com-users-"], .edit) .form-check .form-control-feedback {
    display: block;
    color: #b02a2a;
    font-size: 12px;
}
.dtx :is([class*="com-users-"], .edit) input.invalid,
.dtx :is([class*="com-users-"], .edit) select.invalid,
.dtx :is([class*="com-users-"], .edit) textarea.invalid { border-color: #b02a2a; }
.dtx :is([class*="com-users-"], .edit) input.invalid:focus,
.dtx :is([class*="com-users-"], .edit) select.invalid:focus,
.dtx :is([class*="com-users-"], .edit) textarea.invalid:focus { box-shadow: 0 0 0 3px rgba(176, 42, 42, .15); }

/* Inline help text under a field */
.dtx :is([class*="com-users-"], .edit) .form-text,
.dtx :is([class*="com-users-"], .edit) .controls small {
    display: block;
    margin-top: 4px;
    color: var(--dtx-text-muted);
    font-size: 12px;
}

/* Checkboxes (remember-me, etc.) sit inline with their label */
.dtx :is([class*="com-users-"], .edit) .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 16px;
}
.dtx :is([class*="com-users-"], .edit) .form-check-input { width: auto; margin: 0; }
.dtx :is([class*="com-users-"], .edit) .form-check-label { margin: 0; font-size: 14px; }

/* Buttons — reuse the .dtx-btn pill look */
.dtx :is([class*="com-users-"], .edit) .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--dtx-blue);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}
.dtx :is([class*="com-users-"], .edit) .btn:hover { background: var(--dtx-blue-dark); color: #fff; text-decoration: none; }
.dtx :is([class*="com-users-"], .edit) .btn-secondary {
    background: #fff;
    border: 1px solid var(--dtx-border);
    color: var(--dtx-navy);
}
.dtx :is([class*="com-users-"], .edit) .btn-secondary:hover { background: var(--dtx-bg); color: var(--dtx-navy); }
.dtx :is([class*="com-users-"], .edit) .btn-danger {
    background: transparent;
    border: 1px solid var(--dtx-border);
    color: var(--dtx-text-muted);
}
.dtx :is([class*="com-users-"], .edit) .btn-danger:hover { background: var(--dtx-bg); color: var(--dtx-text); }
.dtx :is([class*="com-users-"], .edit) .btn.w-100 { width: 100%; justify-content: center; }

/* Icons inside buttons. The template loads no icon font, so empty icon-*
   spans are hidden (otherwise they leave a stray gap before the label), and
   inline SVGs such as the passkey button's glyph are sized down to fit. */
.dtx :is([class*="com-users-"], .edit) .btn svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}
.dtx :is([class*="com-users-"], .edit) .btn [class^="icon-"]:empty,
.dtx :is([class*="com-users-"], .edit) .btn [class*=" icon-"]:empty { display: none; }

/* Password field: core wraps the input and a show/hide-password toggle in an
   .input-group. The toggle's eye glyph is an icon-font character that can't
   render here, so it collapses to an empty pill — hide it and let the input
   fill the row. */
.dtx :is([class*="com-users-"], .edit) .input-group {
    display: flex;
    align-items: stretch;
}
.dtx :is([class*="com-users-"], .edit) .input-group > input { flex: 1 1 auto; width: auto; }
.dtx :is([class*="com-users-"], .edit) .input-password-toggle { display: none; }

/* Login: the reset / remind / register links */
.dtx .com-users-login__options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 18px;
    padding: 0;
}
.dtx .com-users-login__options a { font-size: 14px; }
.dtx .com-users-login__options a:hover { text-decoration: underline; }

/* Profile display view */
.dtx .com-users-profile .btn-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}
.dtx .com-users-profile .btn-group { display: inline-flex; }
.dtx .com-users-profile fieldset {
    background: var(--dtx-card-bg);
    border: 1px solid var(--dtx-border);
    border-radius: var(--dtx-radius);
    padding: 20px 24px;
    margin-bottom: 16px;
}
.dtx .com-users-profile .dl-horizontal {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 24px;
    margin: 0;
}
.dtx .com-users-profile .dl-horizontal dt { font-weight: 600; color: var(--dtx-navy); }
.dtx .com-users-profile .dl-horizontal dd { margin: 0; color: var(--dtx-text); }

@media (max-width: 560px) {
    .dtx :is([class*="com-users-"], .edit) form { padding: 18px; }
    .dtx .com-users-profile .dl-horizontal { grid-template-columns: 1fr; gap: 2px 0; }
    .dtx .com-users-profile .dl-horizontal dd { margin-bottom: 10px; }
}

/* ---------- Article add/edit form (front-end com_content) ----------
   The form is organised with the <joomla-tab> web component, which is
   self-contained (ships its own CSS/JS at media/vendor/joomla-custom-elements
   — not Bootstrap), so the tabs work here. Its defaults are grey with a blue
   accent; retheme to the dramatix navy/gold. Field, input, fieldset/legend and
   button styling is inherited from the shared form rules above via the .edit
   scope. */

/* Room for the rich-text editor. */
.dtx .edit { max-width: 900px; }

/* Tab strip + buttons */
.dtx .edit joomla-tab[view="tabs"] > div[role="tablist"] {
    background: var(--dtx-bg);
    border-color: var(--dtx-border);
    border-radius: var(--dtx-radius) var(--dtx-radius) 0 0;
    box-shadow: none;
}
.dtx .edit joomla-tab button[role="tab"] {
    color: var(--dtx-text-muted);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .3px;
    text-transform: uppercase;
    box-shadow: none;
}
.dtx .edit joomla-tab button[role="tab"][aria-selected="true"],
.dtx .edit joomla-tab button[role="tab"][aria-expanded="true"] {
    color: var(--dtx-navy);
    background: #fff;
    box-shadow: none;
}
/* Active-tab accent → gold */
.dtx .edit joomla-tab button[aria-selected="true"]::after,
.dtx .edit joomla-tab button[aria-expanded="true"]::after {
    background: var(--dtx-gold);
    opacity: 1;
    height: 3px;
}
/* Panes */
.dtx .edit joomla-tab > joomla-tab-element {
    background: #fff;
    border-color: var(--dtx-border);
    border-radius: 0 0 var(--dtx-radius) var(--dtx-radius);
}

/* Accordion mode (below the 768px breakpoint): retheme the section toggles. */
.dtx .edit joomla-tab[view="accordion"] > button {
    background: var(--dtx-bg);
    color: var(--dtx-navy);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
}
.dtx .edit joomla-tab[view="accordion"] > button[aria-expanded="true"]::after {
    background: var(--dtx-gold);
}

/* Submit / cancel row. Core wraps the buttons in Bootstrap .d-grid utilities
   that do nothing here, so lay them out as a simple wrapped row. */
.dtx .edit .d-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

/* ---------- Repeatable subform fields (e.g. the Downloads / Attachments tab) ----------
   Rendered by the <joomla-field-subform> web component as a .table with a
   controls column of .group-add / .group-remove / .group-move buttons. Those
   are .btn (so the shared pill styling hits them) with icon-font glyphs that
   don't render here — reset them to small square buttons and draw the glyphs. */
.dtx .edit table.table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
.dtx .edit table.table th,
.dtx .edit table.table td {
    padding: 8px 10px;
    border: 1px solid var(--dtx-border);
    text-align: left;
    vertical-align: middle;
}
.dtx .edit table.table th {
    background: var(--dtx-bg);
    color: var(--dtx-navy);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
}
/* Keep the controls column tight. */
.dtx .edit table.table td:last-child,
.dtx .edit table.table th:last-child { width: 1%; white-space: nowrap; }
.dtx .edit .btn-group { display: inline-flex; gap: 4px; }

/* Row-control buttons: small squares with drawn glyphs (override the pill). */
.dtx .edit :is(.group-add, .group-remove, .group-move).btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 6px;
    justify-content: center;
    gap: 0;
    font-size: 0;
    line-height: 1;
}
.dtx .edit .group-add.btn { background: var(--dtx-blue); }
.dtx .edit .group-add.btn:hover { background: var(--dtx-blue-dark); }
.dtx .edit .group-remove.btn { background: #b02a2a; }
.dtx .edit .group-remove.btn:hover { background: #8f2020; }
.dtx .edit .group-move.btn { background: var(--dtx-text-muted); cursor: move; }
.dtx .edit .group-move.btn:hover { background: var(--dtx-navy); }
.dtx .edit :is(.group-add, .group-remove, .group-move).btn::before {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}
.dtx .edit .group-add.btn::before    { content: "+"; }
.dtx .edit .group-remove.btn::before { content: "\2212"; } /* − minus sign */
.dtx .edit .group-move.btn::before   { content: "\2195"; } /* ↕ up-down arrow */

/* ---------- Calendar (date) fields ----------
   .field-calendar renders an .input-group of <input> + a .btn toggle whose
   icon-calendar glyph needs an icon font. Make the toggle a square button flush
   with the input and paint a calendar icon (inline SVG, like the header
   search). Affects the Publishing tab's Start/Finish Publishing/Featured. */
.dtx :is([class*="com-users-"], .edit) .field-calendar .input-group > input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.dtx :is([class*="com-users-"], .edit) .field-calendar .btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 0 var(--dtx-radius) var(--dtx-radius) 0;
    font-size: 0;
    background: var(--dtx-blue) url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23fff'%20stroke-width='2'%20stroke-linecap='round'%3E%3Crect%20x='3'%20y='4'%20width='18'%20height='17'%20rx='2'/%3E%3Cline%20x1='16'%20y1='2'%20x2='16'%20y2='6'/%3E%3Cline%20x1='8'%20y1='2'%20x2='8'%20y2='6'/%3E%3Cline%20x1='3'%20y1='10'%20x2='21'%20y2='10'/%3E%3C/svg%3E") no-repeat center / 18px 18px;
}
.dtx :is([class*="com-users-"], .edit) .field-calendar .btn:hover { background-color: var(--dtx-blue-dark); }

/* ---------- choices.js widgets (Category, Tags, and other enhanced selects) ----------
   choices.js hides the native <select> and renders its own .choices__inner box
   (grey by default), so the plain-select rules don't reach it. Match it to the
   text inputs: white, same border/radius/height. */
.dtx :is([class*="com-users-"], .edit) .choices { width: 100%; margin-bottom: 0; }
.dtx :is([class*="com-users-"], .edit) .choices__inner {
    min-height: 44px;
    padding: 5px 10px;
    font-size: 15px;
    background: #fff;
    border: 1px solid var(--dtx-border);
    border-radius: var(--dtx-radius);
}
.dtx :is([class*="com-users-"], .edit) .choices.is-focused .choices__inner,
.dtx :is([class*="com-users-"], .edit) .choices.is-open .choices__inner {
    border-color: var(--dtx-blue);
    box-shadow: 0 0 0 3px rgba(47, 111, 176, .15);
}
.dtx :is([class*="com-users-"], .edit) .choices__list--dropdown {
    border-color: var(--dtx-border);
    border-radius: 0 0 var(--dtx-radius) var(--dtx-radius);
}

/* ---------- Front-end "Edit" link on articles ----------
   Shown top-right of an article to users with edit permission (access-edit).
   Uses the existing .dtx-btn--outline pill. */
.dtx-script__actions {
    float: right;
    margin: 0 0 10px 16px;
}
.dtx-script__actions .dtx-btn {
    padding: 8px 16px;
    font-size: 13px;
}
.dtx-script__actions .dtx-btn svg { width: 15px; height: 15px; }
