/* =========================================================
   HAPPY PENS ARCHIVE — PEOPLE & PEN
   System elements only
========================================================= */

:root {
  --hpc-pp-bg: #fdfbf8;
  --hpc-pp-surface: #fffdfa;
  --hpc-pp-border: #d8c8aa;
  --hpc-pp-border-soft: #e8dfd1;
  --hpc-pp-gold: #b08a52;
  --hpc-pp-gold-dark: #8c6836;
  --hpc-pp-title: #171411;
  --hpc-pp-text: #423d38;
  --hpc-pp-muted: #77706a;
  --hpc-pp-blue-grey: #64718a;
  --hpc-pp-shadow: 0 3px 15px 2px rgba(42, 32, 20, 0.15);
  --hpc-pp-radius: 8px;
}

/*
 * Не изменяем ширину основного контента.
 * Блоки занимают только доступную ширину родителя Kadence.
 */
.hpc-pp-story-system,
.hpc-pp-navigation,
.hpc-pp-acknowledgement,
.hpc-pp-archive,
.hpc-pp-pagination {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

/* =========================================================
   STORY SYSTEM WRAPPER
========================================================= */

.hpc-pp-story-system {
  margin-top: 22px;
}

/* =========================================================
   PREVIOUS / CURRENT / NEXT
========================================================= */

.hpc-pp-navigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;

  min-height: 120px;
  margin: 0;

  background: var(--hpc-pp-surface);
  border: 1px solid var(--hpc-pp-gold);
  border-radius: var(--hpc-pp-radius);
  box-shadow: var(--hpc-pp-shadow);

  overflow: hidden;
}

.hpc-pp-navigation__side {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.hpc-pp-navigation__side--previous {
  text-align: center;
}

.hpc-pp-navigation__side--next {
  text-align: center;
}

.hpc-pp-navigation__side--empty {
  min-height: 120px;
}

.hpc-pp-navigation__link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  width: 100%;
  min-width: 0;
  padding: 15px 22px;

  color: var(--hpc-pp-title);
  text-decoration: none !important;

  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.hpc-pp-navigation__link:hover,
.hpc-pp-navigation__link:focus-visible {
  background: rgba(176, 138, 82, 0.055);
  color: var(--hpc-pp-title);
}

.hpc-pp-navigation__link:focus-visible {
  outline: 2px solid var(--hpc-pp-gold);
  outline-offset: -3px;
}

.hpc-pp-navigation__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;

  margin-bottom: 5px;

  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: var(--hpc-pp-title);
}

/* =========================================================
   MAIN ROW: ICON + CENTERED TEXT BLOCK
========================================================= */

.hpc-pp-navigation__main {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 18px;

    width: 100%;
    min-width: 0;
}

/* Previous — сдвиг влево, к внешнему краю */
.hpc-pp-navigation__side--previous .hpc-pp-navigation__main {
    transform: translateX(-30px);
}

/* Next — сдвиг вправо, к внешнему краю */
.hpc-pp-navigation__side--next .hpc-pp-navigation__main {
    transform: translateX(30px);
}

/* =========================================================
   TEXT STACK: LABEL + PERSON + PEN
========================================================= */

.hpc-pp-navigation__copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-width: 0;

    gap: 6px;

    text-align: center;
}


/* =========================================================
   LABEL / PERSON / PEN — ONE CENTRAL AXIS
========================================================= */

.hpc-pp-navigation__label,
.hpc-pp-navigation__person,
.hpc-pp-navigation__pen {
    display: block;

    width: 100%;
    max-width: 100%;

    margin: 0;
    padding: 0;

    text-align: center;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   PREVIOUS / NEXT LABEL
========================================================= */

.hpc-pp-navigation__label {
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .01em;

    color: var(--hpc-pp-title);
}


/* =========================================================
   PERSON
========================================================= */

.hpc-pp-navigation__person {
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.35;

    color: var(--hpc-pp-title);
}


/* =========================================================
   PEN
========================================================= */

.hpc-pp-navigation__pen {
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.35;

    color: var(--hpc-pp-gold-dark);
}


/* =========================================================
   CHAPTER NAVIGATION ICON
========================================================= */

.hpc-pp-navigation__chapter-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 42px;

    width: 42px;
    height: 42px;

    margin: 0;

    border: 1px solid rgba(176, 138, 82, .65);
    border-radius: 50%;

    color: #B08A52;

    box-sizing: border-box;
}


/* =========================================================
   ICON INNER
========================================================= */

.hpc-pp-navigation__chapter-icon .hpc-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 22px;
    height: 22px;
}


.hpc-pp-navigation__chapter-icon svg {
    display: block;

    width: 100%;
    height: 100%;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   HOVER
========================================================= */

.hpc-pp-navigation__link:hover
.hpc-pp-navigation__chapter-icon,
.hpc-pp-navigation__link:focus-visible
.hpc-pp-navigation__chapter-icon {
    background: #B08A52;
    border-color: #B08A52;

    color: #FDFBF8;
}

/* =========================================================
   CURRENT STORY
========================================================= */

.hpc-pp-navigation__current {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-width: 210px;
  padding: 14px 28px;

  border-left: 1px solid var(--hpc-pp-border-soft);
  border-right: 1px solid var(--hpc-pp-border-soft);

  text-align: center;
}

.hpc-pp-navigation__project {
  display: block;
  margin-bottom: 4px;

  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--hpc-pp-gold-dark);
}

.hpc-pp-navigation__position {
  display: block;

  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--hpc-pp-title);
}

/* =========================================================
   STORY PROGRESS
========================================================= */

.hpc-pp-navigation__progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;

  width: 150px;
  max-width: 100%;
  margin-top: 10px;
}

.hpc-pp-navigation__progress-dot {
  display: block;
  flex: 0 0 5px;

  width: 5px;
  height: 5px;

  background: #dedbd6;
  border-radius: 50%;
}

.hpc-pp-navigation__progress-dot.is-active {
  background: var(--hpc-pp-gold);
}

/* =========================================================
   ACKNOWLEDGEMENT
========================================================= */

.hpc-pp-acknowledgement {
  margin: 27px 0 0;
  padding: 0 24px 26px;

  background: transparent;
  border: 0;
  text-align: center;
}

.hpc-pp-acknowledgement__inner {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

.hpc-pp-acknowledgement__heading {
  margin: 0 0 9px;

  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--hpc-pp-blue-grey);
}

.hpc-pp-acknowledgement__text {
  margin: 0;

  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 13px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.65;
  color: var(--hpc-pp-gold-dark);
}

/* =========================================================
   ARCHIVE
========================================================= */

.hpc-pp-archive {
  margin: 0;
}

.hpc-pp-archive__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.hpc-pp-archive__empty {
  padding: 45px 24px;

  background: var(--hpc-pp-surface);
  border: 1px solid var(--hpc-pp-border-soft);
  border-radius: var(--hpc-pp-radius);

  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
  color: var(--hpc-pp-muted);
}

/* =========================================================
   ARCHIVE CARD
========================================================= */

.hpc-pp-card {
  min-width: 0;

  background: var(--hpc-pp-surface);
  border: 1px solid var(--hpc-pp-border-soft);
  border-radius: var(--hpc-pp-radius);
  box-shadow: 0 4px 13px rgba(42, 32, 20, 0.065);

  overflow: hidden;

  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.hpc-pp-card:hover {
  transform: translateY(-2px);
  border-color: var(--hpc-pp-border);
  box-shadow: 0 8px 20px rgba(42, 32, 20, 0.1);
}

.hpc-pp-card__link {
  display: block;
  height: 100%;

  color: inherit;
  text-decoration: none !important;
}

.hpc-pp-card__media {
  position: relative;

  width: 100%;
  aspect-ratio: 4 / 3;

  background: #f0ece6;
  overflow: hidden;
}

.hpc-pp-card__image {
  display: block;

  width: 100%;
  height: 100%;
  object-fit: cover;

  transition: transform 300ms ease;
}

.hpc-pp-card:hover .hpc-pp-card__image {
  transform: scale(1.018);
}

.hpc-pp-card__image-placeholder {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(
      135deg,
      rgba(176, 138, 82, 0.08),
      rgba(176, 138, 82, 0.015)
    );
}

.hpc-pp-card__number {
  position: absolute;
  top: 12px;
  left: 12px;

  padding: 5px 9px;

  background: rgba(253, 251, 248, 0.94);
  border: 1px solid rgba(176, 138, 82, 0.42);
  border-radius: 3px;

  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hpc-pp-gold-dark);
}

.hpc-pp-card__content {
  padding: 21px 21px 23px;
}

.hpc-pp-card__status {
  margin-bottom: 7px;

  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hpc-pp-gold);
}

.hpc-pp-card__person {
  margin: 0;

  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--hpc-pp-title);
}

.hpc-pp-card__country {
  margin-top: 5px;

  font-size: 13px;
  line-height: 1.4;
  color: var(--hpc-pp-muted);
}

.hpc-pp-card__pen {
  margin: 18px 0 0;
  padding-top: 16px;

  border-top: 1px solid var(--hpc-pp-border-soft);

  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--hpc-pp-title);
}

.hpc-pp-card__excerpt {
  margin: 11px 0 0;

  font-size: 14px;
  line-height: 1.65;
  color: var(--hpc-pp-text);
}

.hpc-pp-card__read {
  display: inline-block;
  margin-top: 18px;

  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--hpc-pp-gold-dark);
}

/* =========================================================
   PAGINATION
========================================================= */

.hpc-pp-pagination {
  margin-top: 40px;
}

.hpc-pp-pagination .page-numbers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;

  margin: 0;
  padding: 0;

  list-style: none;
}

.hpc-pp-pagination .page-numbers li {
  margin: 0;
  padding: 0;
}

.hpc-pp-pagination a.page-numbers,
.hpc-pp-pagination span.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 38px;
  min-height: 38px;
  padding: 7px 11px;

  background: var(--hpc-pp-surface);
  border: 1px solid var(--hpc-pp-border-soft);
  border-radius: 4px;

  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--hpc-pp-text);
  text-decoration: none !important;
}

.hpc-pp-pagination a.page-numbers:hover,
.hpc-pp-pagination a.page-numbers:focus-visible {
  border-color: var(--hpc-pp-gold);
  color: var(--hpc-pp-gold-dark);
}

.hpc-pp-pagination span.page-numbers.current {
  background: var(--hpc-pp-gold);
  border-color: var(--hpc-pp-gold);
  color: #fff;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

  .hpc-pp-navigation__current {
    min-width: 175px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .hpc-pp-navigation__link {
    padding-right: 15px;
    padding-left: 15px;
  }

  .hpc-pp-navigation__person,
  .hpc-pp-navigation__pen {
    white-space: normal;
  }

  .hpc-pp-archive__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 640px) {

  .hpc-pp-story-system {
    margin-top: 18px;
  }

  .hpc-pp-navigation {
    grid-template-columns: 1fr;
  }

  .hpc-pp-navigation__side,
  .hpc-pp-navigation__side--empty {
    min-height: 0;
  }

  .hpc-pp-navigation__current {
    grid-row: 1;

    min-width: 0;
    padding: 17px 18px;

    border-right: 0;
    border-left: 0;
    border-bottom: 1px solid var(--hpc-pp-border-soft);
  }

  .hpc-pp-navigation__side--previous {
    grid-row: 2;
    border-bottom: 1px solid var(--hpc-pp-border-soft);
  }

  .hpc-pp-navigation__side--next {
    grid-row: 3;
  }

  .hpc-pp-navigation__side--empty {
    display: none;
  }

  .hpc-pp-navigation__link {
    padding: 17px 20px;
  }

  .hpc-pp-navigation__progress {
    width: 135px;
  }

  .hpc-pp-acknowledgement {
    margin-top: 24px;
    padding: 0 18px 22px;
  }

  .hpc-pp-acknowledgement__heading {
    font-size: 15px;
  }

  .hpc-pp-acknowledgement__text {
    font-size: 12px;
    line-height: 1.7;
  }

  .hpc-pp-archive__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hpc-pp-card__person {
    font-size: 20px;
  }
}
/* =========================================================
   SINGLE STORY: HIDE THEME TITLE
========================================================= */

/*
 * WordPress Title остаётся в системе для slug, SEO и админки,
 * но стандартный заголовок темы над Kadence-макетом не выводится.
 */
body.single-people_pen .entry-header,
body.single-people_pen .entry-hero-container-inner .entry-header,
body.single-people_pen .entry-title,
body.single-people_pen .page-title {
  display: none !important;
}

/* Убирает оставшийся верхний отступ Kadence, если header скрыт. */
body.single-people_pen .content-area,
body.single-people_pen .site-main,
body.single-people_pen article.people_pen {
  margin-top: 0;
}

/* =========================================================
   COMPACT TOP NAVIGATION
========================================================= */

.hpc-pp-topbar {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  width: 100%;
  max-width: 100%;
  margin: 0 0 24px;
  padding: 1px 0 12px;

  border-bottom: 1px solid var(--hpc-pp-border-soft);

  font-size: 14px;
  line-height: 1.3;
  color: var(--hpc-pp-muted);
}

.hpc-pp-topbar__catalogue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;

  font-weight: 700;
  letter-spacing: 0.025em;
  color: var(--hpc-pp-gold-dark);
  text-decoration: none !important;
}

.hpc-pp-topbar__catalogue:hover,
.hpc-pp-topbar__catalogue:focus-visible {
  color: var(--hpc-pp-title);
}

.hpc-pp-topbar__catalogue:focus-visible,
.hpc-pp-topbar__arrow:focus-visible {
  outline: 2px solid var(--hpc-pp-gold);
  outline-offset: 3px;
}

.hpc-pp-topbar__back {
  display: inline-block;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  transition: transform 160ms ease;
}

.hpc-pp-topbar__catalogue:hover .hpc-pp-topbar__back {
  transform: translateX(-2px);
}

.hpc-pp-topbar__sequence {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  flex: 0 0 auto;
}

.hpc-pp-topbar__position {
  white-space: nowrap;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--hpc-pp-muted);
}

.hpc-pp-topbar__controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hpc-pp-topbar__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 30px;
  height: 30px;

  border: 1px solid var(--hpc-pp-border-soft);
  border-radius: 50%;

  font-family: Georgia, serif;
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
  color: var(--hpc-pp-gold-dark);
  text-decoration: none !important;

  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.hpc-pp-topbar__arrow:hover {
  background: #b08a52;
  border-color: rgba(176, 138, 82, 0.055);
  color: #171411;
}

.hpc-pp-topbar__arrow.is-disabled {
  opacity: 0.28;
  cursor: default;
}

@media (max-width: 640px) {

  .hpc-pp-topbar {
    gap: 12px;
    margin-bottom: 18px;
    padding-top: 8px;
    padding-bottom: 10px;
  }

  .hpc-pp-topbar__catalogue {
    font-size: 11px;
  }

  .hpc-pp-topbar__sequence {
    gap: 8px;
  }

  .hpc-pp-topbar__position {
    font-size: 10px;
  }

  .hpc-pp-topbar__arrow {
    width: 27px;
    height: 27px;
  }
}


/* =========================================================
   PEOPLE & PEN — VIEW PEN BUTTON
========================================================= */

.hpc-pp-view-pen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 24px;

    border: 1px solid #B08A52;
    border-radius: 3px;
    background: transparent;

    color: #B08A52 !important;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.08em;
    text-align: center;
    text-decoration: none !important;
    text-transform: uppercase;

    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.hpc-pp-view-pen:hover,
.hpc-pp-view-pen:focus-visible {
    border-color: #B08A52;
    background: #B08A52;
    color: #FDFBF8 !important;
    text-decoration: none !important;
}

.hpc-pp-view-pen:focus-visible {
    outline: 2px solid #171411;
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .hpc-pp-view-pen {
        min-height: 42px;
        padding: 0 20px;
        font-size: 13px;
    }
}

/* =========================================================
   PEOPLE & PEN — QUOTE MARKS
========================================================= */

.hpc-pp-quote {
    position: relative;
}


/* Opening quote */

.hpc-pp-quote::before {
    content: "\201C";

    display: inline;

    margin-right: 3px;

    color: #B08A52;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.65em;
    font-weight: 400;
    line-height: 0;
}


/* Closing quote */

.hpc-pp-quote::after {
    content: "\201D";

    display: inline;

    margin-left: 3px;

    color: #B08A52;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.55em;
    font-weight: 400;
    line-height: 0;
}

/* =========================================================
   PEOPLE & PEN — TABLET PORTRAIT LAYOUT
   641px–900px / portrait only

   Desktop / tablet landscape остаются без изменений.
   Mobile <= 640px продолжает использовать mobile rules.
========================================================= */

@media
(min-width: 641px)
and (max-width: 900px)
and (orientation: portrait) {


    /* =====================================================
       ROW 1 — HERO
       3 columns:
       column 1 + column 2 = first row
       column 3 = second row full width
    ===================================================== */

    .hpc-pp-single-hero > .kt-row-column-wrap {
        grid-template-columns:
            repeat(1, minmax(0, 1fr)) !important;
    }

    .hpc-pp-single-hero
    > .kt-row-column-wrap
    > .wp-block-kadence-column:nth-child(3) {
        grid-column: 1 / -1 !important;
    }


    /* =====================================================
       ROW 3 — STORY / PERSON / PEN
       3 columns -> 1 column per row
    ===================================================== */

    .hpc-pp-single-story-info > .kt-row-column-wrap {
        grid-template-columns:
            minmax(0, 1fr) !important;
    }

    .hpc-pp-single-story-info
    > .kt-row-column-wrap
    > .wp-block-kadence-column {
        grid-column: 1 / -1 !important;
    }


    /* =====================================================
       ROW 4 — ABOUT THE PEN
       Every column gets its own row
    ===================================================== */

    .hpc-pp-single-about-pen > .kt-row-column-wrap {
        grid-template-columns:
            minmax(0, 1fr) !important;
    }

    .hpc-pp-single-about-pen
    > .kt-row-column-wrap
    > .wp-block-kadence-column {
        grid-column: 1 / -1 !important;
    }


    /* =====================================================
       ROW 5 — KEY SPECS + MAIN FEATURE
       2 columns -> 1 column per row
    ===================================================== */

    .hpc-pp-single-specs-feature > .kt-row-column-wrap {
        grid-template-columns:
            minmax(0, 1fr) !important;
    }

    .hpc-pp-single-specs-feature
    > .kt-row-column-wrap
    > .wp-block-kadence-column {
        grid-column: 1 / -1 !important;
    }


    /* =====================================================
       ROW 6 — NIB + FILLING SYSTEM
       4 columns -> 2 columns per row
    ===================================================== */

    .hpc-pp-single-nib-filling > .kt-row-column-wrap {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }

    .hpc-pp-single-nib-filling
    > .kt-row-column-wrap
    > .wp-block-kadence-column {
        grid-column: auto !important;
    }


    /* =====================================================
       ROW 7 — PHOTO + QUOTE
       2 columns -> photo row + quote row
    ===================================================== */

    .hpc-pp-single-photo-quote > .kt-row-column-wrap {
        grid-template-columns:
            minmax(0, 1fr) !important;
    }

    .hpc-pp-single-photo-quote
    > .kt-row-column-wrap
    > .wp-block-kadence-column {
        grid-column: 1 / -1 !important;
    }

}