/*
Theme Name: Smolar
Description: Motyw blokowy dla smolar.eu. Ochra i głębokie morze.
Version: 1.0.0
Requires at least: 7.1
Requires PHP: 8.1
Text Domain: smolar
License: GNU General Public License v2 or later
*/

:root, .editor-styles-wrapper {
  color-scheme: light;
  --bg: var(--wp--preset--color--bg, #f7f4ee);
  --bg-soft: var(--wp--preset--color--bg-soft, #efeae0);
  --surface: var(--wp--preset--color--surface, #ece6da);
  --surface-elev: var(--wp--preset--color--surface-elev, #fdfbf7);
  --border: var(--wp--preset--color--border, #ddd5c7);
  --border-strong: var(--wp--preset--color--border-strong, #c7bdb0);
  --ink: var(--wp--preset--color--ink, #161c22);
  --body: var(--wp--preset--color--body, #36404a);
  --muted: var(--wp--preset--color--muted, #65707b);
  --primary: var(--wp--preset--color--primary, #2f5577);
  --primary-hover: var(--wp--preset--color--primary-hover, #24435f);
  --on-primary: var(--wp--preset--color--on-primary, #fff);
  --link: var(--primary);
  --accent: var(--wp--preset--color--accent, #b7834f);
  --accent-text: var(--wp--preset--color--accent-text, #895c30);
  --nav-bg: rgba(247, 244, 238, .94);
  --quote-bg: rgba(253, 251, 247, .96);
  --hero-grad: var(--wp--preset--gradient--ochre-sea, linear-gradient(118deg, #b7834f, #827765 36%, #496375 68%, #2f5577));
  --shadow: 0 10px 30px rgba(20, 26, 32, .08);
  --r-btn: var(--wp--custom--radius--button, 8px);
  --r-card: var(--wp--custom--radius--card, 12px);
  --r-xl: var(--wp--custom--radius--large, 16px);
  --r-pill: var(--wp--custom--radius--pill, 9999px);
  --serif: var(--wp--preset--font-family--fraunces, Georgia, serif);
  --mono: var(--wp--preset--font-family--plex, ui-monospace, monospace);
  --brand: var(--wp--preset--font-family--space, system-ui, sans-serif);
  --gutter: clamp(16px, 3vw, 44px);
  --wmax: var(--wp--custom--layout--wide, 1280px);
  --section-space: clamp(48px, 7vw, 88px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141a20;
  --bg-soft: #182027;
  --surface: #1d252d;
  --surface-elev: #232d37;
  --border: #2c3743;
  --border-strong: #3b4a59;
  --ink: #f3efe7;
  --body: #c4ccd4;
  --muted: #a0abb8;
  --primary: #b7834f;
  --primary-hover: #cb9660;
  --on-primary: #141a20;
  --link: #d7a674;
  --accent-text: #d7a674;
  --nav-bg: rgba(20, 26, 32, .94);
  --quote-bg: rgba(29, 37, 45, .96);
  --hero-grad: linear-gradient(118deg, #8e6339, #4d585f 40%, #24435f);
  --shadow: 0 14px 36px rgba(0, 0, 0, .35);
}

@media (min-width: 2200px) {
  :root { --wmax: var(--wp--custom--layout--ultrawide, 1440px); }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 110px; }
body { margin: 0; background: var(--bg); color: var(--body); }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
a { text-underline-offset: .19em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
:focus:not(:focus-visible) { outline: none; }
[hidden] { display: none !important; }

.smolar-wrap { width: min(100% - 2 * var(--gutter), var(--wmax)); margin-inline: auto; }
:where(.site-main, .editor-styles-wrapper) :where(p, ul, ol) { max-width: 70ch; }
:where(.site-main, .editor-styles-wrapper) p { margin-block: 0 1em; }
:where(.site-main, .editor-styles-wrapper) :where(h1, h2, h3) { margin-block: 0 .55em; text-wrap: balance; }
:where(.site-main, .editor-styles-wrapper) h2 { font-size: clamp(28px, 3.4vw, 42px); }
:where(.site-main, .editor-styles-wrapper) h3 { font-size: clamp(21px, 2vw, 26px); }
:where(.site-main, .editor-styles-wrapper) :where(li + li) { margin-top: .45em; }
.wp-block-buttons { gap: 12px; }
.wp-block-button__link, .brief-form button {
  display: inline-block;
  border: 1px solid transparent;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--r-btn);
  cursor: pointer;
}
.wp-block-button__link:hover, .brief-form button:hover { background: var(--primary-hover); color: var(--on-primary); }
.button-secondary .wp-block-button__link {
  background: var(--surface-elev);
  color: var(--ink);
  border-color: var(--border-strong);
}
.button-secondary .wp-block-button__link:hover { background: var(--surface); }
.wp-element-button:focus-visible { outline-color: var(--ink); }
.wp-block-group.site-main { min-height: 60vh; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) {
  .admin-bar .site-header { top: 0; }
}
.nav-inner {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.nav-left, .nav-right { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.nav-right { justify-content: flex-end; }
.pill, .language-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding-inline: 12px;
  gap: 6px;
  border-radius: var(--r-btn);
  border: 1px solid var(--border-strong);
  background: var(--surface-elev);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.pill:hover { border-color: var(--accent-text); background: var(--surface); }
.pill.nav-contact { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.pill.nav-contact:hover { background: var(--primary-hover); }
.language-switch { display: flex; align-items: center; }
.language-switch a { background: transparent; border-color: transparent; padding-inline: 6px; font: 12px var(--mono); }
.language-switch a[aria-current] { color: var(--link); text-decoration: underline; text-decoration-thickness: 2px; }
.language-switch a:hover { background: var(--surface); }
.theme-toggle { min-width: 36px; padding: 0; }
.theme-icon::before { content: "☾"; font-size: 18px; line-height: 1; }
[data-theme="dark"] .theme-icon::before { content: "☀"; }

.nav-menu { position: relative; }
.nav-menu summary { list-style: none; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu ul {
  position: absolute;
  inset: calc(100% + 12px) auto auto 0;
  min-width: 17rem;
  max-width: calc(100vw - 2 * var(--gutter));
  max-height: min(65vh, 24rem);
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: var(--r-card);
  border: 1px solid var(--border);
  background: var(--surface-elev);
  box-shadow: var(--shadow);
}
.nav-menu li a { display: block; border-radius: var(--r-btn); padding: 8px 12px; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.nav-menu li a:hover, .nav-menu li a[aria-current] { background: var(--surface); text-decoration: underline; }

.brand-link { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; color: var(--ink); text-decoration: none; }
.brand-word {
  display: inline-flex;
  white-space: nowrap;
  font: 600 16px/1 var(--brand);
  letter-spacing: .3em;
  padding-left: .3em;
  transition: font-size .42s ease, letter-spacing .42s ease, padding .35s ease;
}
.brand-tail { max-width: 8em; overflow: hidden; transition: max-width .42s ease; }
.brand-cursor {
  width: 0;
  height: 3px;
  margin-top: 15px;
  background: var(--primary);
  transition: width .42s ease, margin-left .42s ease;
}
.is-scrolled .brand-word { padding-left: 0; font-size: 21px; letter-spacing: 0; }
.is-scrolled .brand-tail { max-width: 0; }
.is-scrolled .brand-cursor { width: 10px; margin-left: 3px; animation: cursor-blink 1s steps(1) .42s 3; }
@keyframes cursor-blink { 50% { opacity: 0; } }

.hero {
  margin-block: clamp(18px, 4vw, 44px) var(--section-space);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  overflow: clip;
}
.hero-copy, .page-intro { padding-block: clamp(36px, 6vw, 68px) clamp(30px, 4.5vw, 44px); }
.hero-copy { padding-inline: clamp(20px, 4vw, 44px); }
.hero h1, .page-intro h1 {
  max-width: 26ch;
  font-family: var(--wp--preset--font-family--inter, system-ui, sans-serif);
  font-size: clamp(30px, 4.1vw, 50px);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.09;
}
.hero h1 em { font: italic 400 1em var(--serif); }
.page-intro { border-bottom: 1px solid var(--border); margin-bottom: clamp(32px, 5vw, 56px); }
.page-intro h1 {
  max-width: 22ch;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(36px, 4.6vw, 56px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -.025em;
  margin-bottom: .4em;
}
.page-intro .lead { margin-bottom: 0; color: var(--ink-soft, var(--ink)); }
.hero-copy .lead, .page-intro .lead { max-width: 64ch; font-size: 17px; margin-bottom: 1.6em; }
.eyebrow { font: 12px/1.5 var(--mono); letter-spacing: .08em; color: var(--accent-text); text-transform: uppercase; }
.hero-band {
  padding: clamp(20px, 4vw, 44px);
  background: var(--hero-grad);
  display: grid;
  grid-template-columns: 1.25fr .95fr;
  gap: clamp(16px, 3vw, 28px);
  align-items: center;
}
.smolar-image { margin: 0; }
.smolar-image img { margin-inline: auto; }
.image-stairs img { width: 100%; }
.quote-card { min-width: 0; padding: clamp(14px, 3vw, 22px); background: var(--quote-bg); color: var(--ink); border-radius: var(--r-card); }
.quote-card h2 { padding-bottom: .7rem; border-bottom: 1px solid var(--border); font-size: clamp(20px, 2.5vw, 26px); }
.quote-card ul { list-style: none; padding: 0; font-size: .85rem; }
.quote-card li { padding-bottom: .45rem; border-bottom: 1px solid var(--border); }
.quote-card p:last-child { margin-bottom: 0; font: .78rem/1.5 var(--mono); }

.home-section { margin-block: var(--section-space); }
.bento-grid, .proof-grid, .work-strip, .case-images { display: grid; gap: 20px; }
.bento-grid { grid-template-columns: 1.2fr 1fr 1fr; }
.bento-card, .case-copy, .tech-note, .cta-panel, .contact-box {
  min-width: 0;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface);
}
.bento-card { position: relative; display: flex; flex-direction: column; }
.bento-card p:last-child { margin-top: auto; margin-bottom: 0; }
.bento-card.featured { background: var(--surface-elev); border-color: var(--border-strong); }
.bento-card.featured::before {
  position: absolute; top: 0; left: 24px; right: 24px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  content: "";
}
.proof-grid { grid-template-columns: 1fr 1fr; align-items: center; }
.work-strip { grid-template-columns: repeat(3, 1fr); align-items: center; padding: clamp(14px, 2.5vw, 24px); margin-top: 20px; background: var(--bg-soft); border-radius: var(--r-card); }
.case-images { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; margin-block: 1.4rem; }
.case-images > :first-child { grid-column: 1 / -1; }
.case-images .image-poltreppen-mobile img, .case-images .image-poltreppen-asystent img { width: auto; max-height: 420px; margin-inline: auto; }
.smolar-image.is-shot img { height: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-elev); box-shadow: 0 1px 2px rgb(22 28 34 / .06), 0 10px 28px -14px rgb(22 28 34 / .28); }
.image-poltreppen-mobile.is-shot img, .image-poltreppen-asystent.is-shot img { border-radius: 18px; }
.voice-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 320px)); gap: clamp(18px, 3vw, 32px); margin-block: 1.6rem .9rem; }
.voice-shots > * { margin: 0; }
.voice-shots .smolar-image img { width: 100%; border-radius: 18px; }
.voice-shots + p { color: var(--muted); font-size: 15px; }
.smolar-video { margin: 0; }
p + .smolar-video { margin-top: clamp(18px, 2.4vw, 28px); }
.video-frame { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-elev); box-shadow: 0 1px 2px rgb(22 28 34 / .06), 0 10px 28px -14px rgb(22 28 34 / .28); }
.video-frame video { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; }
.video-play { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.video-play[hidden] { display: none; }
.video-play span { display: grid; place-items: center; width: clamp(56px, 9vw, 84px); aspect-ratio: 1; border-radius: 50%; background: var(--primary); box-shadow: 0 6px 24px rgb(22 28 34 / .35); transition: background-color .15s ease; }
.video-play span::before { width: 0; height: 0; margin-left: 12%; border-style: solid; border-width: 13px 0 13px 21px; border-color: transparent transparent transparent var(--on-primary); content: ""; }
.video-play:hover span { background: var(--primary-hover); }
.video-play:focus-visible { outline: 3px solid var(--accent); outline-offset: -6px; }
.smolar-video figcaption { margin-top: 10px; color: var(--muted); font-size: 15px; }
.work-strip .smolar-video { grid-column: 1 / -1; }
.work-strip:has(.smolar-video) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.steps { border-left: 2px solid var(--accent); padding-left: 2rem; }
.wp-block-details { padding: 12px 0; border-bottom: 1px solid var(--border); max-width: 72ch; }
.wp-block-details summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.wp-block-details p { margin-top: 10px; }
.cta-panel { background: var(--bg-soft); }
.profile-grid { display: grid; grid-template-columns: auto 1fr; gap: clamp(16px, 4vw, 36px); align-items: center; }
.image-portrait img { display: block; width: clamp(200px, 26vw, 300px); height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--wp--custom--radius--button); }
.page-body { width: min(100% - 2 * var(--gutter), var(--wmax)); margin-inline: auto; padding-bottom: var(--section-space); }
.page-body > * { max-width: 840px; }
.page-body :where(p, li) { max-width: 72ch; }
.page-body h2 { margin-bottom: .45em; }
.page-body :where(p, ul, ol, figure, .wp-block-buttons) + :where(h3, h2) { margin-top: 1.5em; }
.page-body :where(h2, h3) + p { margin-top: 0; }
.page-body > .wp-block-group, .page-body > details + .wp-block-group { margin-top: clamp(28px, 5vw, 54px); }
.page-body > .wp-block-group:first-child { margin-top: 0; }
.page-body .cta-panel { margin-top: 40px; }
.brief-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.brief-form .wide-field { grid-column: 1 / -1; }
.brief-form label { display: grid; grid-template-rows: auto 1fr; align-items: end; gap: 6px; color: var(--ink); font-weight: 600; font-size: 14px; }
.brief-form :is(input, textarea, select) {
  min-width: 0; width: 100%; min-height: 44px; padding: 9px 12px;
  color: var(--ink); background: var(--surface-elev); border: 1px solid var(--muted); border-radius: var(--r-btn);
  font-weight: 400; font-size: 16px;
}
.brief-form textarea { resize: vertical; }
.form-check { min-height: 65px; }
.form-check-note { margin: 8px 0 0; }
.form-status { border-left: 3px solid var(--primary); padding-inline-start: 12px; }
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 18px; align-items: center; padding-block: 28px; font-size: 14px; }
.footer-inner p { margin: 0; }
.footer-inner nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-inner a { color: var(--ink); }

@media (max-width: 960px) {
  .bento-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .nav-inner { grid-template-columns: max-content 1fr max-content; gap: 8px; }
  .brand-link { justify-self: center; }
  .nav-case { display: none; }
  .hero-band, .proof-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .nav-inner { grid-template-columns: auto 1fr auto; gap: 6px; min-height: 56px; }
  .brand-link { grid-area: 1 / 1; justify-self: start; }
  .brand-word { padding-left: 0; font-size: 21px; letter-spacing: 0; }
  .brand-tail { max-width: 0; }
  .brand-cursor { width: 10px; margin-left: 3px; }
  .nav-left { grid-area: 1 / 2; justify-self: start; }
  .nav-right { grid-area: 1 / 3; gap: 4px; }
  .pill { padding-inline: 10px; }
  .language-switch a { padding-inline: 4px; }
  .nav-menu > summary { min-height: 36px; }
  .bento-grid, .brief-form { grid-template-columns: minmax(0, 1fr); }
  .case-images { gap: 12px; }
  .case-images .image-poltreppen-mobile img, .case-images .image-poltreppen-asystent img { max-height: 360px; max-width: 100%; }
  .work-strip { gap: 8px; }
  .profile-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .reveal.is-revealed { animation: smolar-reveal .42s ease-out backwards; }
  @keyframes smolar-reveal { from { opacity: .35; transform: translateY(8px); } }
}
@media (prefers-reduced-motion: reduce) {
  .brand-word, .brand-tail, .brand-cursor { transition: none; }
  .is-scrolled .brand-cursor { animation: none; }
}
