:root {
    --bg: #fbfbf8;
    --text: #1a1a1a;
    --text-2: #3a3631;
    --mute: #5a5651;
    --accent: #8b6f47;
    --hover: #f0eee5;
    --grid: rgba(26,26,26,0.05);
    --cell-edge: #1a1a1a;
    --serif: 'Cormorant Garamond', 'Times New Roman', serif;
    --mono: 'JetBrains Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--serif);
    -webkit-font-smoothing: antialiased;
    min-height: 100%;
}

img { display: block; max-width: 100%; height: auto; }

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

ul { list-style: none; }

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
      linear-gradient(to right, var(--grid) 1px, transparent 1px),
      linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}

.page {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 56px 56px;
}

/* Topbar */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mute);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--text);
}

.topbar-right {
    display: flex;
    gap: 32px;
}

/* Hero — logo vänster, text höger, samma höjd */

.hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 56px;
    padding: 48px 0;
    align-items: center;
}

.hero-icon img {
    width: 320px;
    height: 320px;
}

.lede {
    font-family: var(--serif);
    font-size: 1.6rem;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 1.5rem;
    max-width: 640px;
}

.adress {
    font-family: var(--serif);
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--mute);
}

/* Medlemmar — fyller cellen, ingen vit ruta, tunna svarta linjer */

.medlemmar {
    padding: 32px 0 0;
}

.medlem-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border: 1px solid var(--cell-edge);
}

.medlem {
    background: transparent;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 200ms ease;
    border-right: 1px solid var(--cell-edge);
    border-bottom: 1px solid var(--cell-edge);
}

.medlem:nth-child(3n) { border-right: none; }
.medlem:nth-child(n+4) { border-bottom: none; }

.medlem > a,
.medlem.utan-lank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 16px 24px;
}

.medlem > a:hover {
    background: var(--hover);
}

.medlem img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Footer */

.site-footer {
    border-top: 1px solid var(--text);
    margin-top: 48px;
    padding-top: 24px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--mute);
    line-height: 1.8;
    text-align: center;
}

/* Responsive */

@media (max-width: 1023px) {
    .page { padding: 32px 32px 40px; }
    .hero {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    .hero-icon { display: flex; justify-content: center; }
    .hero-icon img { width: 240px; height: 240px; }
    .lede { font-size: 1.4rem; margin-left: auto; margin-right: auto; }
    .adress { font-size: 1.1rem; }
    .medlem-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .page { padding: 24px 16px 32px; }
    .topbar { flex-direction: column; gap: 6px; align-items: flex-start; }
    .topbar-right { flex-direction: column; gap: 4px; }
    .hero { padding: 32px 0; }
    .hero-icon img { width: 180px; height: 180px; }
    .lede { font-size: 1.2rem; }
    .adress { font-size: 1rem; }
    .medlem-grid { grid-template-columns: 1fr; }
    .medlem { aspect-ratio: 16 / 9; }
}
