/*
Theme Name: Lehtla
Theme URI: https://lehtla.com
Author: Peteris Lehtla
Description: Shared theme for the Lehtla family of sites. Wood background, per-site banner, sticky bar, overlay menu.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: lehtla
*/

@font-face {
    font-family: 'Fraunces';
    src: url(assets/fonts/fraunces.ttf) format('truetype');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap
}

@font-face {
    font-family: 'Fraunces';
    src: url(assets/fonts/fraunces-italic.ttf) format('truetype');
    font-weight: 300 700;
    font-style: italic;
    font-display: swap
}

@font-face {
    font-family: 'Space Grotesk';
    src: url(assets/fonts/spacegrotesk.ttf) format('truetype');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap
}

:root {
    --ink: #0d0b09;
    --cream: #efe9dc;
    --accent: #e8833a;
    --muted: #b9b2a3;
    --line: rgba(239, 233, 220, .24);
    --ease: cubic-bezier(.77, 0, .18, 1);
    --serif: 'Fraunces', Georgia, serif;
    --sans: 'Space Grotesk', Arial, sans-serif
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px
}

body {
    background: var(--ink);
    color: var(--cream);
    font-family: var(--sans);
    line-height: 1.55;
    overflow-x: hidden
}

a {
    color: inherit;
    text-decoration: none
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px
}

.label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .18em;
    font-weight: 500
}

.serif {
    font-family: var(--serif);
    font-weight: 300;
    letter-spacing: -.02em;
    text-wrap: balance
}

.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap
}

.skip:focus {
    position: fixed;
    top: 8px;
    left: 8px;
    width: auto;
    height: auto;
    clip: auto;
    background: var(--cream);
    color: var(--ink);
    padding: 10px 14px;
    z-index: 100
}

#progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: var(--accent);
    transform-origin: left;
    transform: scaleX(0);
    z-index: 70
}

/* wood background (image set inline in header.php) */
.wood {
    position: fixed;
    left: 0;
    right: 0;
    top: -8%;
    height: 116%;
    z-index: -1;
    will-change: transform;
    background: var(--ink) center/cover no-repeat
}

/* top banner: image only here is cropped, never globally */
.banner {
    background: #000;
    height: clamp(64px, 9vw, 150px);
    overflow: hidden
}

.banner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center
}

.site-head {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 5vw;
    z-index: 50;
    background: var(--ink);
    border-bottom: 1px solid var(--line)
}

.admin-bar .site-head {
    top: 32px
}

@media(max-width:782px) {
    .admin-bar .site-head {
        top: 46px
    }
}

.logo {
    font-family: var(--serif);
    font-size: 1.25rem
}

.menu-btn {
    display: flex;
    gap: 10px;
    align-items: center
}

.menu-btn i {
    display: block;
    width: 26px;
    height: 8px;
    border-top: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor
}

/* overlay menu */
#menu {
    position: fixed;
    inset: 0;
    background: var(--ink);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 5vw;
    overflow-y: auto;
    clip-path: inset(0 0 100% 0);
    transition: clip-path .9s var(--ease);
    visibility: hidden
}

#menu.open {
    clip-path: inset(0);
    visibility: visible
}

#menu .menu-list {
    list-style: none
}

#menu .menu-list .sub-menu {
    display: none
}

#menu .menu-list a {
    display: block;
    overflow: hidden;
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(1.4rem, 2.6vw, 2.2rem);
    line-height: 1.35;
}

#menu .menu-list a span {
    display: block;
    transform: translateY(110%);
    transition: transform .8s var(--ease)
}

#menu.open .menu-list a span {
    transform: none
}

#menu.open .menu-list li:nth-child(2) a span {
    transition-delay: .06s
}

#menu.open .menu-list li:nth-child(3) a span {
    transition-delay: .12s
}

#menu.open .menu-list li:nth-child(4) a span {
    transition-delay: .18s
}

#menu.open .menu-list li:nth-child(5) a span {
    transition-delay: .24s
}

#menu .menu-list a:hover {
    color: var(--accent)
}

#menu .close {
    position: absolute;
    top: 20px;
    right: 5vw
}

#menu .meta {
    position: absolute;
    bottom: 28px;
    left: 5vw;
    color: var(--muted)
}

/* reveal (only when JS is running) */
.js .rv {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s var(--ease), transform 1s var(--ease)
}

.js .rv.in {
    opacity: 1;
    transform: none
}

/* sections */
section {
    position: relative
}

.pad {
    padding: 14vh 5vw
}

.panel-a {
    background: rgba(13, 11, 9, .62)
}

.panel-b {
    background: rgba(13, 11, 9, .74)
}

.panel-c {
    background: rgba(13, 11, 9, .93)
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6vw;
    align-items: start
}

.split h1,
.split h2 {
    font-size: clamp(2.2rem, 5.2vw, 4.8rem);
    line-height: 1.02
}

.split p {
    max-width: 34em;
    color: var(--muted);
    font-size: 1.05rem
}

.split p+p {
    margin-top: 1em
}

.page-title {
    font-size: clamp(2.2rem, 5.2vw, 4.8rem);
    line-height: 1.02
}

.facts {
    margin-top: 9vh;
    border-top: 1px solid var(--line)
}

.facts .f {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line)
}

.facts dt {
    color: var(--muted)
}

/* photo band with parallax */
.band {
    height: 90vh;
    min-height: 420px;
    position: relative;
    overflow: hidden;
    background: var(--ink)
}

.band .pic {
    position: absolute;
    inset: -12% 0;
    will-change: transform
}

.band .pic img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .78
}

.band .quote {
    position: relative;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 0 5vw 10vh;
    color: #fff;
    z-index: 2
}

.band .quote p {
    font-size: clamp(2rem, 5.4vw, 5.2rem);
    line-height: 1.05;
    max-width: 16em;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .55)
}

.band .quote em {
    color: var(--accent);
    font-style: normal
}

/* journal rows */
.posts {
    margin-top: 8vh;
    border-top: 1px solid var(--cream)
}

.post {
    display: grid;
    grid-template-columns: 120px 1fr 160px 40px;
    gap: 3vw;
    align-items: baseline;
    width: 100%;
    text-align: left;
    padding: 28px 0;
    border-bottom: 1px solid var(--line);
    transition: padding-left .6s var(--ease)
}

.post:hover {
    padding-left: 16px
}

.post h2,
.post h3 {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(1.5rem, 2.8vw, 2.4rem);
    line-height: 1.1
}

.post .tag,
.post .d {
    color: var(--muted)
}

.post .arr {
    color: var(--accent);
    opacity: 0;
    transform: translateX(-14px);
    transition: .5s var(--ease)
}

.post:hover .arr {
    opacity: 1;
    transform: none
}

.post .d {
    font-variant-numeric: tabular-nums
}

.pagination {
    margin-top: 6vh
}

.pagination .nav-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap
}

.pagination .current {
    color: var(--accent)
}

/* two big links */
.links {
    margin-top: 8vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--line)
}

.lnk {
    display: block;
    text-align: left;
    padding: 40px 4vw 40px 0;
    border-bottom: 1px solid var(--line);
    transition: background .5s var(--ease), color .5s var(--ease), padding .6s var(--ease)
}

.lnk+.lnk {
    padding-left: 4vw;
    border-left: 1px solid var(--line)
}

.lnk:hover {
    background: var(--accent);
    color: var(--ink);
    padding-left: 6vw
}

.lnk h3 {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(2.2rem, 5vw, 4.4rem);
    line-height: 1;
    margin: 12px 0 16px
}

.lnk p {
    max-width: 26em;
    opacity: .85
}

.lnk .go {
    margin-top: 24px;
    display: inline-block
}

/* single posts and pages */
.entry-wrap {
    max-width: 760px
}

.entry-meta {
    color: var(--muted);
    display: block;
    margin: 18px 0 6vh
}

.entry p,
.entry li {
    color: #d6cfc0;
    font-size: 1.1rem;
    text-wrap: pretty
}

.entry p {
    margin-bottom: 1.1em
}

.entry h2,
.entry h3 {
    font-family: var(--serif);
    font-weight: 300;
    margin: 1.6em 0 .6em;
    line-height: 1.1
}

.entry h2 {
    font-size: 2rem
}

.entry h3 {
    font-size: 1.5rem
}

.entry a {
    color: var(--accent);
    text-decoration: underline
}

.entry ul,
.entry ol {
    margin: 0 0 1.1em 1.3em
}

.entry img {
    max-width: 100%;
    height: auto
}

.entry figure {
    margin: 1.6em 0
}

.entry figcaption {
    color: var(--muted);
    font-size: .9rem;
    margin-top: 8px
}

.entry blockquote {
    border-left: 2px solid var(--accent);
    padding-left: 20px;
    margin: 1.6em 0;
    font-family: var(--serif);
    font-size: 1.4rem
}

/* forms (Contact Form 7 / WPForms basics) */
.entry input[type=text],
.entry input[type=email],
.entry select,
.entry textarea {
    width: 100%;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--cream);
    padding: 10px 0;
    font: inherit;
    color: inherit;
    border-radius: 0;
    margin-bottom: 22px
}

.entry textarea {
    min-height: 110px
}

.entry input:focus,
.entry textarea:focus,
.entry select:focus {
    outline: 0;
    border-bottom: 2px solid var(--accent)
}

.entry input[type=submit],
.btn {
    display: inline-block;
    padding: 14px 26px;
    background: var(--accent);
    color: var(--ink);
    font-weight: 600;
    border: 0;
    cursor: pointer
}

.entry input[type=submit]:hover,
.btn:hover {
    background: var(--cream)
}

/* footer */
.site-foot {
    background: rgba(13, 11, 9, .88);
    padding: 8vh 5vw 28px;
    border-top: 1px solid var(--line)
}

.site-foot .big {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    line-height: 1.05;
    display: block
}

.site-foot .big:hover {
    color: var(--accent)
}

.site-foot .bar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 6vh;
    border-top: 1px solid var(--line);
    padding-top: 20px;
    color: var(--muted)
}

@media(max-width:820px) {

    .split,
    .links {
        grid-template-columns: 1fr
    }

    .lnk+.lnk {
        padding-left: 0;
        border-left: 0
    }

    .lnk:hover {
        padding-left: 3vw
    }

    .post {
        grid-template-columns: 1fr auto;
        gap: 6px 16px
    }

    .post .d {
        grid-column: 1
    }

    .post h2,
    .post h3 {
        grid-column: 1/-1;
        grid-row: 2
    }

    .post .tag {
        grid-column: 2;
        grid-row: 1;
        text-align: right
    }

    .post .arr {
        display: none
    }

    .pad {
        padding: 10vh 5vw
    }

    .band {
        height: 70vh
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important
    }
}

/* gateway */
.doors {
    margin-top: 9vh;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line)
}

.doors .lnk {
    padding: 40px 3vw
}

.doors .lnk:first-child {
    padding-left: 0
}

.doors .lnk+.lnk {
    border-left: 1px solid var(--line)
}

.doors .lnk:hover {
    padding-left: 4vw
}

.doors .lnk h3 {
    font-size: clamp(2rem, 3.6vw, 3.4rem)
}

.pics {
    margin-top: 8vh;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px
}

.pic-tile {
    position: relative;
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: rgba(239, 233, 220, .06);
    border: 1px solid var(--line)
}

.pic-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s var(--ease)
}

.pic-tile:hover img {
    transform: scale(1.04)
}

.pic-tile .label {
    position: absolute;
    left: 14px;
    bottom: 12px;
    color: var(--cream);
    text-shadow: 0 1px 8px rgba(0, 0, 0, .7)
}

.pic-tile.empty {
    display: flex;
    align-items: center;
    justify-content: center
}

.pic-tile.empty .label {
    position: static;
    color: var(--muted);
    text-shadow: none
}

@media(max-width:820px) {
    .doors {
        grid-template-columns: 1fr
    }

    .doors .lnk,
    .doors .lnk:first-child {
        padding: 32px 0
    }

    .doors .lnk+.lnk {
        border-left: 0
    }

    .doors .lnk:hover {
        padding-left: 3vw
    }

    .pics {
        grid-template-columns: 1fr 1fr
    }
}

/* door pictures (portraits) */
.door-img {
    display: block;
    aspect-ratio: 4/5;
    overflow: hidden;
    margin-bottom: 22px;
    background: rgba(239, 233, 220, .06);
    border: 1px solid var(--line)
}

.door-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: grayscale(.35);
    transition: transform .8s var(--ease), filter .5s var(--ease)
}

.lnk:hover .door-img img {
    transform: scale(1.05);
    filter: none
}

.door-img.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted)
}

.lnk:hover .door-img {
    border-color: var(--ink)
}

.doors .lnk {
    text-align: center;
}

.gateway-intro .split>div:last-child {
    text-align: center;
}

.gateway-intro .split>div:last-child p {
    margin-inline: auto;
}

.doors {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.doors .lnk,
.doors .lnk:first-child {
    padding-left: 3vw;
    padding-right: 3vw;
}

.doors .door-img {
    width: 100%;
}

#menu .menu-list li {
    border-bottom: 1px solid var(--line);
    max-width: 460px;
}

#menu .menu-list a {
    padding: 14px 0;
}

/* dropdown menu */
.site-head {
    position: sticky
}

#menu {
    position: absolute;
    inset: auto;
    top: 100%;
    right: 5vw;
    left: auto;
    width: min(280px, 90vw);
    padding: 8px 22px 14px;
    background: var(--ink);
    border: 1px solid var(--line);
    border-top: 0;
    display: block;
    overflow: visible;
    z-index: 60;
    clip-path: inset(0 0 100% 0);
    transition: clip-path .45s var(--ease);
    visibility: hidden
}

#menu.open {
    clip-path: inset(0 0 0 0);
    visibility: visible
}

#menu .close {
    display: none
}

#menu .menu-list li {
    max-width: none;
    border-bottom: 1px solid var(--line)
}

#menu .menu-list li:last-child {
    border-bottom: 0
}

#menu .menu-list a {
    font-family: var(--sans);
    font-size: .95rem;
    line-height: 1.3;
    padding: 12px 0;
    overflow: visible
}

#menu .menu-list a span {
    transform: none;
    transition: none
}

#menu .menu-list a:hover {
    color: var(--accent)
}

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

    .doors .lnk,
    .doors .lnk:first-child {
        padding: 32px 0;
    }

    .doors .lnk+.lnk {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .doors .lnk:hover {
        padding-left: 0;
    }

    .doors .door-img {
        max-width: 300px;
        margin-inline: auto;
    }

    .doors .lnk h3 {
        font-size: 2.2rem;
    }

    .doors .lnk p {
        font-size: 1rem;
    }

    .pics {
        grid-template-columns: 1fr 1fr;
    }
}

/* type scale, calmer */
body {
    font-size: 17px;
    line-height: 1.6;
}

h1.serif,
.page-title {
    font-size: clamp(2rem, 4.6vw, 3.8rem);
    line-height: 1.1;
}

.doors .lnk h3 {
    font-size: clamp(1.6rem, 2.6vw, 2.4rem);
}

.posts .post h3 {
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
}

.lnk h3 {
    font-size: clamp(1.6rem, 2.8vw, 2.4rem);
}

.band .quote p {
    font-size: clamp(1.5rem, 3.4vw, 2.8rem);
}

@media (max-width: 820px) {
    body {
        font-size: 16px;
    }

    .doors .lnk h3 {
        font-size: 1.8rem;
    }

    .doors .lnk p {
        font-size: .95rem;
    }
}