/*
Theme Name:   eInvoiceTool (GeneratePress child)
Theme URI:    https://einvoicetool.com/
Description:  Child theme for einvoicetool.com. Keep custom styles here so GeneratePress updates never overwrite them.
Author:       einvoicetool.com
Template:     generatepress
Version:      0.2.0
Text Domain:  einvoicetool
*/

/* ==========================================================================
   Design tokens
   Colours mirror the GeneratePress global colours (--contrast, --accent …)
   set in Customizer, so editor colour pickers and these styles stay in sync.
   ========================================================================== */

:root {
	--eit-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--eit-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
	--eit-radius: 10px;
	--eit-radius-sm: 6px;
	--eit-shadow: 0 1px 2px rgba(31, 41, 51, .06), 0 4px 16px rgba(31, 41, 51, .06);
	--eit-prose: 760px;
	--eit-wide: 1040px;
	--eit-space: clamp(2.5rem, 6vw, 4.5rem);
}

/* ==========================================================================
   Base typography
   ========================================================================== */

body,
button,
input,
select,
textarea {
	font-family: var(--eit-font);
}

body {
	font-size: 17px;
	line-height: 1.65;
	color: var(--contrast);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
	font-family: var(--eit-font);
	color: var(--contrast);
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: 1.2;
}

h1 { font-size: clamp(2rem, 4.2vw, 2.75rem); margin-bottom: .5em; }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin: 1.8em 0 .6em; }
h3 { font-size: 1.25rem; margin: 1.4em 0 .5em; }

code,
kbd,
pre {
	font-family: var(--eit-mono);
	font-size: .9em;
}

:not(pre) > code {
	background: var(--base-2);
	border: 1px solid var(--base);
	border-radius: 4px;
	padding: .1em .35em;
}

::selection {
	background: rgba(31, 78, 120, .15);
}

:focus-visible {
	outline: 3px solid rgba(31, 78, 120, .45);
	outline-offset: 2px;
}

/* ==========================================================================
   Layout: readable text column, wider tool area
   ========================================================================== */

.one-container .site-content {
	padding: var(--eit-space) 24px;
}

.entry-content > * {
	max-width: var(--eit-prose);
	margin-left: auto;
	margin-right: auto;
}

/* GeneratePress gives .alignwide negative side margins; centre it in our wide column instead. */
.site-main .entry-content > .alignwide {
	max-width: var(--eit-wide);
	width: auto;
	margin-left: auto;
	margin-right: auto;
}

.entry-content > .alignfull {
	max-width: none;
}

/* GeneratePress pads group inner containers by 40px; our components set their own spacing. */
.entry-content [class*="eit-"] > .wp-block-group__inner-container {
	padding: 0;
}

.page .entry-header {
	max-width: var(--eit-prose);
	margin: 0 auto 1.5rem;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
	border-bottom: 1px solid var(--base);
}

.site-header .inside-header {
	padding-top: 14px;
	padding-bottom: 14px;
}

.main-title {
	font-size: 1.3rem;
	font-weight: 750;
	letter-spacing: -0.02em;
	line-height: 1;
}

.main-title a {
	display: inline-flex;
	align-items: center;
	gap: .55rem;
	color: var(--contrast);
	text-decoration: none;
}

.main-title .eit-logo-mark {
	flex: none;
	width: 32px;
	height: 32px;
}

.main-title .eit-logo-accent {
	color: var(--accent);
}

.main-navigation .main-nav ul li a {
	font-size: .95rem;
	font-weight: 550;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.wp-block-button__link,
.eit-btn,
button,
input[type="submit"] {
	font-weight: 600;
	border-radius: var(--eit-radius-sm);
	transition: background-color .15s ease, box-shadow .15s ease;
}

.wp-block-button__link,
.eit-btn {
	background: var(--accent);
	color: var(--base-3);
	padding: .75em 1.4em;
	text-decoration: none;
	display: inline-block;
}

.wp-block-button__link:hover,
.wp-block-button__link:focus,
.eit-btn:hover,
.eit-btn:focus {
	background: var(--accent-hover);
	color: var(--base-3);
}

.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--accent);
	border: 2px solid currentColor;
}

/* ==========================================================================
   Hero (top of tool pages)
   ========================================================================== */

.eit-hero {
	text-align: center;
	padding-bottom: .5rem;
}

.eit-hero h1 {
	max-width: 22ch;
	margin-left: auto;
	margin-right: auto;
}

.eit-lead {
	font-size: 1.15rem;
	color: var(--contrast-2);
	max-width: 62ch;
	margin-left: auto;
	margin-right: auto;
}

.eit-badges {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .5rem 1.25rem;
	list-style: none;
	margin: 1rem auto 0;
	padding: 0;
	font-size: .92rem;
	color: var(--contrast-2);
}

.eit-badges li {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	margin: 0;
}

.eit-badges li::before {
	content: "";
	width: 1.1em;
	height: 1.1em;
	flex: none;
	background: var(--success);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 14.2L4.6 10l1.4-1.4 2.8 2.8 5.2-5.2 1.4 1.4-6.6 6.6z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 14.2L4.6 10l1.4-1.4 2.8 2.8 5.2-5.2 1.4 1.4-6.6 6.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ==========================================================================
   Tool area (the viewer plugin mounts inside .eit-tool)
   ========================================================================== */

.eit-tool {
	background: var(--base-3);
	border: 1px solid var(--base);
	border-radius: var(--eit-radius);
	box-shadow: var(--eit-shadow);
	padding: clamp(1rem, 3vw, 2rem);
	margin-top: 2rem;
	margin-bottom: 2.5rem;
}

/* ==========================================================================
   How it works (numbered steps)
   ========================================================================== */

ol.eit-steps {
	counter-reset: eit-step;
	list-style: none;
	padding: 0;
	margin-left: auto;
	margin-right: auto;
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

ol.eit-steps > li {
	counter-increment: eit-step;
	margin: 0;
	padding: 1.25rem 1.35rem;
	background: var(--base-2);
	border-radius: var(--eit-radius);
	font-size: .97rem;
}

ol.eit-steps > li strong {
	display: block;
	margin-bottom: .2rem;
}

ol.eit-steps > li::before {
	content: counter(eit-step);
	margin-bottom: .75rem;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--accent);
	color: var(--base-3);
	font-weight: 700;
	display: grid;
	place-items: center;
	font-size: .95rem;
}

/* ==========================================================================
   Notes (privacy, info, disclaimer)
   ========================================================================== */

.eit-note {
	border-left: 4px solid var(--accent);
	background: var(--base-2);
	border-radius: 0 var(--eit-radius-sm) var(--eit-radius-sm) 0;
	padding: 1rem 1.25rem;
	font-size: .97rem;
}

.eit-note > :last-child {
	margin-bottom: 0;
}

.eit-note--privacy {
	border-left-color: var(--success);
	background: #eef7ef;
}

.eit-note--muted {
	border-left-color: var(--contrast-3);
	color: var(--contrast-2);
	font-size: .9rem;
}

/* ==========================================================================
   FAQ (core Details blocks inside .eit-faq)
   ========================================================================== */

.eit-faq .wp-block-details {
	border: 1px solid var(--base);
	border-radius: var(--eit-radius-sm);
	padding: 0;
	margin: 0 0 .6rem;
	background: var(--base-3);
}

.eit-faq .wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
	padding: .9rem 2.75rem .9rem 1.1rem;
	position: relative;
	list-style: none;
}

.eit-faq .wp-block-details summary::-webkit-details-marker {
	display: none;
}

.eit-faq .wp-block-details summary::after {
	content: "+";
	position: absolute;
	right: 1.1rem;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.3rem;
	color: var(--accent);
	line-height: 1;
}

.eit-faq .wp-block-details[open] summary::after {
	content: "–";
}

.eit-faq .wp-block-details > :not(summary) {
	padding: 0 1.1rem;
}

.eit-faq .wp-block-details > :last-child {
	padding-bottom: 1rem;
	margin-bottom: 0;
}

/* ==========================================================================
   Cards (related tools / guides)
   ========================================================================== */

.eit-cards {
	gap: 1rem;
}

.eit-cards > .wp-block-column {
	background: var(--base-3);
	border: 1px solid var(--base);
	border-radius: var(--eit-radius);
	padding: 1.25rem 1.35rem;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.eit-cards > .wp-block-column:hover {
	border-color: var(--contrast-3);
	box-shadow: var(--eit-shadow);
}

.eit-cards h3 {
	margin-top: 0;
	font-size: 1.08rem;
}

.eit-cards p {
	color: var(--contrast-2);
	font-size: .95rem;
	margin-bottom: .6rem;
}

.eit-cards a {
	font-weight: 600;
	text-decoration: none;
}

/* ==========================================================================
   Guides: updated line, tables, call to action, sources
   ========================================================================== */

.eit-updated {
	font-size: .85rem;
	color: var(--contrast-2);
	margin-top: -.75rem;
}

.eit-table table {
	width: 100%;
	border-collapse: collapse;
	border: 0;
	font-size: .95rem;
}

.entry-content .eit-table th,
.entry-content .eit-table td {
	border: 0;
	border-bottom: 1px solid var(--base);
	padding: .65rem .75rem;
	text-align: left;
	vertical-align: top;
}

.entry-content .eit-table thead th {
	background: var(--base-2);
	border-bottom: 2px solid var(--base);
	font-size: .85rem;
}

.eit-cta {
	border-left-color: var(--accent);
	background: #eaf1f8;
	margin-top: 2rem;
	margin-bottom: 2rem;
}

.eit-cta .wp-block-buttons {
	margin-top: .75rem;
}

.eit-sources {
	font-size: .9rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-info {
	font-size: .88rem;
}

.site-info .inside-site-info {
	padding-top: 28px;
	padding-bottom: 28px;
}

.eit-footer-note {
	display: block;
	opacity: .75;
	margin-top: .25rem;
}

.eit-footer-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .35rem 1.25rem;
	margin-bottom: .75rem;
}

.site-info .eit-footer-links a {
	text-decoration: none;
}

.site-info .eit-footer-links a:hover {
	text-decoration: underline;
}

/* ==========================================================================
   Contact form
   ========================================================================== */

.eit-contact__form label {
	display: block;
	font-weight: 600;
	margin-bottom: .3rem;
}

.eit-contact__form input[type="text"],
.eit-contact__form input[type="email"],
.eit-contact__form textarea {
	width: 100%;
	border: 1px solid var(--contrast-3);
	border-radius: var(--eit-radius-sm);
	padding: .65rem .8rem;
	background: var(--base-3);
	font: inherit;
}

.eit-contact__form input:focus,
.eit-contact__form textarea:focus {
	border-color: var(--accent);
	outline: 2px solid rgba(31, 78, 120, .25);
}

.eit-contact__privacy {
	font-size: .88rem;
	color: var(--contrast-2);
}

.eit-contact__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.eit-contact__error {
	border-left: 4px solid #b42318;
	background: #fef3f2;
	color: #b42318;
	padding: .8rem 1rem;
	border-radius: 0 var(--eit-radius-sm) var(--eit-radius-sm) 0;
}

.eit-contact button.eit-btn {
	border: 0;
	cursor: pointer;
}

/* ==========================================================================
   Wide layout (default on all pages): everything aligned with the tool box
   ========================================================================== */

.eit-layout-wide .entry-content > *,
.eit-layout-wide.page .entry-header {
	max-width: var(--eit-wide);
}

.eit-layout-wide .eit-hero h1 {
	max-width: none;
}

/* Notes: the last paragraph's bottom margin made the boxes look bottom-heavy. */
.eit-layout-wide .eit-note .wp-block-group__inner-container > :last-child,
.eit-layout-wide .eit-note > :last-child {
	margin-bottom: 0;
}

/* ==========================================================================
   Small screens
   ========================================================================== */

@media (max-width: 768px) {
	body {
		font-size: 16px;
	}

	.one-container .site-content {
		padding: 2rem 16px;
	}

	.eit-tool {
		margin-left: -4px;
		margin-right: -4px;
	}
}
