:root {
    --wudi-navy: #0a1c2b;
    --wudi-red: #a4161a;
    --wudi-white: #ffffff;
    --wudi-black: #111111;
    --wudi-footer-text: #c9c9c9;
    --wudi-body-text: #1a1a1a;
    --wudi-muted: #555555;
    --wudi-card-bg: #f5f6f8;
    --wudi-card-border: #e2e4e8;
    --wudi-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body.wudi {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    margin: 0;
    font-family: var(--wudi-font);
    color: var(--wudi-body-text);
    background: var(--wudi-white);
}

a {
    color: inherit;
}

/* Baseline heading scale so h1/h2/h3 read as distinct levels wherever
   they show up without a more specific rule of their own (e.g. legacy
   component pages like registration's .componentheading, which only
   sets margin/weight, not size). .wudi-page-header h1 and
   .wudi-section-heading below still win where they're more specific. */
h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--wudi-navy);
    margin: 0 0 16px;
}

h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--wudi-navy);
    margin: 0 0 12px;
}

h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--wudi-body-text);
    margin: 0 0 8px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.wudi-utility {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--wudi-navy);
    color: var(--wudi-white);
    padding: 6px 24px 16px;
}

.wudi-logo {
    display: flex;
    align-items: center;
}

.wudi-logo img {
    display: block;
    height: 64px;
    width: auto;
}

.wudi-body {
    flex: 1 0 auto;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 24px 40px;
}

.wudi-footer {
    flex-shrink: 0;
    background: var(--wudi-black);
    color: var(--wudi-footer-text);
    padding: 40px 24px;
    font-size: 13px;
}

.wudi-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

.wudi-footer-social {
    display: flex;
    gap: 20px;
}

.wudi-footer a {
    color: var(--wudi-footer-text);
    text-decoration: none;
}

.wudi-footer a:hover {
    color: var(--wudi-white);
}

.wudi-utility-right a {
    color: var(--wudi-white);
    text-decoration: none;
    font-size: 14px;
}

.wudi-user-menu {
    position: relative;
}

.wudi-user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--wudi-white);
    font-family: var(--wudi-font);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 0;
}

.wudi-user-menu-list {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--wudi-white);
    border: 1px solid var(--wudi-card-border);
    border-radius: 6px;
    list-style: none;
    margin: 6px 0 0;
    padding: 4px;
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 20;
}

.wudi-user-menu-list.is-open {
    display: block;
}

.wudi-user-menu-list a {
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    color: var(--wudi-body-text);
    text-decoration: none;
    font-size: 13px;
}

.wudi-user-menu-list a:hover {
    background: var(--wudi-card-bg);
}

.wudi-nav {
    background: var(--wudi-red);
}

.wudi-nav-list {
    list-style: none;
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 10px 24px;
}

.wudi-nav-list a {
    color: var(--wudi-white);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.wudi-nav-list a.active {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.wudi-nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
}

.wudi-nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--wudi-white);
    margin: 4px 0;
}

@media (max-width: 700px) {
    .wudi-nav {
        display: flex;
        justify-content: flex-end;
        position: relative;
    }

    .wudi-nav-toggle {
        display: block;
    }

    .wudi-nav-list {
        display: none;
        flex-direction: column;
        gap: 0;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--wudi-red);
        padding: 8px 0;
        z-index: 10;
    }

    .wudi-nav-list.is-open {
        display: flex;
    }

    .wudi-nav-list li {
        padding: 10px 24px;
    }
}

.wudi-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--wudi-red);
    margin-bottom: 4px;
}

.wudi-page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--wudi-navy);
    margin: 0 0 16px;
}

.wudi-home-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

.wudi-card {
    background: var(--wudi-card-bg);
    border: 1px solid var(--wudi-card-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.wudi-section-heading {
    font-size: 19px;
    font-weight: 700;
    color: var(--wudi-navy);
    margin: 0 0 14px;
}

@media (max-width: 700px) {
    .wudi-home-grid {
        grid-template-columns: 1fr;
    }
}

/* Homepage news cards: image as full-bleed background, date + title
   overlaid, whole card clickable through to the article. Joomla's
   Featured Articles view splits into two groups — "Leading" (one
   full-width hero) and "Intro" (a grid below it) — which is exactly
   the big-card-then-row layout this is built for. */
.blog-featured {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog-items:not(.items-leading) {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.blog-item {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 220px;
    border-radius: 8px;
    overflow: hidden;
    isolation: isolate;
}

.items-leading .blog-item {
    min-height: 320px;
}

.blog-item .item-image {
    position: absolute;
    inset: 0;
    margin: 0;
    z-index: -2;
}

.blog-item .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    border-radius: 0;
}

.blog-item .item-image a {
    pointer-events: none;
}

.blog-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 28, 43, 0.1) 0%, rgba(10, 28, 43, 0.9) 100%);
    z-index: -1;
}

.blog-item .item-content {
    position: relative;
    padding: 20px;
    color: var(--wudi-white);
}

/* Hide everything in the card body except the date/title overlay - not
   just <p>, since an article with no Read More break (e.g. one authored
   elsewhere and pasted in whole) can put figures/images/headings/lists
   directly in the introtext too, and those would otherwise render
   full-size and unstyled inside the card. */
.blog-item .item-content > *:not(.article-info):not(.item-title),
.blog-item .items-more,
.blog-item .tags {
    display: none;
}

.blog-item .article-info {
    display: flex;
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--wudi-white);
}

.blog-item .article-info dt,
.blog-item .article-info .icon-calendar,
.blog-item .article-info .createdby,
.blog-item .article-info .category-name,
.blog-item .article-info .parent-category-name,
.blog-item .article-info .hits {
    display: none;
}

.blog-item .item-title {
    color: var(--wudi-white);
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.items-leading .blog-item .item-title {
    font-size: 28px;
}

.blog-item .item-title a {
    color: var(--wudi-white);
    text-decoration: none;
}

.blog-item .item-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Full single-article page (com_content's default article view) is a
   completely separate template from the homepage's .blog-item cards
   above — images here should behave like normal responsive content,
   not the cropped-cover card backgrounds. */
.com-content-article img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.com-content-article .item-image {
    margin: 0 0 16px;
}

.com-content-article .item-image figcaption {
    font-size: 12px;
    color: var(--wudi-muted);
    margin-top: 6px;
}

/* Joomla's own article view renders its own title heading and a
   Details/Written-by/Category/Published/Hits block — both redundant
   with this template's own eyebrow+H1 pattern, which already names
   every page consistently. */
.com-content-article .page-header,
.com-content-article .article-info {
    display: none;
}

@media (max-width: 700px) {
    .blog-items:not(.items-leading) {
        grid-template-columns: 1fr;
    }
}

.wudi-card h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--wudi-navy);
    margin: 0 0 8px;
}

.wudi-card ul {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
}

/* Joomla's front-end module editing (shown to logged-in editors on the
   Quick Links / Fall League at a Glance modules) adds an edit link plus a
   tooltip meant to only appear on hover — that requires Bootstrap's
   tooltip JS, which this template doesn't load, so the tooltip renders as
   permanently-visible text instead. Keep the edit link, drop the tooltip
   text, and make the link legible without Joomla's (also unloaded) icon
   font. */
[role="tooltip"] {
    display: none;
}

.jmodedit {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: var(--wudi-card-bg);
    border: 1px solid var(--wudi-card-border);
    border-radius: 4px;
    color: var(--wudi-navy);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
}

.jmodedit:hover {
    background: var(--wudi-white);
    border-color: var(--wudi-navy);
}

.jmodedit .visually-hidden {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Joomla core views (login, registration, reset/remind, edit profile) use
   Joomla's own Bootstrap-style class names, but this template loads no
   Bootstrap — style the real markup directly instead of pulling in a whole
   framework for a handful of pages. */
.com-users-login,
.com-users-profile,
div.com-users-profile__edit,
.com-users-registration,
.com-users-remind,
.com-users-reset {
    max-width: 480px;
    margin: 0 auto;
}

.com-users-login .page-header,
.com-users-profile .page-header,
div.com-users-profile__edit .page-header,
.com-users-registration .page-header,
.com-users-remind .page-header,
.com-users-reset .page-header {
    display: none;
}

/* Joomla reuses the "com-users-profile__edit" class name for the Edit
   Profile button toolbar on the read-only Profile page too (a totally
   different element than the edit-form container above) — style that
   specific case as a plain right-aligned button, not a bulleted list. */
ul.com-users-profile__edit {
    list-style: none;
    display: flex;
    justify-content: flex-end;
    margin: 0 0 16px;
    padding: 0;
    max-width: none;
}

.com-users-profile img {
    max-width: 150px;
    height: auto;
    border-radius: 6px;
    display: block;
}

.com-users-profile__multifactor {
    display: none;
}

fieldset {
    border: none;
    margin: 0 0 24px;
    padding: 0;
}

legend {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--wudi-navy);
    width: 100%;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--wudi-card-border);
}

.control-group,
.form-group {
    margin-bottom: 16px;
}

.control-label,
.com-users-login label,
.com-users-profile__edit label,
.com-users-registration label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--wudi-body-text);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="tel"],
select,
textarea {
    box-sizing: border-box;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--wudi-card-border);
    border-radius: 6px;
    font-family: var(--wudi-font);
    font-size: 14px;
}

/* Full-width fields are correct for Joomla's own login/profile/registration
   forms (one field per row, card layout) but wrong for the com_ultileague
   league-signup pages, which are legacy table layouts of many short fields
   (state, jersey size, etc.) that size themselves via size="" / inline
   styles. Scoping width:100% to just these three contexts keeps the
   league-signup forms at their intended compact widths. */
:is(.com-users-login, .com-users-profile__edit, .com-users-registration)
    :is(input[type="text"], input[type="password"], input[type="email"], input[type="url"], input[type="number"], input[type="tel"], select, textarea) {
    width: 100%;
}

input[type="checkbox"],
input[type="radio"] {
    margin-right: 6px;
}

/* Joomla core's HTMLHelper::_('select.radiolist', ...) helper (used for
   the 1-10 skill-rating fields) emits Bootstrap's .form-check-inline
   markup to lay radio options out in a row - but this template doesn't
   load Bootstrap, so without this the divs default to block and each
   option stacks on its own line instead. */
.form-check-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 16px;
    margin-bottom: 4px;
}

.form-check-input {
    margin: 0;
}

.form-check-label {
    margin: 0;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--wudi-navy);
    color: var(--wudi-white);
}

.btn-secondary {
    background: var(--wudi-card-bg);
    color: var(--wudi-body-text);
    border: 1px solid var(--wudi-card-border);
}

.btn-danger {
    background: var(--wudi-red);
    color: var(--wudi-white);
}

.btn:hover {
    opacity: 0.9;
}

.com-users-login__options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    padding: 0;
    list-style: none;
}

.list-group-item {
    display: block;
    padding: 10px 12px;
    background: var(--wudi-card-bg);
    border: 1px solid var(--wudi-card-border);
    border-radius: 6px;
    color: var(--wudi-body-text);
    text-decoration: none;
    font-size: 13px;
}

.list-group-item:hover {
    background: var(--wudi-white);
    border-color: var(--wudi-navy);
}

.com-users-profile__edit-submit .controls {
    display: flex;
    gap: 12px;
}

.field-media-preview img {
    max-width: 120px;
    height: auto;
    border-radius: 6px;
    display: block;
    margin-bottom: 8px;
}
