/*
Theme Name: Szkoła Pływania Pana Maćka
Theme URI: https://szkolaplywania.com.pl/
Author: Studio Relax
Description: Motyw blokowy Szkoły Pływania Pana Maćka — nagłówek, stopka, szablony stron i wpisów oraz wzorce sekcji. Wymaga WordPress 6.6+.
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: szkola-plywania
*/

:root {
  --sp-bg: #f2f3f6; --sp-surface: #e5e8ee; --sp-text: #1a1d26;
  --sp-accent: #2b53c4; --sp-accent-300: #a8c0fb; --sp-accent-400: #7d9ef1; --sp-accent-700: #1f45a3;
  --sp-divider: color-mix(in srgb, #1a1d26 16%, transparent);
  --sp-ink: #161923; --sp-paper: #f5f6fa;
  --sp-head: "Cormorant Garamond", Georgia, serif; --sp-body: Lora, Georgia, serif;
  --sp-radius: 4px; --sp-pad: 40px;
}
@media (max-width: 781px) { :root { --sp-pad: 20px; } }

body { -webkit-font-smoothing: antialiased; }
:where(h1,h2,h3,h4) { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--sp-accent-700); }
a:hover { color: var(--sp-accent); }
:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--sp-accent) 22%, transparent); }
.tnum, .sp-kicker, .sp-fact__n, .sp-table td, .sp-meta { font-variant-numeric: tabular-nums; }

/* Kontenery */
.sp-wrap { max-width: 1280px; margin-left: auto !important; margin-right: auto !important; padding-left: var(--sp-pad); padding-right: var(--sp-pad); box-sizing: border-box; }
.sp-section { padding-top: 84px; padding-bottom: 84px; }
.sp-band { background: var(--sp-surface); border-top: 1px solid var(--sp-divider); border-bottom: 1px solid var(--sp-divider); }
.sp-main > .wp-block-post-content > * + * { margin-block-start: 0; }
.sp-main { margin-block-start: 0 !important; }
.wp-site-blocks > * + * { margin-block-start: 0; }

/* Typografia pomocnicza */
.sp-kicker { font-family: var(--sp-body); font-size: 11px !important; letter-spacing: .2em; text-transform: uppercase; color: var(--sp-accent-700); margin: 0 0 16px !important; }
.sp-lede { font-size: 19px; line-height: 1.6; max-width: 46ch; color: color-mix(in srgb, var(--sp-text) 80%, transparent); }
.sp-muted { font-size: 14px; color: color-mix(in srgb, var(--sp-text) 62%, transparent); }
.sp-justify { text-align: justify; hyphens: auto; }
.sp-display { font-size: clamp(40px, 5.2vw, 76px) !important; line-height: 1.02 !important; letter-spacing: -.02em; font-weight: 400 !important; margin: 0 0 26px !important; }
.sp-h2 { font-size: clamp(30px, 3vw, 40px) !important; font-weight: 400 !important; margin: 0 0 14px !important; }
.sp-link { font-family: var(--sp-head); font-size: 14px; }
.sp-link a { text-decoration: none; border-bottom: 1px solid var(--sp-accent); color: var(--sp-text); }
.sp-link a:hover { color: var(--sp-accent-700); }

/* Przyciski — zawsze obrys, nigdy wypełnienie */
.wp-block-button__link, .wp-element-button {
  font-family: var(--sp-head); font-size: 15px; line-height: 1.2;
  background: transparent !important; color: var(--sp-accent) !important;
  border: 1px solid var(--sp-accent) !important; border-radius: var(--sp-radius) !important;
  padding: 12px 22px !important; text-decoration: none; transition: background .15s, color .15s;
}
.wp-block-button__link:hover { background: color-mix(in srgb, var(--sp-accent) 8%, transparent) !important; color: var(--sp-accent-700) !important; border-color: var(--sp-accent-700) !important; }
.wp-block-button.is-style-secondary .wp-block-button__link { color: var(--sp-text) !important; border-color: var(--sp-divider) !important; }

/* Zdjęcia jako „plansze” */
.plate img, .wp-block-image.plate img { display: block; width: 100%; object-fit: cover; border-radius: var(--sp-radius); padding: 6px; background: var(--sp-surface); border: 1px solid var(--sp-divider); box-sizing: border-box; filter: saturate(.94) contrast(1.02); }
.plate.ratio-43 img { aspect-ratio: 4 / 3; }
.plate.ratio-32 img { aspect-ratio: 3 / 2; }
.plate.ratio-34 img { aspect-ratio: 3 / 4; }
.plate figcaption, .wp-element-caption { font-size: 12px; color: color-mix(in srgb, var(--sp-text) 58%, transparent); margin-top: 10px; text-align: left; }

/* Nagłówek */
.sp-header-part { position: sticky; top: 0; z-index: 50; }
.admin-bar .sp-header-part { top: 32px; }
@media (max-width: 782px) { .admin-bar .sp-header-part { top: 46px; } }
.sp-header { background: color-mix(in srgb, var(--sp-bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--sp-divider); }
.sp-header__in { display: flex; align-items: center; gap: 22px; padding: 14px var(--sp-pad); }
.sp-brand { display: flex; align-items: center; gap: 13px; text-decoration: none; color: var(--sp-text); margin-right: auto; line-height: 1.05; }
.sp-brand img { width: 46px; height: 46px; flex: none; }
.sp-brand__name { display: block; font-family: var(--sp-head); font-size: 19px; }
.sp-brand__sub { display: block; margin-top: 3px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--sp-accent-700); }
.sp-nav { font-family: var(--sp-head); font-size: 16px; gap: 22px !important; }
.sp-nav a { color: var(--sp-text); text-decoration: none; }
.sp-nav a:hover, .sp-nav .current-menu-item > a, .sp-nav [aria-current="page"] { color: var(--sp-accent); }
.sp-nav .wp-block-navigation__responsive-container.is-menu-open { background: var(--sp-bg); padding: 28px var(--sp-pad); }
.sp-nav .is-menu-open .wp-block-navigation-item { font-size: 22px; border-bottom: 1px solid var(--sp-divider); padding: 10px 0; width: 100%; }
@media (max-width: 599px) { .sp-header .wp-block-buttons { display: none; } .sp-brand__name { font-size: 17px; } }

/* Hero i fakty */
.sp-hero { padding-top: 84px; padding-bottom: 72px; gap: 56px !important; align-items: center !important; }
.sp-facts { border-top: 1px solid var(--sp-divider); padding-top: 34px; padding-bottom: 76px; gap: 40px !important; }
.sp-fact__n { font-family: var(--sp-head); font-size: 46px !important; line-height: 1 !important; letter-spacing: -.02em; margin: 0 !important; }
.sp-fact__l { font-size: 13px; line-height: 1.5; margin-top: 8px !important; color: color-mix(in srgb, var(--sp-text) 65%, transparent); }

/* Oferta */
.sp-offer { gap: 32px !important; }
.sp-offer h3 { font-size: 26px; font-weight: 400; margin: 6px 0 10px; }
.sp-offer p { font-size: 14px; line-height: 1.65; }
.sp-offer .sp-kicker { margin: 20px 0 6px !important; font-size: 10px !important; }
.sp-card-foot { border-top: 1px solid var(--sp-divider); padding-top: 12px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sp-card-foot p { margin: 0; font-size: 13px; }

/* Grupy — blok „Szczegóły” */
.sp-groups { border-top: 1px solid var(--sp-divider); margin-bottom: 40px; }
.sp-groups h3 { font-size: 13px; font-family: var(--sp-body); letter-spacing: .14em; text-transform: uppercase; color: var(--sp-accent-700); margin: 34px 0 6px; font-weight: 400; }
.wp-block-details { border-bottom: 1px solid var(--sp-divider); padding: 0; margin: 0 !important; }
.wp-block-details summary { font-family: var(--sp-head); font-size: 24px; line-height: 1.2; padding: 20px 36px 20px 4px; cursor: pointer; list-style: none; position: relative; }
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after { content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--sp-accent); font-size: 26px; }
.wp-block-details[open] summary::after { content: "–"; }
.wp-block-details > :not(summary) { padding-left: 4px; max-width: 78ch; }
.wp-block-details[open] > :last-child { padding-bottom: 24px; }
.wp-block-details .sp-meta { font-size: 13px; color: var(--sp-accent-700); margin: -4px 0 10px; }
.sp-goal { border-left: 2px solid var(--sp-accent); padding-left: 16px; font-size: 14px; }

/* Tabele */
.sp-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sp-table thead { border-bottom: 1px solid var(--sp-text) !important; }
.sp-table th { font-family: var(--sp-head); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; text-align: left; padding: 10px 12px 10px 0; border: 0 !important; }
.sp-table td { padding: 12px 12px 12px 0; border: 0 !important; border-bottom: 1px solid var(--sp-divider) !important; vertical-align: top; }
.sp-table td:first-child { font-family: var(--sp-head); font-size: 17px; }
.sp-table td:last-child, .sp-table th:last-child { text-align: right; white-space: nowrap; padding-right: 0; }
.sp-table figcaption { font-size: 12px; margin-top: 14px; }
.sp-box { border: 1px solid var(--sp-divider); border-radius: var(--sp-radius); padding: 20px 22px; margin-top: 22px; }
.sp-box p { margin: 0 0 6px; font-size: 13px; line-height: 1.7; }

/* Ciemne pasmo */
.sp-dark { background: var(--sp-ink); color: color-mix(in srgb, var(--sp-paper) 78%, transparent); }
.sp-dark :where(h1,h2,h3,h4) { color: var(--sp-paper); }
.sp-dark .sp-kicker { color: var(--sp-accent-400); }
.sp-dark a { color: var(--sp-accent-300); }
.sp-dark .wp-block-button__link { color: var(--sp-accent-300) !important; border-color: var(--sp-accent-400) !important; }
.sp-dark .wp-block-button__link:hover { background: color-mix(in srgb, var(--sp-accent-400) 14%, transparent) !important; }
.sp-dark .wp-block-button.is-style-secondary .wp-block-button__link { color: var(--sp-paper) !important; border-color: color-mix(in srgb, var(--sp-paper) 28%, transparent) !important; }
.sp-dark .plate img { background: var(--sp-ink); border-color: #2b2f3b; }
.sp-camp-grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 18px; }
.sp-camp-grid > :first-child { grid-row: span 2; }
.sp-camp-grid .plate, .sp-camp-grid .plate img { height: 100%; margin: 0; }

/* Aktualności */
.sp-news .wp-block-post-template { gap: 32px !important; }
.sp-news .wp-block-post { border-top: 2px solid var(--sp-text); padding-top: 18px; display: flex; flex-direction: column; }
.sp-news .wp-block-post-date { font-size: 12px; letter-spacing: .06em; color: color-mix(in srgb, var(--sp-text) 55%, transparent); }
.sp-news .wp-block-post-title { font-size: 24px; font-weight: 400; line-height: 1.2; margin: 12px 0 10px; }
.sp-news .wp-block-post-title a { text-decoration: none; color: var(--sp-text); }
.sp-news .wp-block-post-title a:hover { color: var(--sp-accent-700); }
.sp-news .wp-block-post-excerpt { font-size: 14px; line-height: 1.65; }
.sp-news .wp-block-post-excerpt__more-link { font-family: var(--sp-head); font-size: 13px; text-decoration: none; border-bottom: 1px solid var(--sp-accent); color: var(--sp-text); }
.sp-news .wp-block-post-featured-image img { aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--sp-radius); margin-bottom: 14px; }
.wp-block-query-pagination { margin-top: 44px; font-family: var(--sp-head); gap: 14px; }

/* Zapisy */
.sp-steps { list-style: none; padding: 0 !important; margin: 0; counter-reset: krok; display: grid; gap: 18px; }
.sp-steps li { counter-increment: krok; display: grid; grid-template-columns: 34px 1fr; gap: 14px; font-size: 15px; line-height: 1.6; }
.sp-steps li::before { content: counter(krok, decimal-leading-zero); font-family: var(--sp-head); color: var(--sp-accent-700); border-bottom: 1px solid var(--sp-accent); justify-self: start; height: fit-content; font-variant-numeric: tabular-nums; }
.sp-form { background: var(--sp-bg); border: 1px solid var(--sp-divider); border-radius: 6px; padding: 28px; }
.sp-notice { font-size: 13px; border: 1px dashed var(--sp-accent); border-radius: var(--sp-radius); padding: 14px 16px; }

/* Strony i wpisy */
.sp-page-head { padding-top: 72px; padding-bottom: 28px; }
.sp-page-head .wp-block-post-title, .sp-page-head h1 { font-size: clamp(36px, 4.4vw, 60px); font-weight: 400; line-height: 1.05; letter-spacing: -.015em; margin: 0; }
.sp-prose { padding-bottom: 84px; }
.sp-prose > * { max-width: 760px; margin-left: auto !important; margin-right: auto !important; }
.sp-prose > .alignwide { max-width: 1200px; }
.sp-prose > .alignfull { max-width: none; }

/* Stopka */
.sp-footer { background: var(--sp-ink); color: color-mix(in srgb, var(--sp-paper) 70%, transparent); padding-top: 76px; padding-bottom: 40px; font-size: 13px; line-height: 1.8; }
.sp-footer .wp-block-columns { gap: 44px !important; }
.sp-footer h4 { font-family: var(--sp-body); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--sp-accent-400); margin: 0 0 14px; font-weight: 400; }
.sp-footer p { margin: 0 0 12px; }
.sp-footer a { color: var(--sp-accent-300); text-decoration: none; }
.sp-footer a:hover { color: var(--sp-paper); }
.sp-footer .sp-footer__name { font-family: var(--sp-head); font-size: 26px; line-height: 1.15; color: var(--sp-paper); }
.sp-footer .sp-footer__big { font-size: 15px; color: var(--sp-paper); }
.sp-footer .sp-sitemap a { color: color-mix(in srgb, var(--sp-paper) 78%, transparent); font-size: 14px; }
.sp-footer-bottom { margin-top: 52px; padding-top: 22px; border-top: 1px solid color-mix(in srgb, var(--sp-paper) 16%, transparent); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 12px; color: color-mix(in srgb, var(--sp-paper) 50%, transparent); }
.sp-footer-bottom p { margin: 0; }
.sp-footer-bottom a { color: inherit; margin-left: 22px; }

/* Contact Form 7 */
.wpcf7-form p { margin: 0 0 16px; }
.wpcf7-form label { display: block; font-family: var(--sp-head); font-size: 14px; color: color-mix(in srgb, var(--sp-text) 72%, transparent); }
.wpcf7-form input[type="text"], .wpcf7-form input[type="email"], .wpcf7-form input[type="tel"], .wpcf7-form input[type="number"], .wpcf7-form input[type="date"], .wpcf7-form select, .wpcf7-form textarea {
  width: 100%; box-sizing: border-box; margin-top: 6px; font: inherit; font-size: 15px; color: var(--sp-text);
  background: transparent; border: 1px solid var(--sp-divider); border-radius: var(--sp-radius); padding: 10px 12px;
}
.wpcf7-form textarea { min-height: 110px; }
.wpcf7-form input:focus-visible, .wpcf7-form select:focus-visible, .wpcf7-form textarea:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; border-color: transparent; }
.wpcf7-list-item { display: block; margin: 6px 0 0; }
.wpcf7-list-item label { font-family: var(--sp-body); font-size: 14px; color: var(--sp-text); display: flex; gap: 10px; align-items: baseline; }
.wpcf7-acceptance .wpcf7-list-item label { font-size: 12.5px; line-height: 1.6; }
.wpcf7-form input[type="checkbox"], .wpcf7-form input[type="radio"] { accent-color: var(--sp-accent); }
.wpcf7-form input[type="submit"] {
  width: 100%; font-family: var(--sp-head); font-size: 16px; color: var(--sp-accent); background: transparent;
  border: 1px solid var(--sp-accent); border-radius: var(--sp-radius); padding: 13px 22px; cursor: pointer;
}
.wpcf7-form input[type="submit"]:hover { color: var(--sp-accent-700); border-color: var(--sp-accent-700); background: color-mix(in srgb, var(--sp-accent) 8%, transparent); }
.wpcf7-form input[type="submit"]:disabled { opacity: .45; cursor: not-allowed; }
.wpcf7-not-valid-tip { font-size: 12px; color: #a3261f; margin-top: 4px; }
.wpcf7 form .wpcf7-response-output { font-size: 13px; border: 1px solid var(--sp-accent); border-radius: var(--sp-radius); padding: 12px 14px; margin: 16px 0 0; }
.wpcf7 form.invalid .wpcf7-response-output, .wpcf7 form.failed .wpcf7-response-output { border-color: #a3261f; }
.sp-dark .wpcf7-form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), .sp-dark .wpcf7-form select, .sp-dark .wpcf7-form textarea { color: var(--sp-paper); border-color: color-mix(in srgb, var(--sp-paper) 25%, transparent); }
.sp-dark .wpcf7-form label, .sp-dark .wpcf7-list-item label { color: color-mix(in srgb, var(--sp-paper) 80%, transparent); }
.sp-dark .sp-form { background: transparent; border-color: color-mix(in srgb, var(--sp-paper) 18%, transparent); }

/* Responsywność */
@media (max-width: 781px) {
  .sp-section { padding-top: 60px; padding-bottom: 60px; }
  .sp-hero { padding-top: 48px; padding-bottom: 40px; }
  .sp-camp-grid { grid-template-columns: 1fr; }
  .sp-camp-grid > :first-child { grid-row: auto; }
  .sp-news .wp-block-post-template { grid-template-columns: 1fr !important; }
  .sp-footer-bottom a { margin: 0 16px 0 0; }
}
