/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --forest:     #1e3d2f;
    --forest-mid: #2d5a3d;
    --forest-lt:  #4a7c5e;
    --lake:       #1e4d6b;
    --lake-lt:    #3a7fa8;
    --gold:       #c9a84c;
    --cream:      #f7f3ed;
    --cream-dk:   #ede8e0;
    --text:       #2a2a2a;
    --text-mid:   #4a4a4a;
    --text-light: #777;
    --white:      #fff;
    --border:     #ddd;
    --shadow:     0 4px 20px rgba(0,0,0,.12);
    --shadow-lg:  0 8px 40px rgba(0,0,0,.18);
    --max-w:      1100px;
    --nav-h:      62px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text);
    background: var(--cream);
    line-height: 1.75;
}

a { color: var(--lake); text-decoration: none; transition: color .2s; }
a:hover { color: var(--forest); text-decoration: underline; }

h1,h2,h3,h4 { font-family: 'Playfair Display', serif; line-height: 1.25; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); color: var(--forest); margin: 1.8rem 0 .8rem; }
h3 { font-size: 1.15rem; color: var(--forest-mid); margin: 1.2rem 0 .5rem; }
p  { margin-bottom: 1rem; }
ul,ol { margin: 0 0 1rem 1.5rem; }
li { margin-bottom: .35rem; }
img { max-width: 100%; height: auto; display: block; }

/* ===== NAVIGATION ===== */
.site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    z-index: 200;
    background: rgba(18,40,28,.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
    transition: background .3s;
}
.site-nav.scrolled { background: rgba(18,40,28,.97); }

.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 1.2rem;
    gap: 1rem;
}

.nav-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--gold);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: .03em;
}
.nav-logo:hover { color: #e0bc6a; text-decoration: none; }

.nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin: 0; padding: 0;
    gap: .1rem;
    flex: 1;
    justify-content: flex-end;
}

.nav-menu li a {
    display: block;
    padding: .55rem .9rem;
    color: rgba(255,255,255,.88);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-radius: 4px;
    transition: background .2s, color .2s;
}
.nav-menu li a:hover,
.nav-menu li.current a {
    background: var(--forest-lt);
    color: #fff;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    padding: .3rem .5rem;
    margin-left: auto;
}

/* ===== HERO ===== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 520px;
    max-height: 860px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('https://www.oravasaari.fi/wp-content/uploads/2019/03/paijanne2.jpg');
    background-size: cover;
    background-position: center 55%;
    transform: scale(1.05);
    transition: transform 8s ease-out;
    will-change: transform;
}
.hero-bg.loaded { transform: scale(1); }

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(10,30,20,.65) 0%,
        rgba(18,45,30,.5) 50%,
        rgba(15,35,55,.7) 100%
    );
}

.hero-content {
    position: relative;
    text-align: center;
    color: #fff;
    padding: 1rem 1.5rem;
    max-width: 720px;
    animation: heroFadeUp .9s ease both;
    animation-delay: .2s;
}

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

.hero-eyebrow {
    display: inline-block;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1rem;
    border: 1px solid rgba(201,168,76,.5);
    padding: .3rem .9rem;
    border-radius: 20px;
}

.hero-title {
    font-size: clamp(2.6rem, 7vw, 4.5rem);
    font-family: 'Playfair Display', serif;
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0,0,0,.5);
    margin-bottom: .7rem;
}

.hero-sub {
    font-size: clamp(.95rem, 2vw, 1.2rem);
    color: rgba(255,255,255,.88);
    max-width: 520px;
    margin: 0 auto 2rem;
    font-weight: 400;
    text-shadow: 0 1px 8px rgba(0,0,0,.4);
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    color: rgba(255,255,255,.7);
    font-size: .75rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    animation: bounce 2s infinite;
}
.hero-scroll svg { width: 22px; height: 22px; opacity: .7; }

@keyframes bounce {
    0%,100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(6px); }
}

/* ===== PAGE BANNER (sisäsivut) ===== */
.page-banner {
    position: relative;
    height: 260px;
    overflow: hidden;
    margin-top: var(--nav-h);
}
.page-banner-bg {
    position: absolute;
    inset: 0;
    background-image: url('https://www.oravasaari.fi/wp-content/uploads/2019/03/teerilahti4-1024x680.jpg');
    background-size: cover;
    background-position: center 40%;
}
.page-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(15,35,25,.55), rgba(15,35,25,.75));
    display: flex;
    align-items: flex-end;
    padding: 2rem 2.5rem;
}
.page-banner h1 {
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,.5);
    border-left: 4px solid var(--gold);
    padding-left: 1rem;
}

/* ===== WAVE DIVIDER ===== */
.wave-top, .wave-bottom {
    display: block;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}
.wave-top svg, .wave-bottom svg { display: block; width: 100%; }

/* ===== LAYOUT ===== */
.site-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
}

/* ===== ETUSIVU ===== */
.intro-strip {
    background: var(--forest);
    color: rgba(255,255,255,.92);
    padding: 3rem 0 0;
}
.intro-strip-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem 2.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.intro-strip-text h2 {
    color: var(--gold);
    margin-top: 0;
    font-size: 1.6rem;
}
.intro-strip-text p { color: rgba(255,255,255,.85); margin-bottom: .8rem; }

.intro-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    margin-top: 1rem;
}
.badge {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: rgba(255,255,255,.9);
    padding: .35rem .9rem;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .03em;
}

.intro-image { border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-lg); }
.intro-image img { width: 100%; height: 260px; object-fit: cover; }

/* ===== HOME CARDS ===== */
.home-cards-section {
    background: var(--cream);
    padding: 3.5rem 0;
}
.home-cards-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}
.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
}
.section-title h2 {
    margin: 0 0 .4rem;
    font-size: 2rem;
    color: var(--forest);
}
.section-title p { color: var(--text-light); font-size: .95rem; }
.section-title .title-line {
    width: 50px;
    height: 3px;
    background: var(--gold);
    margin: .8rem auto 0;
    border-radius: 2px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.card-img {
    width: 100%;
    height: 170px;
    object-fit: cover;
}

.card-body { padding: 1.3rem; }
.card-body h3 { margin-top: 0; color: var(--forest); font-size: 1.05rem; }
.card-body p { font-size: .9rem; color: var(--text-mid); margin: 0; }
.card-link {
    display: inline-block;
    margin-top: .9rem;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--forest-lt);
}
.card-link:hover { color: var(--forest); text-decoration: none; }

/* ===== TAPAHTUMAT / UUTISET STRIP ===== */
.events-strip {
    background: linear-gradient(135deg, var(--forest) 0%, var(--lake) 100%);
    padding: 3.5rem 0;
    position: relative;
}

.events-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.events-col h2 {
    color: var(--gold);
    margin-top: 0;
    padding-bottom: .7rem;
    border-bottom: 1px solid rgba(255,255,255,.2);
    margin-bottom: 1.2rem;
    font-size: 1.4rem;
}

.post-list { list-style: none; margin: 0; padding: 0; }

.post-item {
    padding: .9rem 0;
    border-bottom: 1px solid rgba(255,255,255,.12);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.post-item:last-child { border-bottom: none; }

.post-date-box {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 8px;
    min-width: 52px;
    text-align: center;
    padding: .4rem .5rem;
    flex-shrink: 0;
}
.post-date-day  { display: block; font-size: 1.3rem; font-weight: 700; color: #fff; line-height: 1; }
.post-date-mon  { display: block; font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); margin-top: .15rem; }

.post-text h3 { font-family: 'Open Sans', sans-serif; font-size: .95rem; font-weight: 700; color: #fff; margin: 0 0 .2rem; }
.post-text p  { font-size: .83rem; color: rgba(255,255,255,.7); margin: 0; }

/* Uutiset ilman päivämääräboxia */
.news-item {
    padding: .85rem 0;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.news-item:last-child { border-bottom: none; }
.news-date { font-size: .75rem; color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .2rem; }
.news-item h3 { font-family: 'Open Sans', sans-serif; font-size: .95rem; font-weight: 700; color: #fff; margin: 0 0 .25rem; }
.news-item p  { font-size: .83rem; color: rgba(255,255,255,.72); margin: 0; }

/* ===== PHOTO STRIP ===== */
.photo-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    height: 280px;
}
.photo-strip-item {
    overflow: hidden;
    position: relative;
}
.photo-strip-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.photo-strip-item:hover img { transform: scale(1.07); }

/* ===== INNER PAGE CONTENT ===== */
.content-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    animation: fadeIn .5s ease both;
}
.content-section:last-child { border-bottom: none; }

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

.content-section h2 {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.content-section h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.4em;
    background: var(--gold);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ===== CONTACT TABLE ===== */
.contact-group { margin-bottom: 2rem; }
.contact-group h3 {
    background: var(--forest);
    color: #fff;
    padding: .55rem 1rem;
    border-radius: 6px;
    font-family: 'Open Sans', sans-serif;
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: .8rem;
    border-left: 4px solid var(--gold);
}
.contact-table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--white); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.contact-table td { padding: .65rem 1rem; border-bottom: 1px solid var(--cream-dk); vertical-align: top; }
.contact-table tr:last-child td { border-bottom: none; }
.contact-table td:first-child { font-weight: 600; width: 50%; color: var(--forest); }

/* ===== NOTICE ===== */
.notice {
    background: linear-gradient(135deg, rgba(30,61,47,.06), rgba(30,77,107,.06));
    border: 1px solid rgba(30,61,47,.2);
    border-left: 4px solid var(--forest-lt);
    padding: 1.1rem 1.4rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

/* ===== PHOTO GRID (sisäsivut) ===== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .8rem;
    margin: 2rem 0;
}
.photo-grid img { width: 100%; height: 200px; object-fit: cover; border-radius: 8px; }

/* ===== FOOTER ===== */
.site-footer {
    background: var(--forest);
    color: rgba(255,255,255,.75);
    text-align: center;
    padding: 3rem 1.5rem;
    font-size: .88rem;
}
.footer-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--gold);
    display: block;
    margin-bottom: .5rem;
}
.footer-tagline { color: rgba(255,255,255,.5); font-size: .8rem; margin-bottom: 1.5rem; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem 1.5rem; margin-bottom: 1.5rem; }
.footer-links a { color: rgba(255,255,255,.8); font-size: .85rem; }
.footer-links a:hover { color: var(--gold); text-decoration: none; }
.footer-copy { color: rgba(255,255,255,.35); font-size: .78rem; }

/* ===== ADMIN ERROR ===== */
.db-error { background: #fff8e1; border: 1px solid #f0c040; border-left: 4px solid #e0a800; padding: .9rem 1.2rem; border-radius: 0 6px 6px 0; margin-bottom: 1rem; font-size: .9rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .cards-grid { grid-template-columns: 1fr 1fr; }
    .intro-strip-inner { grid-template-columns: 1fr; }
    .intro-image { display: none; }
    .events-inner { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 680px) {
    .nav-toggle { display: block; }
    .nav-logo { font-size: 1rem; }
    .nav-menu {
        display: none;
        position: absolute;
        top: var(--nav-h);
        left: 0; right: 0;
        flex-direction: column;
        background: rgba(18,40,28,.98);
        padding: .5rem;
        gap: .2rem;
    }
    .nav-menu.open { display: flex; }
    .nav-menu li a { padding: .75rem 1rem; border-radius: 6px; font-size: .85rem; }
    .site-nav { position: fixed; }

    .hero { max-height: 600px; }
    .hero-title { font-size: 2.4rem; }

    .cards-grid { grid-template-columns: 1fr; }
    .photo-strip { grid-template-columns: 1fr; height: auto; }
    .photo-strip-item { height: 200px; }
    .photo-grid { grid-template-columns: 1fr 1fr; }
    .page-banner { height: 200px; }
}

@media (max-width: 420px) {
    .photo-grid { grid-template-columns: 1fr; }
}
