:root {
    --swedish-blue: #006aa7;
    --swedish-yellow: #fecc00;
    --bg: #ffffff;
    --page-bg: #f0f0f0;
    --bg-alt: #f5f5f5;
    --text: #222222;
    --text-muted: #666666;
    --link: var(--swedish-blue);
    --border: #dddddd;
    --navbar-bottom-radius: 8px;
}

html {
    overflow-x: clip;
}

@media (min-width: 601px) {
    html {
        scrollbar-gutter: stable;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1a1a;
        --page-bg: #121212;
        --bg-alt: #2a2a2a;
        --text: #e0e0e0;
        --text-muted: #a0a0a0;
        --link: #70c8f0;
        --border: #444444;
    }
}

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

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1.1rem;
    background: var(--page-bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (max-width: 600px) {
    body {
        background: var(--bg);
    }

    main {
        background: transparent;
    }
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Logo styles */
.logo img {
    height: 40px;
    vertical-align: middle;
}

/* Header bar (mobile only - scrolls away) */
.header-bar {
    background: var(--swedish-blue);
    padding: 0.5rem 1rem;
    display: none;
    justify-content: center;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    border-radius: 0;
}

/* Desktop: hide header-bar, show logo in navbar */
.logo-desktop {
    display: block;
}

.logo-mobile {
    display: block;
}

/* Mobile: show header-bar, hide navbar logo */
@media (max-width: 600px) {
    .header-bar {
        display: flex;
    }

    .logo-desktop {
        display: none;
    }
}

/* Navbar (sticky) */
.navbar {
    background: var(--swedish-blue);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    border-radius: 0 0 var(--navbar-bottom-radius) var(--navbar-bottom-radius);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links-right {
    margin-left: auto;
}

/* Medium screens: center everything before awkward wrap */
@media (max-width: 900px) {
    .navbar {
        justify-content: center;
    }

    .nav-links-right {
        margin-left: 0;
    }
}

.nav-links a {
    color: #ffffff;
    font-weight: 500;
}

.nav-links a.active {
    color: var(--swedish-yellow);
}

.nav-links a:hover {
    color: var(--swedish-yellow);
    text-decoration: none;
}

/* Main content */
main {
    flex: 1;
    max-width: 900px;
    margin: calc(-1 * var(--navbar-bottom-radius)) auto 0;
    padding: calc(2rem + var(--navbar-bottom-radius)) 1rem 2rem;
    width: 100%;
    background: var(--bg);
}

.page-header {
    min-height: 3.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

h1 {
    color: var(--swedish-blue);
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.2;
}

@media (prefers-color-scheme: dark) {
    h1 {
        color: var(--swedish-yellow);
    }
}

h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    /* background:  #fefefe; */
    color: var(--swedish-blue);
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    border-left: 2px solid var(--swedish-blue);
    border-top: 2px solid var(--swedish-blue);
    border-right: 2px solid var(--swedish-blue);
    border-bottom: 2px solid var(--swedish-blue);
    font-size: 1.1rem;
    font-weight: 500;
}

@media (prefers-color-scheme: dark) {
    h2 {
        background: transparent;
        color: #b0b0b0;
        border-color: var(--swedish-blue);
    }
}

/* Meetup cards */
.meetup-day {
    margin-bottom: 2rem;
}

.meetup-list {
    display: grid;
    gap: 1rem;
}

.meetup-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-left: 4px solid var(--swedish-blue);
    padding: 1rem;
    border-radius: 10px;
}

.meetup-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: 500;
}

.meetup-group {
    font-weight: 500;
    color: var(--text);
}

.meetup-date {
    color: var(--swedish-blue);
    font-size: 1.1rem;
    font-weight: 400;
}

@media (prefers-color-scheme: dark) {
    .meetup-date {
        color: var(--swedish-yellow);
    }
}

.meetup-location {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Next meetup section */
.next-meetup {
    margin-top: 2rem;
}

.next-meetup .meetup-card {
    border-left-width: 6px;
}

/* Footer */
footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* About page */
.about-content {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

.about-section {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-left: 4px solid var(--swedish-blue);
    padding: 1rem;
    border-radius: 10px;
    overflow: hidden;
}

.about-section h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.about-section p {
    margin-bottom: 0.5rem;
}

.about-section p:last-child {
    margin-bottom: 0;
}

.about-section ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.about-section li {
    margin-bottom: 0.25rem;
}

/* Sponsor carousel */
.sponsor-carousel {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 0;
    margin: 0.5rem 0;
    overflow: hidden;
    mask-image: linear-gradient(
        to right,
        transparent,
        black 5%,
        black 95%,
        transparent
    );
}

.sponsor-carousel-track {
    display: flex;
    gap: 1.5rem;
    animation: scroll-left 20s linear infinite;
}

.sponsor-carousel-track.speed-fast {
    animation-duration: 12s;
}

.sponsor-carousel-track.speed-faster {
    animation-duration: 8s;
}

.sponsor-carousel:hover .sponsor-carousel-track {
    animation-play-state: paused;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.sponsor-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    min-width: 100px;
}

.sponsor-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--bg-alt);
    padding: 4px;
}

.sponsor-item span {
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-muted);
}

.sponsor-item:hover span {
    color: var(--link);
}

/* Blog articles */
.blog-day {
    margin-bottom: 2rem;
}

.blog-list {
    display: grid;
    gap: 0.75rem;
}

.blog-card {
    min-width: 0;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-left: 4px solid var(--swedish-blue);
    padding: 0.75rem;
    border-radius: 10px;
}

.blog-card-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--link);
}

.blog-card-link:hover {
    color: var(--link-hover);
}

.blog-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.blog-thumb-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    border: 1px dashed var(--border);
    background: var(--bg);
}

.blog-card-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.blog-title {
    font-size: 1.2rem;
    font-weight: 500;
}

.blog-summary {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-source {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* Podcast episodes */
.podcast-day {
    margin-bottom: 2rem;
}

.podcast-list {
    display: grid;
    gap: 0.75rem;
}

.podcast-card {
    min-width: 0;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-left: 4px solid var(--swedish-blue);
    padding: 0.75rem 1rem;
    border-radius: 10px;
}

.podcast-card-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--link);
}

.podcast-card-link:hover {
    color: var(--link-hover);
}

.podcast-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.podcast-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 1px dashed var(--border);
    background: var(--bg);
}

.podcast-card-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.podcast-title {
    font-size: 1.2rem;
    font-weight: 500;
}

.podcast-source {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Software releases */
.release-day {
    margin-bottom: 2rem;
}

.release-list {
    display: grid;
    gap: 0.75rem;
}

.release-card {
    min-width: 0;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-left: 4px solid var(--swedish-blue);
    padding: 0.75rem;
    border-radius: 10px;
}

.release-card-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--link);
}

.release-card-link:hover {
    color: var(--link-hover);
}

.release-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.release-thumb-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    border: 1px dashed var(--border);
    background: var(--bg);
}

.release-card-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.release-title {
    font-size: 1.2rem;
    font-weight: 500;
}

.release-summary {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.release-source {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.content-type-badge {
    display: inline-block;
    font-size: 0.9rem;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
}

/* Hall of Fame - Speakers */
.speaker-list {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.speaker-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-left: 4px solid var(--swedish-blue);
    border-radius: 10px;
    overflow: hidden;
}

.speaker-card summary {
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 1.1rem;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--swedish-blue);
    border-radius: 10px;
}

@media (prefers-color-scheme: dark) {
    .speaker-card summary {
        background: transparent;
        color: #b0b0b0;
        border: 2px solid var(--swedish-blue);
    }
}

.speaker-card summary::-webkit-details-marker {
    display: none;
}

.speaker-card summary::before {
    content: "▶";
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.speaker-card[open] summary::before {
    transform: rotate(90deg);
}

.speaker-card summary:hover {
    background: transparent;
}

.speaker-body {
    background: transparent;
    border: none;
    margin-top: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition:
        max-height 0.25s ease,
        opacity 0.2s ease;
}

.speaker-card[open] .speaker-body {
    max-height: none;
    opacity: 1;
}

.talk-count {
    color: inherit;
    font-weight: normal;
    font-size: 0.9rem;
}

.speaker-card .video-list {
    list-style: none;
    padding: 0.75rem 1rem 1rem 2rem;
}

.speaker-card .video-list li {
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
}

.speaker-card .video-list li:last-child {
    border-bottom: none;
}

.video-item-hof a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    text-decoration: none;
    color: var(--link);
}

.video-item-hof a:hover {
    color: var(--link-hover);
}

.video-item-hof-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.video-item-hof-title {
    font-size: 1rem;
    font-weight: 400;
}

.video-item-hof-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 400;
}

.video-thumb-small {
    width: 90px;
    height: 68px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Video filter */
.video-filter > input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.video-tabs {
    display: flex;
    align-items: center;
}

.video-tabs label {
    display: inline-block;
    min-width: 6rem;
    padding: 0.5rem 0.6rem;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    color: var(--swedish-blue);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    margin-right: -1px;
    cursor: pointer;
    transition:
        background 0.2s,
        color 0.2s;
}

.video-tabs label:first-of-type {
    border-radius: 4px 0 0 4px;
}

.video-tabs label:nth-of-type(4) {
    border-radius: 0 4px 4px 0;
}

.video-tabs label:hover {
    background: var(--border);
}

@media (prefers-color-scheme: dark) {
    .video-tabs label {
        color: var(--swedish-yellow);
    }
}

#filter-all:checked ~ .page-header .video-tabs label[for="filter-all"],
#filter-conference:checked
    ~ .page-header
    .video-tabs
    label[for="filter-conference"],
#filter-creator:checked ~ .page-header .video-tabs label[for="filter-creator"],
#filter-usergroup:checked
    ~ .page-header
    .video-tabs
    label[for="filter-usergroup"] {
    background: var(--swedish-blue);
    color: #ffffff;
    border-color: var(--swedish-blue);
}

/* Video items */
.video-day {
    margin-bottom: 2rem;
}

.creator-video-list {
    list-style: none;
    display: grid;
    gap: 0.75rem;
}

.video-item {
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
    padding: 0.75rem 1rem;
    align-items: center;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-left: 4px solid var(--swedish-blue);
    border-radius: 4px;
}

.video-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.video-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.video-info a {
    font-size: 1.2rem;
    font-weight: 500;
}

.video-channel {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Video filter logic (CSS-only) */
#filter-conference:checked
    ~ .video-content
    .video-item:not([data-type="conference"]),
#filter-creator:checked ~ .video-content .video-item:not([data-type="creator"]),
#filter-usergroup:checked
    ~ .video-content
    .video-item:not([data-type="usergroup"]) {
    display: none;
}

/* Responsive */
@media (max-width: 600px) {
    .navbar {
        justify-content: center;
        text-align: center;
    }

    .nav-links {
        justify-content: center;
        width: 100%;
    }

    .nav-links-right {
        margin-left: 0;
    }

    main {
        padding: calc(1rem + var(--navbar-bottom-radius)) 1rem 1rem;
    }

    .blog-card-link {
        align-items: flex-start;
    }

    .blog-thumb {
        width: 90px;
        height: 68px;
    }

    .release-card-link {
        align-items: flex-start;
    }

    .release-thumb {
        width: 90px;
        height: 68px;
    }

    .podcast-card-link {
        align-items: flex-start;
    }

    .podcast-thumb {
        width: 90px;
        height: 68px;
    }
}

/* Index page */

.page-header-index {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted, #666);
}

.explore-section {
    margin-top: 0;
}

.bmc-section {
    margin: 1.5rem 0;
    text-align: center;
}

.bmc-text {
    margin-bottom: 0.75rem;
    color: var(--link);
    font-size: 1.15rem;
    font-weight: bold;
}

.preview-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.preview-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-left: 4px solid var(--swedish-blue);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.preview-card h3 {
    color: var(--swedish-blue);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

@media (prefers-color-scheme: dark) {
    .preview-card h3 {
        color: var(--swedish-yellow);
    }
}

.preview-source {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.preview-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

.preview-more {
    font-size: 0.85rem;
    margin-top: 0.25rem;
    align-self: flex-end;
}

/* Small screens (iPhone SE, XR, etc.) */
@media (max-width: 480px) {
    .navbar {
        padding: 0.6rem 0.5rem;
        gap: 0.5rem;
    }

    .nav-links {
        gap: 0.75rem;
    }

    .nav-links a {
        font-size: 0.95rem;
    }

    main {
        padding: calc(0.75rem + var(--navbar-bottom-radius)) 0.75rem 0.75rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    body {
        font-size: 1rem;
    }

    .video-tabs label {
        min-width: 3.5rem;
        padding: 0.4rem 0.3rem;
        font-size: 0.8rem;
    }
}
