/* =========================================================================
   Tandlægerne Vindinggård – tema-stilark
   Layout-/komponent-styling oven på theme.json.
   Farver hentes fra CSS-variabler defineret af theme.json (--wp--preset--color--*).
   ========================================================================= */

:root {
	--vg-sidebar-w: 248px;
	--vg-radius: 16px;
	--vg-radius-sm: 12px;
}

/* ---- "Spring til indhold"-link (skjult indtil tastatur-fokus) ---- */
.vg-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	padding: 0.75rem 1.25rem;
	background: var(--wp--preset--color--primary);
	color: #ffffff !important;
	border-radius: 0 0 var(--vg-radius-sm) 0;
	text-decoration: none;
}
.vg-skip-link:focus {
	left: 0;
}

/* Ingen luft over den grønne bjælke/sidebar.
   WordPress' "layout-flow" tilføjer automatisk margin-block-start: 1.5rem på
   flow-børn. På forsiden rammer det .vg-shell; på undersiderne rammer det
   .vg-shell__nav (template-delen). Vi nulstiller derfor begge dele + det
   første barn i shellen, så den grønne bjælke altid sidder helt i top. */
body { margin: 0; }
.wp-site-blocks { padding-top: 0; margin-top: 0; }
.wp-site-blocks > .vg-shell,
.vg-shell {
	margin-block-start: 0 !important;
	margin-top: 0 !important;
}
.vg-shell > .vg-shell__nav,
.vg-shell > .vg-skip-link,
.vg-shell > *:first-child {
	margin-block-start: 0 !important;
	margin-top: 0 !important;
}

/* ---- Grund-shell: fast grøn sidebar til venstre, indhold til højre ---- */
.vg-shell {
	display: grid;
	grid-template-columns: var(--vg-sidebar-w) 1fr;
	min-height: 100vh;
	align-items: stretch;
}

.vg-shell__main {
	min-width: 0; /* tillader at indhold krymper i grid */
	background: var(--wp--preset--color--surface);
	display: flex;
	flex-direction: column;
}

.vg-shell__main .vg-page {
	flex: 1 0 auto;
	width: 100%;
}

/* =========================================================================
   SIDEBAR
   ========================================================================= */
.vg-shell__nav {
	position: sticky;
	top: 0;
	align-self: start;
	height: 100vh;
	max-height: 100vh;
	overflow-y: auto; /* lange menuer kan scrolle i stedet for at blive klippet */
}

.vg-sidebar {
	min-height: 100%;
	box-sizing: border-box;
}

.vg-sidebar .vg-brand {
	margin-bottom: 0.5rem;
	align-items: center; /* centrér logo + titel i sidebaren */
	text-align: center;
}

.vg-logo {
	width: 56px;
	height: 56px;
	background: url("../images/tooth-logo.svg") center / contain no-repeat;
}

.vg-site-title,
.vg-site-title a {
	color: var(--wp--preset--color--on-primary) !important;
	text-decoration: none;
	text-align: center;
}

/* Navigation som lodret liste af "pille"-knapper */
.vg-nav {
	width: 100%;
}

.vg-nav .wp-block-navigation__container {
	flex-direction: column;
	align-items: stretch;
	gap: 0.35rem;
	width: 100%;
}

.vg-nav .wp-block-navigation-item {
	width: 100%;
}

.vg-nav .wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	width: 100%;
	box-sizing: border-box;
	min-height: 44px; /* tilstrækkeligt tryk-mål */
	padding: 0.7rem 0.9rem;
	border-radius: var(--vg-radius-sm);
	color: #ffffff !important; /* fuld hvid -> bedre kontrast (WCAG) */
	font-weight: 500;
	transition: background-color 0.15s ease;
}

.vg-nav .wp-block-navigation-item__content:hover {
	background: rgba(255, 255, 255, 0.14);
	text-decoration: none;
}

/* Tydelig fokus-markering for tastatur-brugere */
.vg-nav .wp-block-navigation-item__content:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
	background: rgba(255, 255, 255, 0.14);
	text-decoration: none;
}

/* Aktiv side fremhæves med lys baggrund.
   Navigation-blokken sætter aria-current="page" på det aktive link. */
.vg-nav .wp-block-navigation-item__content[aria-current="page"],
.vg-nav .current-menu-item > .wp-block-navigation-item__content {
	background: rgba(255, 255, 255, 0.20);
	color: #fff !important;
}

/* Ikon foran hvert menupunkt – bundet til stabile klasser, så det IKKE
   flytter sig, hvis menupunkter omarrangeres eller tilføjes i WordPress. */
.vg-nav .wp-block-navigation-item__content::before {
	content: "";
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	background-color: currentColor;
	-webkit-mask: var(--vg-nav-ico) center / contain no-repeat;
	mask: var(--vg-nav-ico) center / contain no-repeat;
}

/* Skjul ikon-pladsen for menupunkter uden et tildelt ikon (undgår fyldt firkant) */
.vg-nav .wp-block-navigation-item:not([class*="nav-"]) .wp-block-navigation-item__content::before {
	display: none;
}

.vg-nav .nav-forside      > .wp-block-navigation-item__content::before { --vg-nav-ico: url("../images/icons/home.svg"); }
.vg-nav .nav-behandlere   > .wp-block-navigation-item__content::before { --vg-nav-ico: url("../images/icons/user.svg"); }
.vg-nav .nav-behandlinger > .wp-block-navigation-item__content::before { --vg-nav-ico: url("../images/icons/tooth.svg"); }
.vg-nav .nav-priser       > .wp-block-navigation-item__content::before { --vg-nav-ico: url("../images/icons/tag.svg"); }
.vg-nav .nav-om-os        > .wp-block-navigation-item__content::before { --vg-nav-ico: url("../images/icons/info.svg"); }
.vg-nav .nav-kontakt      > .wp-block-navigation-item__content::before { --vg-nav-ico: url("../images/icons/phone.svg"); }

/* =========================================================================
   FOKUS-MARKERING (tilgængelighed) – på lyst indhold bruges den grønne
   ========================================================================= */
.vg-shell__main a:focus-visible,
.vg-shell__main .wp-element-button:focus-visible,
.wp-element-button:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

/* =========================================================================
   GENERELLE TEKST-HJÆLPERE
   ========================================================================= */
.vg-muted { color: var(--wp--preset--color--muted) !important; }
.vg-lead  { color: var(--wp--preset--color--text); }
.vg-eyebrow { letter-spacing: 0.01em; margin-bottom: 0; }

.vg-sep {
	border: none;
	border-top: 1px solid var(--wp--preset--color--border);
	height: 0;
	opacity: 1;
}

.vg-breadcrumb a { color: var(--wp--preset--color--muted); }
.vg-breadcrumb a:hover { color: var(--wp--preset--color--primary); }

/* =========================================================================
   HERO (forside)
   ========================================================================= */
.vg-hero { align-items: center; }

.vg-hero-img img {
	width: 100%;
	height: auto;
	display: block;
}

/* Telefon-knap med ikon */
.vg-btn-call .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
}

.vg-ico-phone-btn {
	width: 18px;
	height: 18px;
	display: inline-block;
	background: currentColor;
	-webkit-mask: url("../images/icons/phone.svg") center / contain no-repeat;
	mask: url("../images/icons/phone.svg") center / contain no-repeat;
}

/* =========================================================================
   IKON-CIRKLER (genbruges i kort, behandlinger, footer)
   ========================================================================= */
.vg-ico {
	display: inline-block;
	background-color: var(--wp--preset--color--primary);
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: contain;
	mask-size: contain;
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	vertical-align: middle;
}

.vg-ico-clock  { -webkit-mask-image: url("../images/icons/clock.svg");  mask-image: url("../images/icons/clock.svg"); }
.vg-ico-pin    { -webkit-mask-image: url("../images/icons/pin.svg");    mask-image: url("../images/icons/pin.svg"); }
.vg-ico-phone  { -webkit-mask-image: url("../images/icons/phone.svg");  mask-image: url("../images/icons/phone.svg"); }
.vg-ico-mail   { -webkit-mask-image: url("../images/icons/mail.svg");   mask-image: url("../images/icons/mail.svg"); }

/* =========================================================================
   FORSIDE-KORT (3 genveje)
   ========================================================================= */
.vg-feature {
	gap: 0.9rem;
	align-items: flex-start;
}

.vg-feature__ico {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background-color: var(--wp--preset--color--accent-soft);
	-webkit-mask: none;
	mask: none;
	position: relative;
}

.vg-feature__ico::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 22px;
	height: 22px;
	background-color: var(--wp--preset--color--primary);
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: contain;
	mask-size: contain;
}

.vg-ico-team.vg-feature__ico::after  { -webkit-mask-image: url("../images/icons/team.svg");   mask-image: url("../images/icons/team.svg"); }
.vg-ico-tooth.vg-feature__ico::after { -webkit-mask-image: url("../images/icons/tooth.svg");  mask-image: url("../images/icons/tooth.svg"); }
.vg-ico-tag.vg-feature__ico::after   { -webkit-mask-image: url("../images/icons/tag.svg");    mask-image: url("../images/icons/tag.svg"); }

/* =========================================================================
   BEHANDLINGER (liste-rækker)
   ========================================================================= */
.vg-treat-list { border-top: 1px solid var(--wp--preset--color--border); }

.vg-treat {
	gap: 1.25rem;
	align-items: center;
	padding: 1.4rem 0.25rem;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.vg-treat__ico {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background-color: var(--wp--preset--color--primary-light);
	position: relative;
	-webkit-mask: none;
	mask: none;
}

.vg-treat__ico::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 30px;
	height: 30px;
	background-color: var(--wp--preset--color--primary);
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: contain;
	mask-size: contain;
}

.vg-ico-tooth.vg-treat__ico::after   { -webkit-mask-image: url("../images/icons/tooth.svg");   mask-image: url("../images/icons/tooth.svg"); }
.vg-ico-filling.vg-treat__ico::after { -webkit-mask-image: url("../images/icons/filling.svg"); mask-image: url("../images/icons/filling.svg"); }
.vg-ico-crown.vg-treat__ico::after   { -webkit-mask-image: url("../images/icons/crown.svg");   mask-image: url("../images/icons/crown.svg"); }
.vg-ico-implant.vg-treat__ico::after { -webkit-mask-image: url("../images/icons/implant.svg"); mask-image: url("../images/icons/implant.svg"); }
.vg-ico-extract.vg-treat__ico::after { -webkit-mask-image: url("../images/icons/extract.svg"); mask-image: url("../images/icons/extract.svg"); }
.vg-ico-sparkle.vg-treat__ico::after { -webkit-mask-image: url("../images/icons/sparkle.svg"); mask-image: url("../images/icons/sparkle.svg"); }

.vg-treat__body { flex: 1 1 auto; }

/* =========================================================================
   KONTAKT-KORT / KORT
   ========================================================================= */
.vg-card {
	background: var(--wp--preset--color--surface-alt);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--vg-radius);
	position: sticky;
	top: 2rem;
}

.vg-hours-box { border-radius: var(--vg-radius-sm); }

/* Kontakt-lister med ikon */
.vg-contact-list { list-style: none; padding: 0; margin: 0; }

.vg-contact-list li {
	display: flex;
	align-items: flex-start; /* ikon bliver foroven når lang tekst ombrydes */
	gap: 0.7rem;
	padding: 0.4rem 0;
	min-width: 0;
}

.vg-contact-list a {
	color: var(--wp--preset--color--text);
	overflow-wrap: anywhere; /* lange e-mails giver ikke vandret scroll */
	min-width: 0;
}
.vg-contact-list a:hover { color: var(--wp--preset--color--primary); }

/* ikonet skal stå pænt på linje med første tekstlinje */
.vg-contact-list .vg-ico { margin-top: 0.15rem; }

/* Åbningstids-tabel uden ramme */
.vg-hours table { width: 100%; border-collapse: collapse; }
.vg-hours td { border: none; padding: 0.2rem 0; }
.vg-hours td:last-child { text-align: right; white-space: nowrap; color: var(--wp--preset--color--text); }

.vg-foot-head { align-items: center; }
.vg-foot-head .vg-ico { background-color: var(--wp--preset--color--primary); }

/* =========================================================================
   FOOTER
   ========================================================================= */
.vg-footer { border-top: 1px solid var(--wp--preset--color--border); }
.vg-footer .vg-ico { width: 18px; height: 18px; }

/* =========================================================================
   RESPONSIVT: sidebar bliver til en slank topbjælke med burgermenu
   ========================================================================= */
@media (max-width: 900px) {
	.vg-shell {
		grid-template-columns: 1fr;
	}

	.vg-shell__nav {
		position: sticky;
		top: 0;
		z-index: 100;
		height: auto;
		max-height: none;
		overflow: visible;
	}

	/* Grøn topbjælke: logo/titel til venstre, burger til højre */
	.vg-sidebar {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		flex-wrap: nowrap;
		gap: 1rem;
		padding-top: var(--wp--preset--spacing--20) !important;
		padding-bottom: var(--wp--preset--spacing--20) !important;
	}

	.vg-brand {
		flex-direction: row !important;
		align-items: center;
		gap: 0.6rem;
		margin-bottom: 0;
		flex: 0 1 auto;
		min-width: 0;
	}

	.vg-logo { width: 40px; height: 40px; }

	/* Navigationen må kun fylde det burgeren kræver – ikke strække sig,
	   så burger-knappen sidder yderst til højre uden tomrum. */
	.vg-nav {
		width: auto !important;
		flex: 0 0 auto;
		margin-left: auto;
	}

	/* Burger-knappen (leveres af WordPress' Navigation-blok) */
	.vg-nav .wp-block-navigation__responsive-container-open,
	.vg-nav .wp-block-navigation__responsive-container-close {
		display: flex;
		align-items: center;
		justify-content: center;
		min-width: 44px;
		min-height: 44px;
		color: var(--wp--preset--color--on-primary);
	}

	.vg-nav .wp-block-navigation__responsive-container-open:focus-visible,
	.vg-nav .wp-block-navigation__responsive-container-close:focus-visible {
		outline: 2px solid #ffffff;
		outline-offset: 2px;
	}

	/* Når menuen er åben: lodret liste igen, fuld bredde, grøn baggrund */
	.vg-nav .wp-block-navigation__responsive-container.is-menu-open {
		padding: 1.25rem;
	}

	.vg-nav .is-menu-open .wp-block-navigation__container {
		flex-direction: column;
		align-items: stretch;
		gap: 0.4rem;
	}

	.vg-nav .is-menu-open .wp-block-navigation-item { width: 100%; }

	.vg-nav .is-menu-open .wp-block-navigation-item__content {
		color: #ffffff !important;
		font-size: 1.15rem;
	}

	/* Hero: tekst FØRST, billede mindre så "Ring"-knappen ses uden at scrolle */
	.vg-hero { flex-direction: column; }
	.vg-hero .wp-block-column { flex-basis: 100% !important; }
	.vg-hero-img img {
		max-height: 220px;
		width: auto;
		margin-left: auto;
		margin-right: auto;
	}

	/* Stablede kolonner: undgå kæmpe lodret mellemrum fra blockGap */
	.vg-hero,
	.vg-treat-layout { gap: var(--wp--preset--spacing--40) !important; }

	.vg-treat-layout { flex-wrap: wrap; }
	.vg-treat-layout .wp-block-column { flex-basis: 100% !important; }

	.vg-card { position: static; }

	/* Lidt mindre luft i top/bund af sider på mobil */
	.vg-page {
		padding-top: var(--wp--preset--spacing--50) !important;
		padding-bottom: var(--wp--preset--spacing--50) !important;
	}
}

/* =========================================================================
   REDUCERET BEVÆGELSE (respekter brugerens systemvalg)
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.001ms !important;
		animation-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

/* =========================================================================
   EDITOR-JUSTERINGER (så redigering ligner frontend)
   ========================================================================= */
.editor-styles-wrapper .vg-shell { min-height: auto; }
