/* css/nisim/pages/contact.css - page "contact" (view/pages/contact.tpl, design "tsor kesher"). Owner: contact.
   Shared components from base.css, used as they are: .nis-pagehero (+ __bg __in __title __lead, breadcrumbs as the
   last child of __in), .nis-kicker, .nis-b, .nis-ltr, .nis-on-navy, .nis-contact --flush (+ __head, __cms, __line,
   __line--soft, __social), .nis-iconbtn --social, .nis-map, .nis-formpanel (+ __title __text __note), the automatic
   lead-form styles, .nis-field__label, .nis-vh, @keyframes nisUp.
   Page blocks defined here: .nis-con, .nis-con__*, .nis-con-branch*, .nis-con-rows.
   js/nisim/contact.js turns the free CMS rows of the two branches into the design's icon rows: it adds
   data-nis-row="phone|mobile|fax|address|mail|hours|whatsapp|other" to every row, the class is-tagged to the text
   box and the class nis-con-rows to the parent of the rows, moves "label:" into a span.nis-vh and gives .nis-vh to a
   branch e-mail row that repeats the shared e-mail line. Without the script the rows keep their labels and get the
   icons by position (fallback look, nothing is hidden). The script also prints the field captions of the lead form
   (label.nis-field__label) and sets --nis-con-sub-w on the submit wrapper (data-nis-sub).
   Minifier-safe: one declaration per line, single spaces, no data URIs, no template braces. */

/* ---- section (design: navy-deep ground shared with the footer; the two columns are top aligned) */
.nis-con {
	padding: clamp(40px, 4.4vw, 68px) var(--nis-gutter) clamp(56px, 6vw, 90px);
	background: var(--nis-navy-deep);
}
.nis-con__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: clamp(36px, 4vw, 72px);
	align-items: start;
}
.nis-con__info {
	min-width: 0;
}

/* ---- CMS photo (xtag contactimg, 640x200). Legacy-image bridge: the design shows no photo, so the file that is
   uploaded today stays in the DOM but takes no space; any other upload is shown as a rounded photo above the branches */
.nis-con__photo {
	position: relative;
	line-height: 0;
}
.nis-con__photo img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 5;
	object-fit: cover;
	margin-bottom: 26px;
	border: 1px solid var(--nis-line-gold);
	border-radius: var(--nis-r-card);
}
.nis-con__photo img[src$="יצירת-קשר.jpg"],
.nis-con__photo img[src$="/media/main/"] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	border: 0;
	opacity: 0;
	pointer-events: none;
}

/* ---- branches: a 2-row grid shared by both branches (row 1 = CMS text, row 2 = map), so the two maps start on the
   same line whatever the text heights are (the design pushes them down with margin-top: auto);
   .nis-con-branch is display:contents (its two children are the cells) */
.nis-con__branches {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	grid-template-rows: auto auto;
	column-gap: clamp(24px, 3vw, 44px);
}
.nis-con-branch {
	display: contents;
}

/* ---- branch text = free CMS html (fields contactinfo, contactinfo2) on top of the shared .nis-contact__cms:
   nested div rows with strong labels. Structure A: div(name) + div(rows wrapper) + p. Structure B: div(wrapper:
   name row + rows) + p. */
.nis-con-branch__text {
	grid-row: 1;
	min-width: 0;
	line-height: 1.55;
	overflow-wrap: anywhere;
	text-wrap: pretty;
}
.nis-con-branch__text:empty {
	display: none;
}
.nis-con-branch__text p {
	margin: 13px 0 0;
}
/* the editor's trailing empty paragraph: one 20px line pulled back by 20px = no gap; real text typed there stays readable */
.nis-con-branch__text > p:last-child {
	margin: 0 0 -20px;
	line-height: 20px;
}
/* row label (visible only without the script): gold (shared look) unless the row carries an icon, then the icon is
   the accent and the label steps back */
.nis-con-branch__text strong {
	color: var(--nis-con-label, var(--nis-gold-sand));
	font-weight: var(--nis-con-label-w, 500);
}
/* branch name = the first leaf row (values of .nis-contact__label) */
.nis-con-branch__text > div:first-child {
	color: var(--nis-gold-sand);
	font-size: 12.5px;
	font-weight: 500;
	letter-spacing: var(--nis-ls-label);
}
.nis-con-branch__text > div:first-child > strong,
.nis-con-branch__text > div:first-child > div:first-child > strong {
	color: inherit;
	font-weight: inherit;
}
/* structure B: rows 2..n of the first wrapper go back to the row type */
.nis-con-branch__text > div:first-child > div + div {
	color: var(--nis-on-navy);
	font-size: 15.5px;
	font-weight: 300;
	letter-spacing: 0;
}
/* rhythm: 16px under the branch name, 13px between rows */
.nis-con-branch__text > div + div {
	margin-top: 16px;
}
.nis-con-branch__text:not(.is-tagged) > div > div + div {
	margin-top: 13px;
}
.nis-con-branch__text:not(.is-tagged) > div:first-child > div:first-child + div {
	margin-top: 16px;
}

/* ---- row icons (design: 19px gold-sand glyph, 13px gap). Two sources, same glyphs:
   1. contact.js reads the label of every row and sets data-nis-row (any order, any number of rows);
   2. before / without the script: by position, and only while the block has exactly the 4 rows of today
      (phone, fax, address, e-mail) - one more or one less row and no selector matches: rows without icons. */
.nis-con-branch__text [data-nis-row],
.nis-con-branch__text:not(.is-tagged) > div:first-child + div > div:first-child:nth-last-child(4),
.nis-con-branch__text:not(.is-tagged) > div:first-child + div > div:nth-child(2):nth-last-child(3),
.nis-con-branch__text:not(.is-tagged) > div:first-child + div > div:nth-child(3):nth-last-child(2),
.nis-con-branch__text:not(.is-tagged) > div:first-child + div > div:nth-child(4):last-child,
.nis-con-branch__text:not(.is-tagged) > div:first-child > div:nth-child(2):nth-last-child(4),
.nis-con-branch__text:not(.is-tagged) > div:first-child > div:nth-child(3):nth-last-child(3),
.nis-con-branch__text:not(.is-tagged) > div:first-child > div:nth-child(4):nth-last-child(2),
.nis-con-branch__text:not(.is-tagged) > div:first-child > div:nth-child(5):last-child {
	--nis-con-label: var(--nis-on-navy-faint);
	--nis-con-label-w: 400;
	position: relative;
	padding-inline-start: 32px;
}
.nis-con-branch__text [data-nis-row]::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child + div > div:first-child:nth-last-child(4)::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child + div > div:nth-child(2):nth-last-child(3)::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child + div > div:nth-child(3):nth-last-child(2)::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child + div > div:nth-child(4):last-child::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child > div:nth-child(2):nth-last-child(4)::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child > div:nth-child(3):nth-last-child(3)::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child > div:nth-child(4):nth-last-child(2)::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child > div:nth-child(5):last-child::before {
	position: absolute;
	top: 3px;
	inset-inline-start: 0;
	color: var(--nis-gold-sand);
	font-family: 'Phosphor-Light';
	font-size: 19px;
	font-weight: normal;
	line-height: 1;
	letter-spacing: 0;
}
/* phone */
.nis-con-branch__text [data-nis-row="phone"]::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child + div > div:first-child:nth-last-child(4)::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child > div:nth-child(2):nth-last-child(4)::before {
	content: "\e3b8";
}
/* fax = printer; the number is dimmed like in the design (.72) */
.nis-con-branch__text [data-nis-row="fax"]::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child + div > div:nth-child(2):nth-last-child(3)::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child > div:nth-child(3):nth-last-child(3)::before {
	content: "\e3dc";
}
.nis-con-branch__text.is-tagged [data-nis-row="fax"],
.nis-con-branch__text:not(.is-tagged) > div:first-child + div > div:nth-child(2):nth-last-child(3),
.nis-con-branch__text:not(.is-tagged) > div:first-child > div:nth-child(3):nth-last-child(3) {
	color: rgba(247, 242, 234, .72);
}
/* address = map-pin */
.nis-con-branch__text [data-nis-row="address"]::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child + div > div:nth-child(3):nth-last-child(2)::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child > div:nth-child(4):nth-last-child(2)::before {
	content: "\e316";
}
/* e-mail = envelope-simple */
.nis-con-branch__text [data-nis-row="mail"]::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child + div > div:nth-child(4):last-child::before,
.nis-con-branch__text:not(.is-tagged) > div:first-child > div:nth-child(5):last-child::before {
	content: "\e218";
}
/* rows that only the script can tell (they do not exist in the CMS text today): mobile, opening hours, WhatsApp */
.nis-con-branch__text [data-nis-row="mobile"]::before {
	content: "\e1e0";
}
.nis-con-branch__text [data-nis-row="hours"]::before {
	content: "\e19a";
}
.nis-con-branch__text.is-tagged [data-nis-row="hours"] {
	color: var(--nis-on-navy-soft);
}
.nis-con-branch__text [data-nis-row="whatsapp"]::before {
	content: "\e5d0";
}

/* ---- tagged rows = the design's rows: icon + value (the script keeps "label:" for screen readers in a span.nis-vh),
   in the design's order whatever the order in the CMS text: address, phone(s), fax, then anything else.
   .nis-con-rows = the parent of the rows (set by the script; in a flat text it is the text box itself).
   A branch e-mail row that repeats the address of the shared e-mail line below gets .nis-vh from the script. */
.nis-con-branch__text.is-tagged .nis-con-rows,
.nis-con-branch__text.is-tagged.nis-con-rows {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 13px;
}
.nis-con-rows > [data-nis-row] {
	order: 8;
	margin-top: 0;
}
.nis-con-rows > [data-nis-row="address"] {
	order: 1;
	line-height: 1.6;
}
.nis-con-rows > [data-nis-row="phone"] {
	order: 2;
}
.nis-con-rows > [data-nis-row="mobile"] {
	order: 3;
}
.nis-con-rows > [data-nis-row="whatsapp"] {
	order: 4;
}
.nis-con-rows > [data-nis-row="fax"] {
	order: 5;
}
.nis-con-rows > [data-nis-row="mail"] {
	order: 6;
}
.nis-con-rows > [data-nis-row="hours"] {
	order: 7;
}
/* the branch name when it is the first row of the same parent (structure B, flat text): 13px gap + 3px = the design's 16px */
.nis-con-rows > div:first-child:not([data-nis-row]) {
	margin-bottom: 3px;
}
/* anything else in a flat text (the editor's trailing paragraph) goes after the rows */
.nis-con-rows > :not([data-nis-row]):not(:first-child) {
	order: 9;
}

/* ---- maps (fields map, map2 = a raw iframe with an inline border:0) inside the shared .nis-map: 170px, radius 14px,
   gold hairline, 20px above. No legacy "map" class: the embeds are interactive at once. */
.nis-con-branch__map {
	grid-row: 2;
	min-width: 0;
	margin-top: 0;
}
.nis-con-branch__map:empty {
	display: none;
}
.nis-con-branch__map iframe {
	background: rgba(247, 242, 234, .05);
}

/* ---- shared lines under the branches (shared .nis-contact__line), design values: 20px padding, .24 gold hairlines
   above the first line and under every line. E-mail, then opening hours (only when the CMS field contacthours is
   filled), then the social buttons (only the networks that have a link in the site settings: Facebook) */
.nis-con__line {
	padding: 20px 0;
	border-bottom-color: rgba(255, 255, 255, .24);
}
.nis-con__contact + .nis-con__line {
	margin-top: 26px;
	border-top: 1px solid rgba(255, 255, 255, .24);
}
.nis-con__line > a,
.nis-con__line > span:last-child {
	min-width: 0;
	line-height: 1.55;
	text-wrap: pretty;
}
.nis-con__social {
	margin-top: 30px;
}

/* ---- form panel (shared .nis-formpanel), values of this page's design: bold part of the title 500, sub-line
   muted grey with margins 22 / 40 (the shared default is the home panel's 28 / 44), message box 106px (4 rows).
   contact.js prints the field names as captions above the fields (label.nis-field__label, shared look) and turns the
   placeholders into the design's hints (lighter, shared "label + field" rule). */
.nis-con__form {
	position: relative;
}
.nis-con__form .nis-formpanel__title {
	--nis-b-weight: 500;
}
.nis-con__form .nis-formpanel__text {
	margin: 22px 0 40px;
	color: var(--nis-text-muted);
}
.nis-con__form textarea {
	min-height: 106px;
}
/* submit: the design centres label + arrow as one group (12px gap, 19px arrow). The label is moved 15.5px towards the
   start (31px more padding at the end) and the shared arrow is placed right after it; --nis-con-sub-w = width of the
   label, measured by contact.js. Without the script the shared look stays (arrow at the end edge). */
@supports selector(:has(*)) {
	.nis-con__form [data-nis-sub] > input[type="submit"] {
		padding-inline-end: 79px;
	}
	.nis-con__form [data-nis-sub]::after {
		inset-inline-end: calc(50% - (var(--nis-con-sub-w) + 31px) / 2);
	}
}

/* ---- entrance (decorative): shared keyframes nisUp with fill "backwards" - the hidden state exists only while the
   animation is pending, only under html.nis-js and only when motion is allowed */
@media (prefers-reduced-motion: no-preference) {
	html.nis-js .nis-pagehero__in > * {
		animation: nisUp .7s ease backwards;
	}
	html.nis-js .nis-pagehero__in > .nis-kicker {
		animation-delay: .06s;
	}
	html.nis-js .nis-pagehero__in > .nis-pagehero__title {
		animation-duration: .8s;
		animation-delay: .12s;
	}
	html.nis-js .nis-pagehero__in > .nis-pagehero__lead {
		animation-duration: .8s;
		animation-delay: .2s;
	}
	html.nis-js .nis-con__info {
		animation: nisUp .8s var(--nis-ease) .1s backwards;
	}
	html.nis-js .nis-con__form {
		animation: nisUp .8s var(--nis-ease) .2s backwards;
	}
}

/* ---- 1100 - 1249.98: the two branches stay side by side (2 x 220-250px: the long address takes two lines, as in
   the design) so the info column keeps the desktop look and about the height of the form */
@media (max-width: 1249.98px) {
	.nis-con__branches {
		column-gap: 30px;
	}
}
/* ---- <= 1099.98: the info column is too narrow for two branches side by side (the design's own auto-fit grid drops
   below 2 x 240px) -> one branch per row. 900 - 1099.98: text and map share the row (text at the start, map at the
   end, both top aligned), so the info column stays about as tall as the form */
@media (max-width: 1099.98px) {
	.nis-con__branches {
		grid-auto-flow: row;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
		grid-template-rows: none;
		gap: 34px 20px;
	}
	.nis-con-branch__text {
		grid-column: 1;
		grid-row: auto;
	}
	.nis-con-branch__map {
		grid-column: 2;
		grid-row: auto;
		padding-top: 0;
	}
}

/* ---- <= 899.98: the two page columns stack (info, then form) */
@media (max-width: 899.98px) {
	.nis-con__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}
/* 600 - 899.98: the full-width info column holds the two branches side by side again (desktop look: text row 1,
   map row 2) */
@media (min-width: 600px) and (max-width: 899.98px) {
	.nis-con__branches {
		grid-auto-flow: column;
		grid-auto-columns: minmax(0, 1fr);
		grid-template-columns: none;
		grid-template-rows: auto auto;
		gap: 0 clamp(24px, 3vw, 44px);
	}
	.nis-con-branch__text {
		grid-column: auto;
		grid-row: 1;
	}
	.nis-con-branch__map {
		grid-column: auto;
		grid-row: 2;
		padding-top: 20px;
	}
}

/* ---- <= 599.98: one column: text, map, text, map; phone spacing */
@media (max-width: 599.98px) {
	.nis-con__branches {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}
	.nis-con-branch__text,
	.nis-con-branch__map {
		grid-column: 1;
	}
	.nis-con-branch__map {
		padding-top: 20px;
	}
	.nis-con-branch + .nis-con-branch > .nis-con-branch__text {
		margin-top: 32px;
	}
	.nis-con__contact + .nis-con__line {
		margin-top: 28px;
	}
	.nis-con__social {
		margin-top: 26px;
	}
	.nis-con__form .nis-formpanel__text {
		margin: 16px 0 28px;
	}
}

/* ---- touch: 44px tap height for the phone and e-mail links without changing the row height */
@media (pointer: coarse) {
	.nis-con-branch__text a,
	.nis-con__line a {
		display: inline-block;
		margin: -10px 0;
		padding: 10px 0;
	}
}
