/* HGS Liga 2026 — design ported from hgsliga2026.elevien.com (Tailwind output → semantic CSS). */

:root {
    --hgs-blue: rgb(0 80 160);
    --hgs-blue-dark: rgb(0 54 112);
    --hgs-ink: rgb(17 20 24);
    --hgs-surface: rgb(246 247 249);
    --hgs-line: rgb(230 232 236);
    --hgs-muted: rgb(91 100 112);

    --radius-sm: 4px;
    --radius:    6px;
    --radius-md: 8px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow:    0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07);

    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Manrope', 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: var(--hgs-ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

main { flex: 1; }

.container-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}
@media (min-width: 640px) {
    .container-page { padding-left: 1.5rem; padding-right: 1.5rem; }
}

.font-display { font-family: var(--font-display); }
.font-mono    { font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace; }

/* ---------- Header ---------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--hgs-line);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.brand__tile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--hgs-blue);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    border-radius: var(--radius);
    line-height: 1;
}
.brand__lines { line-height: 1.2; }
.brand__primary {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
}
.brand__secondary {
    font-size: 0.75rem;
    color: var(--hgs-muted);
}
.site-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}
@media (min-width: 640px) { .site-nav { gap: 1rem; } }
.site-nav a {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--hgs-ink);
    transition: background-color 0.12s ease;
}
.site-nav a:hover { background: var(--hgs-surface); }
.site-nav a.is-active { color: var(--hgs-blue); }

/* ---------- Hero ---------- */
.page-shell { padding: 2.5rem 0; }
@media (min-width: 640px) { .page-shell { padding: 4rem 0; } }

.hero { margin-bottom: 3rem; max-width: 48rem; }
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--hgs-line);
    border-radius: 999px;
    background: var(--hgs-surface);
    color: var(--hgs-muted);
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}
.hero__title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.875rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}
@media (min-width: 640px) { .hero__title { font-size: 3rem; } }
.hero__title-accent {
    display: block;
    color: var(--hgs-blue);
}
.hero__lede {
    margin: 1rem 0 0;
    color: var(--hgs-muted);
    font-size: 1rem;
    line-height: 1.65;
}
@media (min-width: 640px) { .hero__lede { font-size: 1.125rem; } }

.cta-row {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
    border: 1px solid transparent;
    cursor: pointer;
}
.btn--primary {
    background: var(--hgs-blue);
    color: #fff;
}
.btn--primary:hover { background: var(--hgs-blue-dark); }
.btn--ghost {
    background: #fff;
    color: var(--hgs-ink);
    border-color: var(--hgs-line);
}
.btn--ghost:hover { background: var(--hgs-surface); }

/* ---------- Section header ---------- */
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.section-head__title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}
@media (min-width: 640px) { .section-head__title { font-size: 1.5rem; } }
.section-head__meta {
    font-size: 0.75rem;
    color: var(--hgs-muted);
}

/* ---------- Tournament grid ---------- */
.tournament-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 640px) { .tournament-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tournament-grid { grid-template-columns: repeat(3, 1fr); } }

.t-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--hgs-line);
    border-radius: var(--radius-md);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.t-card:hover {
    border-color: rgb(0 80 160 / 0.5);
    box-shadow: var(--shadow-sm);
}
.t-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.t-card__title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.25;
}
.t-card__chip {
    flex-shrink: 0;
    background: var(--hgs-surface);
    color: var(--hgs-muted);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
}
.t-card__date {
    color: var(--hgs-muted);
    font-size: 0.875rem;
}
.t-card__foot {
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid rgb(230 232 236 / 0.7);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.t-card__link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hgs-blue);
}
.t-card__link:hover { color: var(--hgs-blue-dark); }
.t-card__ext {
    font-size: 0.75rem;
    color: var(--hgs-muted);
}
.t-card__ext:hover { color: var(--hgs-ink); }

/* ---------- Rezultati tree ---------- */
.tree { display: flex; flex-direction: column; gap: 3rem; }

.discipline {}
.discipline__header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid rgb(0 80 160 / 0.3);
}
.discipline__title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}
@media (min-width: 640px) { .discipline__title { font-size: 1.875rem; } }
.discipline__subtitle {
    color: var(--hgs-muted);
    font-size: 0.875rem;
}

.program { margin-top: 0; }
.program + .program { margin-top: 2rem; }
.program__title {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--hgs-ink);
}

.cat-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }

.cat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--hgs-line);
    border-radius: var(--radius);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.cat-card:hover {
    border-color: rgb(0 80 160 / 0.5);
    box-shadow: var(--shadow-sm);
}
.cat-card__name {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.25;
}
.cat-card__meta {
    margin-top: 0.25rem;
    color: var(--hgs-muted);
    font-size: 0.75rem;
}
.cat-card__arrow {
    color: var(--hgs-blue);
    transition: transform 0.12s ease;
    font-size: 1rem;
}
.cat-card:hover .cat-card__arrow { transform: translateX(2px); }

/* ---------- Breadcrumb ---------- */
.crumbs {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--hgs-muted);
}
.crumbs a { color: var(--hgs-muted); }
.crumbs a:hover { color: var(--hgs-ink); }
.crumbs__sep { margin: 0 0.5rem; color: var(--hgs-line); }
.crumbs__current { color: var(--hgs-ink); }

/* ---------- Detail page ---------- */
.detail-header { margin-bottom: 2rem; }
.detail-header__title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.875rem;
    letter-spacing: -0.02em;
}
@media (min-width: 640px) { .detail-header__title { font-size: 2.25rem; } }
.detail-header__meta {
    margin-top: 0.5rem;
    color: var(--hgs-muted);
}

.detail-section { margin-bottom: 3rem; }
.detail-section__title {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
}

/* ---------- Standings (grid-based, expandable) ---------- */
.standings {
    background: #fff;
    border: 1px solid var(--hgs-line);
    border-radius: var(--radius);
    overflow: hidden;
}
.standings__head,
.standings__row {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1.4fr) minmax(0, 1.2fr) 3rem minmax(6rem, 1fr) minmax(5rem, 1fr) 1.25rem;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
}
.standings__head {
    background: var(--hgs-surface);
    color: var(--hgs-muted);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.standings__row {
    cursor: pointer;
}
.standings details {
    border-top: 1px solid var(--hgs-line);
}
.standings details:first-of-type { border-top: 1px solid var(--hgs-line); }
.standings details > summary {
    list-style: none;
    transition: background 0.1s ease;
}
.standings details > summary::-webkit-details-marker { display: none; }
.standings details > summary:hover { background: rgb(246 247 249 / 0.6); }

.cell--right { text-align: right; }
.cell--rank  { color: var(--hgs-muted); font-size: 0.875rem; text-align: right; }
.cell--name  {
    font-size: 0.875rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cell--club  {
    font-size: 0.875rem;
    color: var(--hgs-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cell--num   { font-family: var(--font-mono); font-size: 0.875rem; font-weight: 600; text-align: right; }
.cell--num-muted { font-family: var(--font-mono); font-size: 0.875rem; color: var(--hgs-muted); text-align: right; }
.cell--small { color: var(--hgs-muted); font-size: 0.875rem; text-align: right; }
.cell--chevron {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 1.5px solid var(--hgs-muted);
    border-bottom: 1.5px solid var(--hgs-muted);
    transform: rotate(45deg);
    margin-left: auto;
    transition: transform 0.18s ease;
    margin-bottom: 2px;
    justify-self: end;
}
.standings details[open] .cell--chevron {
    transform: rotate(-135deg);
    margin-bottom: -2px;
}

.breakdown {
    background: rgb(246 247 249 / 0.6);
    border-top: 1px solid rgb(230 232 236 / 0.6);
    padding: 0.75rem 1rem;
}
@media (min-width: 640px) { .breakdown { padding: 0.75rem 2rem; } }
.breakdown table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.breakdown th {
    color: var(--hgs-muted);
    font-weight: 500;
    text-align: left;
    padding: 0.25rem 0;
}
.breakdown th.is-right { text-align: right; }
.breakdown th.col-rank { width: 4rem; }
.breakdown th.col-score { width: 6rem; }
.breakdown td {
    padding: 0.375rem 0.5rem 0.375rem 0;
    border-top: 1px solid rgb(230 232 236 / 0.6);
}
.breakdown td.is-right { text-align: right; }
.breakdown td.is-muted { color: var(--hgs-muted); }
.breakdown td.is-num   { font-family: var(--font-mono); }
.breakdown tr.total {
    border-top: 1px solid var(--hgs-line);
    font-weight: 600;
}
.breakdown tr.total td {
    border-top: 1px solid var(--hgs-line);
}
.breakdown tr.total .label {
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    font-size: 0.7rem;
    color: var(--hgs-muted);
}

/* Team standings — different column layout (no club column) */
.standings--teams .standings__head,
.standings--teams .standings__row {
    grid-template-columns: 2.5rem minmax(0, 2.6fr) 3rem minmax(6rem, 1fr) minmax(5rem, 1fr) 1.25rem;
}

/* ---------- Search ---------- */
.search-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0 1.5rem;
}
.search-input {
    flex: 1;
    min-width: 16rem;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    border: 1px solid var(--hgs-line);
    border-radius: var(--radius);
    background: #fff;
    font-family: inherit;
    color: var(--hgs-ink);
}
.search-input:focus {
    outline: none;
    border-color: var(--hgs-blue);
    box-shadow: 0 0 0 3px rgb(0 80 160 / 0.12);
}
.tabs {
    display: inline-flex;
    border: 1px solid var(--hgs-line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}
.tabs a {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hgs-ink);
}
.tabs a:hover { background: var(--hgs-surface); }
.tabs a.is-active { background: var(--hgs-blue); color: #fff; }

.result-card {
    background: #fff;
    border: 1px solid var(--hgs-line);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}
.result-card__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.result-card__title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
}
.result-card__sub {
    font-size: 0.875rem;
    color: var(--hgs-muted);
}
.result-card__cats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
@media (min-width: 768px) { .result-card__cats { grid-template-columns: repeat(2, 1fr); } }

.cat-link {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--hgs-line);
    border-radius: var(--radius-sm);
    color: var(--hgs-ink);
    background: #fff;
    font-size: 0.875rem;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.cat-link:hover {
    border-color: rgb(0 80 160 / 0.5);
    background: var(--hgs-surface);
}
.cat-link__total {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--hgs-blue);
}

.empty {
    background: var(--hgs-surface);
    border: 1px dashed var(--hgs-line);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--hgs-muted);
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--hgs-line);
    background: #fff;
    color: var(--hgs-muted);
    font-size: 0.8125rem;
}
.site-footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.site-footer a { color: var(--hgs-muted); }
.site-footer a:hover { color: var(--hgs-ink); }
.site-footer strong { color: var(--hgs-ink); }
