/*
Theme Name: EELK kogudus
Description: Eestikeelne koguduse koduleht kirikufoto, lühitutvustuse ja kuue fotolingiga.
Version: 1.7.0
Requires at least: 5.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: eelk-kogudus
*/
:root {
    --ingel-palve: url("assets/ingel-palve.png");
    --ingel-pasun: url("assets/ingel-pasun.png");
    --ingel-raamat: url("assets/ingel-raamat.png");
    --ingel-harf: url("assets/ingel-harf.png");
    --ingel-liilia: url("assets/ingel-liilia.png");
    --ingel-kuunal: url("assets/ingel-kuunal.png");
    --ingel-kirjarull: url("assets/ingel-kirjarull.png");
    --paper: #eef6ed;
    --ink: #26372e;
    --muted: #555e55;
    --rule: #cbd9ca;
    --gold: #a78b54;
    --serif: "Baskervville", "Baskerville", "Palatino Linotype", Palatino, Georgia, serif;
    --sans: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.62 var(--sans); }
a { color: inherit; text-underline-offset: .2em; }
a:focus-visible { outline: 3px solid #ba7024; outline-offset: 4px; }
h1, h2, h3, .subpages a { font-family: var(--serif); font-weight: 400; }
img { max-width: 100%; height: auto; }
.wrap { width: min(1152px, 88%); margin-inline: auto; }
.skip { position: absolute; z-index: 10; left: 8px; top: -100px; padding: 8px 16px; color: white; background: var(--ink); }
.skip:focus { top: 4px; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--rule); }
.main-nav { display: flex; align-items: center; justify-content: space-between; max-width: 912px; margin: auto; gap: clamp(8px,2vw,32px); padding-inline: 5%; overflow-x: auto; overscroll-behavior-x: contain; }
.main-nav > * { flex: 0 0 auto; white-space: nowrap; padding: 18px 4px 16px; text-decoration: none; font-size: 16px; border-bottom: 2px solid transparent; }
.main-nav a:is(:hover,[aria-current="page"]) { border-color: var(--gold); }
.main-nav a:focus-visible { outline-offset: -4px; }
.hero { display: grid; position: relative; isolation: isolate; color: white; background: #263b30; overflow: hidden; }
.hero::after { content: ""; position: absolute; z-index: 1; pointer-events: none; inset: 0; background: linear-gradient(90deg, rgba(11,27,19,.83), rgba(11,27,19,.71) 36%, rgba(12,26,18,.13) 72%, rgba(12,26,18,.03)); }
.hero-photo { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 80% 35%; }
.hero-inner { position: relative; z-index: 2; display: flex; align-items: center; min-height: clamp(365px,31vw,555px); padding-block: clamp(45px,4vw,72px); }
.hero-copy { width: min(62%, 780px); }
.hero-mark { display: block; margin: 0 0 23px 7px; width: 2px; height: 27px; position: relative; background: #e8d9ad; }
.hero-mark::after { content: ""; background: #e8d9ad; position: absolute; width: 16px; height: 2px; top: 8px; left: -7px; }
.affiliation { margin: 0 0 9px; text-transform: uppercase; font: 600 11px/1.5 var(--sans); letter-spacing: .19em; color: #f0e4c5; }
.hero h1 { margin: 0; font-size: clamp(49px,5.4vw,88px); line-height: 1.03; letter-spacing: -.035em; overflow-wrap: anywhere; text-wrap: balance; }
.intro { max-width: 44ch; margin: 18px 0 0; font: 400 clamp(18px,1.6vw,23px)/1.45 var(--serif); white-space: pre-line; }
.intro:empty { display: none; }
.cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 38px 30px; padding-block: clamp(34px,4vw,64px) clamp(42px,5vw,80px); }
.card { display: block; min-width: 0; text-decoration: none; border-bottom: 1px solid var(--rule); }
.card-photo, .album-photo { overflow: hidden; background: #e1e2d9; aspect-ratio: 1.9; }
.card-photo img, .album-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-text { padding: 17px 0 23px; min-height: 118px; }
.card-text, .parish-calendar > h2, .inner-page { position: relative; isolation: isolate; }
.card-text::before, .parish-calendar > h2::before, .inner-page::before {
    content: ""; position: absolute; z-index: -1; pointer-events: none; opacity: .08;
}
.card-text::before, .parish-calendar > h2::before {
    top: 4px; bottom: 4px; right: 0; width: min(40%, 120px);
    background: var(--angel) center right / contain no-repeat;
}
.card:nth-child(1) { --angel: var(--ingel-palve); }
.card:nth-child(2) { --angel: var(--ingel-pasun); }
.card:nth-child(3) { --angel: var(--ingel-raamat); }
.card:nth-child(4) { --angel: var(--ingel-harf); }
.card:nth-child(5) { --angel: var(--ingel-liilia); }
.card:nth-child(6) { --angel: var(--ingel-kuunal); }
.parish-calendar > h2 { --angel: var(--ingel-kirjarull); padding-block: 24px 22px; }
/* Keep a complete set on the first screen, even on long archive pages. */
.inner-page::before {
    inset: 12px 0 auto;
    height: min(calc(100% - 24px), 62vh, 540px);
    background-image: var(--ingel-palve), var(--ingel-pasun), var(--ingel-raamat),
        var(--ingel-harf), var(--ingel-liilia), var(--ingel-kuunal), var(--ingel-kirjarull);
    background-position: 3% 9%, 36% 0%, 68% 12%, 98% 5%, 15% 91%, 51% 77%, 89% 97%;
    background-size: auto min(15vw, 22vh, 160px);
    background-repeat: no-repeat;
}
@media (max-width: 600px) {
    .inner-page::before {
        background-position: 8% 0%, 81% 5%, 0% 49%, 51% 42%, 100% 53%, 17% 98%, 80% 93%;
        background-size: auto min(22vw, 14vh, 100px);
    }
}
/* On pages with photos, keep the seven watermarks in the heading area above the media. */
.inner-page:has(img, video, iframe) {
    --heading-art-height: clamp(160px, 24vw, 216px);
}
.inner-page:has(img, video, iframe)::before {
    height: var(--heading-art-height);
    background-position: 0% 5%, 33% 0%, 66% 5%, 100% 0%, 17% 100%, 50% 94%, 84% 100%;
    background-size: auto min(16vw, 44%);
}
.inner-page:has(img, video, iframe) > h1 {
    min-height: max(1.1em, calc(var(--heading-art-height) - 80px));
}
.card-text h2 { margin: 0; font-size: clamp(26px,2.45vw,38px); line-height: 1.1; letter-spacing: -.025em; }
.card-text p { margin: 7px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
a.card:hover h2, .subpages a:hover, .entries a:hover h2, .albums a:hover h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
.site-footer { border-top: 1px solid var(--rule); background: #e4eee1; color: #445347; font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 26px; }
.footer-inner a { text-decoration: none; font: 21px/1.3 var(--serif); }
.footer-inner a:hover { text-decoration: underline; }
.inner-page { padding-block: 35px 75px; min-height: 70vh; max-width: 1000px; overflow-wrap: anywhere; }
.inner-page h1 { font-size: clamp(38px,5.2vw,70px); line-height: 1.1; letter-spacing: -.035em; margin: 0 0 18px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; color: var(--muted); font-size: 15px; margin-bottom: 40px; }
.lead { color: var(--muted); font: 23px/1.5 var(--serif); margin: 0 0 32px; }
.reading, .contacts, .subpages, .entries { max-width: 76ch; }
.reading { overflow-wrap: anywhere; display: flow-root; }
.reading > :first-child { margin-top: 0; }
.reading iframe, .reading video { max-width: 100%; }
.reading figure { margin-inline: 0; }
.reading .wp-block-image img, .reading .wp-block-gallery img { max-width: 100%; }
.home-content { margin-bottom: 3rem; }
.muted, time { color: var(--muted); }
.subpages a { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding-block: 17px; font-size: 24px; line-height: 1.3; text-decoration: none; border-top: 1px solid var(--rule); }
.subpages a:last-child { border-bottom: 1px solid var(--rule); }
.entries article { border-top: 1px solid var(--rule); padding-block: 18px; }
.entries a, .albums a { text-decoration: none; display: block; }
.entries h2, .albums h2 { font-size: 28px; line-height: 1.25; margin: 3px 0; }
.albums { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(240px,100%),1fr)); gap: 25px; }
time { font-size: 14px; font-variant-numeric: tabular-nums; }
.album-photo { margin-bottom: 12px; }
.pager { display: flex; flex-wrap: wrap; gap: 20px; align-items: baseline; margin-top: 28px; }
.contacts:empty { display: none; }
.contacts div { display: grid; grid-template-columns: minmax(150px,1fr) 2fr; gap: 1em; border-top: 1px solid var(--rule); padding: 14px 0; }
.contacts dt { font-weight: 600; }
.contacts dd { margin: 0; }
@media (max-width: 760px) {
    .cards { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
    .wrap { width: 90%; }
    .hero-copy { width: 71%; }
    .main-nav { padding-inline: 4%; gap: 9px; }
}
@media (max-width: 540px) {
    .main-nav { gap: 5px; padding-inline: 8px; }
    .main-nav > * { font-size: 14px; padding: 13px 1px 11px; }
    .hero-inner { min-height: 348px; align-items: flex-end; padding-block: 132px 24px; }
    .hero-photo { object-position: 93% top; }
    .hero::after { background: linear-gradient(0deg,rgba(9,23,16,.93),rgba(9,23,16,.72) 38%,rgba(9,23,16,.13) 72%,rgba(9,23,16,0)); }
    .hero-copy { width: 100%; }
    .hero-mark { display: none; }
    .hero h1 { font-size: clamp(38px,10.8vw,48px); }
    .affiliation { font-size: 10px; letter-spacing: .14em; }
    .intro { max-width: 35ch; margin-top: 13px; }
    .cards { grid-template-columns: 1fr; gap: 25px; }
    .contacts div { display: block; }
    .card-text { padding-top: 13px; min-height: 110px; }
}

.sermon-years small { margin-left: auto; color: var(--muted); font: 15px/1.5 var(--sans); }
.sermon-year-heading { margin: 20px 0 16px; font-size: 32px; }
.overview-link { font-size: 15px; }
.sermon-list { margin: 0; padding: 0; list-style: none; }
.sermon-list li { display: grid; grid-template-columns: 96px minmax(0,1fr) auto; align-items: baseline; gap: 8px 20px; padding-block: 14px; border-top: 1px solid var(--rule); }
.sermon-title { font: 22px/1.35 var(--serif); text-decoration: none; }
.sermon-title:hover { text-decoration: underline; }
.watch { font-size: 15px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
    .sermon-list li { grid-template-columns: 1fr auto; }
    .sermon-list time { grid-column: 1 / -1; }
}

.entries .event-item { display: flex; align-items: flex-start; gap: 20px; }
.event-cover { flex: 0 0 min(24%, 150px); }
.event-cover img { display: block; width: 100%; height: auto; }
.event-body { min-width: 0; }
.event-body p { margin: .45em 0 0; }
.entries .event-body h2 a:hover { text-decoration: underline; }
.entries .event-open { display: inline-block; margin-top: .65em; font-size: 15px; text-decoration: underline; }
@media (max-width: 540px) {
    .entries .event-item { flex-direction: column; gap: 10px; }
    .event-cover { width: min(180px,100%); }
}
.parish-calendar { --cal-red: #cc0000; --cal-blue: #0056ad; margin-bottom: clamp(44px,6vw,82px); }
.parish-calendar > h2 { margin: 0 0 18px; font-size: clamp(32px,4vw,46px); line-height: 1.2; }
.cal-tools, .cal-actions, .cal-jump, .cal-legend { display: flex; align-items: center; flex-wrap: wrap; gap: .5em; }
.cal-tools { gap: .7em 1em; border-top: 1px solid var(--rule); padding-top: 14px; }
.cal-tools h3 { margin: 0 auto 0 0; font-size: 28px; line-height: 1.3; }
.cal-actions, .cal-jump { gap: 5px; }
.cal-tools :is(button,select,input) { font: 15px/1.2 var(--sans); color: var(--ink); background: var(--paper); border: 1px solid #a4aba0; padding: 8px 10px; border-radius: 3px; }
.cal-tools button, .cal-grid button { cursor: pointer; }
.cal-tools button:hover { background: #e7eadf; }
.cal-tools input { width: 6em; }
.cal-modes { display: inline-flex; }
.cal-modes button:first-child { border-radius: 4px 0 0 4px; }
.cal-modes button:last-child { border-radius: 0 4px 4px 0; border-left: 0; }
.cal-modes button[aria-pressed="true"] { background: #30563e; border-color: #30563e; color: white; }
.cal-legend { gap: 4px 18px; margin: 15px 0 12px; font-size: 13px; color: var(--muted); }
.cal-color-note { flex-basis: 100%; }
.cal-mark { display: inline-block; width: 8px; height: 8px; margin: 0 5px 1px 0; vertical-align: baseline; }
.cal-civil { color: var(--ink); }
.cal-civil .cal-mark { border: 1.5px solid currentColor; }
.cal-church .cal-mark { background: currentColor; border-radius: 50%; }
.cal-both .cal-mark { background: currentColor; transform: rotate(45deg); }
.cal-parish-event { color: #245639; }
.cal-parish-event .cal-mark { width: 11px; height: 3px; background: currentColor; border-radius: 2px; }
.cal-grid { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 14px; }
.cal-grid :is(td,th) { border: 1px solid var(--rule); text-align: left; padding: 7px 8px; }
.cal-grid th { background: #e9ede5; }
.cal-grid td { vertical-align: top; height: 80px; overflow-wrap: anywhere; }
.cal-grid time { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.cal-grid th:nth-child(n+6), .cal-grid .cal-red-date time, .cal-both { color: var(--cal-red); }
.cal-grid .cal-church-date time, .cal-church { color: var(--cal-blue); }
.cal-grid .cal-pad { background: #f0f1eb; }
.cal-grid .cal-today { outline: 2px solid #4d6e55; outline-offset: -2px; }
.cal-grid .cal-selected { background: #deebdc; }
.cal-date-button, .cal-month-title button { font: inherit; color: inherit; border: 0; padding: 0; background: transparent; }
.cal-date-button { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; min-width: 1.5em; }
.cal-date-button:hover time, .cal-month-title button:hover { text-decoration: underline; }
.cal-grid button:focus-visible { outline: 2px solid #426751; outline-offset: -2px; }
.cal-holiday, .cal-event { margin-top: 4px; line-height: 1.35; }
.cal-event { display: block; color: #244e38; font-weight: 600; }
.cal-signs { display: none; align-items: center; justify-content: center; flex-wrap: wrap; gap: 3px; line-height: 0; }
.cal-signs .cal-mark { width: 5px; height: 5px; margin: 0; }
.cal-signs .cal-parish-event .cal-mark { width: 8px; height: 3px; }
.cal-year { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,235px),1fr)); align-items: start; gap: 18px 14px; }
.cal-year tbody { display: table; width: 100%; table-layout: fixed; border-collapse: collapse; }
.cal-year :is(td,th) { text-align: center; padding: 2px; }
.cal-year td { vertical-align: middle; height: 38px; }
.cal-year .cal-month-title { background: #dde8dc; padding: 0; }
.cal-month-title button { display: block; width: 100%; padding: 7px 0; font: 21px/1.25 var(--serif); }
.cal-year .cal-date-button { width: 100%; min-height: 33px; }
.cal-year .cal-signs { display: flex; }
.cal-details { margin-top: 12px; padding: 12px 17px; border-inline-start: 3px solid #56775d; background: #e5eee2; }
.cal-details h4 { margin: 0 0 6px; font: 22px/1.3 var(--serif); }
.cal-details:focus { outline: 1px solid #54755d; }
.event-heading { font-size: 30px; margin: 28px 0 10px; }
@media (max-width: 700px) {
    .cal-month :is(td,th) { text-align: center; padding: 2px; }
    .cal-grid td { vertical-align: middle; height: 46px; }
    .cal-grid time { font-size: 16px; }
    .cal-grid .cal-date-button { width: 100%; min-height: 42px; }
    .cal-month .cal-signs { display: flex; }
    .cal-month .cal-inline { display: none; }
    .cal-tools :is(button,select,input) { font-size: 16px; min-height: 40px; }
    .cal-tools h3 { flex-basis: 100%; }
    .cal-details .cal-event { padding-block: 5px; }
}

.contact-section { max-width: 46rem; margin: 1.8rem 0 2.4rem; padding-block: 1.4rem; border-block: 1px solid var(--rule); }
.contact-section h2 { margin: 0 0 .65rem; font: normal clamp(1.65rem, 4vw, 2rem)/1.18 var(--serif); }
.useful-links .reading > :first-child { margin-top: .65rem; }
.useful-links .reading > :last-child { margin-bottom: 0; }
.contact-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1.25rem; }
.contact-fields label { display: grid; align-content: start; gap: .25rem; font-weight: 600; }
.contact-fields .full { grid-column: 1 / -1; }
.contact-form input, .contact-form textarea { width: 100%; min-width: 0; border: 1px solid #839683; border-radius: 3px; padding: .6rem .75rem; background: #fcfefa; color: var(--ink); font: 400 1rem/1.45 var(--sans); }
.contact-form textarea { resize: vertical; }
.contact-note, .contact-count { font-size: .9rem; color: var(--muted); }
.contact-fields .contact-note, .contact-count { margin: -.35rem 0 0; }
.contact-count { text-align: right; }
.contact-form button { margin: .8rem 0 0; background: #31573d; color: white; border: 0; border-radius: 3px; padding: .7rem 1.25rem; font: 600 1rem/1.4 var(--sans); cursor: pointer; }
.contact-form button:disabled { opacity: .65; }
.contact-feedback { background: #e4eee1; border-left: 3px solid #446652; padding: .65rem 1rem; }
.contact-feedback[role="alert"] { border-color: #88442a; }
.contact-feedback ul { margin: 0; padding-inline-start: 1.4rem; }
@media (max-width: 560px) { .contact-fields { grid-template-columns: 1fr; } }

.news-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); grid-template-areas: "links feed"; gap: clamp(1.5rem, 3.5vw, 3rem); align-items: start; }
.news-feed { grid-area: feed; min-width: 0; }
.news-feed > .reading:empty { display: none; }
.news-feed > .event-heading:first-child, .news-feed > .reading:empty + .event-heading { margin-top: 0; }
.news-shortcut { display: none; }
.useful-links { grid-area: links; min-width: 0; border-inline-end: 1px solid var(--rule); padding-inline-end: clamp(.85rem, 1.7vw, 1.6rem); }
.useful-links h2 { margin: 0 0 .8rem; font: normal clamp(1.35rem, 2.4vw, 1.7rem)/1.2 var(--serif); }
.useful-links .reading :is(ul,ol) { padding-inline-start: 1.15em; }
.useful-links .reading li + li { margin-top: .5rem; }
@media (max-width: 680px) {
    .news-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "shortcut" "feed" "links"; gap: 1.5rem; }
    .news-shortcut { display: inline-block; grid-area: shortcut; justify-self: start; font-size: .94rem; }
    .useful-links { border-inline-end: 0; border-top: 1px solid var(--rule); padding: 1.2rem 0 0; scroll-margin-top: 1rem; }
}

.eelk-wp-menu, .eelk-wp-menu .sub-menu { list-style: none; }
.eelk-wp-menu > li { padding: 0; border: 0; }
.eelk-wp-menu > li > a { display: inline-block; padding: 18px 4px 16px; border-bottom: 2px solid transparent; text-decoration: none; }
.eelk-wp-menu:has(.sub-menu) { overflow: visible; flex-wrap: wrap; }
.eelk-wp-menu li { position: relative; }
.eelk-wp-menu .sub-menu { display: none; position: absolute; z-index: 8; inset-inline-start: 0; top: 100%; min-width: 12rem; max-width: 18rem; padding: .35rem; margin: 0; background: var(--paper); border: 1px solid var(--rule); }
.eelk-wp-menu > li:last-child > .sub-menu { inset-inline: auto 0; }
.eelk-wp-menu .sub-menu a { display: inline-block; padding: .45rem .6rem; white-space: normal; overflow-wrap: anywhere; }
.eelk-wp-menu .sub-menu .sub-menu { position: static; margin-inline-start: .5rem; min-width: 0; border: 0; }
.eelk-wp-menu:not(.eelk-submenus-ready) li:is(:hover,:focus-within) > .sub-menu,
.eelk-sub-toggle[aria-expanded="true"] + .sub-menu { display: block; }
.eelk-sub-toggle { padding: .5rem; background: transparent; border: 0; color: var(--ink); cursor: pointer; }
.reading .parish-calendar { width: 100%; }
.home-content:has(.parish-calendar) { max-width: 1152px; }
@media (max-width: 540px) {
    .eelk-wp-menu > li { padding: 0; }
    .eelk-wp-menu > li > a { padding: 13px 1px 11px; }
    .eelk-wp-menu:has(.sub-menu) > li { position: static; }
    .eelk-wp-menu:has(.sub-menu) { position: relative; }
    .eelk-wp-menu > li > .sub-menu { inset-inline: 0; max-width: none; }
}
