/*
Theme Name: Bartasdev
Theme URI: https://bartasdev.com
Author: Bartosz Szymański
Description: Minimal block theme for Bartasdev.com - Business Central, AI, agents and software development.
Version: 0.3.1
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 7.4
Text Domain: bartasdev
*/

:root {
  --bd-radius: 18px;
  --bd-radius-small: 12px;
  --bd-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  --bd-transition: 180ms ease;
}

html { scroll-behavior: smooth; }
body { text-rendering: optimizeLegibility; }

a { text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

.bd-header {
  border-bottom: 1px solid var(--wp--preset--color--border);
  background: color-mix(in srgb, var(--wp--preset--color--background) 94%, transparent);
}
.bd-header__inner { min-height: 84px; gap: 28px; }
.bd-brand { gap: 0; flex: 0 1 auto; }
.bd-brand .wp-block-site-logo { margin: 0; }
.bd-brand .wp-block-site-logo img { width: auto; max-width: min(43vw, 240px); max-height: 56px; height: auto; display: block; }
.bd-main-nav { flex: 1 1 auto; justify-content: flex-end; }
.bd-header .wp-block-navigation { font-size: 0.96rem; font-weight: 600; }
.bd-header .wp-block-navigation-item__content { text-decoration: none; }
.bd-header .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--accent); }

.bd-hero {
  position: relative;
  overflow: hidden;
  padding-top: clamp(64px, 9vw, 128px);
  padding-bottom: clamp(52px, 7vw, 96px);
  background-color: var(--wp--preset--color--background);
  background-image: url("assets/hero-waves.svg");
  background-repeat: no-repeat;
  background-position: center right;
  background-size: auto 112%;
}
.bd-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, var(--wp--preset--color--background) 0%, var(--wp--preset--color--background) 34%, rgba(248,250,252,.72) 50%, rgba(248,250,252,.03) 100%);
}
.bd-hero__copy { max-width: 900px; position: relative; z-index: 1; }
.bd-eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--wp--preset--color--accent);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.bd-hero h1 { max-width: 880px; margin-bottom: 22px; letter-spacing: -0.045em; }
.bd-hero p { max-width: 760px; color: var(--wp--preset--color--muted); font-size: clamp(1.08rem, 1.7vw, 1.28rem); }
.bd-hero .wp-block-buttons { margin-top: 30px; }

.bd-section { padding-top: clamp(46px, 6vw, 82px); padding-bottom: clamp(46px, 6vw, 82px); }
.bd-section--soft { background: var(--wp--preset--color--surface); }
.bd-section-heading { margin-bottom: 28px; }
.bd-section-heading h2 { margin-bottom: 8px; letter-spacing: -0.03em; }
.bd-section-heading p { margin-top: 0; color: var(--wp--preset--color--muted); }

.bd-topic-grid { gap: 18px; }
.bd-topic-card {
  height: 100%;
  padding: 26px;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--bd-radius);
  background: var(--wp--preset--color--background);
  transition: transform var(--bd-transition), border-color var(--bd-transition), box-shadow var(--bd-transition);
}
.bd-topic-card:hover { transform: translateY(-3px); border-color: var(--wp--preset--color--accent); box-shadow: var(--bd-shadow); }
.bd-topic-card h3 { margin: 0 0 10px; font-size: 1.2rem; }
.bd-topic-card p { margin: 0 0 18px; color: var(--wp--preset--color--muted); font-size: 0.98rem; }
.bd-topic-card a { font-weight: 700; text-decoration: none; }

.bd-post-list .wp-block-post-template { gap: 18px; }
.bd-post-card {
  align-items: stretch !important;
  gap: 0 !important;
  overflow: hidden;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--bd-radius);
  background: var(--wp--preset--color--background);
  transition: transform var(--bd-transition), border-color var(--bd-transition), box-shadow var(--bd-transition);
}
.bd-post-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--wp--preset--color--accent) 55%, var(--wp--preset--color--border)); box-shadow: var(--bd-shadow); }
.bd-post-thumb { flex: 0 0 min(34vw, 330px); width: min(34vw, 330px) !important; margin: 0 !important; align-self: stretch; }
.bd-post-thumb img { width: 100%; height: 100%; min-height: 240px; object-fit: cover; display: block; }
.bd-post-card__content { flex: 1 1 auto; padding: clamp(24px, 3vw, 36px); }
.bd-post-card__content .wp-block-post-title { margin: 5px 0 12px; letter-spacing: -0.025em; }
.bd-post-card__content .wp-block-post-title a { text-decoration: none; }
.bd-post-card__content .wp-block-post-excerpt { color: var(--wp--preset--color--muted); }
.bd-post-card__content .wp-block-post-excerpt__more-link { font-weight: 700; text-decoration: none; }
.bd-post-meta { gap: 10px; color: var(--wp--preset--color--muted); font-size: 0.88rem; }
.bd-post-meta a { color: inherit; text-decoration: none; }
.bd-post-category { font-size: 0.78rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.bd-post-category a { color: var(--wp--preset--color--accent); text-decoration: none; }

.wp-block-query-pagination { margin-top: 36px; }
.wp-block-query-pagination a { text-decoration: none; font-weight: 650; }

.bd-single-header { padding-top: clamp(58px, 8vw, 104px); padding-bottom: 36px; }
.bd-single-header .wp-block-post-title { max-width: 940px; margin: 10px auto 18px; letter-spacing: -0.045em; }
.bd-single-meta { justify-content: center; gap: 10px; color: var(--wp--preset--color--muted); font-size: 0.94rem; }
.bd-single-featured { margin-top: 16px; margin-bottom: clamp(42px, 6vw, 72px); }
.bd-single-featured img { border-radius: var(--bd-radius); box-shadow: var(--bd-shadow); }
.bd-article { font-size: 1.05rem; line-height: 1.8; }
.bd-article > * + * { margin-block-start: 1.35em; }
.bd-article h2 { margin-top: 2.2em; letter-spacing: -0.03em; }
.bd-article h3 { margin-top: 1.8em; letter-spacing: -0.02em; }
.bd-article p, .bd-article li { max-width: 75ch; }
.bd-article blockquote { border-left: 4px solid var(--wp--preset--color--accent); padding-left: 1.25rem; color: var(--wp--preset--color--muted); }
.bd-article pre,
.bd-article .wp-block-code {
  overflow-x: auto;
  border: 1px solid #1e293b;
  border-radius: var(--bd-radius-small);
  background: #0b1220;
  color: #e6edf7;
  padding: 20px 22px;
  font-size: 0.9rem;
  line-height: 1.65;
}
.bd-article code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
.bd-article :not(pre) > code { padding: 0.15em 0.35em; border-radius: 5px; background: var(--wp--preset--color--surface); font-size: 0.92em; }
.bd-article table { width: 100%; border-collapse: collapse; }
.bd-article th, .bd-article td { border-bottom: 1px solid var(--wp--preset--color--border); padding: 0.75rem; text-align: left; }

.bd-post-footer { margin-top: clamp(52px, 7vw, 88px); padding-top: 28px; border-top: 1px solid var(--wp--preset--color--border); }
.bd-post-nav { gap: 18px; margin-top: 28px; }
.bd-post-nav > * { flex: 1; padding: 20px; border: 1px solid var(--wp--preset--color--border); border-radius: var(--bd-radius-small); }
.bd-post-nav a { text-decoration: none; font-weight: 700; }

.bd-page-header { padding-top: 64px; padding-bottom: 32px; }
.bd-page-header h1 { letter-spacing: -0.04em; }
.bd-empty-state { padding: 44px; border: 1px dashed var(--wp--preset--color--border); border-radius: var(--bd-radius); text-align: center; background: var(--wp--preset--color--surface); }

.bd-footer { margin-top: clamp(52px, 7vw, 96px); border-top: 1px solid var(--wp--preset--color--border); }
.bd-footer__inner { padding-top: 34px; padding-bottom: 34px; gap: 28px; }
.bd-footer__brand { margin: 0; }
.bd-footer__brand .wp-block-site-logo { margin: 0 0 10px; }
.bd-footer__brand .wp-block-site-logo img { width: auto; max-width: 170px; max-height: 42px; height: auto; display: block; }
.bd-footer__meta { color: var(--wp--preset--color--muted); font-size: 0.9rem; }
.bd-footer a { text-decoration: none; }

@media (max-width: 820px) {
  .bd-header__inner { min-height: 72px; }
  .bd-brand .wp-block-site-logo img { max-width: 210px; max-height: 46px; }
  .bd-hero { background-position: 65% center; background-size: auto 92%; }
  .bd-hero::after { background: linear-gradient(90deg, var(--wp--preset--color--background) 0%, rgba(248,250,252,.95) 58%, rgba(248,250,252,.72) 100%); }
  .bd-post-card { flex-direction: column !important; }
  .bd-post-thumb { flex-basis: auto; width: 100% !important; }
  .bd-post-thumb img { min-height: 210px; max-height: 320px; }
}

@media (max-width: 600px) {
  .bd-header__inner { gap: 16px; }
  .bd-brand .wp-block-site-logo img { max-width: 180px; max-height: 40px; }
  .bd-hero { background-image: none; }
  .bd-hero::after { display: none; }
  .bd-hero { padding-top: 52px; }
  .bd-topic-card { padding: 22px; }
  .bd-post-card__content { padding: 22px; }
  .bd-single-meta { justify-content: flex-start; }
  .bd-single-header { text-align: left; }
  .bd-post-nav { flex-direction: column; }
}
