/* Ekeby / Svenska Torp — hand-written CSS, no build step (One.com friendly). */

:root {
    /* Typefaces from the classic site: Times New Roman for display text
       (object number, name, preamble), Calibri for body text and menus. */
    --font-body: Calibri, "Trebuchet MS", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-display: "Times New Roman", Times, serif;
    --accent: #325235;
    --accent-soft: #cde2c9;
    --bg-soft: #eff6ed;
    --bg-hover: #e1f0de;
    --text: #22301f;
    --muted: #5f6f5c;
    --border: #d8e4d4;
    --sold: #8b2e2e;
    --max-width: 1000px;
}

/* Svenska Torp: classic dark-red accents on cream (not rose) surfaces. */
body.brand-svenskatorp {
    --accent: #6d1f1f;
    --accent-soft: #eae4cf;
    --bg-soft: #f5f2e6;
    --bg-hover: #edeada;
    --text: #2e2626;
    --muted: #6f5f5c;
    --border: #ded8c2;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    line-height: 1.55;
    /* Fixed, blurred lakeside photo behind the centered content card — as on the classic site. */
    background: #43563f url('/img/bakgrund-suddig.jpg') no-repeat center top fixed;
    background-size: cover;
}

/* The whole page sits in a centered white "paper" card floating on the photo. */
.site-frame {
    max-width: var(--max-width);
    margin: 10px auto 30px;
    background: #fff;
    border: 1px solid var(--accent-soft);
    box-shadow: 0 3px 18px rgba(0, 0, 0, .30);
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }
.site-frame .container { max-width: 100%; }
.site-frame main.container { padding: 1.4rem 1.6rem 2.4rem; }

a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; color: var(--accent); }
h1 { font-size: 1.7rem; }

/* Header: full-bleed photo banner with the EKEBY wordmark, over a green menu bar */
.site-header { background: #fff; }

.site-banner { position: relative; display: block; line-height: 0; text-decoration: none; }
.site-banner img { width: 100%; height: auto; display: block; }

/* Slideshow stage: 749×140, the ratio of the static header image ekeby.cc
   shows now that Flash is gone (images/header-thin-*.png) — the 749×212
   photos are cropped to it. Photos stack and crossfade; the texts scale with
   the stage width (container query units). */
.banner-stage {
    position: relative; overflow: hidden; aspect-ratio: 749 / 140;
    background: #43563f; container-type: inline-size; line-height: 1;
}
.banner-slide {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    opacity: 0; transition: opacity 1.8s ease-in-out;
}
.banner-slide.is-active { opacity: 1; }
/* A soft dark band at the top keeps the white texts legible on bright photos */
.banner-stage::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .38), rgba(0, 0, 0, 0) 70%);
}
.banner-stage span { z-index: 1; }
.banner-stage span {
    position: absolute; color: #fff; white-space: nowrap;
    font-family: var(--font-display); text-shadow: 0 1px 3px rgba(0, 0, 0, .75), 0 0 14px rgba(0, 0, 0, .45);
}
/* Vertical offsets are in cqw too: the stage only contains inline-size, so
   cqh would resolve against the viewport, not the banner. */
.banner-wordmark { left: 4.5cqw; top: 2.8cqw; font-size: 8cqw; font-weight: 700; letter-spacing: .02em; }
.banner-slogan { left: 45cqw; top: 4.2cqw; font-size: 3.4cqw; font-weight: 700; font-style: italic; }
@media (prefers-reduced-motion: reduce) { .banner-slide { transition: none; } }

/* Text logo — fallback for brands without a photo banner or graphic logo */
.site-logo { display: block; text-decoration: none; color: var(--accent); padding: 1rem; }
.site-logo strong { display: block; font-size: 1.6rem; letter-spacing: .02em; }
.site-logo span { font-size: .85rem; color: var(--muted); }

/* Graphic logo + photo strip, as on the classic Svenska Torp header */
.site-logo-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .8rem 1rem .6rem; }
.site-logo-img { line-height: 0; }
.site-logo-img img, .site-header-photo { max-width: 100%; height: auto; display: block; }
@media (max-width: 640px) { .site-header-photo { display: none; } }

/* Green menu bar, à la the classic site */
.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem 1rem;
    padding: .5rem 1rem;
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-body);
}
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .1rem 1rem; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; font-weight: 700; font-size: .92rem; color: var(--accent); padding: .2rem 0; }
.site-nav a:hover { text-decoration: underline; }
.nav-toggle, .nav-toggle-label { display: none; }

/* Search + languages (+ admin link) at the right edge, wrapping as one unit */
.nav-tools { display: flex; align-items: center; gap: .25rem 1rem; margin-left: auto; }
.site-nav .lang-switcher { padding-left: 1rem; border-left: 1px solid var(--border); }
.lang-switcher a { font-size: .82rem; font-weight: 700; color: var(--muted); }
.lang-switcher a.active { color: var(--accent); }
.lang-flag { margin-right: .3rem; vertical-align: -1px; image-rendering: pixelated; }
.lang-switcher a:not(.active) .lang-flag { opacity: .65; }
.lang-switcher a:hover .lang-flag { opacity: 1; }

/* Object search in the menu bar (classic page1.asp had a tiny field + "Sök") */
.nav-search { display: flex; gap: .3rem; }
.nav-search input {
    font: inherit; font-size: .85rem; width: 8.5em; min-width: 0;
    padding: .2rem .45rem; border: 1px solid var(--border); border-radius: 4px; background: #fff;
}
.nav-search button {
    font: inherit; font-size: .85rem; font-weight: 700; padding: .2rem .7rem;
    color: var(--accent); background: var(--bg-hover); border: 1px solid #888; border-radius: 4px; cursor: pointer;
}
/* Admin shortcut, only rendered for logged-in admins */
/* Admin shortcut (logged-in admins only): top right corner of the header image */
.site-header { position: relative; }
.header-admin {
    position: absolute; top: .6rem; right: .6rem; z-index: 5; padding: .2rem .6rem; border-radius: 4px;
    background: rgba(255, 255, 255, .88); color: var(--accent); font-size: .8rem; font-weight: 700; text-decoration: none;
}
.header-admin:hover { background: #fff; }
.page-object .header-admin { display: none; }
/* Svenska Torp: no menu search, and smaller menu text so the menu and the
   languages fit on one row, as on the classic site */
body.brand-svenskatorp .site-nav ul { column-gap: .9rem; }
body.brand-svenskatorp .site-nav > ul a { font-size: .86rem; }
body.brand-svenskatorp .site-nav .lang-switcher { column-gap: .7rem; }

/* Object detail pages ("page-object"): classic object_details.asp chrome —
   tiled light-green background, no banner and no site menu (the action bar
   below is the only navigation: Tillbaka + languages). */
body.page-object {
    --max-width: 1200px; /* wider frame than the rest of the site */
    background: #eef3ea url('/img/lightGreenBg.gif') repeat fixed;
    background-size: auto;
}
.page-object .site-banner, .page-object .site-logo-row { display: none; }

/* Green action bar (Tillbaka | Skriv ut | favoriter | Skicka e-post … languages),
   stays pinned to the top of the viewport while scrolling the object. */
.object-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem 1rem;
    background: #6c9770;
    padding: .45rem 1.6rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: .95rem;
}
.object-toolbar a { color: #ecf8ed; text-decoration: none; }
.object-toolbar a:hover { text-decoration: underline; }
.object-toolbar .sep { color: #ecf8ed; opacity: .75; }
/* Admin edit link + language switcher sit at the right edge */
.object-toolbar .toolbar-right { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.object-toolbar .lang-switcher { list-style: none; display: flex; gap: .9rem; margin: 0; padding: 0; }
.object-toolbar .lang-switcher a { font-size: .82rem; color: #d7e9d8; }
.object-toolbar .lang-switcher a.active { color: #fff; }
/* Narrow screens: swap the long link labels for short ones so the bar stays one line */
.object-toolbar .short { display: none; }
@media (max-width: 700px) {
    .object-toolbar { font-size: .85rem; gap: .3rem .7rem; padding: .45rem 1rem; }
    .object-toolbar .long { display: none; }
    .object-toolbar .short { display: inline; }
}
body.brand-svenskatorp .object-toolbar { background: var(--accent); }

@media (max-width: 700px) {
    .nav-toggle-label { display: block; cursor: pointer; font-size: 1.4rem; color: var(--accent); align-self: flex-start; padding-top: .15rem; }
    .site-nav > ul { display: none; width: 100%; flex-direction: column; gap: 0; }
    .site-nav .nav-toggle:checked ~ ul { display: flex; }
    /* ☰ left, search right on the first line; languages on a line of their own */
    .nav-tools { flex: 1 1 0; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
    .site-nav .lang-switcher { border-left: none; padding-left: 0; flex-direction: row !important; width: 100%; justify-content: flex-end; }
    .nav-search input { width: 8em; }
}

/* Sections */
main { padding: 1.5rem 1rem 3rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Prices + sold badge (shared by cards, lists and the detail page) */
.price { color: var(--accent); font-weight: 700; margin: 0; }
.price-eur { font-weight: 400; color: var(--muted); font-size: .85em; }
.price-large { font-size: 1.3rem; margin-top: 1rem; }

.badge-sold {
    position: absolute; top: .5rem; left: .5rem;
    background: var(--sold); color: #fff;
    font-size: .75rem; font-weight: 700;
    padding: .15rem .5rem; border-radius: 4px;
    text-transform: uppercase; letter-spacing: .04em;
}
h1 .badge-sold { position: static; margin-left: .75rem; vertical-align: middle; }

/* Filter bar */
.filter-bar {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: .6rem 1rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .7rem .9rem;
    margin: 1rem 0;
    font-size: .9rem;
}
.filter-bar select, .filter-bar input[type=search], .filter-bar button {
    font: inherit; padding: .35rem .5rem;
    border: 1px solid var(--border); border-radius: 5px; background: #fff;
}
.filter-bar button { background: var(--accent); color: #fff; border-color: var(--accent); cursor: pointer; }
.filter-search { display: flex; gap: .4rem; margin-left: auto; }

/* Detail page — classic layout: images left, text + facts in a right column.
   Compact head: name + preamble left, price with object number under it right. */
.object-head {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start;
    gap: .2rem 1rem; margin-top: .2rem;
}
.object-meta { text-align: right; white-space: nowrap; }
.object-meta p { margin: 0; }
.object-price .price-eur { display: block; font-size: .8rem; color: var(--muted); }

.object-number { font-family: var(--font-display); font-size: 1.05rem; color: var(--accent); margin: 0 0 .1rem; }
.property-detail h1 { font-weight: 400; margin: 0; }
.property-detail .preamble { font-family: var(--font-display); font-size: 1.2rem; color: #8f9236; margin: .15rem 0 1rem; }

.gallery-thumbs { display: flex; gap: .4rem; overflow-x: auto; padding: .5rem 0; }
/* max-width + cover crops extreme panoramas (e.g. text banners), which would
   otherwise fill the strip with what looks like giant stray text. */
.gallery-thumbs img { height: 64px; max-width: 140px; object-fit: cover; border-radius: 4px; cursor: pointer; flex: 0 0 auto; }
.gallery-thumbs img.current { outline: 2px solid var(--accent); outline-offset: 1px; }

/* "Alla bilder (n)" jump link under the main image, scrolls to the stack */
.gallery-actions { margin-top: .5rem; }
.gallery-actions a {
    display: inline-block; font-size: .82rem; text-decoration: none;
    padding: .2rem .7rem; border: 1px solid var(--border); border-radius: 4px;
    background: #fff; color: var(--accent);
}
.gallery-actions a:hover { background: var(--bg-hover); }
.image-caption, .gallery-stack figcaption { font-size: .9rem; color: var(--muted); margin: .35rem 0 0; }
/* scroll-margin keeps the sticky toolbar off jumped-to images */
.gallery-stack figure { margin: 1.6rem 0 0; scroll-margin-top: 3.2rem; }
.gallery-stack img { width: 100%; display: block; border-radius: 8px; }

/* Overlay controls on each stacked image: prev/next on hover + "3/14" chip.
   Prev/next are full-height edge zones; gradient + chevron appear on hover. */
.stack-frame { position: relative; }
.stack-nav {
    position: absolute; top: 0; bottom: 0; width: clamp(56px, 18%, 110px);
    display: flex; align-items: center; justify-content: center;
    border: none; background: none; color: #fff;
    font-size: 2.4rem; line-height: 1; cursor: pointer;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}
.stack-nav.prev { left: 0; border-radius: 8px 0 0 8px; }
.stack-nav.next { right: 0; border-radius: 0 8px 8px 0; }

/* Fullscreen trigger in the image's top-right corner */
.frame-expand {
    position: absolute; top: .7rem; right: .7rem;
    width: 38px; height: 38px; border: none; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .45); color: #fff; cursor: pointer;
}
.frame-expand:hover { background: rgba(0, 0, 0, .65); }

/* Rapid taps on the gallery controls must not trigger double-tap zoom
   (manipulation still allows scrolling and pinch-zoom). */
.stack-nav, .frame-expand, .stack-float button, .gallery-actions a,
.gallery-thumbs img, #gallery-main, .gallery-stack .stack-frame img,
.lb-stage, .lb-close, .lb-fold, .lb-thumbs img { touch-action: manipulation; }

/* Pointer devices: overlay controls hide until the image is hovered. Touch
   devices keep them visible — hover-revealed controls are unreachable there,
   and iOS spends the first tap on emulating the hover. */
@media (hover: hover) {
    .stack-nav, .frame-expand { opacity: 0; transition: opacity .15s; }
    .stack-frame:hover .stack-nav, .stack-nav:focus-visible,
    .stack-frame:hover .frame-expand, .frame-expand:focus-visible { opacity: 1; }
    /* Edge gradients only where hover exists — on touch they'd sit on the
       photo permanently and cover too much of it. */
    .stack-nav.prev { background: linear-gradient(to right, rgba(0, 0, 0, .35), rgba(0, 0, 0, 0)); }
    .stack-nav.next { background: linear-gradient(to left, rgba(0, 0, 0, .35), rgba(0, 0, 0, 0)); }
    .stack-nav.prev:hover { background: linear-gradient(to right, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0)); }
    .stack-nav.next:hover { background: linear-gradient(to left, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0)); }
}
.lb-enabled #gallery-main, .lb-enabled .gallery-stack .stack-frame img { cursor: zoom-in; }
.stack-pos {
    position: absolute; right: .7rem; bottom: .7rem;
    background: rgba(0, 0, 0, .55); color: #fff;
    font-size: .78rem; padding: .12rem .55rem; border-radius: 999px;
}
#gallery-main { width: 100%; max-height: 560px; object-fit: contain; background: var(--bg-soft); border-radius: 8px; }

/* Floating prev/next + counter in stack mode; JS adds .in-view while the
   stack is on screen. Extra bottom offset clears iOS Safari's bottom bar. */
.stack-float {
    display: none; position: fixed; right: 1rem; z-index: 50;
    flex-direction: column; align-items: center; gap: .5rem;
    bottom: 1rem;
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
}
.stack-float.in-view { display: flex; }
.stack-float .stack-pos { position: static; }
.stack-float button {
    width: 48px; height: 48px; border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .45); color: #fff;
    font-size: 1.9rem; line-height: 1; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.stack-float button:hover { background: rgba(0, 0, 0, .65); }
/* ‹ / › rotated a quarter turn become up / down chevrons (and « a "to top") */
.stack-float button span { display: block; transform: rotate(90deg); }
/* Back-to-top sits above the counter, set apart from the image stepping pair */
.stack-float .stack-top { margin-bottom: .35rem; font-size: 1.5rem; }

/* Fullscreen lightbox: image stage + foldable thumb tray */
.lightbox { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; background: rgba(12, 12, 12, .97); }
.lightbox[hidden] { display: none; }
html.lb-lock, html.lb-lock body { overflow: hidden; }
.lb-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-stage .stack-nav { opacity: 1; border-radius: 0; }
.lightbox .stack-pos { position: absolute; left: .7rem; top: .7rem; right: auto; bottom: auto; }
.lb-caption {
    position: absolute; left: 50%; bottom: .8rem; transform: translateX(-50%);
    max-width: min(90%, 60ch); margin: 0; padding: .25rem .9rem;
    background: rgba(0, 0, 0, .55); color: #fff;
    font-size: .9rem; text-align: center; border-radius: 999px;
}
.lb-close {
    position: absolute; top: .7rem; right: .7rem; z-index: 2;
    width: 44px; height: 44px; border: none; border-radius: 50%;
    background: rgba(0, 0, 0, .45); color: #fff;
    font-size: 1.9rem; line-height: 1; cursor: pointer;
}
.lb-close:hover { background: rgba(0, 0, 0, .7); }
.lb-thumbs {
    display: flex; gap: .4rem; overflow-x: auto; overflow-y: hidden;
    max-height: calc(90px + env(safe-area-inset-bottom, 0px));
    padding: .6rem .6rem .6rem 3.6rem;
    padding-bottom: calc(.6rem + env(safe-area-inset-bottom, 0px));
    background: rgba(0, 0, 0, .55);
    transition: max-height .2s ease, padding .2s ease;
}
.lightbox.tray-hidden .lb-thumbs { max-height: 0; padding-top: 0; padding-bottom: 0; }
.lb-thumbs img { height: 64px; max-width: 140px; object-fit: cover; border-radius: 4px; cursor: pointer; flex: 0 0 auto; opacity: .7; }
.lb-thumbs img:hover { opacity: 1; }
.lb-thumbs img.current { opacity: 1; outline: 2px solid #fff; outline-offset: 1px; }
.lb-fold {
    position: absolute; left: .7rem; z-index: 2;
    bottom: .7rem;
    bottom: calc(.7rem + env(safe-area-inset-bottom, 0px));
    width: 40px; height: 40px; border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .45); color: #fff;
    font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.lb-fold:hover { background: rgba(0, 0, 0, .7); }
.lb-fold span { display: block; transform: rotate(90deg); transition: transform .2s; }   /* › down */
.lightbox.tray-hidden .lb-fold span { transform: rotate(-90deg); }                       /* › up */

.property-columns { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2rem; margin-top: .5rem; align-items: start; }
/* Grid items may not shrink below their content by default; a wide photo
   would otherwise blow the gallery column out of the frame. */
.property-columns > * { min-width: 0; }
@media (max-width: 800px) { .property-columns { grid-template-columns: 1fr; } }

.property-info .prose { font-size: .95rem; }
/* Top-align the text column with the cover image: kill the leading margin on
   whatever renders first (HTML bodies start with a <p>; without a body the
   facts grid is first). */
.property-info > :first-child > :first-child { margin-top: 0; }
.property-info > .property-facts:first-child .facts-grid { margin-top: 0; }
.facts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem .9rem; font-size: .92rem; margin-top: 1.2rem; }
.facts-grid p { margin: 0; padding: .1rem 0; }

/* Legacy CMS content */
.prose { max-width: 72ch; overflow-wrap: break-word; }
.prose img { max-width: 100%; height: auto; }
.prose table { max-width: 100%; }
.ingress { font-size: 1.05rem; color: var(--muted); }

/* Sub nav on content pages */
.sub-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding: 0; border-bottom: 1px solid var(--border); }
.sub-nav a { text-decoration: none; padding-bottom: .35rem; display: inline-block; }
.sub-nav a.active { border-bottom: 2px solid var(--accent); font-weight: 600; }

/* Pagination (Laravel default markup) */
nav[role=navigation] { margin-top: 1.5rem; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: #fff; /* the logos are GIF/JPG on white */
    color: var(--muted);
    font-size: .85rem;
    margin-top: 2rem;
}
.site-footer .container { padding-top: 1.2rem; padding-bottom: 1.5rem; text-align: center; }
.site-footer p { margin: .25rem 0; }
.footer-logo { display: block; margin: 0 auto .6rem; line-height: 0; }
.footer-logo img { max-width: 220px; height: auto; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Start page: news/info (left) + monthly & newest lists (right) */
.home-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    align-items: start;
}
.home-news h1 { font-size: 1.4rem; margin-top: 0; }
/* No gap — the two columns share a dashed divider and item separators touch it,
   forming a connected lattice like the classic site. */
.home-picks { display: grid; grid-template-columns: 1fr 1fr; }
/* Items in the two columns rarely align in height, so there are no horizontal
   separators here — just the dashed divider between the columns. */
.pick-col:first-child { border-left: 1px dashed #565960; border-right: 1px dashed #565960; }
.pick-col .list-item { padding-left: .75rem; padding-right: .75rem; }
.pick-head {
    background: var(--accent);
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin: 0 0 .85rem;
    padding: .32rem .6rem;
    border-radius: 3px;
}
.list-item {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: .7rem .4rem .8rem;
}
.list-item:hover { background: var(--bg-hover); }
.list-item:hover h3 { text-decoration: underline; }
.list-item h3 { font-family: var(--font-body); margin: 0 0 .35rem; font-size: .92rem; }
.list-item-image { position: relative; aspect-ratio: 4/3; background: var(--bg-soft); border-radius: 5px; overflow: hidden; }
.list-item-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.list-item .price { margin: .35rem 0 0; font-size: .9rem; }
.list-item.is-sold img { filter: grayscale(.5); opacity: .85; }
.pick-all { margin-top: .4rem; font-size: .9rem; }

@media (max-width: 820px) { .home-layout { grid-template-columns: 1fr; gap: 1.25rem; } }
@media (max-width: 480px) {
    .home-picks { grid-template-columns: 1fr; }
    .pick-col:first-child { border-left: none; border-right: none; }
}

/* Catalogue: region selector, toolbar, 3-up grid */
.region-selector { display: flex; align-items: flex-start; gap: 1rem; }
.region-body { flex: 1 1 auto; min-width: 0; }
.region-top { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.region-map { width: 90px; height: auto; flex: 0 0 auto; }
/* Clickable region outlines: invisible until hovered; the chosen one stays tinted */
.region-map polygon { fill: transparent; cursor: pointer; }
.region-map a:hover polygon, .region-map a:focus-visible polygon { fill: rgba(50, 82, 53, .35); }
.region-map a.active polygon { fill: rgba(50, 82, 53, .45); stroke: #fff; stroke-width: .7; }
body.brand-svenskatorp .region-map a:hover polygon { fill: rgba(109, 31, 31, .35); }
body.brand-svenskatorp .region-map a.active polygon { fill: rgba(109, 31, 31, .45); }
.region-intro { flex: 1 1 220px; margin: .4rem 0; font-size: 1.15rem; color: var(--accent); }
.region-intro .sep { color: var(--muted); margin: 0 .5rem; }
.region-intro a { text-decoration: underline; }
.region-search { display: flex; gap: .35rem; margin-left: auto; }
.region-search input { font: inherit; font-size: .85rem; padding: .25rem .45rem; border: 1px solid var(--border); border-radius: 4px; }
.region-search button { font: inherit; font-size: .85rem; font-weight: 700; padding: .25rem .8rem; color: var(--accent); background: var(--bg-hover); border: 1px solid #888; border-radius: 4px; cursor: pointer; }

/* One link per region: letter header + province names. Equal columns on
   desktop; the 2px gaps show the white page card, like the old table borders. */
.region-list { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; }
.region-cell { display: flex; flex-direction: column; text-align: center; text-decoration: none; color: var(--accent); }
.region-cell:hover { text-decoration: underline; }
.region-cell.active { font-weight: 700; text-decoration: underline; }
.region-letter { background: var(--accent-soft); padding: .3rem; font-size: 1.1rem; font-weight: 700; }
.region-names { flex: 1 1 auto; background: var(--bg-soft); padding: .55rem .4rem; font-size: .88rem; line-height: 1.4; }
.region-names span { display: block; }

@media (max-width: 700px) {
    /* Stack the selector: full-width tappable rows instead of columns.
       The map legend is redundant here since every row spells out its provinces. */
    .region-map { display: none; }
    .region-intro .sep { display: none; }
    .region-intro a { display: block; }
    .region-search { margin-left: 0; width: 100%; }
    .region-search input { flex: 1 1 auto; min-width: 0; }
    .region-list { grid-auto-flow: row; }
    .region-cell { flex-direction: row; text-align: left; }
    .region-letter { flex: 0 0 2.4rem; display: flex; align-items: center; justify-content: center; }
    .region-names span { display: inline; }
    .region-names span + span::before { content: ", "; }
}

.selected-region {
    background: #6c9770;
    color: #ecf8ed;
    text-align: center;
    padding: .45rem 1rem;
    margin: 1.1rem auto;
    border-radius: 4px;
    font-size: 1.1rem;
}
.selected-region strong { font-weight: 700; }
body.brand-svenskatorp .selected-region { background: var(--accent-soft); color: var(--text); }

/* Catalogue filter changes swap #catalog in place (fetch); dim while loading */
#catalog { transition: opacity .12s; }
#catalog.is-loading { opacity: .55; pointer-events: none; }

.catalog-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: .6rem 1rem; flex-wrap: wrap;
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 5px;
    padding: .45rem .7rem; margin-bottom: 1.2rem; font-size: .9rem;
}
/* Svenska Torp: dark-red toolbar strip with white text, like the classic sort bar */
body.brand-svenskatorp .catalog-toolbar { background: var(--accent); border-color: var(--accent); color: #fff; }
body.brand-svenskatorp .catalog-toolbar a { color: #fff; }
.toolbar-sort { display: flex; align-items: center; gap: .6rem 1.1rem; flex-wrap: wrap; margin: 0; }
.toolbar-sort label { display: inline-flex; align-items: center; gap: .3rem; }
.toolbar-sort select { font: inherit; padding: .2rem .3rem; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.print-link { text-decoration: underline; white-space: nowrap; }

/* No gaps — cards touch so their dashed borders connect into a grid, as on
   the classic catalogue (line2.gif separators); spacing comes from padding. */
.catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.catalog-card { display: block; text-decoration: none; color: inherit; padding: .8rem .8rem 1rem; border-bottom: 1px dashed #565960; border-right: 1px dashed #565960; }
.catalog-card:nth-child(3n) { border-right: none; }
/* Svenska Torp: 4-up grid as on the classic catalogue */
body.brand-svenskatorp .catalog-grid { grid-template-columns: repeat(4, 1fr); }
body.brand-svenskatorp .catalog-card:nth-child(3n) { border-right: 1px dashed #565960; }
body.brand-svenskatorp .catalog-card:nth-child(4n) { border-right: none; }
/* … with the price directly under the title, EUR estimate on its own line */
body.brand-svenskatorp .catalog-card h3 { margin-bottom: .15rem; }
body.brand-svenskatorp .catalog-card h3 + .price { margin-bottom: .5rem; }
body.brand-svenskatorp .catalog-card h3 + .price .price-eur { display: block; }
.catalog-card h3 { font-family: var(--font-body); margin: 0 0 .5rem; font-size: 1rem; }
.cc-date { margin: 0 0 .2rem; font-size: .75rem; color: var(--muted); }
.catalog-card:hover { background: var(--bg-hover); }
.catalog-card:hover h3 { text-decoration: underline; }
/* 5:4 rather than 3:2: ~40% of covers are legacy banners (~5:4) with the title
   baked in at the top; top-anchoring keeps that band when taller images crop. */
.catalog-card-image { position: relative; aspect-ratio: 5/4; background: var(--bg-soft); overflow: hidden; }
/* Favourite star: hover-revealed on pointer devices, always visible on touch
   (a hover-hidden star would also cost iOS visitors an extra tap per card). */
.fav-star {
    position: absolute; top: .4rem; right: .4rem;
    padding: .3rem .55rem; border: none; border-radius: 7px;
    background: rgba(255, 255, 255, .88); color: #a9a9a9;
    font-size: 1.3rem; line-height: 1; cursor: pointer;
}
@media (hover: hover) {
    .fav-star { opacity: 0; transition: opacity .15s; }
    .catalog-card:hover .fav-star, .list-item:hover .fav-star,
    .fav-star:focus-visible, .fav-star.is-fav { opacity: 1; }
}
.fav-star:hover { color: #e2a400; }
.fav-star.is-fav { color: #e2a400; }
.fav-filter { font-size: .9rem; font-weight: 700; text-decoration: none; color: var(--accent); white-space: nowrap; }
.fav-filter:hover { text-decoration: underline; }
.fav-filter[data-active="1"] { background: var(--accent); color: #fff; padding: .15rem .7rem; border-radius: 999px; }
.catalog-card-image img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.catalog-card.is-sold img { filter: grayscale(.5); opacity: .85; }
.cc-desc { font-weight: 700; font-size: .9rem; margin: .55rem 0 .3rem; color: var(--text); }
.cc-facts { font-size: .82rem; color: var(--muted); margin: 0 0 .4rem; }
.catalog-card .price { font-size: .95rem; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 1.6rem 0 .4rem; }
.pagination-link { display: inline-flex; align-items: center; justify-content: center; min-width: 2.1rem; padding: .35rem .6rem; font-size: .9rem; line-height: 1; text-decoration: none; color: var(--accent); background: #fff; border: 1px solid var(--border); border-radius: 4px; }
.pagination-link:hover { background: var(--bg-hover); }
.pagination-link.is-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pagination-link.is-disabled { color: var(--muted); background: var(--bg-soft); cursor: not-allowed; }
.pagination-ellipsis { padding: 0 .3rem; color: var(--muted); }
.pagination-summary { font-size: .85rem; color: var(--muted); margin: 0 0 1rem; }

@media (max-width: 800px) {
    .catalog-grid, body.brand-svenskatorp .catalog-grid { grid-template-columns: repeat(2, 1fr); }
    .catalog-card:nth-child(3n), body.brand-svenskatorp .catalog-card:nth-child(3n) { border-right: 1px dashed #565960; }
    .catalog-card:nth-child(2n), body.brand-svenskatorp .catalog-card:nth-child(2n) { border-right: none; }
}
@media (max-width: 520px) {
    .catalog-grid, body.brand-svenskatorp .catalog-grid { grid-template-columns: 1fr; }
    .catalog-card:nth-child(1n), body.brand-svenskatorp .catalog-card:nth-child(1n) { border-right: none; }
    .selected-region { font-size: 1rem; }
}

/* Print: replaces the old objects_print.asp pages */
@media print {
    /* .site-banner is a real <img>, so unlike the body background it would
       print even with "print backgrounds" off — hide it like the nav. */
    .no-print, .site-nav, .site-footer, .site-banner { display: none !important; }
    .site-header { border-bottom: 1px solid #000; background: none; }
    body, body.page-object { background: none; }
    .site-frame { max-width: none; margin: 0; border: none; box-shadow: none; }
    .property-columns { grid-template-columns: 1fr; }
    #gallery-main { max-height: 300px; }
    a { color: inherit; text-decoration: none; }
}

/* Print catalogue — dedicated printable page (classic objects_print_katalog.asp):
   plain white, no chrome, 3×4 objects per page, the Ekeby logo between pages. */
body.print-body {
    background: #fff; color: #000; margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}
.print-toolbar {
    display: flex; align-items: center; gap: 1.2rem;
    padding: .6rem 1rem; background: #f3f3f3; border-bottom: 1px solid #ccc;
    font-size: .9rem;
}
.print-toolbar button { font: inherit; cursor: pointer; padding: .3rem .9rem; }

.print-page { max-width: 660px; margin: 0 auto; padding: 1.6rem 1rem; }
.print-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem 1.1rem; align-items: start; }
.pc-card { font-size: 12px; line-height: 1.35; color: #000; }
/* Reserve two lines so a one- vs two-line title never shifts the image down. */
.pc-title { font-family: Arial, Helvetica, sans-serif; font-size: 13px; font-weight: 700; margin: 0 0 .4rem; color: #000; min-height: 2.5em; }
/* Uniform image box so every image in a row lines up, whatever its native size. */
.pc-image { margin: 0 0 .4rem; aspect-ratio: 3 / 2; background: #f0f0f0; overflow: hidden; }
.pc-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pc-desc { font-weight: 700; font-size: 11px; margin: 0 0 .4rem; }
.pc-facts { font-size: 11px; margin: 0 0 .45rem; }
.pc-price { color: #325235; font-weight: 700; font-size: 13px; margin: 0; }
.pc-eur { font-weight: 400; font-size: 10px; }

.print-footer { text-align: center; margin-top: 1.8rem; padding-top: 1.1rem; border-top: 1px dotted #999; }
.print-logo { height: 64px; width: auto; }
.print-logo-text { font-size: 15px; margin: 0; }
.print-contact { font-size: 11px; margin: .55rem 0 0; }
.print-empty { text-align: center; padding: 2rem; }

@media print {
    @page { margin: 1cm; }
    body.print-body { margin: 0; }
    .print-page { max-width: none; margin: 0; padding: 0; page-break-after: always; }
    .print-page:last-child { page-break-after: auto; }
    .print-grid { gap: .55rem .9rem; }
    .pc-card { page-break-inside: avoid; }
    /* Compact fixed-height thumbnails so a full 3×4 block plus the logo fits one sheet.
       Rows are sized by their tallest card (3-line trilingual preambles), so keep this
       low enough that four such rows plus the footer clear one A4 page. */
    .pc-image { margin-bottom: .25rem; aspect-ratio: auto; height: 72px; }
    .pc-title { min-height: 2.4em; }
    .pc-desc, .pc-facts { margin-bottom: .2rem; line-height: 1.25; }
    .print-footer { margin-top: .9rem; padding-top: .7rem; }
    .print-logo { height: 52px; }
}

/* Inquiry form */
.inquiry { margin-top: 1.5rem; padding: 1rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; }
.inquiry h2 { margin-top: 0; font-size: 1.1rem; }
.inquiry label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .6rem; }
.inquiry input, .inquiry textarea { display: block; width: 100%; font: inherit; padding: .4rem .5rem; border: 1px solid var(--border); border-radius: 5px; margin-top: .15rem; }
.inquiry button { font: inherit; background: var(--accent); color: #fff; border: none; border-radius: 5px; padding: .45rem 1.1rem; cursor: pointer; }
.inquiry-sent { color: var(--accent); font-weight: 600; }
.form-error { color: var(--sold); font-size: .85rem; }
.hp-field { position: absolute !important; left: -9999px !important; }

/* CMS info pages: the old template rendered every page body in a 540px column
   centred inside the 750px frame, and the texts were hand-broken for that
   width (align=center/left per paragraph, <br> + &nbsp; indents). Centre the
   prose block the same way so those alignments land where they were written. */
.page > .prose { max-width: 46rem; margin-left: auto; margin-right: auto; }

/* Images inserted from the admin Bildbibliotek with a placement (like the old
   webadmin's left/right alignment): float beside the text, plain <img> stays
   in the flow. Legacy align="left|right" attributes keep their native float. */
.prose img.img-left { float: left; margin: .2rem 1.2rem .6rem 0; max-width: 50%; }
.prose img.img-right { float: right; margin: .2rem 0 .6rem 1.2rem; max-width: 50%; }
.prose::after { content: ""; display: block; clear: both; }
