:root {
  /* Značka */
  --color-primary: #e7488a;
  --color-accent: #e7488a;
  --color-secondary: #dae4eb;

  /* Základní */
  --color-black: #181c25;
  --color-white: #f6f8f7;

  /* Text */
  --color-text-primary: #2e333f;
  --color-text-secondary: rgb(75, 83, 99);
  --color-text-tertiary: rgb(111, 132, 143);

  /* Odvozené role */
  --color-headings: var(--color-primary);
  --color-tag-inverted: var(--color-white);
  --color-border: var(--color-secondary);
}

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

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  font-family: Rubik-Light, sans-serif;
}

/* Vizuálně skrytý obsah – zůstává pro čtečky a SEO (např. h1). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Nadpisové prvky beze změny vzhledu (vizuál řeší .frame-title /
   .article-title; tyto resety jen ruší výchozí styl <h1>/<h2>). */
h1.frame-title {
  margin: 0;
}

.article-card-heading {
  margin: 0;
  font: inherit;
}

.non-selectable {
  -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */ /* Konqueror HTML */
       -moz-user-select: none; /* Firefox */
        -ms-user-select: none; /* Internet Explorer/Edge */
            user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome and Opera */
}

/* Hero header – úvodní bílý, v běžném toku nad obsahem; se scrollem
   přirozeně odjede pryč, žádná animace navázaná na scroll. */
.header-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 150px;
  background-color: var(--color-white);
}

/* Sticky header – kompaktní růžový s pevnou výškou; objeví se, jakmile
   se hero header zmenší o 1px pod jeho výšku. */
.header-sticky {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  z-index: 2;
  background-color: var(--color-primary);
  transform: translateY(-100%);
  opacity: 0;
  /* skrývání: posun zároveň s průhledností, která mizí až ke konci –
     header zůstane vidět, dokud zajíždí */
  transition: transform .4s cubic-bezier(.32, .72, 0, 1), opacity .4s ease-in, box-shadow .4s cubic-bezier(.32, .72, 0, 1);
}

.header-sticky.is-visible {
  transform: translateY(0);
  opacity: 1;
  /* zobrazení: výjezd zeshora + rychlé objevení */
  transition: transform .4s cubic-bezier(.32, .72, 0, 1), opacity .1s ease-out, box-shadow .4s cubic-bezier(.32, .72, 0, 1);
  -webkit-box-shadow: 0 15px 30px 0 color-mix(in srgb, var(--color-black) 11%, transparent), 0 30px 60px 0 color-mix(in srgb, var(--color-black) 11%, transparent);
          box-shadow: 0 15px 30px 0 color-mix(in srgb, var(--color-black) 11%, transparent), 0 30px 60px 0 color-mix(in srgb, var(--color-black) 11%, transparent);
}

.header-content {
  margin: auto;
  width: 100%;
  max-width: calc(1100px + 2 * 45px);
  padding-left: 45px;
  padding-right: 45px;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  gap: 25px;
  color: var(--color-white);
}

.site-logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  height: 28px;
  font-family: KaushanScript;
  text-decoration: none;
  font-size: 1.45em;
}

.site-logo::before {
  content: '';
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background-color: currentColor;
  -webkit-mask: url('/images/icons/site_logo.svg') center / contain no-repeat;
          mask: url('/images/icons/site_logo.svg') center / contain no-repeat;
}

/* Vnitřek hero headeru – logo + kategorie ve sloupci na střed. */
.hero-header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 19px;
}

/* Velké logo na střed – v hero headeru */
.site-logo-hero {
  height: 42px;
  gap: 0;
  font-size: 2.15em;
  color: var(--color-primary);
}

.site-logo-hero::before {
  width: 42px;
  height: 42px;
}

/* Kompaktní logo vlevo – ve sticky headeru */
.site-logo-compact {
  color: var(--color-white);
  gap: 0;
}

/* Seznam kategorií – pod logem v hero headeru, vpravo ve sticky headeru */
.category-nav {
  display: flex;
  flex-direction: row;
  gap: 24px;
}

.category-link {
  position: relative;
  font-family: 'RobotoCondensed', sans-serif;
  font-size: .82em;
  letter-spacing: .07em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text-tertiary);
  transition: color .15s ease;
}

.category-link:hover {
  color: var(--color-primary);
}

.header-sticky .category-nav {
  margin-left: auto;
}

.header-sticky .category-link {
  color: var(--color-white);
}

.header-sticky .category-link::after {
  background-color: var(--color-white);
}

.admin-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: -4px;
}

.admin-nav-link::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: url('/images/icons/material/admin_panel-dark.svg') center / 16px no-repeat;
          mask: url('/images/icons/material/admin_panel-dark.svg') center / 16px no-repeat;
  flex-shrink: 0;
}

.category-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 2px;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .2s ease-out;
}

.category-link:hover::after {
  transform: scaleX(1);
}

.options-frame {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
}

.options-frame .option {
  background-size: 24px;
  background-position: center;
  background-repeat: no-repeat;
  width: 24px;
  height: 24px;
  cursor: pointer;
  position: relative;
}

.options-frame .option:hover {
  transform: scale(1.12);
}

.option.admin {
  background-size: 27px;
  background-image: url('/images/icons/material/admin_panel-dark.svg');
}

.nav-item {
  text-decoration: none;
  color: var(--color-white);
}

footer {
  background-color: var(--color-secondary);
  box-sizing: border-box;
  margin-top: 30px;
  width: 100%;
  height: 56px;
  position: fixed;
  bottom: 0;
  z-index: -1;
}

.footer-content {
  margin: auto;
  height: 100%;
  width: 100%;
  max-width: calc(1100px + 2 * 45px);
  padding-left: 45px;
  padding-right: 45px;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  color: var(--color-text-secondary);
  font-size: .9em;
}

.frame-title {
  color: var(--color-primary);
  font-size: 1.585em;
  font-family: 'RobotoCondensed';
  font-weight: 400;
}

aside {
  grid-area: aside;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

aside .frame-title {
  margin-bottom: 30px;
}

.aside-content {
  color: var(--color-black);
}

.aside-content:last-of-type {
  margin-top: auto;
}

.aside-content.sticky {
  position: sticky;
  top: calc(56px + 25px);
}

.tags-frame-wrapper {
  margin-bottom: 20px;
}

aside .tags-frame-wrapper {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.tags-frame-wrapper .tag {
  flex-shrink: 0;
  padding-top: 6.5px;
  padding-bottom: 7px;
  padding-left: 9.5px;
  padding-right: 10.5px;
  color: var(--color-black);
  background-color: var(--color-secondary);
  border-radius: 5px;
  font-size: .915em;
  transition: all 0.15s ease;
  text-decoration: none;
}

.tags-frame-wrapper .tag::before {
  content: '# ';
}

.tags-frame-wrapper .tag::after {
  /* content: attr(data-posts-count); */
  margin-left: 7px;
  background-color: var(--color-headings);
  border-radius: 2px;
  color: var(--color-tag-inverted);
  font-weight: bold;
  box-sizing: border-box;
  padding-top: 1px;
  padding-bottom: .5px;
  padding-left: 3px;
  padding-right: 2.5px;
  font-size: .8em;
  border: 1px solid transparent;
}

.tags-frame-wrapper .tag:hover {
  transition: all 0.15s ease;
  color: var(--color-white);
  background-color: var(--color-primary);
}

.author-frame-wrapper {
  border-radius: 12px;
  background-image: url('/images/misc/avatar.webp');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  padding: 18px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  color: white;
}

.author-frame-wrapper::before {
  position: absolute;
  content: '';
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background-color: color-mix(in srgb, var(--color-black) 15%, transparent);
}

@keyframes gradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.author-frame {
  position: relative;
  z-index: 1;
  font-family: RobotoCondensed;
  font-size: 1.225em;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.author-avatar {
  flex-shrink: 0;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background-image: url('/images/misc/avatar.webp');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
}

.author-name {
  color: var(--color-white);
}

.main-wrapper {
  width: 100%;
  background-color: var(--color-white);
  min-height: calc(100vh - 56px);
  margin-bottom: 56px;
  padding-bottom: 65px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, .1);
  box-sizing: border-box;
}

.main-frame {
  width: inherit;
  display: grid;
  grid-template-areas: 'hero-wrapper hero-wrapper'
                       'nav aside'
                       'articles aside'
                       'wide-wrapper wide-wrapper';
  grid-template-columns: 1fr clamp(240px, 28%, 300px);
  grid-template-rows: auto auto 1fr;
  column-gap: 30px;
  width: 100%;
  min-height: 100vh;
  max-width: calc(1100px + 2 * 45px);
  padding-left: 45px;
  padding-right: 45px;
  padding-top: 0;
  box-sizing: border-box;
  padding-bottom: 30px;
  margin: auto;
}

/* Položky gridu se smí zúžit pod min-content svého obsahu – jinak by
   širší prvek (karta článku) roztáhl 1fr sloupec a rozhodil centrování. */
.main-frame > * {
  min-width: 0;
}

.back-to-top {
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  margin-top: 30px;
  background-image: url('/images/icons/material/arrow_up-light.svg');
  width: auto;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 49px;
  border-radius: 50% 50% 0 0;
  opacity: .5;
  padding: 5px;
  padding-top: 68px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}

.back-to-top:hover {
  opacity: 1;
}

/* Stránkování (sdílené napříč stránkami) */
.pagination {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 45px;
}

.page-link {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 38px;
  height: 38px;
  padding: 0.75px 6px 0;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text-secondary);
  font-family: 'RobotoCondensed', sans-serif;
  font-size: 1.02em;
  line-height: 1;
  cursor: pointer;
  transition: all .15s ease;
}

.page-link:hover {
  background-color: var(--color-secondary);
}

.page-link.current {
  background-color: var(--color-primary);
  color: var(--color-white);
  cursor: default;
}

.page-link.disabled {
  opacity: .35;
  pointer-events: none;
}

.page-link.prev,
.page-link.next {
  font-size: 1.55em;
  line-height: 0;
  transform: translateY(-2px);
}

/* =====================================================================
   Responzivní vrstva. Desktop na plné šíři (obsah > 1190 px) je beze
   změn – všechny breakpointy začínají až pod hranicí max-width layoutu.
   ===================================================================== */

/* --- Úzké pásmo dvousloupcového layoutu: aside se zúžil, avatar autorky
       se s ním úměrně zmenší, ať v boxu nezůstane nepoměrně velký. --- */
@media (max-width: 1160px) and (min-width: 981px) {

  .author-avatar {
    width: 104px;
    height: 104px;
  }

  .author-frame {
    gap: 12px;
  }
}

/* --- Sbalení dvousloupcového layoutu do jednoho sloupce --- */
@media (max-width: 980px) {

  .main-frame {
    grid-template-areas: 'hero-wrapper'
                         'nav'
                         'articles'
                         'aside'
                         'wide-wrapper';
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  aside {
    margin-top: 45px;
  }

  .aside-content.sticky {
    position: static;
  }

  .aside-content:last-of-type {
    display: none;
  }
}

/* --- Mobilní zobrazení --- */
@media (max-width: 600px) {

  .header-content,
  .footer-content {
    padding-left: 20px;
    padding-right: 20px;
    gap: 16px;
  }

  .main-frame {
    padding-left: 20px;
    padding-right: 20px;
  }

  aside {
    margin-top: 38px;
  }

  .frame-title {
    font-size: 1.38em;
  }

  /* Hero hlavička – menší logo, kategorie se mohou zalomit */
  .header-hero {
    height: auto;
    min-height: 130px;
    padding: 22px 20px;
    box-sizing: border-box;
  }

  .hero-header-inner {
    gap: 14px;
    width: 100%;
  }

  .site-logo-hero {
    height: 34px;
    font-size: 1.7em;
  }

  .site-logo-hero::before {
    width: 34px;
    height: 34px;
  }

  .hero-header-inner .category-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
    max-width: 100%;
  }

  /* Sticky hlavička – logo vlevo, kategorie se vodorovně posouvají,
     ať se layout nikdy nezalomí na úzkém displeji. */
  .header-content .site-logo,
  .options-frame {
    flex-shrink: 0;
  }

  .header-sticky .category-nav {
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .header-sticky .category-nav::-webkit-scrollbar {
    display: none;
  }

  .header-sticky .category-link {
    white-space: nowrap;
  }

  .pagination {
    flex-wrap: wrap;
  }
}