/*
Theme Name: Putsspecialisten
Description: Tema för Putsspecialisten Helsingborg – puts, fasad, murning och microcement. Galleri med egna projektbilder, offertformulär och kontaktuppgifter under Utseende → Anpassa.
Version: 1.2.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: putsspecialisten
*/

:root {
	--paper: #f7f6f1;
	--sand: #efeee8;
	--white: #fff;
	--ink: #1b2220;
	--dark: #202824;
	--deep: #19211d;
	--accent: #b74726;
	--accent-dark: #993a1e;
	--bright: #f6a37c;
	--rule: #dcded6;
	--muted: #545e57;
	--max: 1240px;
	--head: Georgia, 'Times New Roman', serif;
	--body: Arial, Helvetica, sans-serif;
	--ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img { display: block; width: 100%; height: auto; object-fit: cover; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.05; text-wrap: balance; }
h1, h2 { font-family: var(--head); font-weight: 400; letter-spacing: -.035em; }
h2 { font-size: clamp(2.5rem, 5vw, 4.2rem); }
h3 { font-size: 1.28rem; letter-spacing: -.025em; }
p + p { margin-top: 1rem; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #e3794b; outline-offset: 5px; }
[hidden] { display: none !important; }

.wrap { max-width: var(--max); margin: auto; padding-inline: 32px; }
.skip { position: absolute; left: 12px; top: 12px; transform: translateY(-160%); z-index: 50; background: white; padding: 10px; color: #111; }
.skip:focus { transform: none; }

/* Topprad och sidhuvud */
.utility { background: var(--deep); color: #e8ece6; font-size: .82rem; }
.utility .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 38px; gap: 16px; }
.utility a { text-decoration: none; font-weight: 700; }
.utility a:hover { text-decoration: underline; }

.site-header { position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 20; background: #fffffff2; backdrop-filter: blur(10px); border-bottom: 1px solid #e8e8e3; }
.header-inner { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: block; flex: none; }
.brand img { width: 195px; height: auto; object-fit: contain; }
.nav { display: flex; align-items: center; gap: clamp(15px, 2.2vw, 32px); }
.nav a, .nav summary { text-decoration: none; font-size: .92rem; font-weight: 700; white-space: nowrap; }
.nav > a { position: relative; padding-block: 6px; }
.nav > a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; border-top: 2px solid var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.nav > a:hover::after, .nav > a[aria-current=page]::after { transform: none; }
.nav a:hover, .nav a[aria-current=page], .nav summary:hover { color: var(--accent); }
.nav details { position: relative; }
.nav summary { cursor: pointer; list-style: none; }
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.nav details div { position: absolute; z-index: 3; background: white; box-shadow: 0 10px 25px #0002; min-width: 180px; top: calc(100% + 12px); left: -13px; padding: 8px; border-top: 2px solid var(--accent); }
.nav details a { display: block; padding: 8px; }
.mobile-toggle { display: none; }

/* Knappar och småtext */
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 11px 22px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; border: 1px solid transparent; line-height: 1.3; text-align: center; transition: background .2s, color .2s; }
.button:hover { background: var(--accent-dark); }
.button.secondary { background: transparent; color: inherit; border-color: currentColor; }
.button.secondary:hover { background: #ffffff16; }
.button.light { background: var(--paper); color: var(--ink); }
.button.light:hover { background: #fff; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.eyebrow { font-size: .81rem; line-height: 1.4; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--accent); margin-bottom: 16px; }
.eyebrow::before { content: ''; display: inline-block; width: 26px; border-top: 2px solid currentColor; vertical-align: middle; margin-right: 10px; }
.text-link { font-weight: 700; text-underline-offset: 5px; }
.text-link:hover { color: var(--accent); }

/* Startsidan */
.hero { display: grid; grid-template-columns: 49% 51%; min-height: 620px; background: var(--dark); color: var(--white); }
.hero-copy { padding: 80px 36px 82px max(32px, calc((100vw - var(--max)) / 2 + 32px)); align-self: center; }
.hero .eyebrow, .foot-cta .eyebrow, .inner-hero .eyebrow { color: var(--bright); }
.hero h1 { font-size: clamp(3.3rem, 6vw, 6.15rem); max-width: 680px; }
.hero h1 em { font-weight: 400; color: #f5bb9e; }
.hero p:not(.eyebrow) { max-width: 448px; color: #e0e5df; font-size: 1.08rem; margin-top: 22px; }
.hero-photo { position: relative; min-height: 100%; overflow: hidden; background: #645f52; }
.hero-photo img { position: absolute; height: 100%; inset: 0; object-position: center 49%; }
.hero-photo figcaption { position: absolute; bottom: 24px; right: 24px; padding: 8px 13px; background: #202824e8; color: white; font-size: .84rem; }

.trust { border-bottom: 1px solid var(--rule); background: var(--white); }
.trust .wrap { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); }
.trust span { padding: 20px 12px; text-align: center; font-size: .91rem; font-weight: 700; }
.trust span + span { border-left: 1px solid var(--rule); }

.section { padding-block: 88px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 38px; }
.section-head p:not(.eyebrow) { max-width: 390px; color: var(--muted); }

.services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.service { position: relative; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--rule); padding: 26px 24px 24px; min-height: 230px; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.service::before { content: ''; position: absolute; inset: -1px -1px auto; border-top: 3px solid var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.service:hover { transform: translateY(-4px); box-shadow: 0 18px 34px -22px #1b222066; border-color: #c9ccc2; }
.service:hover::before { transform: none; }
.service-no { font-family: var(--head); font-size: 1.05rem; color: var(--accent); margin-bottom: 26px; }
.service-no::after { content: ''; display: inline-block; width: 28px; border-top: 1px solid currentColor; vertical-align: middle; margin-left: 10px; opacity: .6; }
.service h3 { margin-bottom: 8px; font-size: 1.4rem; }
.service p { color: var(--muted); margin-bottom: 16px; }
.service a { margin-top: auto; align-self: flex-start; }
.service a::after { content: ''; position: absolute; inset: 0; }

.gallery-section { background: var(--sand); }

.split { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(28px, 7vw, 100px); }
.split img { aspect-ratio: 5/4; }
.split h2, .content h2 { margin-bottom: 20px; }
.split p:not(.eyebrow), .content p { color: var(--muted); }
.framed { position: relative; margin: 0 18px 18px 0; }
.framed::before { content: ''; position: absolute; inset: 18px -18px -18px 18px; background: #e4ded2; }
.framed img { position: relative; }

.foot-cta { padding-block: 62px; background: var(--dark); color: white; }
.foot-cta .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.foot-cta p:not(.eyebrow) { color: #e0e5df; margin-top: 12px; }

.footer { background: var(--deep); color: #f3f5f0; padding-block: 48px 20px; }
.footer-main { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 30px; }
.footer strong { display: block; margin-bottom: 9px; }
.footer a { display: block; width: fit-content; color: #dce3db; text-underline-offset: 4px; }
.footer a + a { margin-top: 4px; }
.footer a:hover { color: #fff; }
.footer p { color: #dce3db; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; border-top: 1px solid #ffffff27; margin-top: 34px; padding-top: 15px; color: #c7d0c6; font-size: .88rem; }
.footer-bottom a { margin: 0; color: #c7d0c6; }

/* Undersidor */
.inner-hero { background: var(--dark); color: white; }
.inner-hero .wrap { min-height: 340px; display: grid; grid-template-columns: 1.04fr 1fr; align-items: center; gap: 26px; }
.inner-hero.no-photo .wrap { display: block; min-height: unset; padding-block: 58px 64px; }
.inner-hero h1 { font-size: clamp(3.1rem, 6vw, 5.25rem); margin-bottom: 14px; }
.inner-hero p:not(.eyebrow) { max-width: 550px; color: #e0e5df; font-size: 1.05rem; }
.inner-copy { padding-block: 44px; }
.inner-hero.no-photo .inner-copy { padding: 0; }
.inner-hero img { height: 100%; max-height: 365px; min-height: 340px; }

.content { max-width: 800px; }
.entry > * + * { margin-top: 1rem; }
.entry > h2:not(:first-child), .entry > h3:not(:first-child) { margin-top: 2.2rem; }
.entry a:not(.text-link):not(.button) { color: var(--accent-dark); text-underline-offset: 4px; }
.entry ul, .entry ol { color: var(--muted); padding-left: 1.2em; }
.entry .actions { margin-top: 30px; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.info-card { background: white; border: 1px solid var(--rule); border-top: 3px solid var(--accent); padding: 23px; }
.info-card h3 { margin-bottom: 9px; }
.partners { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.entry .partners a { display: inline-block; padding: 8px 16px; background: white; border: 1px solid var(--rule); color: var(--ink); font-weight: 700; text-decoration: none; }
.entry .partners a:hover { border-color: var(--accent); color: var(--accent); }

/* Galleri: enhetliga porträttrutor med bildtext som tonar fram */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile-open { position: relative; display: block; aspect-ratio: 4/5; overflow: hidden; background: #dfddd5; color: #fff; text-decoration: none; }
.tile-open img { height: 100%; transition: transform .7s var(--ease); }
.tile-open::after { content: '+'; position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 40px; height: 40px; background: var(--paper); color: var(--ink); font: 400 1.5rem/1 var(--body); padding-bottom: 2px; opacity: 0; transform: scale(.85); transition: opacity .3s, transform .3s var(--ease); }
.tile-caption { position: absolute; inset: auto 0 0; display: grid; gap: 3px; padding: 64px 18px 16px; background: linear-gradient(to top, #101511e0 0%, #10151199 45%, #10151100 100%); line-height: 1.25; }
.tile-caption strong { font-family: var(--head); font-weight: 400; font-size: 1.18rem; letter-spacing: -.015em; }
.tile-caption span { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; color: #f5bb9e; }
.tile-open:hover img, .tile-open:focus-visible img { transform: scale(1.06); }
.tile-open:hover::after, .tile-open:focus-visible::after { opacity: 1; transform: none; }
.tile-open:focus-visible { outline-offset: 3px; }
@media (hover: hover) {
	.tile-caption { opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .35s var(--ease); }
	.tile-open:hover .tile-caption, .tile-open:focus-visible .tile-caption { opacity: 1; transform: none; }
}
.tile.is-entering { animation: tile-in .5s var(--ease) both; }
@keyframes tile-in { from { opacity: 0; transform: translateY(14px); } }

.gallery-page { background: var(--sand); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 30px; }
.filters button { display: inline-flex; align-items: center; gap: 9px; border: 1px solid #b9bdb3; background: transparent; color: var(--ink); padding: 8px 16px; min-height: 44px; font-weight: 700; font-size: .92rem; transition: background .2s, color .2s, border-color .2s; }
.filters button span { font-weight: 400; font-size: .8rem; color: var(--muted); }
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed=true] { background: var(--dark); color: white; border-color: var(--dark); }
.filters button[aria-pressed=true] span { color: #c7d0c6; }
.more { display: grid; justify-items: center; gap: 14px; margin-top: 40px; }
.more-status { color: var(--muted); font-size: .9rem; }
.more .button.secondary:hover { background: var(--dark); color: #fff; border-color: var(--dark); }
.gallery-text { margin-top: 48px; }

/* Före och efter */
.pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 32px; }
.pair-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.pair h3 { margin-top: 16px; font-family: var(--head); font-weight: 400; font-size: 1.45rem; letter-spacing: -.02em; }
.pair > p { margin-top: 5px; color: var(--muted); font-size: .9rem; }
.pair .tile-caption { inset: 12px auto auto 12px; padding: 0; background: none; opacity: 1; transform: none; }
.pair .tile-caption strong { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.pair .tile-caption span { padding: 6px 10px; background: var(--paper); color: var(--ink); letter-spacing: .12em; }
.pair .tile:last-child .tile-caption span { background: var(--accent); color: #fff; }
.pair .tile-open::after { display: none; }

/* Bildvisare */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; padding: 0; background: #0f1411; color: white; overflow: hidden; }
.lightbox[open] { display: grid; grid-template: 'bar bar bar' auto 'prev stage next' minmax(0, 1fr) / auto minmax(0, 1fr) auto; }
.lightbox::backdrop { background: #0f1411; }
.lightbox-bar { grid-area: bar; display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 10px 22px; }
.lightbox-count { font-size: .88rem; letter-spacing: .08em; color: #c7d0c6; font-variant-numeric: tabular-nums; }
.lightbox-close { min-height: 44px; padding: 5px 16px; background: transparent; color: white; border: 1px solid #ffffff55; font-weight: 700; }
.lightbox-close:hover { background: white; color: var(--ink); }
.lightbox figure { grid-area: stage; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; min-height: 0; padding-bottom: 6px; }
.lightbox figure img { width: auto; max-width: 100%; height: 100%; min-height: 0; object-fit: contain; transition: opacity .2s; }
.lightbox figure img.is-loading { opacity: .25; }
.lightbox figcaption { padding: 14px 20px 18px; text-align: center; font-family: var(--head); font-size: 1.15rem; }
.lightbox figcaption small { display: block; margin-top: 3px; font: 700 .72rem/1.4 var(--body); letter-spacing: .13em; text-transform: uppercase; color: #f5bb9e; }
.lightbox-nav { align-self: center; width: 52px; height: 52px; margin-inline: 14px; border: 1px solid #ffffff55; background: transparent; color: white; display: grid; place-items: center; }
.lightbox-nav.prev { grid-area: prev; }
.lightbox-nav.next { grid-area: next; }
.lightbox-nav::before { content: ''; width: 11px; height: 11px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateX(-2px) rotate(-45deg); }
.lightbox-nav.prev::before { transform: translateX(2px) rotate(135deg); }
.lightbox-nav:hover { background: white; color: var(--ink); }
.lightbox-nav[hidden] + figure { grid-column: 1 / -1; }

/* Kontakt */
.contact-grid { align-items: start; grid-template-columns: .85fr 1.15fr; }
.contact-list { margin: 22px 0 0; padding: 0; list-style: none; }
.contact-list li { border-top: 1px solid var(--rule); padding: 14px 0; }
.contact-list small { display: block; color: var(--muted); font-size: .89rem; }
.contact-list a { overflow-wrap: anywhere; font-size: 1.08rem; }
.contact-text { margin-top: 24px; color: var(--muted); }
.form { background: white; border: 1px solid var(--rule); border-top: 3px solid var(--accent); padding: clamp(20px, 4vw, 38px); }
.form h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 12px; }
.form p { color: var(--muted); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-block: 20px; }
.form label { display: grid; align-content: start; gap: 5px; font-size: .92rem; font-weight: 700; }
.form .wide { grid-column: 1 / -1; }
.form :is(input, select, textarea) { min-width: 0; width: 100%; padding: 11px 12px; border: 1px solid #939a90; border-radius: 0; background: white; color: var(--ink); font-weight: 400; }
.form :is(input, select, textarea):focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.form [aria-invalid=true] { border-color: #a12a12; box-shadow: inset 3px 0 #a12a12; }
.field-error { color: #a12a12; font-weight: 400; font-size: .88rem; }
.form textarea { resize: vertical; }
.form-notice { margin-top: 14px; padding: 12px 15px; border-left: 3px solid; }
.form .form-notice.error { background: #fbefeb; border-color: #a12a12; color: #7c200e; }
.form .form-notice.success { background: #eef3ec; border-color: #3d6b4a; color: #24432d; margin-bottom: 14px; }
.form .form-privacy { margin-top: 16px; font-size: .86rem; }
.form-privacy a { text-underline-offset: 3px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Mindre skärmar */
@media (max-width: 1000px) {
	.tiles.catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
	.nav { gap: 15px; }
	.brand img { width: 163px; }
	.header-inner { gap: 15px; }
	.hero { min-height: 505px; }
	.services { grid-template-columns: repeat(2, 1fr); }
	.section { padding-block: 64px; }
}
@media (max-width: 760px) {
	html { scroll-padding-top: 90px; }
	.wrap { padding-inline: 20px; }
	.header-inner { min-height: 72px; flex-wrap: wrap; }
	.header-cta { display: none; }
	.mobile-toggle { display: block; background: white; border: 1px solid var(--rule); color: var(--ink); padding: 8px 14px; min-height: 44px; font-weight: 700; }
	.nav[hidden] { display: none; }
	.nav { flex-basis: 100%; padding: 0 0 14px; display: grid; gap: 0; }
	.nav > a, .nav summary { display: block; padding: 10px 0; }
	.nav > a::after { display: none; }
	.nav details div { position: static; box-shadow: none; border: 0; padding: 0 0 0 14px; }
	.hero { display: block; }
	.hero-copy { padding: 47px 20px 42px; }
	.hero h1 { font-size: clamp(3.12rem, 11.3vw, 4.6rem); }
	.hero-photo { aspect-ratio: 1.32; min-height: 0; }
	.hero-photo img { object-position: center 42%; }
	.hero-photo figcaption { right: 12px; bottom: 12px; }
	.trust span { padding: 14px 5px; font-size: .8rem; }
	.section { padding-block: 48px; }
	.section-head { display: block; margin-bottom: 25px; }
	.section-head p:not(.eyebrow) { margin-top: 10px; }
	.section-head .text-link { display: inline-block; margin-top: 14px; }
	.tiles, .tiles.catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.tile-caption { padding: 40px 12px 11px; }
	.tile-caption strong { font-size: 1rem; }
	.tile-caption span { font-size: .66rem; }
	.tile-open::after { display: none; }
	.pairs { grid-template-columns: 1fr; gap: 32px; }
	.pair .tile-caption { inset: 8px auto auto 8px; }
	.filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -20px; padding: 0 20px 6px; scrollbar-width: none; }
	.filters::-webkit-scrollbar { display: none; }
	.filters button { flex: none; }
	.split, .contact-grid, .inner-hero .wrap { grid-template-columns: 1fr; gap: 23px; }
	.framed { margin: 0 12px 12px 0; }
	.framed::before { inset: 12px -12px -12px 12px; }
	.inner-hero .wrap { min-height: 0; }
	.inner-hero .inner-copy { padding: 35px 0 0; }
	.inner-hero.no-photo .wrap { padding-block: 40px 44px; }
	.inner-hero.no-photo .inner-copy { padding: 0; }
	.inner-hero img { min-height: 0; height: auto; max-height: none; aspect-ratio: 1.55; margin-bottom: 20px; }
	.foot-cta .wrap { display: block; }
	.foot-cta .button { margin-top: 19px; }
	.footer-main { grid-template-columns: 1fr 1fr; }
	.footer-main > div:first-child { grid-column: 1 / -1; }
	.lightbox[open] { grid-template: 'bar bar' auto 'stage stage' minmax(0, 1fr) 'prev next' auto / 1fr 1fr; }
	.lightbox-nav { width: auto; margin: 0; height: 54px; border-width: 1px 0 0; }
	.lightbox-nav.next { border-left-width: 1px; }
	.lightbox figcaption { font-size: 1.02rem; padding: 12px 16px 14px; }
}
@media (max-width: 430px) {
	.utility .wrap { font-size: .75rem; gap: 8px; }
	.service { padding: 16px 15px 15px; min-height: 200px; }
	.service-no { margin-bottom: 16px; }
	.services { gap: 10px; }
	.service p { font-size: .96rem; }
	.service h3 { font-size: 1.15rem; }
	.info-grid, .fields, .footer-main { grid-template-columns: 1fr; }
	.form .wide { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
