.hallinta-site {
    max-width: 1160px;
    margin: 0 auto;
    color: #1a1a1a;
    line-height: 1.6;
}

.hallinta-site section {
    margin: 2.5rem 0;
}

.hallinta-site h1,
.hallinta-site h2,
.hallinta-site h3,
.hallinta-site h4 {
    margin-top: 0;
}

.hallinta-site h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.hallinta-site h3 {
    font-size: 1.2rem;
}

.hallinta-hero {
    background: linear-gradient(135deg, #111 0%, #202020 70%);
    color: #fff;
    border-radius: 4px;
    padding: 2.2rem 1.4rem;
    margin-bottom: 2rem;
}

.hallinta-hero h1 {
    font-size: 2rem;
    margin-bottom: 1.2rem;
}

.hallinta-hero-stats {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

/* Dark hero band only: [saje_hero_stats] on the front page has no .hallinta-hero wrapper,
   so stats must not inherit translucent panels and light gray labels (invisible on light bg). */
.hallinta-hero .hallinta-hero-stat {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.06);
}

.hallinta-hero .hallinta-hero-value {
    font-size: 2rem;
    font-weight: 700;
    color: #e85000;
    line-height: 1;
}

.hallinta-hero .hallinta-hero-label {
    margin-top: 0.4rem;
    color: #ededed;
}

.hallinta-feature-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 1rem;
}

.hallinta-feature-card {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 1rem;
    background: #fff;
}

.hallinta-feature-card h3 {
    margin-bottom: 0.6rem;
}

/* Do not set padding/border on .hallinta-tiedote here: frontend.css loads after many
   themes and would override card spacing (e.g. SAJE child theme uses padded white boxes). */

.hallinta-tiedote h3 {
    margin: 0 0 0.5rem;
    font-size: 1.04rem;
    font-weight: 700;
    text-transform: uppercase;
}

.hallinta-tiedote h3 small {
    display: block;
    margin-bottom: 0.25rem;
    color: #bf360c;
    font-size: 0.9rem;
    text-transform: none;
}

.hallinta-tiedote h3 a.hallinta-tiedote-title-link {
    color: inherit;
    text-decoration: none;
}

.hallinta-tiedote h3 a.hallinta-tiedote-title-link:hover {
    text-decoration: underline;
    color: var(--accent-orange-dark, #bf360c);
}

.hallinta-tiedote-excerpt {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #3c434a;
}

.hallinta-tiedote-excerpt a {
    color: var(--accent-orange-dark, #bf360c);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--accent-orange-dark, #bf360c);
    text-underline-offset: 2px;
}

.hallinta-tiedote-excerpt a:hover {
    text-decoration-thickness: 2px;
}

.hallinta-tiedote-more {
    margin: 0.85rem 0 0;
    font-size: 0.95rem;
}

.hallinta-tiedote-more a {
    color: var(--accent-orange-dark, #bf360c);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--accent-orange-dark, #bf360c);
    text-underline-offset: 2px;
}

/* Visually hidden post title after "Read more" (same pattern as WP core latest-posts block). */
.hallinta-tiedote-more .screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.hallinta-nimeamiset-table,
.hallinta-harraste-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

.hallinta-nimeamiset-table th,
.hallinta-harraste-table th {
    background: #1a1a1a;
    color: #fff;
    text-align: left;
    padding: 10px 12px;
}

.hallinta-nimeamiset-table td,
.hallinta-harraste-table td,
.hallinta-harraste-joukkueet-table td {
    border-bottom: 1px solid #e9e9e9;
    padding: 8px 12px;
}

.hallinta-harraste-joukkueet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

.hallinta-harraste-joukkueet-table th {
    background: #1a1a1a;
    color: #fff;
    text-align: left;
    padding: 10px 12px;
}

/* Sortable headers: full chrome lives in saje-theme style.css; minimal fallback when theme is inactive. */
.hallinta-sortable-th {
    padding: 0;
    vertical-align: middle;
}

.hallinta-sort-btn {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: block;
    font: inherit;
    font-weight: 700;
    padding: 10px 12px;
    text-align: left;
    width: 100%;
}

.hallinta-empty-state {
    margin: 0;
    text-align: center;
}

.hallinta-empty-state__text {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.55;
    color: #3c434a;
}

.hallinta-bullet-list,
.hallinta-harraste-joukkueet,
.hallinta-fees-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hallinta-linkit {
    list-style: none;
    margin: 0;
    padding: 30px;
}

/* Membership CF7 wrapper; SAJE child theme adds scroll hint when content overflows horizontally. */
.saje-h-scroll {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.hallinta-linkit li {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    border-bottom: 1px solid #ededed;
    padding: 0.5rem 0;
}

.hallinta-linkit li a {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hallinta-linkit-wrap {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hallinta-linkit-group {
    border: 1px solid #ededed;
    padding: 1rem 1.25rem 1.25rem;
    background: #fff;
}

.hallinta-linkit-group__title {
    margin: 0 0 0.65rem;
    font-size: 1.15rem;
    font-weight: 700;
}

.hallinta-linkit-wrap .hallinta-linkit {
    padding: 0;
}

.hallinta-linkit__note {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: #3c434a;
}

.hallinta-linkit li a,
.hallinta-yhteystiedot a {
    /* Match theme --accent-orange-dark; #e85000 fails WCAG AA on white (body text). */
    color: #bf360c;
}

.hallinta-bullet-list li {
    border-bottom: 1px solid #ededed;
    padding: 0.5rem 0;
}

.hallinta-jasenyys-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.hallinta-fees-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid #ededed;
    padding: 0.5rem 0;
}

.hallinta-fees-list li strong {
    color: #1a1a1a;
}

.hallinta-hallitus h3 {
    margin-bottom: 0.25rem;
}

.hallinta-harraste-card {
    margin: 0;
    padding: 0.75rem 0;
    border: 0;
    border-bottom: 1px solid #e5e5e5;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.hallinta-harraste-card:last-child {
    border-bottom: none;
}

.hallinta-harraste-card strong {
    display: block;
    margin-bottom: 0.35rem;
}

.hallinta-harraste-list--results {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hallinta-harraste-list--results::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.94) 100%);
    pointer-events: none;
    z-index: 0;
}

.hallinta-harraste-list--results > .hallinta-harraste-card {
    position: relative;
    z-index: 1;
}

.hallinta-harraste-joukkueet {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* Do not set background here: theme uses dark / accent pills with light text;
   forcing #fff made text illegible when plugin CSS loads after the theme. */
.hallinta-harraste-joukkueet li {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.35rem 0.65rem;
}

.hallinta-sponsorit {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.hallinta-sponsori {
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e3e3e3;
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    position: relative;
}

.hallinta-sponsori__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: inherit;
    text-decoration: none;
    color: inherit;
}

.hallinta-sponsori__external {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    font-size: 0.875rem;
    line-height: 1;
    opacity: 0.55;
    pointer-events: none;
}

.hallinta-sponsori--dark-bg {
    background: #171717;
    border-color: #333;
}

.hallinta-sponsori img {
    max-width: 100%;
    max-height: 56px;
    object-fit: contain;
}

.hallinta-hk-tulokset-sivu {
    margin-bottom: 2rem;
}

.hallinta-hk-kausi-nav--pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 1.25rem;
}

.hallinta-hk-kausi-nav--select {
    margin: 1rem 0 1.25rem;
}

.hallinta-hk-kausi-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.hallinta-hk-kausi-select-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.hallinta-hk-kausi-select {
    min-width: min(100%, 16rem);
    max-width: 100%;
    padding: 0.45rem 0.65rem;
    font-size: 0.95rem;
    border: 1px solid #c5c5c5;
    border-radius: 4px;
    background: #fff;
    color: #1a1a1a;
}

.hallinta-hk-kausi-form__submit {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.hallinta-hk-kausi-nav__link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border: 1px solid #c5c5c5;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    background: #f5f5f5;
}

.hallinta-hk-kausi-nav__link:hover,
.hallinta-hk-kausi-nav__link:focus-visible {
    border-color: #1565c0;
    color: #0d47a1;
    outline: none;
}

.hallinta-hk-kausi-nav__link--active {
    border-color: #1565c0;
    background: #1565c0;
    color: #fff;
}

.hallinta-hk-kausi-nav__link--active:hover,
.hallinta-hk-kausi-nav__link--active:focus-visible {
    border-color: #0d47a1;
    background: #0d47a1;
    color: #fff;
}

.hallinta-hk-tulokset-toolbar {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.hallinta-hk-tulokset-toolbar .hallinta-hk-kausi-nav--pills,
.hallinta-hk-tulokset-toolbar .hallinta-hk-kausi-nav--select {
    margin-bottom: 0;
}

.hallinta-hk-jump-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.55rem;
    margin-top: 0.75rem;
}

.hallinta-hk-jump-nav__label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #3c434a;
}

.hallinta-hk-jump-nav__link {
    display: inline-flex;
    padding: 0.35rem 0.75rem;
    border: 1px solid #c5c5c5;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1a;
    background: #fff;
}

.hallinta-hk-tulokset-block--standings {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 2px solid #e0e0e0;
}

.hallinta-hk-section-heading {
    margin: 0 0 0.85rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.hallinta-hk-sarjataulukko-grid {
    /* One Lohko table per row, each full width (never side by side). */
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.hallinta-hk-sarjataulukko-lohko {
    min-width: 0;
}

.hallinta-hk-sarjataulukko-lohko .hallinta-hk-lohko-otsikko {
    margin-top: 0;
}

.hallinta-hk-tulokset-direct {
    margin: 0 0 1rem;
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
    line-height: 1.55;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
}

.hallinta-hk-tulokset-direct__summary {
    cursor: pointer;
    font-weight: 700;
    color: #1a1a1a;
}

.hallinta-hk-tulokset-direct__body {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid #e0e0e0;
}

.hallinta-hk-tulokset-direct p {
    margin: 0 0 0.65rem;
}

.hallinta-hk-tulokset-direct p:last-child {
    margin-bottom: 0;
}

.hallinta-hk-tulokset-direct a {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.hallinta-hk-sarja-legend {
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #333;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #1565c0;
}

.hallinta-hk-sarja-legend strong {
    color: #1a1a1a;
}

.hallinta-hk-lohko-otsikko {
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

.hallinta-hk-tulokset-otsikko {
    margin: 1.5rem 0 0.85rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #e0e0e0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
}

#hk-tulokset-ottelut,
#hk-sarjataulukko-heading,
#sarjataulukko,
#hk-sarjataulukko-lohko-a,
#hk-sarjataulukko-lohko-b {
    scroll-margin-top: 5rem;
}

.hallinta-hk-sarjataulukko-controls {
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #1565c0;
}

.hallinta-hk-sarjataulukko-controls .hallinta-hk-kausi-nav--pills,
.hallinta-hk-sarjataulukko-controls .hallinta-hk-kausi-nav--select {
    margin: 0;
}

@media (max-width: 720px) {
    .hallinta-site h1 {
        font-size: 1.5rem;
    }

    .hallinta-site h2 {
        font-size: 1.4rem;
    }
}

/* UKK (FAQ) module: [saje_ukk] */
.hallinta-ukk__group {
    margin: 0 0 2rem;
}

.hallinta-ukk__category {
    margin: 0 0 0.75rem;
}

.hallinta-ukk--accordion .hallinta-ukk__item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin: 0 0 0.5rem;
    background: #fff;
}

.hallinta-ukk--accordion .hallinta-ukk__question {
    cursor: pointer;
    padding: 0.85rem 1rem;
    font-weight: 600;
    list-style: none;
    transition: background-color 0.15s ease;
}

.hallinta-ukk--accordion .hallinta-ukk__question:hover {
    background: #f6f7f7;
}

.hallinta-ukk--accordion .hallinta-ukk__question:focus-visible {
    outline: 3px solid var(--accent-orange-dark, #8a2f0a);
    outline-offset: 2px;
}

.hallinta-ukk--accordion .hallinta-ukk__item:hover {
    border-color: #c8c8c8;
}

.hallinta-ukk--accordion .hallinta-ukk__question::-webkit-details-marker {
    display: none;
}

.hallinta-ukk--accordion .hallinta-ukk__question::after {
    content: "+";
    float: right;
    font-weight: 700;
    margin-left: 0.5rem;
    color: var(--accent-orange-dark, #bf360c);
}

.hallinta-ukk--accordion details[open] > .hallinta-ukk__question::after {
    content: "\2212"; /* minus */
}

.hallinta-ukk--accordion .hallinta-ukk__answer {
    padding: 0 1rem 1rem;
}

.hallinta-ukk--list .hallinta-ukk__item {
    margin: 0 0 1.25rem;
}

.hallinta-ukk--list .hallinta-ukk__question {
    margin: 0 0 0.35rem;
}

.hallinta-ukk__answer > :first-child {
    margin-top: 0;
}

.hallinta-ukk__answer > :last-child {
    margin-bottom: 0;
}

/* Sanasto (glossary) module: [saje_sanasto] */
.hallinta-sanasto__group {
    margin: 0 0 2rem;
}

.hallinta-sanasto__category {
    margin: 0 0 0.75rem;
}

.hallinta-sanasto--accordion .hallinta-sanasto__item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin: 0 0 0.5rem;
    background: #fff;
}

.hallinta-sanasto--accordion .hallinta-sanasto__term {
    cursor: pointer;
    padding: 0.85rem 1rem;
    font-weight: 600;
    list-style: none;
    transition: background-color 0.15s ease;
}

.hallinta-sanasto--accordion .hallinta-sanasto__term:hover {
    background: #f6f7f7;
}

.hallinta-sanasto--accordion .hallinta-sanasto__term:focus-visible {
    outline: 3px solid var(--accent-orange-dark, #8a2f0a);
    outline-offset: 2px;
}

.hallinta-sanasto--accordion .hallinta-sanasto__item:hover {
    border-color: #c8c8c8;
}

.hallinta-sanasto--accordion .hallinta-sanasto__term::-webkit-details-marker {
    display: none;
}

.hallinta-sanasto--accordion .hallinta-sanasto__term::after {
    content: "+";
    float: right;
    font-weight: 700;
    margin-left: 0.5rem;
    color: var(--accent-orange-dark, #bf360c);
}

.hallinta-sanasto--accordion details[open] > .hallinta-sanasto__term::after {
    content: "\2212"; /* minus */
}

.hallinta-sanasto--accordion .hallinta-sanasto__definition {
    padding: 0 1rem 1rem;
}

.hallinta-sanasto--list .hallinta-sanasto__item {
    margin: 0 0 1rem;
    padding-left: 0.85rem;
    border-left: 3px solid var(--accent-orange, #e65100);
}

.hallinta-sanasto--list .hallinta-sanasto__term {
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.hallinta-sanasto--list .hallinta-sanasto__definition {
    margin: 0;
}

/* Ajankohtaista: "Katso kaikki artikkelit" archive link under [saje_ajankohtaista] */
.hallinta-ajankohtaista-lisaa {
    margin: 1.5rem 0 0;
    text-align: center;
}

.hallinta-ajankohtaista-lisaa__link {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    color: var(--accent-orange-dark, #bf360c);
    background: #fff;
    border: 2px solid var(--accent-orange, #e65100);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hallinta-ajankohtaista-lisaa__link:hover,
.hallinta-ajankohtaista-lisaa__link:focus {
    background: #fff8f0;
    border-color: var(--accent-orange-dark, #bf360c);
    color: var(--accent-orange-dark, #bf360c);
}

.hallinta-empty-state {
    margin: 0;
    text-align: center;
}

.hallinta-empty-state__text {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.55;
    color: #3c434a;
}

/* Theme-inactive fallback only. saje-theme owns the responsive table card
   layout (style.css @media max-width:900px) and .table-wrapper card chrome;
   keep this minimal and do NOT duplicate the theme's card styling here. This
   one rule just gives a bare wide table a horizontal scroll if the theme is
   not active, so it never forces page-level overflow. */
.table-wrapper {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
