/* Rygehus boliger – bruker fargene og fontene fra temaet (theme.json). */

/* ---------- Karusell ---------- */
.rh-galleri { position: relative; background: var(--wp--preset--color--contrast, #231f20); }
.rh-galleri-spor { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.rh-galleri-spor::-webkit-scrollbar { display: none; }
.rh-galleri-bilde { flex: 0 0 100%; margin: 0; scroll-snap-align: center; aspect-ratio: 16 / 7; }
.rh-galleri-bilde img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rh-galleri-pil {
	position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%;
	border: 0; background: rgba(255, 255, 255, .9); cursor: pointer; transition: background .25s, transform .25s;
}
.rh-galleri-pil::before { content: ""; position: absolute; inset: 0; margin: auto; width: 12px; height: 12px; border: solid var(--wp--preset--color--contrast, #231f20); border-width: 0 2.5px 2.5px 0; }
.rh-galleri-pil.forrige { left: max(16px, 2vw); }
.rh-galleri-pil.forrige::before { transform: translateX(2px) rotate(135deg); }
.rh-galleri-pil.neste { right: max(16px, 2vw); }
.rh-galleri-pil.neste::before { transform: translateX(-2px) rotate(-45deg); }
.rh-galleri-pil:hover, .rh-galleri-pil:focus-visible { background: var(--wp--preset--color--accent, #00b4d1); transform: translateY(-50%) scale(1.06); }
.rh-galleri-teller { position: absolute; right: max(16px, 2vw); bottom: 16px; background: rgba(15, 30, 34, .7); color: #fff; font-size: .85rem; padding: .25rem .7rem; border-radius: 999px; }

/* ---------- Merker ---------- */
.rh-merker { display: flex; gap: .4rem; flex-wrap: wrap; }
.rh-merke-status {
	display: inline-block; padding: .3rem .75rem; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700;
	background: var(--wp--preset--color--accent, #00b4d1); color: var(--wp--preset--color--accent-contrast, #0f1e22); border-radius: 2px;
}
.rh-merke-status.er-utsolgt { background: var(--wp--preset--color--contrast, #231f20); color: #fff; }
.rh-merke-status.er-kommer-for-salg { background: #fff; color: var(--wp--preset--color--contrast, #231f20); }

/* Ingressen: boksen følger rutenettet (samme venstrekant som tittelen), teksten inni er maks 60 tegn bred. */
.rh-bolig-ingress { font-size: clamp(1.1rem, 1.8vw, 1.3rem); line-height: 1.5; max-width: 60ch; margin: 0; }

/* ---------- Tre kolonner ---------- */
.rh-detaljer { display: grid; gap: var(--wp--preset--spacing--50, 2.5rem); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rh-detaljer-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rh-detaljer-1 { grid-template-columns: minmax(0, 1fr); }
.rh-detaljer-kol { display: flex; flex-direction: column; gap: var(--wp--preset--spacing--40, 2rem); }
.rh-boks-tittel {
	font-size: .9rem !important; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 1rem; padding-bottom: .6rem; position: relative;
}
.rh-boks-tittel::after { content: ""; position: absolute; left: 0; bottom: 0; width: 40px; height: 3px; background: var(--wp--preset--color--accent, #00b4d1); }
.rh-boks-innhold > :first-child { margin-top: 0; }
.rh-boks-innhold > :last-child { margin-bottom: 0; }
.rh-boks-innhold img { max-width: 100%; height: auto; }
.rh-pris .rh-boks-innhold { font-size: 1.15rem; }
.rh-pris .rh-boks-innhold strong, .rh-pris .rh-boks-innhold b { font-family: var(--wp--preset--font-family--overskrift, inherit); }
.rh-megler-logo img { max-width: 180px; max-height: 70px; width: auto; height: auto; margin-bottom: .8rem; }
.rh-filer { list-style: none; padding: 0; margin: 0; }
.rh-filer li { border-bottom: 1px solid var(--wp--preset--color--border, #dce6e8); }
.rh-filer a { display: flex; align-items: center; gap: .7rem; padding: .7rem 0; text-decoration: none; }
.rh-filer a::before {
	content: ""; flex: none; width: 22px; height: 26px; border: 2px solid currentColor; border-radius: 2px 8px 2px 2px;
	background: linear-gradient(currentColor, currentColor) 50% 60% / 10px 2px no-repeat;
}
.rh-filer a:hover { color: var(--wp--preset--color--accent-2, #007c8e); }
.rh-knapp-omriss { background: transparent !important; color: var(--wp--preset--color--contrast, #231f20) !important; border: 1.5px solid var(--wp--preset--color--accent, #00b4d1) !important; }
.rh-knapp-omriss:hover { background: var(--wp--preset--color--accent, #00b4d1) !important; color: var(--wp--preset--color--accent-contrast, #0f1e22) !important; }
.rh-meld-interesse { margin-top: 1.5rem; }

/* ---------- Interessert? ---------- */
.rh-interesse { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--wp--preset--spacing--50, 2.5rem); align-items: start; scroll-margin-top: 110px; }
.rh-interesse h2 { margin-top: 0; }
.rh-interesse .wpforms-container { margin: 0 !important; }
.rh-interesse input[type=text], .rh-interesse input[type=email], .rh-interesse input[type=tel], .rh-interesse textarea {
	border-radius: 4px !important; border: 1px solid var(--wp--preset--color--border, #dce6e8) !important; padding: .75rem .9rem !important; max-width: 100% !important;
}
.rh-interesse button[type=submit] {
	background: var(--wp--preset--color--accent, #00b4d1) !important; color: var(--wp--preset--color--accent-contrast, #0f1e22) !important;
	border: 0 !important; border-radius: 4px !important; padding: .9rem 1.6rem !important; text-transform: uppercase; letter-spacing: .08em; font-weight: 700 !important;
}

/* ---------- Oversikt med filter ---------- */
.rh-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-bottom: var(--wp--preset--spacing--40, 2rem); }
.rh-filter button {
	font: inherit; font-size: .9rem; padding: .55rem 1.1rem; border-radius: 999px; cursor: pointer;
	border: 1.5px solid var(--wp--preset--color--border, #dce6e8); background: #fff; color: var(--wp--preset--color--contrast, #231f20);
	transition: background .25s, border-color .25s, color .25s;
}
.rh-filter button span { opacity: .6; margin-left: .25rem; font-size: .8em; }
.rh-filter button:hover { border-color: var(--wp--preset--color--accent, #00b4d1); }
.rh-filter button.er-valgt { background: var(--wp--preset--color--contrast, #231f20); border-color: var(--wp--preset--color--contrast, #231f20); color: #fff; }
.rh-bolig-rutenett { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--wp--preset--spacing--30, 1.5rem); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.rh-bolig-kort { transition: opacity .4s, transform .4s; }
.rh-bolig-kort.er-skjult, .rh-bolig-kort.er-filtrert { display: none; }
.rh-bolig-kort.er-inn { animation: rh-kort-inn .55s cubic-bezier(.2, .7, .2, 1) both; }
.rh-bolig-kort a { display: block; height: 100%; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--wp--preset--color--border, #dce6e8); border-radius: 8px; overflow: hidden; transition: transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s; }
.rh-bolig-kort a:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(15, 30, 34, .12); }
.rh-bolig-bilde { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--wp--preset--color--base-2, #f2f7f8); }
.rh-bolig-bilde img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.rh-bolig-kort a:hover .rh-bolig-bilde img { transform: scale(1.06); }
.rh-bolig-bilde .rh-merker { position: absolute; top: 12px; left: 12px; }
.rh-bolig-navn { display: block; padding: 1rem 1.1rem 1.2rem; font-family: var(--wp--preset--font-family--overskrift, inherit); font-size: 1.1rem; font-weight: 500; }
.rh-kort-kategori { display: block; padding: 1rem 1.1rem 0; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--wp--preset--color--accent-2, #007c8e); font-weight: 700; }
.rh-kort-kategori + .rh-bolig-navn { padding-top: .3rem; }
.rh-vis-flere { text-align: center; margin-top: var(--wp--preset--spacing--40, 2rem); }
@keyframes rh-kort-inn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rh-bolig-kort.er-inn { animation: none; } .rh-galleri-spor { scroll-behavior: auto; } }

/* ---------- Før og etter ---------- */
.rh-for-etter-seksjon { margin-bottom: var(--wp--preset--spacing--50, 2.5rem); }
.rh-for-etter-seksjon h2 { margin-top: 0; }
.rh-for-etter { margin: 0 0 var(--wp--preset--spacing--40, 2rem); }
.rh-fe-bilder { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 8px; background: var(--wp--preset--color--base-2, #f2f7f8); user-select: none; touch-action: pan-y; }
.rh-fe-bilder img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.rh-fe-for { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.rh-fe-merke {
	position: absolute; top: 16px; z-index: 2; padding: .35rem .9rem; border-radius: 2px; font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
	background: rgba(255, 255, 255, .92); color: var(--wp--preset--color--contrast, #231f20); transition: opacity .25s;
}
.rh-fe-merke.er-for { left: 16px; }
.rh-fe-merke.er-etter { right: 16px; background: var(--wp--preset--color--accent, #00b4d1); color: var(--wp--preset--color--accent-contrast, #0f1e22); }
.rh-for-etter[data-pos-lav] .rh-fe-merke.er-for, .rh-for-etter[data-pos-hoy] .rh-fe-merke.er-etter { opacity: 0; }
.rh-fe-linje { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 12px rgba(0, 0, 0, .35); z-index: 2; pointer-events: none; }
.rh-fe-handtak {
	position: absolute; top: 50%; left: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
	background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .3); transition: transform .2s, background .2s;
}
.rh-fe-handtak::before, .rh-fe-handtak::after { content: ""; position: absolute; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border: solid var(--wp--preset--color--contrast, #231f20); border-width: 0 2.5px 2.5px 0; }
.rh-fe-handtak::before { left: 12px; transform: rotate(135deg); }
.rh-fe-handtak::after { right: 12px; transform: rotate(-45deg); }
.rh-fe-glider { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 3; -webkit-appearance: none; appearance: none; }
.rh-fe-glider:focus-visible + .rh-fe-linje, .rh-fe-bilder:focus-within .rh-fe-linje { background: var(--wp--preset--color--accent, #00b4d1); }
.rh-fe-bilder:hover .rh-fe-handtak, .rh-fe-bilder:focus-within .rh-fe-handtak { transform: scale(1.08); background: var(--wp--preset--color--accent, #00b4d1); }
.rh-for-etter figcaption { margin-top: .6rem; font-size: .95rem; color: var(--wp--preset--color--contrast-2, #5c5c5c); }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
	.rh-detaljer, .rh-detaljer-2 { grid-template-columns: minmax(0, 1fr); }
	.rh-interesse { grid-template-columns: minmax(0, 1fr); }
	.rh-galleri-bilde { aspect-ratio: 4 / 3; }
	.rh-galleri-pil { width: 42px; height: 42px; }
}
