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

body {
    background: #203822;
    background-attachment: fixed;
    color: #FAFAF7;
    font-family: 'Titillium Web', sans-serif;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

/* Värit (valinnaiset muuttujat) */
:root {
  --link: #e6c38a;     /* accentti */
  --link-visited: #e6c38a;
  --link-hover: #F9D299;
  --link-underline: #203822;
}

/* Kaikki "normaalit" linkit sivun sisältöalueilla */
.page-content a,
.content-card a,
.card-content a,
.child-pages li a,
.post-navigation a,
.read-more,
.footer-content a {
  color: var(--link);
  text-decoration: none;
  outline: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-size: 0 1px;               /* piilossa oletuksena */
  background-repeat: no-repeat;
  transition: background-size 160ms ease, opacity 160ms ease, color 160ms ease, border-color 160ms ease;
}

/* Hover & focus: kevyt alleviivaus-animaatio */
.page-content a:hover,
.content-card a:hover,
.card-content a:hover,
.child-pages li a:hover,
.post-navigation a:hover,
.read-more:hover,
.footer-content a:hover,
.page-content a:focus-visible,
.content-card a:focus-visible,
.card-content a:focus-visible,
.child-pages li a:focus-visible,
.post-navigation a:focus-visible,
.read-more:focus-visible,
.footer-content a:focus-visible {
  background-size: 100% 1px;
  text-decoration: none;
}

/* Näkyvä focus-kehys näppäimistölle */
.page-content a:focus-visible,
.content-card a:focus-visible,
.card-content a:focus-visible,
.child-pages li a:focus-visible,
.post-navigation a:focus-visible,
.read-more:focus-visible,
.footer-content a:focus-visible {
  outline: 2px dashed var(--link-underline);
  outline-offset: 3px;
}

/* Vierailtu linkki */
.page-content a:visited,
.content-card a:visited,
.card-content a:visited {
  color: var(--link-visited);
}

/* Aktiivinen klikkaus */
.page-content a:active,
.content-card a:active,
.card-content a:active {
  opacity: 0.9;
}

.footer-content a:hover {
    opacity: 0.8;
}

.child-pages {
    margin: 30px auto;
    max-width: 600px;
}

.child-pages ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.child-pages li {
    background: rgba(79, 148, 163, 0.15);
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 3px solid #2E5760;
}

.child-pages li:hover {
    background: rgba(79, 148, 163, 0.25);
    transform: translateX(5px);
    border-left-color: #4F94A3;
}

.child-pages li a {
    display: block;
    color: #FAFAF7;
    text-decoration: none;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

.child-pages li a:hover {
    color: #F9D299;
}

.site-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
}

.site-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: #4F94A3;
}

.site-title a {
    color: #4F94A3;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.site-title a:hover {
    opacity: 0.8;
}

.site-description {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
    color: #FAFAF7;
}

.main-nav {
    margin-top: 20px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.main-nav a {
    color: #FAFAF7;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.main-nav a:hover {
    background: rgba(79, 148, 163, 0.2);
    transform: translateY(-2px);
    border-color: #4F94A3;
}

.main-nav .active a {
    background: rgba(79, 148, 163, 0.25);
    border-color: #2E5760;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: #4F94A3;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-top: 10px;
    color: #FAFAF7;
}

.date-display {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-top: 10px;
    color: #F9D299;
}

.content-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
    background: rgba(46, 87, 96, 0.3);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
    border-left: 3px solid #2E5760;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(79, 148, 163, 0.3);
    background: rgba(46, 87, 96, 0.4);
    border-left-color: #4F94A3;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8) { animation-delay: 0.8s; }
.card:nth-child(9) { animation-delay: 0.9s; }
.card:nth-child(10) { animation-delay: 1.0s; }
.card:nth-child(11) { animation-delay: 1.1s; }
.card:nth-child(12) { animation-delay: 1.2s; }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2E5760;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #FAFAF7;
}

.card-title a {
    color: #FAFAF7;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.card-title a:hover {
    opacity: 0.8;
    color: #4F94A3;
}

.card-content {
    line-height: 1.8;
    font-size: 1.05rem;
    color: #FAFAF7;
    font-weight: 400;
}

.card-content p {
    margin-bottom: 15px;
}

.card-content a {
    color: #F9D299;
    text-decoration: none;
    border-bottom: 1px solid rgba(249, 210, 153, 0.3);
    transition: border-color 0.3s ease;
}

.card-content a:hover {
    border-color: #F9D299;
}

.card-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(79, 148, 163, 0.3);
}

.content-card {
    background: rgba(46, 87, 96, 0.3);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.6s ease;
    border-left: 3px solid #2E5760;
}

.content-card img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.page-content {
    margin-bottom: 40px;
}

.blog-listing {
    margin-bottom: 40px;
}

.post-meta {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-top: 8px;
    color: #F9D299;
}

.post-meta time {
    margin-right: 15px;
}

.tags {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(79, 148, 163, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #FAFAF7;
    border: 1px solid #2E5760;
}

.read-more {
    color: #F9D299;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.3s ease;
    display: inline-block;
}

.read-more:hover {
    opacity: 0.8;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding: 20px;
    background: rgba(46, 87, 96, 0.2);
    border-radius: 12px;
    gap: 20px;
    flex-wrap: wrap;
    border: 1px solid #2E5760;
}

.post-navigation a {
    color: #F9D299;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.post-navigation a:hover {
    opacity: 0.8;
}

.back-to-blog {
    margin: 0 auto;
}

.site-footer {
    text-align: center;
    margin-top: 60px;
    padding: 30px 20px;
    border-top: 1px solid #2E5760;
}

.footer-content {
    opacity: 0.8;
    color: #FAFAF7;
}

.footer-content p {
    margin: 5px 0;
}

.footer-content a {
    color: #F9D299;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer-content a:hover {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .site-title,
    .page-header h1 {
        font-size: 2rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .main-nav ul {
        gap: 15px;
    }
    
    .content-card {
        padding: 25px;
    }
    
    .post-navigation {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .site-title,
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .site-description,
    .subtitle,
    .date-display {
        font-size: 1rem;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .card-content {
        font-size: 1rem;
    }
    
    .card,
    .content-card {
        padding: 20px;
    }
    
    .main-nav a {
        font-size: 1rem;
        padding: 6px 12px;
    }
}
