/*
Theme Name: Spooky
Author: Tektonic Ltd
Author URI: https://www.tektonic.co.uk
Theme URI: https://www.tektonic.co.uk
Update URI: https://updates.tektonic.co.uk/theme-updates
Description: A light editorial block theme. Install Spooky Companion for maps, route blocks and imports.
Version: 2.1.7
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: spooky
*/

:root{--spooky-gutter:clamp(20px,4vw,48px);--spooky-width:1120px;--spooky-space:clamp(40px,6vw,80px);--spooky-edge:max(var(--spooky-gutter),calc((100% - var(--spooky-width))/2))}
html{scroll-behavior:smooth}body{margin:0}*,*::before,*::after{box-sizing:border-box}
.wp-site-blocks{padding-top:0!important;padding-bottom:0!important}.wp-site-blocks>*,.wp-site-blocks>main,.wp-site-blocks>.wp-block-template-part{margin-block:0}
a{text-underline-offset:.2em}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #205f87;outline-offset:3px}
.spooky-header{border-bottom:1px solid #d7dfda;background:#fff;padding:24px var(--spooky-edge);gap:24px}.spooky-brand{margin:0;font-size:26px;letter-spacing:3px;font-family:Georgia,serif;text-decoration:none}.spooky-header .wp-block-navigation{font:14px/1.5 Arial,sans-serif}.spooky-header .wp-block-navigation__container{gap:24px}
.spooky-hero{padding:var(--spooky-space) var(--spooky-edge);background:linear-gradient(115deg,#edf1e9,#faf9f4);border-bottom:1px solid #d7dfda}.spooky-hero h1{font-size:clamp(40px,5vw,68px);font-weight:400;line-height:1.08;letter-spacing:-.035em;max-width:18ch;margin-block:16px 24px}.spooky-hero p{max-width:65ch}.spooky-eyebrow{font:12px/1.5 Arial,sans-serif;letter-spacing:1.7px;text-transform:uppercase;color:#246a6a}
.spooky-page{padding-block:var(--spooky-space)}.wp-block-post-title{font-size:clamp(36px,4vw,56px);letter-spacing:-.025em;margin-block:0 40px}.wp-block-post-content>h2{margin-block-start:48px;font-size:clamp(28px,3vw,38px)}.wp-block-post-content>h3{margin-block-start:32px}.wp-block-post-content>p,.wp-block-post-content>ul,.wp-block-post-content>ol{margin-block-start:24px;margin-block-end:0}.wp-block-post-content>.wp-block-group:not(.spooky-hero){margin-block:var(--spooky-space)}.wp-block-post-content>:first-child{margin-block-start:0}.wp-block-post-content>:last-child{margin-block-end:0}
.spooky-footer{background:#fff;border-top:1px solid #d7dfda;padding:32px var(--spooky-edge);font:14px/1.7 Arial,sans-serif}.spooky-footer p{margin-block:0}
.source-status,.location-provisional{padding:16px 24px;background:#edf2ed;border-left:3px solid #246a6a}.historical-source{background:#edf2ed;padding:24px}.spooky-article-list{list-style:none;padding:0;display:grid;gap:24px}.spooky-article-list>li{padding:32px;border:1px solid #d5dfd9;background:#fff;margin:0;border-radius:6px}.spooky-article-list h2{margin-top:0}
/* Companion integration: constrain the controls and records, leaving the map full bleed. */
.wp-site-blocks .spooky-atlas .wrap{max-width:none;padding-inline:var(--spooky-edge)}.wp-site-blocks .spooky-atlas [data-spooky-control="map-status"]{max-width:none;padding-inline:var(--spooky-edge)}.wp-site-blocks .spooky-atlas .section-title{padding-block:32px}.wp-site-blocks .spooky-atlas .atlas-controls{padding-bottom:24px}.wp-site-blocks .spooky-atlas .results{gap:24px}.wp-site-blocks .spooky-atlas .card{padding:24px;border-radius:6px}.wp-site-blocks .spooky-atlas .pagination{padding-block:32px}.wp-site-blocks .spooky-route{padding:32px;border-radius:6px}.wp-site-blocks .spooky-route-index article{padding:32px;margin-block:24px;border-radius:6px}
@media(max-width:600px){.spooky-header{padding-block:20px}.spooky-page{padding-block:40px}.wp-block-post-title{margin-bottom:32px}.wp-site-blocks .spooky-route,.wp-site-blocks .spooky-route-index article,.spooky-article-list>li{padding:20px}.spooky-header .wp-block-navigation__container{gap:16px}}

/* The introduction and collapsible atlas controls share one editorial row. */
.wp-site-blocks .wp-block-post-content:has(>.spooky-hero):has(>#atlas){display:grid;grid-template-columns:minmax(var(--spooky-gutter),1fr) minmax(0,640px) minmax(0,480px) minmax(var(--spooky-gutter),1fr);column-gap:0;row-gap:0}
.wp-site-blocks .wp-block-post-content:has(>.spooky-hero)>*{grid-column:2/4;width:auto;max-width:none;margin-inline:0}
.wp-site-blocks .wp-block-post-content>.spooky-hero{grid-column:2;grid-row:1;padding:64px 48px 64px 0;background:none;border:0;margin:0}
.wp-site-blocks .wp-block-post-content>#atlas,.wp-site-blocks #atlas>.spooky-atlas{display:contents}
.wp-site-blocks #atlas .atlas-controls{grid-column:3;grid-row:1;align-self:start;margin:40px 0;padding:24px;background:#fff;border:1px solid #d7dfda;border-radius:8px;min-width:0}
.wp-site-blocks #atlas .atlas-controls .section-title{padding:0;display:flex;flex-wrap:wrap;cursor:pointer;gap:8px 16px;list-style:none}.spooky-filter-title{font-size:28px;line-height:1.2}.spooky-filter-toggle{flex-basis:100%;font:12px/1.6 Arial,sans-serif;color:#246a6a}.spooky-atlas summary::-webkit-details-marker{display:none}
.wp-site-blocks #atlas .filters{margin-top:24px;gap:16px}.wp-site-blocks #atlas .filters label,.wp-site-blocks #atlas .filters label:first-child{flex:1 1 calc(50% - 16px)}.wp-site-blocks #atlas .filters label:first-child{flex-basis:100%}.wp-site-blocks #atlas .atlas{grid-column:1/-1}.wp-site-blocks #atlas .pin-legend{gap:12px;font-size:12px}.wp-site-blocks #atlas .atlas-controls .small{margin-bottom:0}
@media(max-width:800px){.wp-site-blocks .wp-block-post-content>.spooky-hero{grid-column:2/4;grid-row:1;padding:40px 0 24px}.wp-site-blocks #atlas .atlas-controls{grid-column:2/4;grid-row:2;margin:0 0 32px}.wp-site-blocks #atlas .atlas{grid-row:3}.wp-site-blocks #atlas .filters label{flex-basis:calc(50% - 16px)}}

/* Field-guide palette: colour frames the content without changing its grid. */
:root{--spooky-deep-teal:#194c50;--spooky-ochre:#bd8b3d;--spooky-sage:#e7eee5;--spooky-warm-white:#fffdf5}
.spooky-header{background:var(--spooky-deep-teal);color:var(--spooky-warm-white);border-bottom:3px solid var(--spooky-ochre)}
.spooky-header a,.spooky-header .wp-block-site-title a{color:var(--spooky-warm-white);text-decoration:none}
.spooky-header a:hover,.spooky-header .current-menu-item>a,.spooky-header [aria-current="page"]{text-decoration:underline;text-decoration-color:#e4b868;text-decoration-thickness:2px;text-underline-offset:7px}
.spooky-header :focus-visible,.spooky-footer :focus-visible{outline-color:#e4b868}
.spooky-header .wp-block-navigation__responsive-container.is-menu-open{background:var(--spooky-deep-teal);color:var(--spooky-warm-white);padding:var(--spooky-gutter)}
.spooky-header .wp-block-navigation__submenu-container{background:var(--spooky-deep-teal);color:var(--spooky-warm-white);border-color:#467477}
.wp-block-post-content:has(>.spooky-hero){isolation:isolate}
.wp-block-post-content:has(>.spooky-hero)::before{content:"";grid-column:1/-1;grid-row:1;align-self:stretch;background:linear-gradient(115deg,var(--spooky-sage),#f3f2e7);z-index:-1;pointer-events:none}
.wp-site-blocks .wp-block-post-content>.spooky-hero{color:#213a3d}
.spooky-hero>p:first-child::before{content:"";display:block;width:48px;height:4px;background:var(--spooky-ochre);margin-bottom:20px}
.spooky-hero h1,.wp-block-post-title,.wp-block-post-content>h2,.wp-block-post-content>h3{color:var(--spooky-deep-teal)}
.wp-site-blocks #atlas .atlas-controls{border-color:#c7d5ca;box-shadow:0 8px 26px #194c5010;overflow:hidden}
.wp-site-blocks #atlas .atlas-controls .section-title{background:var(--spooky-deep-teal);color:var(--spooky-warm-white);margin:-24px -24px 0;padding:22px 24px;border-bottom:3px solid var(--spooky-ochre)}
.wp-site-blocks #atlas .atlas-controls .section-title .count,.wp-site-blocks #atlas .spooky-filter-toggle{color:#e5ede7}
.wp-site-blocks #atlas .atlas-controls:not([open]) .section-title{margin-bottom:-24px}
.wp-site-blocks .spooky-atlas button:not(.card button),.wp-block-button__link{background:var(--spooky-deep-teal);border-color:var(--spooky-deep-teal);color:#fffdf5}
.wp-site-blocks .spooky-atlas button:not(.card button):hover,.wp-block-button__link:hover{background:#28656a;border-color:#28656a;box-shadow:inset 0 -3px var(--spooky-ochre)}
.wp-site-blocks .spooky-atlas .card{border-top:4px solid #417e80;box-shadow:0 3px 12px #194c5006}
.wp-site-blocks .spooky-atlas .card[data-spooky-theme-category="legends"]{border-top-color:var(--spooky-ochre)}
.wp-site-blocks .spooky-atlas .card[data-spooky-theme-category="legends"] .tag{color:#80551a}
.wp-site-blocks .spooky-route,.wp-site-blocks .spooky-route-index article,.spooky-article-list>li{border-top:4px solid #417e80}
.wp-block-post-content>h2:not(.spooky-hero h2)::before{content:"";display:block;width:36px;height:3px;background:var(--spooky-ochre);margin-bottom:14px}
.spooky-footer{background:var(--spooky-deep-teal);color:#e7eee5;border-top:3px solid var(--spooky-ochre)}.spooky-footer a{color:#f1ce91}
@media(max-width:800px){.wp-block-post-content:has(>.spooky-hero)::before{grid-row:1/3}}

/* Spooky! identity: local Gothic-inspired editorial headings and approved wordmark. */
@font-face{font-family:"Spooky Editorial";src:url("assets/fonts/CormorantGaramond.ttf") format("truetype");font-style:normal;font-weight:300 700;font-display:swap}
h1,h2,h3,h4,h5,h6,.wp-block-heading,.wp-block-post-title,.spooky-filter-title,.spooky-brand,.wp-site-blocks .spooky-atlas .card h3,.wp-site-blocks .spooky-route h2{font-family:"Spooky Editorial",Georgia,serif;font-weight:600}
.spooky-hero h1{font-weight:600;letter-spacing:-.025em}
.spooky-header .spooky-brand{letter-spacing:0;line-height:1;flex-shrink:1;min-width:0}
.spooky-brand a.spooky-logo-link{display:inline-flex;align-items:center;max-width:100%;background:#fffdf5;border-radius:4px;line-height:0;text-decoration:none}
.spooky-brand .spooky-logo-image{display:block;width:264px;max-width:100%;height:auto;border-radius:4px}
.spooky-brand .custom-logo{display:block;max-width:264px;width:auto;height:auto;max-height:100px}.spooky-brand .custom-logo-link{display:inline-block;max-width:100%}
@media(max-width:600px){.spooky-brand .spooky-logo-image{width:210px}.spooky-header{gap:16px}}

/* Reversed identity over a quiet woodland silhouette. */
.spooky-header{background-color:#153e42;background-image:linear-gradient(90deg,rgba(10,35,39,.22),rgba(10,35,39,.38)),url("assets/branding/header-woodland.svg");background-position:center,bottom center;background-size:cover,cover;background-repeat:no-repeat}
.spooky-brand a.spooky-logo-link{background:transparent;border-radius:0}
.spooky-brand .spooky-logo-image{border-radius:0}
.spooky-header .wp-block-navigation a{color:#fffdf5;text-shadow:0 1px 3px #0c2b30}

.spooky-header .wp-block-navigation__responsive-container-open {
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    color: var(--spooky-warm-white);
}
.spooky-header .wp-block-navigation__responsive-container-open svg {
    display: none;
}
.spooky-header .wp-block-navigation__responsive-container-open::before {
    content: "";
    display: block;
    width: 24px;
    height: 18px;
    background: linear-gradient(currentColor, currentColor) top / 100% 2px,
                linear-gradient(currentColor, currentColor) center / 100% 2px,
                linear-gradient(currentColor, currentColor) bottom / 100% 2px;
    background-repeat: no-repeat;
}
.spooky-header .wp-block-navigation__responsive-container.is-menu-open {
    padding: clamp(1rem, 6vw, 2rem);
    background: linear-gradient(rgba(15, 46, 49, .93), rgba(15, 46, 49, .80)),
                url("assets/branding/header-woodland.svg") center bottom / cover no-repeat,
                var(--spooky-deep-teal);
    color: var(--spooky-warm-white);
    backdrop-filter: none;
    animation: none;
}
.spooky-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog::before {
    content: "";
    display: block;
    width: min(12rem, calc(100% - 3.5rem));
    aspect-ratio: 2056 / 765;
    margin-bottom: 1rem;
    background: url("assets/branding/spooky-logo-reversed.svg") left center / contain no-repeat;
}
.spooky-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
    border-top: 2px solid var(--spooky-ochre);
    padding-top: 1rem;
}
.spooky-header .wp-block-navigation__responsive-container.is-menu-open a {
    display: flex;
    align-items: center;
    min-height: 44px;
    font-family: "Spooky Editorial", Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--spooky-warm-white);
    text-shadow: none;
}
.spooky-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
    background: transparent;
    border: 0;
}
.spooky-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container a {
    font-size: 1.25rem;
}
.spooky-header .wp-block-navigation__responsive-container-close {
    min-width: 44px;
    min-height: 44px;
    color: var(--spooky-warm-white);
}

.spooky-header .wp-block-navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container {
    min-width: 15rem;
    max-width: min(20rem, calc(100vw - 2rem));
    padding: .25rem;
    border: 1px solid #467477;
    border-top: 3px solid var(--spooky-ochre);
    border-radius: 0 0 6px 6px;
    background: var(--spooky-deep-teal);
    color: var(--spooky-warm-white);
    box-shadow: 0 8px 20px #0c2b3040;
}
.spooky-header .wp-block-navigation .wp-block-navigation__responsive-container .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: .6rem .75rem;
    color: var(--spooky-warm-white);
    font-family: "Spooky Editorial", Georgia, serif;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.25;
    text-shadow: none;
    overflow-wrap: anywhere;
}
.spooky-header .wp-block-navigation .wp-block-navigation__responsive-container .wp-block-navigation__submenu-container .wp-block-navigation-item__content:is(:hover, :focus-visible, [aria-current="page"]) {
    background: #28656a;
    color: var(--spooky-warm-white);
    text-decoration: underline;
    text-decoration-color: #e4b868;
    text-underline-offset: .2em;
}
.spooky-header .wp-block-navigation .wp-block-navigation__responsive-container .wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus-visible {
    outline: 2px solid #e4b868;
    outline-offset: -2px;
}
.spooky-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
    padding-inline-start: .75rem;
    border-inline-start: 2px solid var(--spooky-ochre);
}

.spooky-research-home {
    display: grid;
    gap: clamp(1rem, 4vw, 3rem);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    margin-block: 3rem;
    padding-inline: 1rem;
}
.spooky-research-home section {
    border-top: 1px solid currentColor;
}
.spooky-change-list li {
    margin-block: .6rem;
}

.spooky-atlas-sidebar {
    min-width: 0;
    padding: clamp(1rem, 2.5vw, 1.75rem);
    background: var(--spooky-warm-white);
    border: 1px solid #d7dfda;
    border-radius: 8px;
    overflow-wrap: anywhere;
}
.spooky-atlas-sidebar .spooky-research-home {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    margin: 0;
    padding: 0;
}
.spooky-atlas-sidebar .spooky-research-home section:first-child {
    border-top: 0;
}
.spooky-atlas-sidebar h2 {
    margin-block-start: .45em;
}
.spooky-atlas-sidebar .spooky-feature-image {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
}
.spooky-atlas-sidebar .spooky-feature-image img {
    display: block;
    max-width: 100%;
    height: auto;
}
.wp-site-blocks .spooky-atlas .atlas:has(> .spooky-atlas-sidebar) {
    display: grid;
    grid-template-columns: minmax(var(--spooky-gutter), 1fr) minmax(0, 800px) minmax(0, 320px) minmax(var(--spooky-gutter), 1fr);
}
.spooky-atlas .atlas:has(> .spooky-atlas-sidebar) > .atlas-map {
    grid-column: 1 / -1;
}
.wp-site-blocks .spooky-atlas .atlas:has(> .spooky-atlas-sidebar) > .atlas-records {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    margin: 0;
    padding-inline: 0 1.5rem;
}
.spooky-atlas .atlas > .spooky-atlas-sidebar {
    grid-column: 3;
    grid-row: 2;
    align-self: start;
    margin-block: 1.5rem;
}
@media (min-width: 801px) {
    .wp-site-blocks .spooky-atlas .atlas:has(> .spooky-atlas-sidebar) .results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 800px) {
    .spooky-atlas .atlas > .spooky-atlas-sidebar,
    .wp-site-blocks .spooky-atlas .atlas:has(> .spooky-atlas-sidebar) > .atlas-records {
        grid-column: 2 / 4;
    }
    .wp-site-blocks .spooky-atlas .atlas:has(> .spooky-atlas-sidebar) > .atlas-records {
        grid-row: 3;
        padding-inline: 0;
    }
}
