/*
Theme Name: Sigma English
Theme URI: https://sigma-english.pl
Author: Sigma English
Description: Motyw blokowy Sigma English – lekcje angielskiego online 1:1. Mind the Accent.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.0
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sigma-english
*/

/* ---------- Base ---------- */

:root {
	--sg-red: #C63628;
	--sg-red-dark: #A42C20;
	--sg-ink: #222220;
	--sg-black: #111111;
	--sg-text: #3C3A37;
	--sg-muted: #6E6A64;
	--sg-cream: #F2EFEA;
	--sg-line: #DED9D2;
	--sg-header-height: 72px;
}

@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

a { text-underline-offset: 4px; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.wp-element-button:focus-visible {
	outline: 3px solid var(--sg-red);
	outline-offset: 2px;
}

.wp-site-blocks > * + * { margin-block-start: 0; }

/* Home page sections sit edge to edge (no white gap between them). */
.wp-site-blocks main > * + * { margin-block-start: 0; }

.sg-red { color: var(--sg-red); }

.sg-section[id] { scroll-margin-top: var(--sg-header-height); }

/* ---------- Header ---------- */

.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
	background: #FFFFFF;
	border-bottom: 1px solid var(--sg-line);
}

@media (max-width: 600px) {
	.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 0; }
}

.sg-header { padding-block: 12px; }

.sg-logo { margin: 0; }
.sg-logo img { display: block; }

.sg-header .wp-block-navigation__container { gap: 4px 28px; }
.sg-header .wp-block-navigation .wp-block-navigation-item__content { padding-block: 10px; }
.sg-header .wp-block-navigation a { text-decoration: none; color: var(--sg-ink); }
.sg-header .wp-block-navigation a:hover { color: var(--sg-red); }

.sg-header-cta .wp-element-button { padding: 11px 20px; font-size: 14px; }

@media (max-width: 1000px) {
	.sg-header .wp-block-navigation__container { gap: 4px 18px; }
}

@media (max-width: 600px) {
	.sg-header .sg-header-cta { display: none !important; }
}

/* Mobile menu: black background, white links, red on hover. */
.sg-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: 24px clamp(16px, 4vw, 48px);
	background-color: var(--sg-black) !important;
	color: #FFFFFF !important;
}
.sg-header .wp-block-navigation__responsive-container.is-menu-open a,
.sg-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { color: #FFFFFF !important; }
.sg-header .wp-block-navigation__responsive-container.is-menu-open a:hover { color: var(--sg-red) !important; }
.sg-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close { color: #FFFFFF; }
.sg-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: 20px;
	font-size: 30px;
	font-weight: 800;
	line-height: 1.2;
}

/* ---------- Text helpers ---------- */

.sg-lead {
	font-size: clamp(17px, 1.5vw, 20px);
	line-height: 1.75;
	color: var(--sg-text);
	max-width: 640px;
}

.sg-eyebrow {
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--sg-red);
}

.sg-eyebrow + h2 { margin-top: 0; }

.sg-arrow-link a {
	font-weight: 600;
	color: var(--sg-ink);
	text-decoration: none;
}

.sg-arrow-link a::after {
	content: "\2192";
	display: inline-block;
	margin-left: 8px;
	color: var(--sg-red);
	transition: translate 0.2s ease;
}

@media (hover: hover) {
	.sg-arrow-link a:hover::after { translate: 4px 0; }
}

.sg-actions { gap: 16px 28px; margin-top: 32px; }

/* ---------- Sections ---------- */

.sg-section { padding-block: clamp(56px, 7vw, 96px); }
.sg-section h2 { margin-top: 0; }
.sg-section-intro { max-width: 720px; }

/* Narrow text inside wide sections: same left edge as headings, shorter lines. */
.sg-section.is-layout-constrained > .sg-lead,
.sg-section.is-layout-constrained > .sg-pay-note {
	box-sizing: border-box;
	max-width: var(--wp--style--global--wide-size, 1160px) !important;
	padding-right: max(0px, calc(100% - 760px));
}

/* Offer intro: full section width. */
#oferta.sg-section.is-layout-constrained > .sg-section-intro { padding-right: 0; }
#oferta.sg-section.is-layout-constrained > .sg-pay-note { padding-right: 0; }
#o-mnie.sg-section.is-layout-constrained > .sg-lead:last-child { padding-right: 0; }

/* ---------- Hero ---------- */

.sg-hero { padding-block: clamp(40px, 6vw, 88px); }
.sg-hero h1 { margin-top: 0; }
.sg-hero .sg-lead { margin-top: 24px; }

.sg-photo { margin: 0; }
.sg-photo img {
	display: block;
	width: 100%;
	max-width: 440px;
	height: auto;
	margin-inline: auto;
	border-radius: 14px 14px 14px 0;
	box-shadow: -14px 14px 0 var(--sg-red);
}

@media (max-width: 781px) {
	.sg-hero__cols { flex-direction: column-reverse; }
	.sg-photo img { max-width: 300px; }
}

/* ---------- Grids and cards ---------- */

.sg-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 18px;
	margin-top: 32px;
}

.sg-grid > * { margin-block-start: 0 !important; }

@media (min-width: 640px) {
	.sg-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
	.sg-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.sg-card {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	padding: 26px 24px;
	background: #FFFFFF;
	border-left: 6px solid var(--sg-red);
	border-radius: 0 12px 12px 0;
	transition: translate 0.25s ease, box-shadow 0.25s ease;
}

.sg-card > * { margin: 0; }
.sg-card > * + * { margin-top: 12px; }
.sg-card p { font-size: 16px; line-height: 1.65; color: var(--sg-text); }

.sg-price {
	align-self: flex-start;
	padding: 5px 14px;
	background: var(--sg-red);
	border-radius: 999px;
	color: #FFFFFF !important;
	font-size: 14px !important;
	font-weight: 600;
	line-height: 1.4 !important;
	white-space: nowrap;
}

@media (hover: hover) {
	.sg-card:hover {
		translate: 0 -4px;
		box-shadow: 0 16px 34px rgba(17, 17, 17, 0.1);
	}
}

.sg-cta-box {
	box-sizing: border-box;
	margin-top: 32px !important;
	padding: clamp(26px, 4vw, 40px);
	border-radius: 14px;
	color: #D6D2CC;
}

.sg-cta-box > * { margin: 0; }
.sg-cta-box > * + * { margin-top: 14px; }
.sg-cta-box h3 { color: #FFFFFF; font-size: clamp(22px, 2.6vw, 28px); text-transform: uppercase; }
.sg-cta-box p { max-width: 720px; }
.sg-cta-box .wp-block-buttons { margin-top: 22px; }
.sg-cta-note { font-size: 14px; color: #A9A49D; }

/* "Bez zobowiązań…" in the bottom-right corner of the box. */
.sg-cta-box { position: relative; }
.sg-cta-box > .sg-cta-note { text-align: right; }
@media (min-width: 782px) {
	.sg-cta-box > .sg-cta-note { position: absolute; right: clamp(26px, 4vw, 40px); bottom: clamp(22px, 3vw, 32px); margin: 0; }
}

.sg-pay-note {
	margin-top: 24px !important;
	font-size: 15px;
	line-height: 1.7;
	color: var(--sg-muted);
}

.sg-pay-note strong { color: var(--sg-ink); }

/* ---------- About ---------- */

.sg-about__cols { gap: clamp(28px, 4vw, 56px); margin-top: 24px; }
.sg-about h3 { margin-top: 32px; }

.sg-panel {
	box-sizing: border-box;
	padding: clamp(24px, 3vw, 34px);
	border-radius: 12px;
}

.sg-panel h3 { margin-top: 0; }
.sg-panel > * + * { margin-top: 14px; }

ul.sg-dots { list-style: none; padding-left: 0; }
ul.sg-dots li {
	position: relative;
	padding-left: 22px;
	line-height: 1.62;
}
ul.sg-dots li + li { margin-top: 10px; }
ul.sg-dots li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.62em;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--sg-red);
}

.sg-who { margin-top: 18px; }
.sg-who__item {
	margin: 0;
	padding: 22px 22px 22px 24px;
	background: var(--sg-cream);
	border-top: 4px solid var(--sg-red);
	border-radius: 0 0 12px 12px;
	font-size: 16px;
	line-height: 1.6;
}

.sg-quote {
	box-sizing: border-box;
	margin-top: 40px !important;
	padding: clamp(26px, 4vw, 40px);
	border-radius: 14px;
}

.sg-quote__text {
	margin: 0;
	font-size: clamp(18px, 2vw, 22px);
	font-weight: 600;
	font-style: italic;
	line-height: 1.5;
	color: #FFFFFF;
}

.sg-quote__cite {
	margin: 12px 0 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--sg-red);
}

.sg-about > .sg-lead:last-child { margin-top: 32px; font-style: italic; }

/* ---------- Booking ---------- */

.sg-booking.sg-section { padding-top: clamp(20px, 2.4vw, 28px); }

/* Hand-drawn arrow from "Zarezerwuj termin" down to the calendar (desktop only). */
.sg-booking.sg-section { position: relative; }
@media (min-width: 1100px) {
	.sg-booking.sg-section::before {
		content: "";
		position: absolute;
		z-index: 1;
		font-size: clamp(28px, 3.2vw, 40px);
		top: calc(clamp(20px, 2.4vw, 28px) + 34px + 0.4em);
		left: calc(var(--wp--style--root--padding-left, 48px) + max(0px, (100% - var(--wp--style--root--padding-left, 48px) - var(--wp--style--root--padding-right, 48px) - 1160px) / 2) + 9.6em);
		width: 7.5em;
		height: 6em;
		background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 240' fill='none' stroke='%23C63628' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 14C90 4 220 6 260 56C290 100 262 146 232 164C206 178 192 160 208 144C230 124 262 144 254 178C248 200 228 216 202 224'/%3E%3Cpath d='M210 206L200 226L223 229'/%3E%3C/svg%3E") no-repeat center / contain;
		pointer-events: none;
	}
	.sg-booking.sg-section > .sg-section-intro { padding-right: max(0px, calc(100% - 560px)); }
}

.sg-booking__box {
	box-sizing: border-box;
	margin-top: 28px !important;
}

/* ---------- Contact ---------- */

.sg-contact__cols { gap: clamp(28px, 4vw, 64px); }

.sg-contact__list { margin-top: 24px; }
.sg-contact__list p { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--sg-line); }
.sg-contact__list p:first-child { border-top: 1px solid var(--sg-line); }
.sg-contact__list a { font-weight: 600; color: var(--sg-ink); text-decoration: none; }
.sg-contact__list a:hover { color: var(--sg-red); }

.sg-contact__label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--sg-muted);
}

.sg-form {
	box-sizing: border-box;
	padding: clamp(22px, 3vw, 36px);
	background: var(--sg-cream);
	border-radius: 14px;
}

/* Contact Form 7 */
.sg-form .wpcf7 p { margin: 0 0 16px; }
.sg-form .wpcf7 label { display: block; font-size: 15px; font-weight: 600; color: var(--sg-ink); }
.sg-form .wpcf7 input[type="text"],
.sg-form .wpcf7 input[type="email"],
.sg-form .wpcf7 input[type="tel"],
.sg-form .wpcf7 textarea,
.sg-form .wpcf7 select {
	box-sizing: border-box;
	width: 100%;
	margin-top: 6px;
	padding: 12px 14px;
	border: 1px solid var(--sg-line);
	border-radius: 8px;
	background: #FFFFFF;
	font: inherit;
	font-weight: 400;
	color: var(--sg-ink);
}
.sg-form .wpcf7 textarea { min-height: 140px; }
.sg-form .wpcf7 input[type="submit"] {
	padding: 13px 26px;
	border: 0;
	border-radius: 999px;
	background: var(--sg-red);
	color: #FFFFFF;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
}
.sg-form .wpcf7 input[type="submit"]:hover { background: var(--sg-red-dark); }

/* ---------- Pages and posts ---------- */

.sg-page { padding-block: clamp(40px, 6vw, 80px); }
.sg-page .wp-block-post-title { margin-top: 0; }
.sg-page .wp-block-post-content h2 { margin-top: 40px; font-size: clamp(24px, 2.6vw, 32px); }
.sg-page .wp-block-post-content h3 { margin-top: 28px; }
.sg-page .wp-block-post-content li + li { margin-top: 6px; }

.sg-back { margin: 0 0 12px; font-size: 15px; }
.sg-back a { color: var(--sg-muted); text-decoration: none; }
.sg-back a:hover { color: var(--sg-red); }

.sg-date { font-size: 14px; color: var(--sg-muted); }
.sg-featured img { border-radius: 12px; }

.sg-post-grid {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr);
	gap: 24px;
	padding: 0;
	list-style: none;
}

@media (min-width: 640px) { .sg-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .sg-post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.sg-post-grid > li { margin: 0 !important; }

.sg-post-card {
	box-sizing: border-box;
	height: 100%;
	padding: 24px;
	background: var(--sg-cream);
	border-top: 4px solid var(--sg-red);
	border-radius: 0 0 12px 12px;
}

.sg-post-card > * { margin: 0; }
.sg-post-card > * + * { margin-top: 10px; }
.sg-post-card .wp-block-post-featured-image img { border-radius: 8px; }
.sg-post-card h2 { font-size: 21px; line-height: 1.3; }
.sg-post-card h2 a { color: var(--sg-ink); text-decoration: none; }
.sg-post-card h2 a:hover { color: var(--sg-red); }
.sg-post-card .wp-block-post-excerpt__excerpt { font-size: 16px; }
.sg-post-card .wp-block-post-excerpt__more-link { font-weight: 600; }

/* ---------- Footer ---------- */

.sg-footer { padding-block: 52px 36px; font-size: 15px; color: #BDB8B1; }
.sg-footer p { margin: 0; }
.sg-footer a { color: #FFFFFF; text-decoration: none; }
.sg-footer a:hover { color: var(--sg-red); }
.sg-footer__logo { margin: 0; }
.sg-footer__logo img { display: block; }

.sg-footer__legal {
	margin-top: 36px !important;
	padding-top: 20px;
	border-top: 1px solid #2E2C2A;
	gap: 8px 24px;
	font-size: 14px;
}

/* ---------- Reveal on scroll ---------- */

.sg-js .sg-reveal {
	opacity: 0;
	transform: translateY(22px);
	transition:
		opacity 0.7s ease var(--sg-delay, 0ms),
		transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--sg-delay, 0ms),
		translate 0.25s ease,
		box-shadow 0.25s ease;
}

.sg-js .sg-reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	.sg-js .sg-reveal { opacity: 1; transform: none; transition: none; }
	.sg-card:hover { translate: none; }
}

/* ---------- Intro (home page) ---------- */

.sg-intro {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: #FFFFFF;
	animation: sg-intro-out 0.7s ease 3s forwards;
}

.sg-intro__text {
	margin: 0;
	font-size: clamp(38px, 7vw, 96px);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.02em;
	color: var(--sg-black);
}

.sg-intro__line {
	display: block;
	opacity: 0;
	transform: translateY(18px);
	animation: sg-intro-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.sg-intro__line:nth-child(1) { animation-delay: 0.25s; }
.sg-intro__line:nth-child(2) { animation-delay: 0.95s; }
.sg-intro__line:nth-child(3) { animation-delay: 1.65s; }

@keyframes sg-intro-in {
	to { opacity: 1; transform: none; }
}

@keyframes sg-intro-out {
	to { opacity: 0; visibility: hidden; }
}

.sg-intro.is-done { display: none; }

/* Mobile: space between the three phrases. */
@media (max-width: 600px) {
	.sg-intro__line + .sg-intro__line { margin-top: 0.9em; }
}

@media (prefers-reduced-motion: reduce) {
	.sg-intro { display: none; }
}
