/* ============================================================================
 * Markedsmateriell.no — Tjeneste (Service) single template
 * ----------------------------------------------------------------------------
 * Loaded only on single `tjeneste` (see inc/tjeneste.php).
 * Design: light only, brand blue accent, orange gradient on primary CTA.
 * All classes prefixed `tjeneste-` to avoid collisions.
 * ==========================================================================*/

.tjeneste-single{
	--tj-blue:#0084D6;
	--tj-blue-dark:#00598f;
	--tj-ink:#181F25;
	--tj-muted:#5a6470;
	--tj-bg:#F5F9FC;
	--tj-border:#D3D3D3;
	--tj-line:#E3E8ED;
	--tj-btn:#EC008C;
	--tj-accent:#0084D6;

	color:var(--tj-ink);
	font-family:inherit;
	line-height:1.7;
}
.tjeneste-single img{ max-width:100%; height:auto; display:block; }
.tjeneste-single strong{ color:var(--tj-ink); }

/* ---- Layout helpers ----
   max-width matches the site header's actual content width
   (Astra's --ast-normal-container-width, 1260px) so hero/section content
   lines up with the header logo/nav instead of the previous 1290px. */
.tjeneste-container{ max-width:var(--ast-normal-container-width, 1260px); padding:0 22px; margin: 0 auto;}
.tjeneste-container-hero{
	padding: 0;
	width: 100%;
	max-width: 1240px;
}
.tjeneste-section{ padding:clamp(40px,6vw,68px) 0; }
.tjeneste-section.alt{ background:var(--tj-bg); }

/* ---- Headings ---- */
.tjeneste-h2{
	font-size:clamp(1.5rem,3.4vw,2rem);
	font-weight:700; line-height:1.2; color:var(--tj-ink);
	margin:0 0 8px;
}
.tjeneste-h2::after{
	content:""; display:block; width:52px; height:3px;
	background:var(--tj-accent); border-radius:2px; margin:12px 0 26px;
}
.tjeneste-lead{ font-size:1.1rem; color:var(--tj-muted); max-width:760px; margin:0 0 28px; }

/* ---- Rich text ---- */
.tjeneste-richtext{ color:var(--tj-muted); }
.tjeneste-richtext > *:last-child{ margin-bottom:0; }
.tjeneste-richtext h2,.tjeneste-richtext h3,.tjeneste-richtext h4{ color:var(--tj-ink); line-height:1.3; margin:1.4em 0 .5em; }
.tjeneste-richtext a{ color:var(--tj-blue); font-weight:600; text-decoration:none; }
.tjeneste-richtext a:hover{ text-decoration:underline; }
.tjeneste-richtext ul,.tjeneste-richtext ol{ margin:0 0 16px; padding-left:22px; }
.tjeneste-richtext li{ margin-bottom:8px; }

/* ---- Buttons ---- */
.tjeneste-btn{
	display:inline-block; background:var(--tj-btn); color:#fff !important;
	font-weight:700; padding:14px 32px; border-radius:8px; text-decoration:none;transition:filter .15s ease, transform .15s ease;
}
.tjeneste-btn:hover{ filter:brightness(1.05); transform:translateY(-1px); color:#fff; }
.tjeneste-btn.full{ display:block; text-align:center; }
.tjeneste-link-btn{
	display:inline-block; margin-top:40px; color:var(--tj-blue); font-weight:700;
	border:1px solid var(--tj-blue); padding:11px 24px; border-radius:8px; text-decoration:none;
	transition:background .15s ease, color .15s ease;
}
.tjeneste-link-btn:hover{ background:var(--tj-blue); color:#fff; }

/* ---- Breadcrumbs (inside hero, above the H1) ---- */
.tjeneste-breadcrumbs{ font-size:.88rem;}
.tjeneste-breadcrumbs a{ color:var(--tj-muted); text-decoration:none; }
.tjeneste-breadcrumbs a:hover{ color:var(--tj-blue); }
.tjeneste-hero.has-image .tjeneste-breadcrumbs,
.tjeneste-hero.has-image .tjeneste-breadcrumbs a{ color:rgba(255,255,255,.85); }

/* ---- Unified hero — single tjeneste + single portfolio + portfolio archives.
   Fixed height (not viewport-stretched), content starts near the top
   (not vertically centered). Same markup/classes everywhere (see
   template-parts/hero.php). No horizontal padding here — .tjeneste-container
   (the flex child) provides it, same as every other section, so the hero
   lines up exactly with the header/rest of the page. align-items:stretch
   (not flex-start) so that child gets full width and its own max-width +
   margin:auto actually centers it. */
.tjeneste-hero{
	position:relative; height:620px;
	display:flex; flex-direction:column; justify-content:flex-start; align-items:stretch;
	padding-top:120px;
	background:var(--tj-bg); background-size:cover; background-position:center;
	overflow:hidden; /* safety net: nothing inside should ever push the page wider than the viewport */
}
.tjeneste-hero.is-blue{ background:linear-gradient(135deg,#0084D6 0%,#00598f 100%); }
.tjeneste-hero.has-overlay::before{
	content:""; position:absolute; inset:0;
	background:linear-gradient(180deg,rgba(12,22,32,.5),rgba(12,22,32,.68));
}
.tjeneste-hero-inner{
	position:relative; width:100%; max-width:1240px;
	display:flex; flex-direction:column; gap:18px;
}
.tjeneste-hero-title{
	/* !important throughout: Elementor's global kit CSS (.elementor-kit-6 h1)
	   targets the bare <h1> element + a class, giving it higher specificity
	   than a single class selector like ours — it was winning outright and
	   silently overriding every property here, including overflow-wrap/
	   word-break, which is why the text kept overflowing on narrow screens
	   even after adding them. */
	font-size:clamp(2rem,5vw,3rem) !important; font-weight:800 !important; line-height:1.12 !important;
	color:var(--tj-ink) !important; margin:0 !important;
	overflow-wrap:break-word !important; word-break:break-word !important; /* long/compound words (Norwegian) wrap instead of overflowing on narrow screens */
}
.tjeneste-hero-lead{ font-size:1.15rem !important; color:var(--tj-muted) !important; max-width:680px; margin:0 !important; overflow-wrap:break-word !important; }

/* Hero meta (Kunde / Sted / År) */
.tjeneste-hero-meta{ display:flex; flex-wrap:wrap; gap:12px 32px; margin:0; padding:0; list-style:none;     background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .22);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
	padding: 16px 6px;
	border-radius: 14px;
    box-shadow: 0 10px 30px rgba(12, 22, 32, .18);width: fit-content;}
.tjeneste-hero-meta li{ display:flex; gap:10px; padding: 2px 26px; align-items: center;}
.tjeneste-hero-meta li + li {
    border-left: 1px solid rgba(255,255,255,.25);
}
.tjeneste-hero-meta-label{ font-size:12px; letter-spacing:.05em; text-transform:uppercase; font-weight:700; color:var(--tj-muted); }
.tjeneste-hero-meta-value{ font-size:17px; font-weight:600; line-height:1.3; color:var(--tj-ink); }
.tjeneste-hero-cta{ margin-top:6px;align-self: flex-start; }

/* Light vs. image/blue (white) text
   !important here too: the base .tjeneste-hero-title/-lead rules above now
   carry !important (needed to beat Elementor's global kit h1 CSS), which
   would otherwise also beat THIS higher-specificity override and leave the
   title/lead dark-colored (illegible) on image/blue hero backgrounds. */
.tjeneste-hero.has-image .tjeneste-hero-title,
.tjeneste-hero.is-blue .tjeneste-hero-title{ color:#fff !important; }
.tjeneste-hero.has-image .tjeneste-hero-lead,
.tjeneste-hero.is-blue .tjeneste-hero-lead{ color:rgba(255,255,255,.92) !important; }
.tjeneste-hero.has-image .tjeneste-hero-meta-label,
.tjeneste-hero.is-blue .tjeneste-hero-meta-label{ color:rgba(255,255,255,.78); }
.tjeneste-hero.has-image .tjeneste-hero-meta-value,
.tjeneste-hero.is-blue .tjeneste-hero-meta-value{ color:#fff; }
.tjeneste-hero.is-blue .tjeneste-breadcrumbs,
.tjeneste-hero.is-blue .tjeneste-breadcrumbs a{ color:rgba(255,255,255,.85); }

@media (max-width:600px){ .tjeneste-hero{ height:440px; padding-top:56px; } }

/* Hero meta (Kunde/Sted/År) on narrow screens: the border-left divider
   between items only makes sense in a single horizontal row — once the
   list wraps, whichever item lands first on a new row keeps its
   border-left with nothing left to divide from, showing as a stray
   floating line. Stack it as one column instead, with a top-border
   divider between rows, which is the correct pattern for a vertical list. */
@media (max-width:600px){
	.tjeneste-hero-meta{
		flex-direction:column; flex-wrap:nowrap; align-items:stretch;
		width:100%; gap:0;
	}
	.tjeneste-hero-meta li{ padding:10px 20px; }
	.tjeneste-hero-meta li + li{
		border-left:none;
		border-top:1px solid rgba(255,255,255,.25);
	}
}

/* ---- Capabilities grid ---- */
.tjeneste-cap-grid{
	list-style:none; margin:0; padding:0;
	display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:22px;
}
.tjeneste-cap{
	background:#fff; border:1px solid var(--tj-border); border-radius:14px; padding:26px 24px;
}
.tjeneste-cap-icon{ display:inline-flex; margin-bottom:14px; }
.tjeneste-cap-icon img{ width:72px; height:72px; object-fit:contain; border-radius:10px; }
.tjeneste-cap-title{ font-size:1.05rem; font-weight:700; color:var(--tj-ink); margin:0 0 6px; }
.tjeneste-cap p{ color:var(--tj-muted); margin:0; font-size:.97rem; }

/* ---- Why us ---- */
.tjeneste-why-list{
	list-style:none; margin:0; padding:0;
	display:grid; grid-template-columns:1fr; gap:12px;
}
@media (min-width:760px){
	.tjeneste-why-list{ grid-template-columns:1fr 1fr; gap:16px; }
}
.tjeneste-why-item{
	display:flex; align-items:flex-start; gap:16px;
	padding:18px 20px;
	background:#fff;
	border:1px solid var(--tj-line);
	border-radius:12px;
	box-shadow:0 1px 3px rgba(24,31,37,.04);
	transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tjeneste-why-item:hover{
	transform:translateY(-2px);
	box-shadow:0 8px 20px rgba(24,31,37,.08);
	border-color:var(--tj-accent);
}
.tjeneste-why-mark{
	flex:0 0 auto; width:30px; height:30px; border-radius:50%;
	background:linear-gradient(135deg, var(--tj-accent), var(--tj-blue-dark));
	color:#fff;
	display:inline-flex; align-items:center; justify-content:center; margin-top:1px;
	box-shadow:0 3px 8px rgba(0,132,214,.28);
}
.tjeneste-why-mark svg{ width:15px; height:15px; }
.tjeneste-why-text{ color:var(--tj-ink); font-weight:500; line-height:1.5; }

/* Section background tint so the cards read clearly against the page */
.tjeneste-whyus{ background:var(--tj-bg);padding-top: 0; }

/* ---- Content blocks ---- */
.tjeneste-block{ display:grid; gap:36px; align-items:center; }
.tjeneste-block + .tjeneste-block{ margin-top:clamp(36px,5vw,56px); }
.tjeneste-block-media img{ width:100%; border-radius:14px; object-fit: contain;}
.tjeneste-block-body .tjeneste-h2{ margin-bottom:6px; }
.tjeneste-block-body .tjeneste-h2::after{ margin:12px 0 18px; }
.tjeneste-block-media,.tjeneste-block .tjeneste-block-media img{ height:100%; }
@media (min-width:860px){
	.tjeneste-block.layout-image-left,
	.tjeneste-block.layout-image-right{ grid-template-columns:1fr 1fr; }
	.tjeneste-block.layout-image-right .tjeneste-block-media{ order:2; height:100%; }
}
.tjeneste-block.no-image .tjeneste-block-body{ max-width:820px; }

/* ---- Process steps ---- */
.tjeneste-steps{ list-style:none; margin:0; padding:0; display:grid; gap:18px; }
.tjeneste-step{ display:flex;flex-direction: column; gap:18px; align-items:flex-start; background:#fff; border:1px solid var(--tj-border); border-radius:14px; padding:22px 24px; }
.tjeneste-step-num{
	flex:0 0 auto; width:40px; height:40px; border-radius:8px;
	background:var(--tj-accent); color:#fff; font-weight:800;
	display:inline-flex; align-items:center; justify-content:center;
}
.tjeneste-step-title{ font-size:1.08rem; font-weight:700; color:var(--tj-ink); margin:4px 0 6px; }
.tjeneste-step-body p{ color:var(--tj-muted); margin:0; }
@media (min-width:760px){
	.tjeneste-steps{ grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); }
}

/* ---- Gallery (masonry) ---- */
.tjeneste-gallery.gallery-masonry{ columns:3 260px; column-gap:16px; }
.tjeneste-gallery.gallery-masonry .tjeneste-gallery-item{ break-inside:avoid; margin:0 0 16px; }
.tjeneste-gallery.gallery-masonry .tjeneste-gallery-item img{
	width:100%; height:auto; border-radius:12px; box-shadow:0 8px 24px rgba(12,22,32,.08);
}

/* ---- Gallery carousel ---- */
.tjeneste-carousel{ position:relative; }
.tjeneste-carousel-track{
	display:flex; gap:16px; overflow-x:auto; scroll-snap-type:x mandatory;
	scroll-behavior:smooth; padding:4px 2px 10px;
	scrollbar-width:none; -ms-overflow-style:none;
}
.tjeneste-carousel-track::-webkit-scrollbar{ display:none; }

.tjeneste-slide{ flex:0 0 86%; max-width:560px; margin:0; scroll-snap-align:start; }
@media (min-width:620px){ .tjeneste-slide{ flex-basis:calc((100% - 16px) / 2); } }
@media (min-width:980px){ .tjeneste-slide{ flex-basis:calc((100% - 32px) / 3); } }
.tjeneste-slide img{
	width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:14px;
	box-shadow:0 8px 24px rgba(12,22,32,.08);
}

/* prev / next arrows */
.tjeneste-carousel-nav{
	position:absolute; top:50%; transform:translateY(-50%); z-index:3;
	width:46px; height:46px; border-radius:50% !important; padding: 0 !important; border:1px solid var(--tj-border);
	background:#fff; color:var(--tj-ink); cursor:pointer;
	display:flex; align-items:center; justify-content:center;
	box-shadow:0 8px 22px rgba(12,22,32,.14);
	transition:background .15s ease, color .15s ease, opacity .15s ease;
}
.tjeneste-carousel-nav:hover{ background:var(--tj-blue); color:#fff; border-color:var(--tj-blue); }
.tjeneste-carousel-nav svg{ width:20px; height:20px; }
.tjeneste-carousel-nav.prev{ left:-12px; }
.tjeneste-carousel-nav.next{ right:-12px; }
.tjeneste-carousel-nav[disabled]{ opacity:0; pointer-events:none; }
@media (max-width:980px){
	.tjeneste-carousel-nav.prev{ left:6px; }
	.tjeneste-carousel-nav.next{ right:6px; }
}
@media (max-width:620px){ .tjeneste-carousel-nav{ display:none; } }

/* ---- Video (YouTube playlist via shortcode) — shown first, gallery below ---- */
.tjeneste-video-wrap{ margin:0; }
.tjeneste-video-wrap + .tjeneste-gallery,
.tjeneste-video-wrap + .tjeneste-carousel{ margin-top:28px; }

/* ---- Related services ---- */
.tjeneste-related-grid{ display:grid; gap:22px; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); }
.tjeneste-card{
	display:flex; flex-direction:column; background:#fff; border:1px solid var(--tj-border);
	border-radius:14px; overflow:hidden; text-decoration:none; color:inherit;
	transition:box-shadow .15s ease, transform .15s ease;
}
.tjeneste-card:hover{ box-shadow:0 14px 30px rgba(12,22,32,.1); transform:translateY(-2px); }
.tjeneste-card-media{ display:block; aspect-ratio:16/10; background:var(--tj-bg); }
.tjeneste-card-media img{ width:100%; height:100%; object-fit:cover; }
.tjeneste-card-body{ padding:20px 22px; display:flex; flex-direction:column; gap:8px; justify-content: space-between;height: 100%;}
.tjeneste-card-title{ font-weight:700; font-size:1.1rem; color:var(--tj-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.tjeneste-card-excerpt{ color:var(--tj-muted); font-size:.95rem; }
.tjeneste-card-arrow{ color:var(--tj-accent); font-weight:700; margin-top:4px; }

/* ---- CTA ---- */
.tjeneste-cta-box{
	background:var(--tj-bg); border:1px solid var(--tj-border); border-radius:18px;
	padding:clamp(26px,4vw,44px); display:grid; gap:30px;
}
@media (min-width:920px){ .tjeneste-cta-box{ grid-template-columns:1fr 1fr; align-items:center; } }
.tjeneste-cta-text .tjeneste-h2{ margin-bottom:6px; }
.tjeneste-cta-text p{ color:var(--tj-muted); }
.tjeneste-cta-contact{ font-size:1.05rem; }
.tjeneste-cta-contact a{ color:var(--tj-blue); font-weight:700; text-decoration:none; }
.tjeneste-cta-contact a:hover{ text-decoration:underline; }
.tjeneste-cta-image{ margin:18px 0 0; }
.tjeneste-cta-image img{ border-radius:14px; width:100%; }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion:reduce){
	.tjeneste-btn,.tjeneste-card,.tjeneste-link-btn,.tjeneste-carousel-nav{ transition:none; }
	.tjeneste-carousel-track{ scroll-behavior:auto; }
}

/* ---- Card grid that stays card-sized with few/single items (auto-FILL, not -fit) ----
   Used by the portfolio archive/related grids + the Tjeneste "Referanser" section.
   The base .tjeneste-related-grid (services' "Andre tjenester") is left untouched. */
.pf-cards-grid{ display:grid; gap:22px; grid-template-columns:repeat(auto-fill,minmax(250px,285px)); justify-content:flex-start; }
@media (max-width:560px){ .pf-cards-grid{ grid-template-columns:1fr; } }

.pf-cards-grid .tjeneste-card{ max-width:295px; }
.pf-cards-grid .tjeneste-card-media img{ width:295px; height:280px; object-fit: cover;}

/* Card text stacks (title above excerpt, not run together on one line) */
.pf-cards-grid .tjeneste-card-title{ display:block; }
.pf-cards-grid .tjeneste-card-excerpt{ display:block; margin-top:4px; }

/* Blue brand placeholder when a card has no image */
.pf-cards-grid .tjeneste-card-media.is-placeholder{
	background:linear-gradient(135deg,#0084D6 0%,#00598f 100%);
	display:flex; align-items:center; justify-content:center;min-height: 280px;
}
.pf-cards-grid .tjeneste-card-media.is-placeholder::after{
	content:"markedsmateriell.no";
	color:rgba(255,255,255,.92); font-weight:800; font-size:.95rem; letter-spacing:.01em;
}
