/* Frontpage Styles for Metsa Theme */


body.home .sidebar-nav .sidebar-icon {
    display: none;
}

body.home .sidebar-nav {
    top: 0;
    bottom: 0;
    display: flex;
    align-items: start;
    flex-direction: column;
    justify-content: center;
}

/* Reset and Base */
#frontpage {
    margin: 0;
    padding: 0;
    background: var(--m-white);
}

#frontpage .m-container {
    max-width: 1432px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero + Sidebar wrapper */
.hero-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 20%;
    gap: 16px;
    align-items: start;
}

.hero-with-sidebar .hero-section-main {
    min-width: 0;
}

.hero-sidebar {
    background: var(--m-sand-80-t);
    padding: 80px 24px 0 24px;
    overflow: hidden;
    box-sizing: border-box;
}

.hero-sidebar-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.hero-sidebar-link:hover {
    opacity: 0.85;
}

.hero-sidebar--slider {
    display: flex;
    flex-direction: column;
    padding: 80px 0 0 0;
    height: calc(100vh - 64px);
    min-height: 500px;
    max-height: 900px;
    box-sizing: border-box;
    position: relative;
}

.calendar-slides {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

.calendar-slide {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    color: inherit;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 600ms ease, visibility 0ms linear 600ms;
}

.calendar-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 600ms ease, visibility 0ms linear 0ms;
}

.hero-sidebar--slider .calendar-slide img {
    width: 100%;
    height: calc(100vh - 360px);
    min-height: 300px;
    max-height: 544px;
    object-fit: cover;
    display: block;
    flex: 0 0 auto;
}

.calendar-slide-text {
    flex: 0 0 auto;
    padding: 33px 0 96px 0;
}

.calendar-slide-text .hero-sidebar-heading {
    margin: 0 0 16px 0;
}
.hero-sidebar-heading a {
    color: inherit;
    text-decoration: none;
    transition: opacity 200ms ease;
}
.hero-sidebar-heading a:hover,
.hero-sidebar-heading a:focus-visible {
    opacity: 0.7;
}

.calendar-slide-meta {
    font-size: 13px;
    line-height: 160%;
    letter-spacing: 0.06em;
    color: var(--m-forest-80-t);
    margin: 0 0 6px 0;
}

.calendar-slide-title {
    font-size: 15px;
    line-height: 170%;
    letter-spacing: 0.06em;
    margin: 0;
}

.calendar-slide-title a {
    color: var(--m-forest);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 200ms ease;
}

.calendar-slide-title a:hover {
    opacity: 0.7;
}

.calendar-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 52px;
    padding: 0 24px;
}

.calendar-more {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 20px;
    padding: 0 24px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--m-forest);
    text-decoration: none;
    opacity: 0.75;
    transition: opacity 200ms ease, color 200ms ease;
}

.calendar-more:hover,
.calendar-more:focus-visible {
    opacity: 1;
    color: var(--m-amber);
}

.calendar-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(23, 49, 50, 0.25);
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    position: relative;
    transition: background 200ms ease, transform 200ms ease;
    appearance: none;
    -webkit-appearance: none;
}

.calendar-dot::before {
    content: "";
    position: absolute;
    inset: -18px;
}

.calendar-dot:hover {
    background: rgba(23, 49, 50, 0.55);
}

.calendar-dot:focus-visible {
    outline: 2px solid var(--m-forest);
    outline-offset: 2px;
}

.calendar-dot.is-active {
    background: var(--m-forest);
    transform: scale(1.15);
}

@media (prefers-reduced-motion: reduce) {
    .calendar-slide {
        transition: opacity 0ms, visibility 0ms;
    }
}

.hero-sidebar img {
    width: 100%;
    max-height: calc(100vh - 360px);
    object-fit: cover;
    display: block;
}

.hero-sidebar-text {
    padding: 24px 0 40px 0;
    flex: 0 0 auto;
}

.hero-sidebar-heading {
    font-weight: 600;
    font-size: 16px;
    line-height: 160%;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--m-forest);
    margin: 0 0 12px 0;
}

.hero-sidebar-body {
    font-size: 15px;
    line-height: 170%;
    letter-spacing: 0.06em;
    margin: 0;
}

/* Hero Section */
.hero-section-main {
    height: calc(100vh - 64px);
    min-height: 500px;
    overflow: hidden;
    z-index: 999;
    left: 0;
    right: 0;
    background: var(--m-sand-80-t);
    z-index: 999;
    position: relative;
    max-height: 900px;
}

/* Mobile Top Nav - Hidden on desktop */
.hero-mobile-nav {
    display: none;
}

.hero-mobile-menu-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
}

.hero-mobile-menu-btn:focus {
    outline: none;
    border: none;
}

.hero-mobile-menu-btn .hamburger-icon {
    display: block;
}

.hero-mobile-menu-btn .close-icon {
    display: none;
}

.hero-mobile-menu-btn.active .hamburger-icon {
    display: none;
}

.hero-mobile-menu-btn.active .close-icon {
    display: block;
}

.hero-image {
    max-height: 624px;
    position: relative;
    width: 100%;
    height: 100%;
    padding: 80px 32px 0 32px;
}

.hero-image img,
.hero-image video {
    max-height: calc(100vh - 360px);
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Bottom bar with logo and tagline */
.hero-bottom-bar {
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 0 40px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.hero-logo-left {
    flex: 0 0 auto;
}

.hero-logo-left .logo-image {
    height: 48px;
    width: 228px;
}

.hero-logo-left .logo-desktop {
    display: block;
}

.hero-logo-left .logo-mobile {
    display: none;
}

.hero-logo-left .site-title {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.4em;
    margin: 0;
    color: var(--m-white);
    text-transform: uppercase;
}

.hero-tagline-right {
    flex: 0 0 auto;
    text-align: right;
    max-width: 500px;

}

.hero-tagline-right p {
    font-weight: 600;
    font-size: 16px;
    line-height: 160%;
    letter-spacing: 0.3em;
    text-align: right;
    text-transform: uppercase;
    color: var(--m-forest);
    margin: 0;
}

/* Journey Section (Teekond Algab) */
.journey-section {
    padding: 80px 32px;
    background: var(--m-pine-80-t);
}


.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.image-column img,
.image-column video {
    width: 100%;
    height: auto;
    display: block;
}

/* Two Worlds Section (Kahe Maailma Vahel) */
.two-worlds-section {
    position: relative;
    padding: 0;
    padding-left: 177px;
    padding-right: 32px;
    padding-top: 80px;
    background: var(--m-sand-80-t);
}

.two-worlds-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.two-worlds-image img,
.two-worlds-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.two-worlds-content {
    background: var(--m-sand-80-t);
    padding: 80px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.two-worlds-title-column {
    position: sticky;
    top: 100px;
}

.two-worlds-title-column h1 {
    margin: 0;
}

.two-worlds-text-column {
    padding-right: 32px;
}


/* Food Section */
.food-section {
    padding: 80px 32px;
    padding-left: 177px;
    background: var(--m-fog-80-t);
}

.food-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

.food-images-column {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.food-grid-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

video.food-grid-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.food-text-column {
    padding-top: 0;
    max-width: 449px;
}

.food-text-column h1 {
    color: var(--m-forest);
    font-size: 1.125rem;
    letter-spacing: 0.3em;
    line-height: 1.6;
    margin-bottom: 30px;
    font-weight: 600;
    text-align: left;
}



/* Three Column Section */
.three-column-section {
    margin-top: 0;
    padding: 100px 32px;
    background: var(--m-fog-80-t);
}

.three-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
}

.column:first-child {
    margin-left: 154px;
}

.column img,
.column video {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    margin-bottom: 80px;
}

.column p {
    padding: 0;
}

/* Extra Content Section */
.extra-content-section {
    position: relative;
    padding: 0;
    padding-left: 177px;
    padding-right: 32px;
    padding-top: 80px;
    background: var(--m-white);
}

.extra-content-image {
    width: 100%;
    height: 460px;
    overflow: hidden;
}

.extra-content-image img,
.extra-content-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.extra-content-content {
    background: var(--m-white);
    padding: 80px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.extra-content-title-column {
    position: sticky;
    top: 100px;
}

.extra-content-title-column h1 {
    margin: 0;
}

.extra-content-text-column {
    padding-right: 32px;
}

/* Footer Landscape */
.footer-landscape {
    background: var(--m-sand-80-t);
    padding: 80px 32px 40px 177px;
    margin: 0;
}

.landscape-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.landscape-image img,
.landscape-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive Design */
@media (max-width: 900px) {

    /* Hide default mobile menu toggle on frontpage */
    body.home .mobile-menu-toggle:not(.hero-mobile-menu-btn) {
        display: none;
    }

    /* Hero + Sidebar Mobile */
    .hero-with-sidebar {
        grid-template-columns: 1fr;
    }

    .hero-sidebar {
        padding: 0;
    }

    .hero-sidebar--slider {
        padding: 40px 16px;
        height: auto;
        min-height: 0;
        max-height: none;
    }


    .hero-sidebar--slider .calendar-slides {
        padding: 0;
    }

    .hero-sidebar--slider .calendar-slide img {
        width: 100%;
        flex: 0 0 auto;
        height: auto;
        aspect-ratio: 1 / 1;
        min-height: 0;
        max-height: none;
        padding: 0;
    }

    .hero-sidebar--slider .calendar-slide-text {
        padding: 20px 0 16px 0;
    }

    .hero-sidebar--slider .calendar-dots {
        position: static;
        padding: 20px 0 0 0;
        margin-top: 0;
    }

    .hero-sidebar .hero-sidebar-link {
        flex-direction: row;
        align-items: stretch;
    }

    .hero-sidebar img {
        width: 40%;
        flex: 0 0 40%;
        padding: 16px 0 16px 16px;
        box-sizing: border-box;
        object-fit: cover;
        height: auto;
    }

    .hero-sidebar-text {
        flex: 1;
        padding: 16px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .hero-sidebar-heading {
        font-size: 14px;
        letter-spacing: 0.2em;
        margin-bottom: 8px;
    }

    .hero-sidebar-body {
        font-size: 13px;
        line-height: 160%;
    }

    /* Hero Section Mobile */
    .hero-section-main {
        height: auto;
        min-height: auto;
        padding-top: 72px;
    }

    /* Mobile Top Nav */
    .hero-mobile-nav {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        padding: 24px 48px;
        justify-content: space-between;
        align-items: center;
        z-index: 1000000;
        background: transparent;
        pointer-events: none;
    }

    .hero-mobile-nav>* {
        pointer-events: auto;
    }

    .hero-mobile-logo {
        display: flex;
        align-items: center;
    }

    .hero-mobile-logo a {
        display: block;
        line-height: 0;
    }

    .hero-mobile-logo img,
    .hero-mobile-logo svg {
        height: 32px;
        width: auto;
    }

    .hero-mobile-menu-btn .hamburger-icon {
        display: block;
        width: 40px;
        height: 40px;
    }

    .hero-mobile-menu-btn .close-icon {
        display: none;
        width: 40px;
        height: 40px;
    }

    .hero-mobile-menu-btn.active .hamburger-icon {
        display: none !important;
    }

    .hero-mobile-menu-btn.active .close-icon {
        display: block !important;
    }

    .hero-image {
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .hero-image img {
        max-height: 50vh;
        min-height: 300px;
        aspect-ratio: 3 / 4;
        object-fit: cover;
    }

    .hero-bottom-bar {
        position: static;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 40px 32px;
        gap: 24px;
    }

    .hero-logo-left {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .hero-logo-left .logo-desktop {
        display: none;
    }

    .hero-logo-left .logo-mobile {
        display: block;
        height: 45px;
        width: 168px;
    }

    .hero-logo-left .site-title {
        font-size: 1.2rem;
    }

    .hero-tagline-right {
        text-align: center;
        max-width: 100%;
    }

    .hero-tagline-right p {
        font-size: 14px;
        line-height: 160%;
        letter-spacing: 0.15em;
        text-align: center;
    }

    /* Journey Section Mobile */
    .journey-section {
        padding: 40px 16px;
    }

    .two-column-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .spacer-column {
        display: none;
    }

    .text-column {
        order: 2;
    }

    .image-column {
        order: 1;
    }

    /* Two Worlds Section Mobile */
    .two-worlds-section {
        padding: 40px 16px;
    }

    .two-worlds-content {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 40px 0;
    }

    .two-worlds-title-column {
        position: static;
    }

    /* Extra Content Section Mobile */
    .extra-content-section {
        padding: 40px 16px;
    }

    .extra-content-content {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 40px 0;
    }

    .extra-content-title-column {
        position: static;
    }

    /* Food Section Mobile */
    .food-section {
        padding: 40px 16px;
    }

    .food-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .food-images-column {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        order: 1;
    }

    .food-text-column {
        order: 2;
    }

    .food-images-column img {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        object-fit: cover;
    }

    /* Three Column Activities Mobile */
    .three-column-section {
        padding: 40px 16px;
    }

    .three-columns {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .column:first-child {
        margin-left: 0;
    }

    .column img {
        margin-bottom: 32px;
    }

    /* Footer Landscape Mobile */
    .footer-landscape {
        padding: 40px 16px;
    }

    .landscape-image {
        height: 300px;
    }
}

@media (min-width: 901px) {

    .two-column-layout>*:nth-child(1),
    .two-column-layout>*:nth-child(2) {
        max-width: 449px;
    }

    .three-columns>*:nth-child(1),
    .three-columns>*:nth-child(2) {
        max-width: 449px;
    }
}

#frontpage {
    display: grid;
    grid-template-columns: 1fr;
    grid-row-gap: 16px;
}

/* WYSIWYG content links styling */
.wysiwyg-content a {
    text-decoration: none;
    color: var(--m-forest);
    border-bottom: 1px solid var(--m-forest);
    transition: color 0.3s ease;
}

.wysiwyg-content a:hover {
    color: var(--m-pine);
}

/* External links with button styling */
#frontpage .button-link {
    margin-top: 40px;
}