* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: #f5f5f5;
    color: #222;
    background: linear-gradient(to bottom, #e8e8e8, #dcdcdc);
}

.hero {
    background: url("img/bild.jpg") center/cover no-repeat;
    height: 300px;
    position: relative;
}

.overlay {
    background-color: rgba(0,0,0,0.6);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
}

.overlay h1 {
    margin: 0;
    font-size: 40px;
}

.overlay p {
    font-size: 18px;
}

nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #1f2a1f;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: auto;
    padding: 10px;
}

.logo {
    color: white;
    font-weight: bold;
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    transition: 0.3s;
}

nav a:hover {
    background: #3b4d3b;
    border-radius: 5px;
}

main {
    max-width: 1000px;
    margin: 30px auto;
    padding: 20px;
}

.intro {
    margin-bottom: 30px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.card {
    position: relative;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: white;
}

.card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: 0.4s;
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.card:hover img {
    transform: scale(1.1);
}

.card:hover {
    transform: translateY(-5px);
    transition: 0.3s;
}

footer {
    text-align: center;
    padding: 15px;
    background: #1f2a1f;
    color: white;
    font-weight: 600;
}

@media (max-width: 768px) {

    .cards {
        grid-template-columns: 1fr;
    }

    nav ul {
        flex-direction: column;
        text-align: center;
    }

    .hero {
        height: 200px;
    }
}

html{
	overscroll-behavior: none;
}

/* Battle sections */

.battle-text p {
    font-weight: 600;
    line-height: 1.6;
}

.battle {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.battle img {
    width: 50%;
    border-radius: 10px;
}

.battle-text {
    width: 50%;
}

.info {
	font-weight: 400;
}

/* Varannan spegelvänd */
.reverse {
    flex-direction: row-reverse;
}

/* Mobil */
@media (max-width: 768px) {

    .battle,
    .leader,
    .vehicle,
    .reverse {
        flex-direction: column;
    }

    .battle img,
    .leader img,
    .vehicle img,
    .battle-text,
    .leader-text,
    .vehicle-text {
        width: 100%;
    }
}

/* Leaders (liknar battle men egen klass) */
.leader {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.leader img {
    width: 30%;
    border-radius: 10px;
}

.leader-text {
    width: 50%;
}

.leader-text p {
    font-weight: 500;
    line-height: 1.6;
}

.leader-text h2 {
    font-weight: 700;
}

/* Mobil */
@media (max-width: 768px) {
    .leader {
        flex-direction: column;
    }

    .leader img,
    .leader-text {
        width: 100%;
    }
}

/* Vehicles */
.vehicle {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.vehicle img {
    width: 40%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 10px;
    transition: 0.3s;
}

.vehicle img:hover {
    transform: scale(1.03);
}

.vehicle-text {
    width: 60%;
}

.vehicle-text p {
    font-weight: 500;
    line-height: 1.6;
}

.vehicle-text h2 {
    font-weight: 700;
}

/* Mobil */
@media (max-width: 768px) {
    .vehicle {
        flex-direction: column;
    }

    .vehicle img,
    .vehicle-text {
        width: 100%;
    }
}

/* Källor */
.sources-intro {
    margin-bottom: 30px;
}

.sources {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.source-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: 0.3s;
}

.source-card:hover {
    transform: translateY(-5px);
}

.source-card h3 {
    margin-top: 0;
}

.source-card a {
    display: inline-block;
    margin-top: 10px;
    color: #2f5d2f;
    text-decoration: none;
    font-weight: bold;
}

.source-card a:hover {
    text-decoration: underline;
}

/* Mobil */
@media (max-width: 768px) {
    .sources {
        grid-template-columns: 1fr;
    }
}

/* TIMELINE (ChatGPT)*/
.timeline-section {
    margin-top: 60px;
}

.timeline-title {
    text-align: center;
    margin-bottom: 40px;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: auto;
}

/* Linjen */
.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: #2f5d2f;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

/* Boxarna */
.timeline-item {
    padding: 20px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

/* Vänster */
.timeline-item:nth-child(odd) {
    left: 0;
}

/* Höger */
.timeline-item:nth-child(even) {
    left: 50%;
}

/* Cirklar */
.timeline-item::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    right: -13px;
    background-color: white;
    border: 4px solid #2f5d2f;
    top: 30px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item:nth-child(even)::after {
    left: -13px;
}

/* Innehåll */
.timeline-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    overflow-wrap: break-word;
}

.timeline-content h3 {
    margin-top: 0;
}

.timeline-content:hover {
    transform: scale(1.03);
    transition: 0.3s;
}

.timeline-content p {
    line-height: 1.6;
    font-weight: 500;
}

.timeline-content h3 {
    color: #2f5d2f;
    margin-bottom: 10px;
    font-size: 22px;
}

/* Mobil */
@media (max-width: 768px) {

    .timeline::after {
        left: 20px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 55px;
        padding-right: 15px;
        left: 0 !important;
    }

    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
    }

    .timeline-item::after {
        left: 11px;
        right: auto;
    }

    .timeline-content {
        width: 100%;
    }
    .timeline {
    overflow-x: hidden;
	}
}

.vehicle,
.leader,
.battle,
.timeline-item {
    animation: fadeInUp 1s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {

    .nav-container {
        flex-direction: column;
        gap: 10px;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        text-align: center;
    }

    nav li {
        width: 100%;
    }

    nav a {
        display: block;
        padding: 12px;
    }
}

/* Alla bilder responsiva */
img {
    max-width: 100%;
    height: auto;
}

/* Extra mobilfixar */
@media (max-width: 768px) {

    .battle,
    .leader,
    .vehicle,
    .reverse {
        flex-direction: column !important;
    }

    .battle img,
    .leader img,
    .vehicle img,
    .battle-text,
    .leader-text,
    .vehicle-text {
        width: 100% !important;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .overlay h1 {
        font-size: 30px;
    }

    .overlay p {
        font-size: 16px;
    }

    h2 {
        font-size: 24px;
    }

    .hero {
        height: 200px;
    }

    main {
        padding: 15px;
    }

    .timeline-content:hover {
        transform: none;
    }

}

.quiz {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin: 40px auto;
    max-width: 600px;
    text-align: center;
}

.quiz h2 {
    margin-top: 0;
}

.quiz button {
    background: #2f5d2f;
    color: white;
    border: none;
    padding: 10px 15px;
    margin: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.quiz button:hover {
    background: #3b4d3b;
    transform: translateY(-2px);
}

.quiz button:disabled {
    background: #aaa;
    cursor: not-allowed;
}

#result {
    margin-top: 15px;
    font-weight: bold;
    font-size: 18px;
}
