/*
 * Nadácia srdca Starter – component and accessibility layer.
 * Global tokens live in theme.json. This file covers selectors and states that
 * are not practical to express declaratively.
 */

:root {
  --ns-transition: var(--wp--custom--motion--standard, 180ms) var(--wp--custom--motion--easing, cubic-bezier(0.2, 0, 0, 1));
  --ns-card-shadow: 0 12px 32px rgba(0, 94, 153, 0.07);
  --ns-card-shadow-hover: 0 16px 38px rgba(0, 94, 153, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  text-size-adjust: 100%;
}

body {
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
textarea,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--wp--preset--color--neutral-300);
  border-radius: 8px;
  background: var(--wp--preset--color--white);
  color: var(--wp--preset--color--text-primary);
  padding: 12px 14px;
}

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

:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--wp--preset--color--deep-medical-blue);
  outline-offset: 3px;
}

.wp-element-button,
.wp-block-button__link,
.wp-block-search__button,
button,
input[type="submit"] {
  min-height: 44px;
  cursor: pointer;
  transition: background-color var(--ns-transition), border-color var(--ns-transition), color var(--ns-transition), transform var(--ns-transition), box-shadow var(--ns-transition);
}

.wp-element-button:hover,
.wp-block-button__link:hover,
.wp-block-search__button:hover {
  background: var(--wp--preset--color--deep-blue-hover);
  border-color: var(--wp--preset--color--deep-blue-hover);
  color: var(--wp--preset--color--white);
}

.wp-element-button:active,
.wp-block-button__link:active,
.wp-block-search__button:active {
  transform: translateY(1px);
}

/* Skip link */
.ns-skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100000;
  transform: translateY(-160%);
  background: var(--wp--preset--color--deep-medical-blue);
  color: var(--wp--preset--color--white);
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}

.ns-skip-link:focus {
  transform: translateY(0);
}

/* Header and navigation */
.ns-site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--wp--preset--color--neutral-100);
  box-shadow: 0 6px 24px rgba(35, 31, 32, 0.05);
  backdrop-filter: blur(10px);
}

.admin-bar .ns-site-header {
  top: 32px;
}

.ns-header-inner {
  min-height: 88px;
}

.ns-brand-link {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}

.ns-brand-link img {
  display: block;
  width: auto;
  height: 58px;
}

.ns-main-navigation .wp-block-navigation-item__content {
  padding: 10px 6px;
  color: var(--wp--preset--color--text-primary);
  text-decoration: none;
}

.ns-main-navigation .wp-block-navigation-item__content:hover {
  color: var(--wp--preset--color--deep-medical-blue);
}

.ns-main-navigation .current-menu-item > .wp-block-navigation-item__content,
.ns-main-navigation .current-menu-ancestor > .wp-block-navigation-item__content {
  color: var(--wp--preset--color--deep-medical-blue);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.ns-header-search {
  flex: 0 0 auto;
}

.ns-header-search .wp-block-search__button {
  min-width: 44px;
  padding: 10px;
}

.ns-navigation-overlay {
  min-height: 100dvh;
  background: var(--wp--preset--color--white);
  padding-top: clamp(20px, 4vw, 40px);
  padding-bottom: clamp(32px, 8vw, 72px);
}

.ns-navigation-overlay .wp-block-navigation {
  width: 100%;
}

.ns-navigation-overlay .wp-block-navigation-item {
  width: 100%;
}

.ns-navigation-overlay .wp-block-navigation-item__content {
  width: 100%;
  padding: 10px 0;
  font-family: var(--wp--preset--font-family--heading);
  font-size: clamp(22px, 5vw, 34px);
  font-weight: 800;
  color: var(--wp--preset--color--text-primary);
  text-decoration: none;
}

/* Mobile overlay: keep the native WP modal, but make the source theme own the F0 visibility fix. */
@media (max-width: 782px) {
  .ns-main-navigation > .wp-block-navigation__responsive-container.is-menu-open,
  .ns-main-navigation > .wp-block-navigation__responsive-container.has-modal-open.is-menu-open {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    overflow-y: auto !important;
    background: var(--wp--preset--color--white) !important;
    color: var(--wp--preset--color--text-primary) !important;
    z-index: 100000 !important;
    padding: 0 !important;
  }

  .ns-main-navigation > .wp-block-navigation__responsive-container.is-menu-open > .wp-block-navigation__responsive-container-content {
    display: block !important;
    width: 100% !important;
    min-height: 100vh !important;
    padding: 0 !important;
    background: var(--wp--preset--color--white) !important;
  }

  .ns-main-navigation > .wp-block-navigation__responsive-container.is-menu-open > .wp-block-navigation__responsive-container-content > .wp-block-navigation__container {
    display: none !important;
  }

  .ns-main-navigation .wp-block-navigation__responsive-container.is-menu-open .ns-navigation-overlay {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    min-height: 100vh !important;
    padding: 20px 16px 40px !important;
    background: var(--wp--preset--color--white) !important;
    box-sizing: border-box;
  }

  .ns-main-navigation .wp-block-navigation__responsive-container.is-menu-open .ns-navigation-overlay .wp-block-navigation__container {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    width: 100% !important;
  }

  .ns-main-navigation .wp-block-navigation__responsive-container.is-menu-open .ns-navigation-overlay .wp-block-navigation-item__content {
    display: block !important;
    padding: 11px 0 !important;
    width: 100% !important;
  }
}

/* Layout helpers */
.ns-section {
  padding-top: var(--wp--custom--layout--section-gap);
  padding-bottom: var(--wp--custom--layout--section-gap);
}

.ns-section-compact {
  padding-top: clamp(28px, 4vw, 48px);
  padding-bottom: clamp(28px, 4vw, 48px);
}

.ns-section-title {
  max-width: 820px;
}

.ns-eyebrow {
  margin-bottom: 10px;
  color: var(--wp--preset--color--deep-medical-blue);
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--eyebrow);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ns-lead {
  max-width: 760px;
  color: var(--wp--preset--color--text-secondary);
  font-size: var(--wp--preset--font-size--lead);
  line-height: 1.58;
}

.ns-meta {
  color: var(--wp--preset--color--text-muted);
  font-size: var(--wp--preset--font-size--small);
}

/* Hero */
.ns-hero {
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 20%, rgba(0, 125, 197, 0.13), transparent 30%),
    linear-gradient(180deg, #f8fcff 0%, var(--wp--preset--color--blue-050) 100%);
}

.ns-hero-inner {
  min-height: min(720px, calc(100dvh - 88px));
  align-items: center;
}

.ns-hero-copy {
  max-width: 720px;
}

.ns-hero-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 94, 153, 0.18);
  border-radius: 12px;
  background: var(--wp--preset--color--white);
  box-shadow: var(--ns-card-shadow);
  padding: clamp(24px, 4vw, 40px);
}

.ns-hero-panel::before,
.ns-hero-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.ns-hero-panel::before {
  inset: 0 auto auto 0;
  width: 120px;
  height: 8px;
  background: var(--wp--preset--color--foundation-blue);
}

.ns-hero-panel::after {
  right: 0;
  bottom: 0;
  width: 120px;
  height: 8px;
  background: var(--wp--preset--color--campaign-red);
}

.ns-step-row {
  padding: 16px 0;
  border-top: 1px solid var(--wp--preset--color--neutral-100);
}

.ns-step-row:first-of-type {
  border-top: 0;
}

.ns-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 999px;
  background: var(--wp--preset--color--blue-050);
  color: var(--wp--preset--color--deep-medical-blue);
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 800;
}

/* Cards and box styles */
.wp-block-group.is-style-card,
.ns-card {
  height: 100%;
  border: 1px solid var(--wp--preset--color--neutral-100);
  border-radius: 8px;
  background: var(--wp--preset--color--white);
  box-shadow: var(--ns-card-shadow);
  padding: clamp(20px, 3vw, 28px);
  transition: border-color var(--ns-transition), box-shadow var(--ns-transition), transform var(--ns-transition);
}

.wp-block-group.is-style-card:hover,
.ns-card:hover {
  border-color: rgba(0, 94, 153, 0.28);
  box-shadow: var(--ns-card-shadow-hover);
  transform: translateY(-2px);
}

.wp-block-group.is-style-info-box {
  border-left: 4px solid var(--wp--preset--color--foundation-blue);
  border-radius: 8px;
  background: var(--wp--preset--color--blue-050);
  padding: clamp(20px, 3vw, 28px);
}

.wp-block-group.is-style-urgent-box {
  border: 1px solid rgba(138, 31, 45, 0.34);
  border-left: 6px solid var(--wp--preset--color--urgent-bordeaux);
  border-radius: 8px;
  background: var(--wp--preset--color--soft-bordeaux);
  color: var(--wp--preset--color--bordeaux-dark);
  padding: clamp(20px, 3vw, 28px);
}

.wp-block-group.is-style-safety-note {
  border: 1px solid var(--wp--preset--color--neutral-300);
  border-left: 4px solid var(--wp--preset--color--deep-medical-blue);
  border-radius: 8px;
  background: var(--wp--preset--color--neutral-050);
  padding: clamp(18px, 3vw, 24px);
}

.wp-block-group.is-style-positive-box {
  border: 1px solid rgba(31, 157, 138, 0.28);
  border-left: 4px solid var(--wp--preset--color--health-teal);
  border-radius: 8px;
  background: var(--wp--preset--color--soft-mint);
  padding: clamp(20px, 3vw, 28px);
}

.wp-block-group.is-style-warning-box {
  border: 1px solid rgba(246, 168, 0, 0.45);
  border-left: 4px solid var(--wp--preset--color--warm-amber);
  border-radius: 8px;
  background: var(--wp--custom--color--surface-warning, #fff5d6);
  color: var(--wp--custom--color--text-warning, #6a4a00);
  padding: clamp(20px, 3vw, 28px);
}

.wp-block-group.is-style-campaign-band,
.ns-campaign-band {
  border-radius: 12px;
  background: linear-gradient(135deg, #005e99 0%, #006fae 100%);
  color: var(--wp--preset--color--white);
  padding: clamp(28px, 5vw, 56px);
}

.wp-block-group.is-style-campaign-band :where(h1, h2, h3, h4, p, a),
.ns-campaign-band :where(h1, h2, h3, h4, p, a) {
  color: inherit;
}

.wp-block-group.is-style-section-soft {
  background: var(--wp--preset--color--neutral-050);
  padding: clamp(28px, 5vw, 56px);
}

/* Button variants */
.wp-block-button.is-style-campaign .wp-block-button__link {
  border-color: var(--wp--preset--color--campaign-red);
  background: var(--wp--preset--color--campaign-red);
  color: var(--wp--preset--color--white);
}

.wp-block-button.is-style-campaign .wp-block-button__link:hover {
  border-color: var(--wp--preset--color--urgent-bordeaux);
  background: var(--wp--preset--color--urgent-bordeaux);
}

.wp-block-button.is-style-urgent .wp-block-button__link {
  border-color: var(--wp--preset--color--urgent-bordeaux);
  background: var(--wp--preset--color--urgent-bordeaux);
  color: var(--wp--preset--color--white);
}

.wp-block-button.is-style-urgent .wp-block-button__link:hover {
  border-color: var(--wp--preset--color--bordeaux-dark);
  background: var(--wp--preset--color--bordeaux-dark);
}

.wp-block-button.is-style-ghost .wp-block-button__link {
  border: 2px solid var(--wp--preset--color--deep-medical-blue);
  background: transparent;
  color: var(--wp--preset--color--deep-medical-blue);
}

.wp-block-button.is-style-ghost .wp-block-button__link:hover {
  background: var(--wp--preset--color--blue-050);
  color: var(--wp--preset--color--deep-blue-hover);
}

.wp-block-button.is-style-white .wp-block-button__link {
  border: 2px solid var(--wp--preset--color--white);
  background: var(--wp--preset--color--white);
  color: var(--wp--preset--color--deep-medical-blue);
}

.wp-block-button.is-style-white .wp-block-button__link:hover {
  border-color: var(--wp--preset--color--neutral-100);
  background: var(--wp--preset--color--neutral-100);
  color: var(--wp--preset--color--deep-blue-hover);
}

/* Search */
.wp-block-search__inside-wrapper {
  border-radius: 8px;
}

.wp-block-search__input {
  min-height: 52px;
}

.wp-block-search__button {
  border-radius: 8px;
}

.ns-hero-search {
  max-width: 680px;
}

/* FAQ */
.wp-block-details.is-style-faq,
.ns-faq .wp-block-details {
  margin-top: 12px;
  border: 1px solid var(--wp--preset--color--neutral-100);
  border-radius: 8px;
  background: var(--wp--preset--color--white);
  padding: 0;
}

.wp-block-details.is-style-faq summary,
.ns-faq .wp-block-details summary {
  cursor: pointer;
  padding: 18px 20px;
  color: var(--wp--preset--color--text-primary);
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 700;
}

.wp-block-details.is-style-faq > :not(summary),
.ns-faq .wp-block-details > :not(summary) {
  margin-right: 20px;
  margin-left: 20px;
}

/* Checklists */
.wp-block-list.is-style-checklist {
  list-style: none;
  padding-left: 0;
}

.wp-block-list.is-style-checklist li {
  position: relative;
  margin: 10px 0;
  padding-left: 32px;
}

.wp-block-list.is-style-checklist li::before {
  content: "✓";
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--wp--preset--color--soft-mint);
  color: var(--wp--preset--color--health-teal);
  font-weight: 800;
}

/* Image frame */
.wp-block-image.is-style-protective-frame {
  position: relative;
  padding: 12px;
  border-top: 6px solid var(--wp--preset--color--foundation-blue);
  border-right: 6px solid var(--wp--preset--color--foundation-blue);
  border-bottom: 6px solid var(--wp--preset--color--campaign-red);
  border-left: 6px solid var(--wp--preset--color--campaign-red);
  background: var(--wp--preset--color--white);
}

.wp-block-image.is-style-protective-frame img {
  display: block;
}

/* Query grids */
.ns-query-grid .wp-block-post-template {
  align-items: stretch;
}

.ns-query-card {
  height: 100%;
}

.ns-query-card .wp-block-post-title a {
  color: var(--wp--preset--color--text-primary);
  text-decoration: none;
}

.ns-query-card .wp-block-post-title a:hover {
  color: var(--wp--preset--color--deep-medical-blue);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.ns-query-card .wp-block-post-featured-image img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.wp-block-query-pagination {
  margin-top: clamp(32px, 5vw, 56px);
}

.wp-block-query-pagination-numbers .page-numbers,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--wp--preset--color--neutral-300);
  border-radius: 8px;
  padding: 8px 12px;
  text-decoration: none;
}

.wp-block-query-pagination-numbers .current {
  border-color: var(--wp--preset--color--deep-medical-blue);
  background: var(--wp--preset--color--deep-medical-blue);
  color: var(--wp--preset--color--white);
}

/* Article */
.ns-article-header {
  padding-top: clamp(32px, 6vw, 72px);
  padding-bottom: clamp(24px, 4vw, 48px);
}

.ns-article-body {
  max-width: 760px;
}

.ns-article-body > * + * {
  margin-top: 1.25em;
}

.ns-article-body :where(h2, h3, h4) {
  scroll-margin-top: 120px;
}

.ns-article-body :where(ul, ol) {
  padding-left: 1.25em;
}

.ns-article-body li + li {
  margin-top: 0.45em;
}

.ns-article-toc {
  margin-bottom: 32px;
  border: 1px solid var(--wp--preset--color--neutral-100);
  border-radius: 8px;
  background: var(--wp--preset--color--neutral-050);
  padding: 20px 24px;
}

.ns-medical-review dl {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
  gap: 8px 20px;
  margin: 0;
}

.ns-medical-review dt {
  color: var(--wp--preset--color--text-secondary);
  font-weight: 700;
}

.ns-medical-review dd {
  margin: 0;
}

/* Breadcrumbs */
.wp-block-breadcrumbs,
.wp-block-breadcrumbs a {
  color: var(--wp--preset--color--text-muted);
  font-size: var(--wp--preset--font-size--small);
}

/* Footer */
.ns-site-footer {
  margin-top: clamp(56px, 8vw, 96px);
  background: #231f20;
  color: var(--wp--preset--color--white);
}

.ns-site-footer :where(h2, h3, h4, p, li, a) {
  color: inherit;
}

.ns-site-footer a {
  text-decoration-color: rgba(255, 255, 255, 0.55);
}

.ns-site-footer a:hover {
  color: var(--wp--preset--color--white);
  text-decoration-color: var(--wp--preset--color--white);
}

.ns-footer-logo {
  display: block;
  width: min(280px, 100%);
  height: auto;
  padding: 8px;
  background: var(--wp--preset--color--white);
  border-radius: 8px;
}

.ns-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

/* Tables */
.wp-block-table table {
  border-collapse: collapse;
}

.wp-block-table th {
  background: var(--wp--preset--color--neutral-050);
  text-align: left;
}

.wp-block-table th,
.wp-block-table td {
  border: 1px solid var(--wp--preset--color--neutral-300);
  padding: 12px 14px;
  vertical-align: top;
}

/* Responsive */
@media (max-width: 1100px) {
  .ns-main-navigation .wp-block-navigation-item__content {
    padding-right: 3px;
    padding-left: 3px;
    font-size: 14px;
  }
}

@media (max-width: 960px) {
  .ns-header-inner {
    min-height: 76px;
  }

  .ns-brand-link img {
    height: 48px;
  }

  .ns-hero-inner {
    min-height: auto;
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .ns-medical-review dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .ns-medical-review dd + dt {
    margin-top: 10px;
  }
}

@media (max-width: 782px) {
  .admin-bar .ns-site-header {
    top: 46px;
  }

  .ns-site-header {
    position: relative;
    top: auto;
  }

  .ns-header-search {
    display: none;
  }

  .ns-section {
    padding-top: 44px;
    padding-bottom: 44px;
  }

  .ns-site-footer .wp-block-columns {
    gap: 28px;
  }
}

@media (max-width: 600px) {
  .ns-brand-link img {
    height: 42px;
  }

  .wp-block-buttons {
    width: 100%;
  }

  .wp-block-buttons > .wp-block-button {
    width: 100%;
  }

  .wp-block-buttons > .wp-block-button .wp-block-button__link {
    width: 100%;
    text-align: center;
  }

  .ns-campaign-band {
    border-radius: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .ns-site-header,
  .ns-site-footer,
  .wp-block-navigation,
  .wp-block-search,
  .wp-block-buttons,
  .ns-campaign-band,
  .wp-block-query-pagination {
    display: none !important;
  }

  body {
    color: #000 !important;
    background: #fff !important;
    font-size: 12pt;
  }

  a {
    color: #000 !important;
    text-decoration: underline;
  }

  .ns-article-body {
    max-width: none;
  }

  .wp-block-group.is-style-card,
  .wp-block-group.is-style-info-box,
  .wp-block-group.is-style-urgent-box,
  .wp-block-group.is-style-safety-note {
    box-shadow: none;
    break-inside: avoid;
  }
}
