/*
Theme Name: Síť bez bariér
Theme URI: https://ausabac55.appon.cloud/
Author: Nadace Charty 77
Description: Šablona webu iniciativy Síť bez bariér podle vizuálního layoutu (Quicksand Bold, Noto Sans Light, zelená linka).
Version: 1.3.3
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.1
Text Domain: sit-bez-barier
*/

/*
  Mobilní hodnoty v :root, desktop v @media (min-width: 48rem).
  Poměry k logu: odsazení nadpisu `--sbb-inset`, zelená čára 2× toto odsazení.
*/

:root {
  --sbb-black: #111111;
  --sbb-ink: #282828;
  --sbb-green: #51ae30;
  --sbb-green-dark: #3d8624;
  --sbb-olive: #586840;
  --sbb-bg: #ffffff;
  --sbb-muted: #333333;
  --sbb-max: 64rem;
  --sbb-pad: 1.25rem;
  --sbb-logo: 9.6rem;
  --sbb-logo-height: calc(var(--sbb-logo) * 254 / 550);
  --sbb-title: 1.6rem;
  --sbb-h2: 1.45rem;
  --sbb-inset: 3rem;
  --sbb-rule: calc(var(--sbb-inset) * 2);
  --sbb-gap: 0.75rem;
  --sbb-logo-gutter: 1rem;
}

@media (min-width: 48rem) {
  :root {
    --sbb-pad: 3rem;
    --sbb-logo: 14rem;
    --sbb-title: 2rem;
    --sbb-h2: 1.85rem;
    --sbb-inset: 4.375rem;
    --sbb-logo-gutter: var(--sbb-inset);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--sbb-bg);
  color: var(--sbb-black);
  font-family: "Noto Sans", system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.55;
}

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

a {
  color: var(--sbb-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
  color: var(--sbb-green-dark);
}

:focus-visible {
  outline: 3px solid var(--sbb-green);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--sbb-pad);
  top: -100px;
  z-index: 100;
  background: var(--sbb-black);
  color: #fff;
  padding: 0.5rem 0.85rem;
  font-weight: 400;
}

.skip-link:focus {
  top: 0.75rem;
}

.site {
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: var(--sbb-max);
  margin: 0 auto;
  padding-left: var(--sbb-pad);
  padding-right: var(--sbb-pad);
}

.site-header {
  padding-top: 1.5rem;
}

.header-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.site-logo {
  display: block;
  width: var(--sbb-logo);
  max-width: 100%;
  margin-left: var(--sbb-logo-gutter);
}

.site-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.header-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
  margin-right: var(--sbb-inset);
  gap: 0.75rem;
}

.lang-switch ul {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lang-switch-item a,
.lang-switch-item span {
  display: block;
  line-height: 0;
  border-radius: 2px;
}

.lang-switch-item img {
  display: block;
  width: 1.75rem;
  height: auto;
  border: 1px solid rgba(40, 40, 40, 0.18);
  border-radius: 2px;
  opacity: 0.42;
}

.lang-switch-item a:hover img,
.lang-switch-item a:focus-visible img {
  opacity: 0.85;
}

.lang-switch-item.is-active img {
  opacity: 1;
  border-color: var(--sbb-green);
  outline: 2px solid var(--sbb-green);
  outline-offset: 2px;
}

.header-nav {
  position: relative;
}

.nav-toggle {
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--sbb-ink);
}

.nav-toggle-bar-green {
  background: var(--sbb-green);
}

.site-nav {
  width: 100%;
  text-align: right;
}

.site-nav:not(.is-open) {
  display: none;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li {
  margin: 0.15rem 0;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--sbb-black);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
  color: var(--sbb-green-dark);
}

.nav-extra {
  margin: 0 0 0.55rem;
}

.nav-extra a {
  font-size: 0.8rem;
  text-decoration: none;
}

.header-rule {
  height: 6px;
  margin: var(--sbb-logo-gutter) 0;
  background: var(--sbb-green);
  border: 0;
}

.site-main {
  flex: 1 0 auto;
  padding-bottom: 0;
}

.page-title,
.entry-content h1,
.entry-content h2,
.archive-title {
  font-family: "Quicksand", "Noto Sans", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: var(--sbb-black);
  margin-left: var(--sbb-inset);
  max-width: 66.67%;
}

.page-title,
.entry-content h1,
.archive-title {
  font-size: var(--sbb-title);
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.entry-content h2 {
  font-size: var(--sbb-h2);
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
}

.entry-content h1 + .sbb-org-name,
.entry-content > .sbb-org-name:first-child,
.entry-content > h2:first-child {
  margin-top: 0;
}

.sbb-org-name {
  scroll-margin-top: 1.25rem;
}

.entry-content a.sbb-org-site {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.28em;
  color: var(--sbb-green);
  text-decoration: none;
  vertical-align: -0.12em;
}

.entry-content a.sbb-org-site:hover,
.entry-content a.sbb-org-site:focus-visible {
  color: var(--sbb-green-dark);
}

.sbb-org-site-icon {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  background-color: currentColor;
  -webkit-mask: url("assets/img/external.svg") center / contain no-repeat;
  mask: url("assets/img/external.svg") center / contain no-repeat;
}

.entry-content p,
.entry-content li {
  font-size: 1rem;
  font-weight: 300;
}

.entry-content p {
  margin: 0 var(--sbb-inset) 1.1rem 0;
}

.entry-content a {
  color: var(--sbb-black);
}

/*
  Čára jen u prvního bloku za nadpisem. Obrázky i odstavce
  drží stejné levé odsazení, aby nepodtékaly čáru.
*/
.entry-content h1 + p,
.entry-content h2 + p,
.entry-content h1 + figure,
.entry-content h2 + figure,
.entry-content h1 + .wp-block-image,
.entry-content h2 + .wp-block-image,
.entry-content h1 + .sbb-with-rule,
.entry-content h2 + .sbb-with-rule {
  position: relative;
  min-height: 1.4em;
}

.entry-content h1 ~ p,
.entry-content h2 ~ p,
.entry-content h1 ~ figure,
.entry-content h2 ~ figure,
.entry-content h1 ~ .wp-block-image,
.entry-content h2 ~ .wp-block-image,
.entry-content h1 ~ .sbb-with-rule,
.entry-content h2 ~ .sbb-with-rule {
  padding-left: calc(var(--sbb-rule) + var(--sbb-gap));
  margin-right: var(--sbb-inset);
}

.entry-content figure,
.entry-content .wp-caption,
.entry-content .wp-block-image,
.entry-content figure.aligncenter,
.entry-content .wp-caption.aligncenter {
  display: block;
  width: auto !important;
  max-width: 100%;
  margin-left: 0;
  margin-right: var(--sbb-inset);
  margin-bottom: 1.1rem;
  float: none;
}

.entry-content p img,
.entry-content figure img,
.entry-content .wp-caption img,
.entry-content .wp-block-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-left: 0;
  margin-right: 0;
}

/* Obálka výroční zprávy má vlastní velikost, sloupec ji nesmí zvětšovat. */
.entry-content .sbb-report img {
  width: auto;
  max-width: min(100%, 254px);
}

.entry-content figcaption,
.entry-content .wp-caption-text {
  margin: 0.45rem 0 0;
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--sbb-muted);
}

.sbb-block + .sbb-block {
  margin-top: 3.25rem;
}

.entry-content p + h1 {
  margin-top: 3.25rem;
}

.entry-content h1 + p::before,
.entry-content h2 + p::before,
.entry-content h1 + figure::before,
.entry-content h2 + figure::before,
.entry-content h1 + .wp-block-image::before,
.entry-content h2 + .wp-block-image::before,
.entry-content h1 + .sbb-with-rule::before,
.entry-content h2 + .sbb-with-rule::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc((1lh - 1cap) / 2);
  width: var(--sbb-rule);
  height: 2px;
  background: var(--sbb-green);
}

.entry-content h1 + p:has(img)::before,
.entry-content h2 + p:has(img)::before,
.entry-content h1 + figure::before,
.entry-content h2 + figure::before,
.entry-content h1 + .wp-block-image::before,
.entry-content h2 + .wp-block-image::before {
  top: 0;
}

.sbb-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  text-align: left;
}

.sbb-table th,
.sbb-table td {
  padding: 0.35rem 0;
  vertical-align: top;
  font-weight: 300;
}

.sbb-table thead th:not(.sbb-table-gap) {
  font-weight: 700;
  text-align: center;
  padding-bottom: 0.75rem;
}

.sbb-table tbody th {
  font-weight: 300;
}

.sbb-table :is(th, td):not(.sbb-table-gap):not(.sbb-area-note-cell) {
  width: 1%;
}

.sbb-table thead th:not(.sbb-table-gap),
.sbb-table .sbb-area-garant {
  white-space: nowrap;
}

.sbb-table thead th:first-child,
.sbb-table tbody th {
  padding-right: 1.5rem;
}

.sbb-table thead th:last-child,
.sbb-table .sbb-area-garant {
  padding-left: 1.5rem;
}

.sbb-table-gap {
  width: 99%;
  padding: 0;
  border: 0;
}

.sbb-area-note-cell {
  padding: 0 1.5rem 0 0;
  vertical-align: top;
}

.sbb-area-head {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.sbb-area-name {
  white-space: nowrap;
}

.sbb-area-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  position: relative;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sbb-green);
  cursor: pointer;
  vertical-align: -0.12em;
}

.sbb-area-toggle:hover,
.sbb-area-toggle:focus-visible {
  color: var(--sbb-green-dark);
}

.sbb-area-icon,
.sbb-area-icon::before,
.sbb-area-icon::after {
  display: block;
}

.sbb-area-icon {
  position: relative;
  width: 0.72rem;
  height: 0.72rem;
  margin: 0 auto;
}

.sbb-area-icon::before,
.sbb-area-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.sbb-area-icon::before {
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
}

.sbb-area-icon::after {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  transform-origin: center;
  transition: transform 0.2s ease;
}

.sbb-area.is-open .sbb-area-icon::after,
.sbb-fold.is-open .sbb-area-icon::after,
.sbb-area-toggle[aria-expanded="true"] .sbb-area-icon::after {
  transform: scaleY(0);
}

.sbb-area-note-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
}

.sbb-area.is-open .sbb-area-note-wrap,
.sbb-fold.is-open .sbb-area-note-wrap {
  grid-template-rows: 1fr;
}

.sbb-area-note-inner {
  overflow: hidden;
  min-height: 0;
}

.entry-content .sbb-area-note {
  margin: 0.35rem 0 0.2rem;
  padding-left: 1rem;
  white-space: normal;
  font-weight: 300;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sbb-area.is-open .sbb-area-note {
  opacity: 1;
}

div.sbb-fold {
  margin: 0;
}

.entry-content p .sbb-area-toggle {
  margin-left: 0.28em;
}

div.sbb-fold .sbb-area-note-inner {
  opacity: 0;
  transition: opacity 0.2s ease;
}

div.sbb-fold.is-open .sbb-area-note-inner {
  opacity: 1;
}

div.sbb-fold .sbb-area-note-inner > :first-child {
  margin-top: 0.45rem;
}

.entry-content h1 ~ .sbb-fold,
.entry-content h2 ~ .sbb-fold {
  padding-left: calc(var(--sbb-rule) + var(--sbb-gap));
  margin-right: var(--sbb-inset);
}

.entry-content .sbb-fold p,
.entry-content .sbb-fold figure,
.entry-content .sbb-fold .wp-caption,
.entry-content .sbb-fold .wp-block-image {
  margin-right: 0;
  padding-left: 0;
}

@media (max-width: 47.99rem) {
  .sbb-area-head {
    display: inline;
  }

  .sbb-area-name {
    white-space: normal;
  }

  .sbb-area-toggle {
    margin-left: 0.28em;
    vertical-align: -0.12em;
  }

  .sbb-table :is(th, td):not(.sbb-table-gap):not(.sbb-area-note-cell) {
    width: 99%;
  }

  .sbb-table thead :is(th, td):last-child:not(.sbb-table-gap):not(.sbb-area-note-cell),
  .sbb-table :is(th, td).sbb-area-garant:not(.sbb-table-gap):not(.sbb-area-note-cell) {
    width: 1%;
    white-space: nowrap;
    padding-left: 0.75rem;
  }

  .sbb-table thead th:first-child,
  .sbb-table tbody th {
    padding-right: 0.75rem;
  }

  .sbb-table :is(th, td).sbb-table-gap {
    width: 0;
    max-width: 0;
    padding: 0;
    overflow: hidden;
  }
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  margin: 0 0 1.75rem;
  max-width: 40rem;
}

.post-list h2 {
  font-family: "Quicksand", sans-serif;
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--sbb-muted);
  margin: 0 0 0.4rem;
}

.empty-note {
  max-width: 36rem;
}

.year-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.year-list a {
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}

.contact-block p {
  margin: 0 0 0.4rem;
}

.site-footer {
  padding: 2.5rem 0 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--sbb-muted);
  margin: 0;
}

.footer-mark {
  display: block;
  margin-left: auto;
  margin-right: var(--sbb-inset);
  line-height: 0;
}

.footer-mark img {
  display: block;
  width: auto;
  height: 65px;
}

@media (max-width: 47.99rem) {
  .site-header {
    position: relative;
    z-index: 40;
  }

  .header-rule {
    position: relative;
    z-index: 0;
  }

  .header-tools {
    margin-right: var(--sbb-logo-gutter);
  }

  .footer-mark {
    margin-right: var(--sbb-logo-gutter);
  }

  .footer-mark img {
    height: 35px;
  }

  .entry-content p {
    margin-right: var(--sbb-logo-gutter);
  }

  .entry-content figure,
  .entry-content .wp-caption,
  .entry-content .wp-block-image,
  .entry-content figure.aligncenter,
  .entry-content .wp-caption.aligncenter {
    margin-left: var(--sbb-logo-gutter);
    margin-right: var(--sbb-logo-gutter);
  }

  body.sbb-nav-open .nav-toggle {
    visibility: hidden;
  }

  .site-nav.is-open {
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    bottom: auto;
    z-index: 30;
    display: block;
    width: max-content;
    max-width: min(16rem, calc(100vw - 2 * var(--sbb-pad)));
    margin: 0;
    padding: 0 0 0.2rem 2.25rem;
    background: linear-gradient(
      to right,
      rgb(255 255 255 / 0) 0,
      rgb(255 255 255 / 1) 2rem,
      rgb(255 255 255 / 1) 100%
    );
    text-align: right;
  }

  .site-nav.is-open li {
    margin: 0;
  }

  .site-nav.is-open a {
    display: block;
    line-height: 1.3;
    padding: 0.08rem 0;
  }

  .page-title,
  .entry-content h1,
  .entry-content h2,
  .archive-title {
    max-width: none;
    margin-left: var(--sbb-logo-gutter);
    margin-right: var(--sbb-logo-gutter);
  }

  .entry-content h1::after,
  .entry-content h2::after,
  .page-title::after,
  .archive-title::after {
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    margin-top: 0.65rem;
    background: var(--sbb-green);
  }

  .entry-content h1 + p::before,
  .entry-content h2 + p::before,
  .entry-content h1 + figure::before,
  .entry-content h2 + figure::before,
  .entry-content h1 + .wp-block-image::before,
  .entry-content h2 + .wp-block-image::before,
  .entry-content h1 + .sbb-with-rule::before,
  .entry-content h2 + .sbb-with-rule::before {
    content: none;
  }

  .entry-content h1 ~ p,
  .entry-content h2 ~ p,
  .entry-content h1 ~ figure,
  .entry-content h2 ~ figure,
  .entry-content h1 ~ .wp-block-image,
  .entry-content h2 ~ .wp-block-image,
  .entry-content h1 ~ .sbb-with-rule,
  .entry-content h2 ~ .sbb-with-rule,
  .entry-content h1 ~ .sbb-fold,
  .entry-content h2 ~ .sbb-fold {
    padding-left: 0;
    margin-left: var(--sbb-logo-gutter);
    margin-right: var(--sbb-logo-gutter);
  }
}

@media (min-width: 48rem) {
  .site-header {
    padding-top: 2.5rem;
  }

  .header-inner {
    display: grid;
    flex-wrap: nowrap;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: stretch;
    column-gap: 1rem;
    row-gap: 0.75rem;
  }

  .site-logo {
    display: flex;
    grid-column: 1;
    grid-row: 2;
    width: auto;
    align-self: stretch;
  }

  .site-logo img {
    width: auto;
    height: 100%;
    max-width: none;
  }

  .header-tools {
    display: grid;
    grid-column: 2;
    grid-row: 1 / 3;
    grid-template-rows: subgrid;
    align-items: end;
    gap: 0;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav,
  .site-nav:not(.is-open) {
    display: block;
    width: auto;
  }

  .site-nav li {
    margin: 0;
  }
}
