/* Golfkort base stylesheet — no framework, kept small on purpose (ponytail).
   Mobile-first: unprefixed rules target small screens; the one @media rule
   near the bottom widens the nav out for larger viewports. */

:root {
    --gk-green: #1e5631;
    --gk-green-dark: #123a1f;
    --gk-cream: #faf7f0;
    --gk-ink: #1a1a1a;
    --gk-border: #ddd6c9;
    --gk-error: #a4243b;
    --gk-max-width: 60rem;
    --gk-touch: 2.75rem; /* ~44px minimum touch target */
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--gk-ink);
    background: var(--gk-cream);
    line-height: 1.5;
}

h1, h2, h3 {
    line-height: 1.2;
}

a {
    color: var(--gk-green-dark);
}

/* --- accessibility utilities ------------------------------------------- */

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

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: #fff;
    color: var(--gk-ink);
    padding: 0.75rem 1rem;
    z-index: 100;
}

.skip-link:focus {
    left: 0.5rem;
    top: 0.5rem;
}

:focus-visible {
    outline: 3px solid #ffb703;
    outline-offset: 2px;
}

/* --- header + nav (mobile-first: collapsed behind a toggle) ------------ */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: var(--gk-green);
}

.site-header .brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
}

.nav-toggle {
    background: none;
    border: 1px solid #fff;
    color: #fff;
    min-height: var(--gk-touch);
    min-width: var(--gk-touch);
    font-size: 1.25rem;
    border-radius: 0.25rem;
}

.site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.site-nav.open {
    display: flex;
}

.site-nav a,
.site-nav button {
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 0.25rem;
    min-height: var(--gk-touch);
    display: flex;
    align-items: center;
}

.site-nav a:hover {
    text-decoration: underline;
}

.bell .badge {
    background: var(--gk-error);
    color: #fff;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    margin-left: 0.35rem;
}

.lang-toggle {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    background: none;
    border: none;
    padding: 0;
}

.lang-toggle button {
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    border-radius: 0.25rem;
    padding: 0.4rem 0.75rem;
    min-height: var(--gk-touch);
    cursor: pointer;
}

.lang-toggle button[aria-current="true"] {
    background: #fff;
    color: var(--gk-green-dark);
    font-weight: 700;
}

@media (min-width: 48rem) {
    .nav-toggle {
        display: none;
    }

    .site-nav {
        display: flex;
        flex-direction: row;
        flex-basis: auto;
        flex-wrap: wrap;
        align-items: center;
        margin-top: 0;
    }

    .lang-toggle {
        margin-top: 0;
        margin-left: 0.5rem;
    }
}

/* --- messages ------------------------------------------------------------ */

.messages {
    list-style: none;
    margin: 0;
    padding: 0.5rem 1.25rem;
}

.messages .message {
    background: #fff;
    border-left: 4px solid var(--gk-green);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

/* --- layout --------------------------------------------------------------- */

.site-main {
    max-width: var(--gk-max-width);
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
}

.site-footer {
    text-align: center;
    padding: 1.5rem 1.25rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

.muted {
    opacity: 0.7;
}

.error {
    color: var(--gk-error);
    font-weight: 600;
}

/* --- forms — big, keyboard/touch friendly ---------------------------------- */

form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 30rem;
}

.filter-form {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: end;
    max-width: none;
}

fieldset {
    border: 1px solid var(--gk-border);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

label {
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="date"],
input[type="number"],
select,
textarea {
    font-size: 1rem;
    padding: 0.6rem 0.6rem;
    min-height: var(--gk-touch);
    border: 1px solid var(--gk-border);
    border-radius: 0.4rem;
    width: 100%;
}

textarea {
    min-height: 4rem;
}

button,
.button {
    font-size: 1rem;
    padding: 0.6rem 1rem;
    min-height: var(--gk-touch);
    min-width: var(--gk-touch);
    border-radius: 0.4rem;
    border: 1px solid var(--gk-green);
    background: var(--gk-green);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover,
.button:hover {
    background: var(--gk-green-dark);
}

.inline-form {
    display: inline-flex;
    max-width: none;
}

.compose-form {
    max-width: none;
    margin-bottom: 1.5rem;
}

/* --- landing page ------------------------------------------------------------ */

.hero {
    padding: 1.5rem 0 2rem;
}

.hero h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.hero-lede {
    max-width: 40rem;
    font-size: 1.05rem;
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.landing-pillars {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin: 2rem 0;
}

.landing-pillars .card h2 {
    font-size: 1.1rem;
    margin-top: 0;
}

.landing-tournaments,
.landing-social,
.landing-support {
    margin: 2rem 0;
}

@media (min-width: 40rem) {
    .landing-pillars {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 60rem) {
    .landing-pillars {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --- cards / lists ---------------------------------------------------------- */

.card-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.card {
    background: #fff;
    border: 1px solid var(--gk-border);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
}

.card.unread {
    border-left: 4px solid var(--gk-error);
}

.badge-inline {
    display: inline-block;
    background: var(--gk-green);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.feature-list {
    padding-left: 1.25rem;
}

/* --- tables (wide content scrolls in its own box) --------------------------- */

.table-scroll {
    overflow-x: auto;
    margin: 1rem 0;
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 24rem;
}

th, td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--gk-border);
    text-align: left;
    white-space: nowrap;
}

/* --- skorkort hole-by-hole entry -------------------------------------------- */

.hole-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 1rem 0;
}

.hole-dot {
    min-width: var(--gk-touch);
    min-height: var(--gk-touch);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--gk-border);
    background: #fff;
    text-decoration: none;
    color: var(--gk-ink);
}

.hole-dot.current {
    border-color: var(--gk-green);
    font-weight: 700;
}

.hole-dot.done {
    background: var(--gk-green);
    color: #fff;
}

.hole-card {
    background: #fff;
    border: 1px solid var(--gk-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.stroke-stepper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
}

.stroke-stepper input {
    text-align: center;
    font-size: 1.5rem;
    max-width: 5rem;
}

.stroke-stepper button {
    font-size: 1.5rem;
    min-width: 3.5rem;
    min-height: 3.5rem;
}

.hole-nav-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.finish-form {
    margin-top: 1.5rem;
    border-top: 1px dashed var(--gk-border);
    padding-top: 1rem;
}

.result-stats {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1rem;
}

.result-stats dt {
    font-weight: 600;
}

.result-stats dd {
    margin: 0;
}

/* --- feed / wall ------------------------------------------------------------ */

.feed-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.feed-item {
    background: #fff;
    border: 1px solid var(--gk-border);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
}

.feed-meta {
    margin: 0 0 0.35rem;
    font-size: 0.85rem;
}

.profile-actions,
.lobby-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* --- embeddable leaderboard -------------------------------------------------- */

body.embed {
    background: #fff;
    padding: 0.5rem;
}

body.embed .site-main {
    padding: 0;
}
