:root {
  --bmd-container-width: 1240px;
  --bmd-content-top-spacing: 48px;
  --bmd-content-bottom-spacing: 72px;
  --bmd-primary: #2962ff;
  --bmd-secondary: #0f172a;
  --bmd-accent: #16a34a;
  --bmd-body-bg: #ffffff;
  --bmd-text: #1f2937;
  --bmd-heading: #111827;
  --bmd-footer-bg: #0f172a;
  --bmd-footer-text: #e5e7eb;
  --bmd-border: #e5e7eb;
  --bmd-soft-bg: #f8fafc;
  --bmd-radius: 18px;
  --bmd-shadow: 0 12px 35px rgba(15, 23, 42, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bmd-body-bg);
  color: var(--bmd-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--bmd-primary);
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

a:hover,
a:focus {
  color: var(--bmd-secondary);
}

img {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed !important;
  top: 12px;
  left: 12px;
  z-index: 99999;
  width: auto;
  height: auto;
  padding: 10px 14px;
  clip: auto;
  background: var(--bmd-secondary);
  color: #fff;
  border-radius: 8px;
}

.bmd-container {
  width: min(100% - 32px, var(--bmd-container-width));
  margin-left: auto;
  margin-right: auto;
}

.bmd-main-content {
  padding-top: var(--bmd-content-top-spacing);
  padding-bottom: var(--bmd-content-bottom-spacing);
}

.site-header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--bmd-border);
  backdrop-filter: blur(12px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 24px;
}

.site-branding {
  display: flex;
  flex-direction: column;
  min-width: 160px;
}

.custom-logo {
  display: block;
  max-height: 58px;
  width: auto;
}

.site-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}

.site-title a {
  color: var(--bmd-heading);
}

.site-description {
  margin: 3px 0 0;
  font-size: 12px;
  color: #64748b;
}

.main-navigation {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  flex: 1;
}

.primary-menu,
.footer-menu {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-menu a {
  color: var(--bmd-secondary);
  font-size: 14px;
  font-weight: 650;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a {
  color: var(--bmd-primary);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--bmd-border);
  border-radius: 10px;
  background: #fff;
  color: var(--bmd-secondary);
  cursor: pointer;
}

.menu-toggle__bar,
.menu-toggle__bar::before,
.menu-toggle__bar::after {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  content: "";
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.menu-toggle__bar::before {
  transform: translateY(-7px);
}

.menu-toggle__bar::after {
  transform: translateY(5px);
}

.main-navigation.is-open .menu-toggle__bar {
  transform: rotate(45deg);
}

.main-navigation.is-open .menu-toggle__bar::before {
  opacity: 0;
}

.main-navigation.is-open .menu-toggle__bar::after {
  transform: translateY(-2px) rotate(-90deg);
}

.bmd-header-cta,
.wp-block-button__link,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--bmd-primary);
  color: #fff;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.bmd-header-cta:hover,
.wp-block-button__link:hover,
button:hover,
input[type="submit"]:hover {
  color: #fff;
  background: var(--bmd-secondary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--bmd-heading);
  line-height: 1.18;
  margin-top: 0;
  margin-bottom: 0.7em;
  font-weight: 800;
}

h1 { font-size: clamp(34px, 5vw, 58px); }
h2 { font-size: clamp(28px, 3.6vw, 42px); }
h3 { font-size: clamp(22px, 2.6vw, 30px); }
h4 { font-size: 22px; }
h5 { font-size: 18px; }
h6 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; }

p {
  margin-top: 0;
  margin-bottom: 1.2em;
}

.bmd-card,
.bmd-empty-state,
.comments-area {
  background: #fff;
  border: 1px solid var(--bmd-border);
  border-radius: var(--bmd-radius);
  box-shadow: var(--bmd-shadow);
}

.bmd-post-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.bmd-post-card {
  overflow: hidden;
}

.bmd-post-card .entry-header,
.bmd-post-card .entry-content,
.bmd-post-card .entry-footer {
  padding: 0 22px 22px;
}

.bmd-post-card .entry-header {
  padding-top: 22px;
}

.bmd-post-card__thumbnail {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bmd-soft-bg);
}

.bmd-post-card__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.bmd-post-card__thumbnail:hover img {
  transform: scale(1.035);
}

.entry-title a {
  color: var(--bmd-heading);
}

.entry-meta,
.entry-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #64748b;
  font-size: 13px;
}

.bmd-page-header,
.page-header {
  margin-bottom: 32px;
}

.bmd-page-featured-image {
  margin-bottom: 32px;
  overflow: hidden;
  border-radius: var(--bmd-radius);
}

.bmd-rich-content > *:first-child {
  margin-top: 0;
}

.bmd-rich-content > *:last-child {
  margin-bottom: 0;
}

.bmd-single-content {
  max-width: 900px;
}

.navigation,
.posts-navigation,
.post-navigation {
  margin-top: 34px;
}

.nav-links {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--bmd-border);
  border-radius: 12px;
  padding: 10px 13px;
  background: #fff;
  color: var(--bmd-text);
  box-shadow: none;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

.site-footer {
  background: var(--bmd-footer-bg);
  color: var(--bmd-footer-text);
  padding: 54px 0 28px;
}

.site-footer a {
  color: inherit;
  opacity: 0.9;
}

.site-footer a:hover {
  opacity: 1;
  color: #fff;
}

.site-footer__widgets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin-bottom: 34px;
}

.site-footer .widget-title {
  color: #fff;
  font-size: 16px;
}

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
}

.footer-menu {
  gap: 16px;
}

@media (max-width: 980px) {
  .site-header__inner {
    min-height: 70px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .main-navigation {
    flex: 0 0 auto;
    order: 3;
  }

  .primary-menu {
    position: absolute;
    top: 70px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--bmd-border);
    border-radius: 16px;
    box-shadow: var(--bmd-shadow);
  }

  .main-navigation.is-open .primary-menu {
    display: flex;
  }

  .primary-menu li {
    width: 100%;
  }

  .primary-menu a {
    display: block;
    padding: 10px 8px;
  }

  .bmd-post-list,
  .site-footer__widgets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .bmd-container {
    width: min(100% - 24px, var(--bmd-container-width));
  }

  .site-header__inner {
    gap: 12px;
  }

  .bmd-header-cta {
    display: none;
  }

  .bmd-post-list,
  .site-footer__widgets {
    grid-template-columns: 1fr;
  }

  .site-footer__bottom,
  .nav-links {
    flex-direction: column;
    align-items: flex-start;
  }
}
