/**
 * Front page ("Sākums") styles.
 * Recreates the tna.lv homepage look: hero, 3 service pillars,
 * recent-projects grid, and a short "Par mums" intro.
 */

:root {
	--tna-blue: #044a88;
	--tna-orange: #ff3700;
}

/* Breaks a section out of Astra's .ast-container to span the full
   viewport width, regardless of the theme's content max-width/padding. */
.tna-hero,
.tna-pillars,
.tna-about {
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	width: 100vw;
}

/* Hero
------------------------------------------------------------ */

.tna-hero {
	min-height: 420px;
	display: flex;
	align-items: center;
	/* tna.lv's title block sits left-aligned within the header's normal
	   content column, not centred.
	   No flat dark gradient over the photo here (there used to be one,
	   rgba(4,20,40,0.45)) -- user-reported: with the header/hero crop
	   now pixel-aligned (cb17f64), that overlay made the two look like
	   different images again, just for a different reason -- the tile
	   row's photo is unfiltered (just a light semi-transparent grey
	   tint) while this band was flatly darkened all over. Legibility
	   for the white title/subtitle now comes from text-shadow alone
	   (beefed up below) rather than tinting the whole photo. */
	background-image:
		url( '../images/header-dot.png'),
		url( '../images/hero.jpg' );
	/* Photo layer MUST use the exact same background-size percentage as
	   #masthead's own (175%), not "cover" -- "cover" computes its own
	   independent scale from this section's own (much taller) box,
	   which is a DIFFERENT scale than #masthead's, so no pixel offset
	   could ever align them exactly (tried that, user correctly caught
	   it: "bildes nesaplūst vienā" -- the images don't merge into one).
	   Since both #masthead and this section are full-bleed (100vw) and
	   background-size percentages are relative to the element's OWN box
	   width, using the SAME percentage on both guarantees the SAME
	   scale (px-per-source-pixel) on both, regardless of their very
	   different heights -- only then does a plain pixel offset actually
	   continue the same image exactly, rather than approximate it. */
	background-size:auto, 175% auto;
	/* -245px -808px continues EXACTLY where #masthead's own window ends
	   (position -245px -663px, box height 144.5px -> -663-144.5 =
	   -807.5, rounded -808px) -- same X so the horizontal crop lines up
	   too, not just Y. Recalculate together with #masthead's own values
	   if either changes -- see header.css. */
	background-position:left top,
			 -245px -290px;
	background-repeat: repeat, no-repeat;
	padding: 40px 20px;
}

.tna-hero__inner {
	max-width: 1320px;
	width: 100%;
	margin: 0 auto;
	padding: 0 20px;
	box-sizing: border-box;
	text-align: left;
}

/* Both of these used a solid "chip" background behind the text at one
   point (guaranteed contrast, verified 12.9:1/14.6:1) -- user-reported
   it read as a crude rectangular text box (Paint-style), not part of
   the design. Replaced with a heavy multi-direction text-outline
   instead: four small tight shadows (one per side) form a solid dark
   edge hugging each glyph, plus two soft wider glows for depth -- no
   background shape at all, just outlined white letters. This is a
   real trade-off, not a free win: unlike the chip, an outline this
   strong is NOT counted toward WCAG 1.4.3's 4.5:1 contrast ratio by
   the spec (or by axe-core) no matter how solid it looks, so this
   knowingly reintroduces the contrast gap the chip closed (sampling
   found ~1.2:1 against the photo's brightest patches). Kept because
   the user explicitly chose this trade-off after that was explained. */
.tna-hero__title {
	color: #fff;
	text-transform: uppercase;
	font-weight: 700;
	font-size: 2.6em;
	letter-spacing: 0.04em;
	margin: 0 0 0.3em;
	text-shadow:
		-1.5px -1.5px 1px rgba( 0, 0, 0, 0.85 ),
		1.5px -1.5px 1px rgba( 0, 0, 0, 0.85 ),
		-1.5px 1.5px 1px rgba( 0, 0, 0, 0.85 ),
		1.5px 1.5px 1px rgba( 0, 0, 0, 0.85 ),
		0 2px 6px rgba( 0, 0, 0, 0.75 ),
		0 0 22px rgba( 0, 0, 0, 0.6 );
}

.tna-hero__subtitle {
	color: #fff;
	font-size: 1.25em;
	margin: 0;
	text-shadow:
		-1.5px -1.5px 1px rgba( 0, 0, 0, 0.85 ),
		1.5px -1.5px 1px rgba( 0, 0, 0, 0.85 ),
		-1.5px 1.5px 1px rgba( 0, 0, 0, 0.85 ),
		1.5px 1.5px 1px rgba( 0, 0, 0, 0.85 ),
		0 2px 6px rgba( 0, 0, 0, 0.75 ),
		0 0 18px rgba( 0, 0, 0, 0.6 );
}

/* Pillars
------------------------------------------------------------ */

.tna-pillars {
	background: #f3f3f3;
}

.tna-pillars__row {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
}

.tna-pillars__item {
	flex: 1 1 0;
	min-width: 220px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 45px 25px;
	text-decoration: none;
	border-top: 4px solid transparent;
	transition: background-color 0.3s ease, border-color 0.3s ease;
}

.tna-pillars__item:not(:last-child) {
	border-right: 1px solid #c9c9c9;
}

.tna-pillars__item:hover,
.tna-pillars__item:focus {
	background-color: #e9e9e9;
	border-top-color: var( --tna-orange );
}

.tna-pillars__icon {
	height: 65px;
	width: auto;
	margin-bottom: 18px;
}

.tna-pillars__title {
	margin: 0;
	color: var( --tna-blue );
	text-transform: uppercase;
	font-size: 1em;
	font-weight: 600;
	line-height: 1.3;
	transition: color 0.3s ease;
}

.tna-pillars__item:hover .tna-pillars__title,
.tna-pillars__item:focus .tna-pillars__title {
	color: var( --tna-orange );
}

/* Projects
------------------------------------------------------------ */

.tna-projects {
	max-width: 1200px;
	margin: 0 auto;
	padding: 60px 20px;
}

.tna-projects__title {
	text-align: center;
	color: var( --tna-blue );
	text-transform: uppercase;
	font-weight: 700;
	margin: 0 0 40px;
}

.tna-projects__grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
	gap: 25px;
}

.tna-projects__item {
	display: block;
	text-decoration: none;
	color: inherit;
	overflow: hidden;
	border-bottom: 4px solid transparent;
	transition: border-color 0.3s ease;
}

.tna-projects__item:hover,
.tna-projects__item:focus {
	border-bottom-color: var( --tna-orange );
}

.tna-projects__image {
	height: 200px;
	overflow: hidden;
}

.tna-projects__image img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.tna-projects__item:hover .tna-projects__image img,
.tna-projects__item:focus .tna-projects__image img {
	transform: scale( 1.08 );
}

.tna-projects__item-title {
	margin: 15px 0 0;
	font-size: 1em;
	font-weight: 600;
	color: var( --tna-blue );
	line-height: 1.4;
}

.tna-projects__empty {
	text-align: center;
	color: #777;
}

/* About intro
------------------------------------------------------------ */

.tna-about {
	background: #f3f3f3;
	padding: 60px 20px;
}

.tna-about__inner {
	max-width: 800px;
	margin: 0 auto;
	text-align: center;
}

.tna-about__title {
	color: var( --tna-blue );
	text-transform: uppercase;
	font-weight: 700;
	margin: 0 0 20px;
}

.tna-about__text {
	color: #333;
	line-height: 1.6;
	margin-bottom: 20px;
}

.tna-about__link {
	display: inline-block;
	color: #fff;
	background: var( --tna-blue );
	text-decoration: none;
	padding: 12px 28px;
	text-transform: uppercase;
	font-weight: 600;
	font-size: 0.9em;
	letter-spacing: 0.03em;
	transition: background-color 0.3s ease;
}

.tna-about__link:hover,
.tna-about__link:focus {
	background: var( --tna-orange );
	color: #fff;
}

/* Responsive
------------------------------------------------------------ */

/* The 175%/-245px/-526px values above only hold at #masthead's desktop
   scale -- #masthead reverts to plain "cover" once the 920px mobile
   nav breakpoint kicks in (see header.css), so match that here too
   rather than carry over now-meaningless desktop pixel values. */
@media ( max-width: 920px ) {
	.tna-hero {
		background-size: cover;
		background-position: center top;
	}
}

@media ( max-width: 720px ) {
	.tna-hero {
		min-height: 300px;
	}

	.tna-hero__title {
		font-size: 1.8em;
	}

	.tna-pillars__row {
		flex-direction: column;
	}

	.tna-pillars__item:not(:last-child) {
		border-right: none;
		border-bottom: 1px solid #c9c9c9;
	}

	.tna-projects__grid {
		grid-template-columns: 1fr;
	}
}

/* See the long note in templates.css. */
.tna-hero {
	background-size: auto, cover;
	background-position: left top, center center;
	background-repeat: repeat, no-repeat;
}

/* Same band as .tna-page-hero. */
.tna-hero {
	background-position: left top, center 30%;
}

/* Same treatment as .tna-page-hero -- see the note in header.css. */
.tna-hero {
	margin-top: calc(-1 * var(--tna-header-h, 150px));
	padding-top: var(--tna-header-h, 150px);
	background-image: url('../images/hero.jpg');
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center 30%;
}

/* Same as .tna-page-hero. */
.tna-hero {
	background-position: center top;
}

/* Same as .tna-page-hero. */
@media screen and (min-width: 921px) {
	.tna-hero {
		background-size: 135% auto;
		background-position: center top;
	}
}

/* Same as .tna-page-hero -- dots over the photo across the whole band. */
@media screen and (min-width: 921px) {
	.tna-hero {
		background-size: auto, 135% auto;
		background-position: left top, center top;
	}
}

/* Final word on the front-page hero.

   The rules above accumulated while the crop was being tuned, and one
   of them sets a single background-size on a two-layer background --
   which lands on the dot texture and leaves the photo unsized, so it
   stopped short of the element's right edge. Both layers get a value
   here, dots then photo, and the photo covers. */
.tna-hero {
	background-image:
		url('../images/header-dot.png'),
		url('../images/hero.jpg');
	background-repeat: repeat, no-repeat;
	background-size: auto, cover;
	background-position: left top, center top;
}
