/* The base styles of every site. A site's theme.css sets only the tokens in :root and its own
   @font-face rules; a site's own sections bring their styles in site/sections/*.css. The build
   checks the colour tokens' contrast. */

:root {
    --primary: #2f5bb0;
    --primary-hover: #22448a;
    --on-primary: #ffffff;
    --hero-bg: #1c2433;
    --hero-text: #ffffff;
    --hero-muted: #c9d0dd;
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-muted: #eceff4;
    --text: #1f2430;
    --text-muted: #59606f;
    --border: #d8dce4;
    --field-border: #7b8292;
    --focus-on-light: #2f5bb0;
    --focus-on-dark: #ffffff;
    --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-heading: var(--font-body);
    --radius: 12px;
    --section-space: clamp(3rem, 8vw, 5.5rem);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
}

main {
    flex: 1;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
    margin: 0;
}

/* Long Finnish words: the build checks every heading at 320 px, and these rules keep a word that
   slips through from pushing the page sideways (DES-4). */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    line-height: 1.2;
    overflow-wrap: break-word;
    hyphens: auto;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--primary);
    text-underline-offset: 0.15em;
}

a:hover {
    color: var(--primary-hover);
}

/* Mail addresses break cleanly on phones (DES-5). */
.mail-link {
    overflow-wrap: anywhere;
}

.nowrap {
    white-space: nowrap;
}

/* Focus rings for light and dark areas (A11Y-1). */
:focus-visible {
    outline: 3px solid var(--focus-on-light);
    outline-offset: 3px;
    border-radius: 4px;
}

.hero :focus-visible,
.footer :focus-visible {
    outline-color: var(--focus-on-dark);
}

.wrap {
    width: min(100% - 2.5rem, 68rem);
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    top: -4rem;
    left: 1rem;
    z-index: 1;
    padding: 0.5rem 1rem;
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
}

.skip-link:focus {
    top: 1rem;
}

/* The top of every page */

.hero {
    padding-block: 1.25rem clamp(3rem, 9vw, 6rem);
    background: var(--hero-bg);
    color: var(--hero-text);
}

.hero a {
    color: var(--hero-text);
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    margin-bottom: clamp(2.5rem, 8vw, 5rem);
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.125rem;
    font-weight: 700;
    text-decoration: none;
}

.wordmark-logo {
    width: auto;
    height: 2.25rem;
}

.topbar ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.topbar ul a {
    display: inline-block;
    padding-block: 0.375rem;
    color: var(--hero-muted);
    font-weight: 600;
    text-decoration: none;
}

.topbar ul a:hover,
.topbar ul a[aria-current='page'] {
    color: var(--hero-text);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.page-hero {
    display: grid;
    gap: clamp(2rem, 6vw, 4rem);
    align-items: center;
}

.page-hero.has-image {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.page-hero h1 {
    max-width: 22ch;
    font-size: clamp(1.625rem, 6vw, 3.25rem);
    font-weight: 700;
}

.lead {
    max-width: 38em;
    margin-top: 1rem;
    color: var(--hero-muted);
    font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
}

.page-hero .button {
    margin-top: 1.75rem;
}

.page-hero-image {
    width: 100%;
    border-radius: var(--radius);
}

/* hero.banner: a photo behind the whole top of the page, menu included. The shade is --hero-bg,
   darkest under the text and the menu, so the text keeps its contrast whatever the photo shows.
   A theme can move the photo's focus with --hero-banner-focus, such as 50% 80%. */

.hero-banner {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-height: clamp(32rem, 82vh, 48rem);
    overflow: hidden;
}

.hero-banner > .wrap {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.hero-banner .page-hero {
    margin-top: auto;
}

.hero-banner-image {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--hero-banner-focus, 50% 50%);
}

.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgb(0 0 0 / 0.6);
    background:
        linear-gradient(to bottom, color-mix(in srgb, var(--hero-bg) 80%, transparent), transparent 9rem),
        linear-gradient(
            to top,
            color-mix(in srgb, var(--hero-bg) 94%, transparent) 10%,
            color-mix(in srgb, var(--hero-bg) 70%, transparent) 50%,
            color-mix(in srgb, var(--hero-bg) 20%, transparent)
        );
}

.hero-banner .page-hero-text {
    max-width: 40rem;
}

.hero-banner h1,
.hero-banner .lead {
    text-shadow: 0 1px 1rem color-mix(in srgb, var(--hero-bg) 80%, transparent);
}

/* Sections */

.section {
    padding-block: var(--section-space);
}

.section + .section:not(.section-muted) {
    padding-top: 0;
}

.section-muted {
    background: var(--surface-muted);
}

.section h2 {
    margin-bottom: 1rem;
    font-size: clamp(1.375rem, 4vw, 2.125rem);
}

.section h3 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.section-intro,
.prose {
    max-width: 42em;
}

.section-intro {
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.section-intro p + p,
.prose p + p,
.prose ul + p,
.prose p + ul {
    margin-top: 1rem;
}

.prose ul {
    margin-block: 0;
    padding-left: 1.25rem;
}

.prose li + li {
    margin-top: 0.375rem;
}

.text-layout.has-image {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 4rem);
    align-items: start;
}

.text-image,
.news-image {
    width: 100%;
    border-radius: var(--radius);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.card {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.card p + p {
    margin-top: 0.75rem;
}

.price {
    font-weight: 700;
    white-space: nowrap;
}

.card .price {
    margin-top: 0.75rem;
}

.price-group + .price-group {
    margin-top: 2rem;
}

.price-list {
    max-width: 42rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.price-list li {
    padding-block: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.price-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.price-description,
.diet-legend,
.news-date,
.section-note,
.privacy-updated {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.diets {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.diet-legend {
    margin-top: 1rem;
}

.hours {
    border-collapse: collapse;
}

.hours th,
.hours td {
    padding: 0.375rem 1.5rem 0.375rem 0;
    text-align: left;
    vertical-align: top;
}

.hours th {
    font-weight: 600;
}

.hours-exceptions {
    margin: 0;
    padding-left: 1.25rem;
}

.section-hours h3,
.section-openingHours h3 {
    margin-top: 1.5rem;
}

.section-note {
    margin-top: 1rem;
}

.news {
    display: grid;
    gap: 2rem;
    max-width: 42rem;
}

.news-item p + p {
    margin-top: 0.75rem;
}

.news-image {
    margin-block: 0.75rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gallery img {
    width: 100%;
    border-radius: var(--radius);
}

.gallery figcaption {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.faq {
    max-width: 42rem;
}

.faq details {
    border-bottom: 1px solid var(--border);
}

.faq summary {
    padding-block: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.faq-answer {
    padding-bottom: 1rem;
}

.faq-answer p + p {
    margin-top: 0.75rem;
}

.contact-details {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.5rem 1.5rem;
}

.contact-details dt {
    font-weight: 600;
}

.privacy h2,
.privacy h3 {
    margin: 2rem 0 0.5rem;
    font-size: 1.25rem;
}

.privacy-updated + div h2,
.privacy-updated + div h3 {
    margin-top: 1.5rem;
}

.status div + div {
    margin-top: 2rem;
}

.status p + p {
    margin-top: 0.75rem;
}

.next-step {
    padding: clamp(1.5rem, 5vw, 3rem);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

.next-step p + p {
    margin-top: 1rem;
}

/* Buttons and the form */

.button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: var(--on-primary);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background: var(--primary-hover);
    color: var(--on-primary);
}

.hero .button {
    color: var(--on-primary);
}

.form {
    display: grid;
    gap: 1rem;
    max-width: 36rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.form label {
    display: grid;
    gap: 0.375rem;
    font-weight: 600;
}

.form input,
.form select,
.form textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--field-border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 400;
}

.form textarea {
    resize: vertical;
}

.form .button {
    justify-self: start;
}

.form-note {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* Hidden from people: only bots fill this field. */
.trap {
    position: absolute;
    left: -9999px;
}

/* Footer */

.footer {
    padding-block: 2rem;
    background: var(--hero-bg);
    color: var(--hero-muted);
    font-size: 0.9375rem;
}

.footer a {
    color: var(--hero-text);
}

.footer p + p {
    margin-top: 0.375rem;
}

@media (max-width: 52rem) {
    .page-hero.has-image,
    .text-layout.has-image {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 26rem) {
    .contact-details {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .contact-details dd {
        margin-bottom: 0.625rem;
    }

    .price-row {
        flex-wrap: wrap;
    }
}

@media (forced-colors: active) {
    .button {
        border: 2px solid ButtonText;
    }
}

/* Kallelan luomutila: the red granary, field green and ripe grain. A theme sets only these tokens
   and its own fonts. Lora (headings) and Manrope (text) are self-hosted, under the SIL OFL. */

@font-face {
    font-family: 'Manrope';
    src: url('/assets/fonts/manrope-latin-wght-normal.woff2') format('woff2');
    font-weight: 200 800;
    font-display: swap;
}

@font-face {
    font-family: 'Lora';
    src: url('/assets/fonts/lora-latin-wght-normal.woff2') format('woff2');
    font-weight: 400 700;
    font-display: swap;
}

:root {
    --primary: #8a3324;
    --primary-hover: #6c2519;
    --on-primary: #ffffff;
    --hero-bg: #24361f;
    --hero-text: #fbf8ef;
    --hero-muted: #d6dec6;
    --bg: #f8f4ea;
    --surface: #ffffff;
    --surface-muted: #eee6d2;
    --text: #25251c;
    --text-muted: #57564a;
    --border: #ddd2bb;
    --field-border: #7f765e;
    --focus-on-light: #8a3324;
    --focus-on-dark: #f0c75e;
    --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Lora', Georgia, 'Times New Roman', serif;
    --hero-banner-focus: 28% 68%;
    --radius: 10px;
    --section-space: clamp(3rem, 8vw, 5rem);
}

.follow-layout.has-image {
    align-items: center;
}

.prose .follow-button {
    margin-top: 1.5rem;
}
