/* HOLZBAU Production Local Styles for optimalnaya-ploshchad-doma-dlya-semi */

:root {
  --hb-green: #2B6D3C;
  --hb-green-dark: #1b3022;
  --hb-green-light: rgba(43, 109, 60, 0.08);
  --hb-ink: #17201b;
  --hb-gray: #64748b;
  --hb-border: #e2e8f0;
}

/* Header hide on scroll down */
.header {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, background 0.3s ease !important;
}
.header.header--hidden {
  transform: translateX(-50%) translateY(-150%) translateZ(0) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

html {
  scroll-behavior: smooth;
}

.article-section,
.content h2,
.content h3 {
  scroll-margin-top: 110px;
}

/* Layout & TOC matching canonical HOLZBAU template */
.article-optimalnaya-ploshchad-doma-dlya-semi .article-layout {
  grid-template-columns: minmax(360px, 380px) minmax(0, 1fr);
  gap: 34px;
}

.article-optimalnaya-ploshchad-doma-dlya-semi .toc__head {
  padding: 20px 24px;
  font-size: 1.25rem;
}

.article-optimalnaya-ploshchad-doma-dlya-semi .toc__list {
  max-height: min(72vh, 760px);
  padding: 16px 16px 18px;
  gap: 8px;
}

.article-optimalnaya-ploshchad-doma-dlya-semi .toc__list a {
  padding: 11px 12px 11px 22px;
  font-size: clamp(1.05rem, 1.1vw, 1.2rem);
  line-height: 1.42;
}

.article-optimalnaya-ploshchad-doma-dlya-semi .toc__l2 a {
  padding-left: 32px;
}

.article-optimalnaya-ploshchad-doma-dlya-semi .toc__l3 a {
  padding-left: 44px;
}

/* Desktop Dynamic Sticky Aside: glides up when scrolling down (header hidden), down when scrolling up */
@media (min-width: 1081px) {
  .article-optimalnaya-ploshchad-doma-dlya-semi .article-aside {
    position: sticky;
    top: 104px;
    transition: top 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: top;
  }

  /* When scrolling down: header hides -> aside occupies top space */
  .article-optimalnaya-ploshchad-doma-dlya-semi.header-is-hidden .article-aside,
  body.header-is-hidden .article-optimalnaya-ploshchad-doma-dlya-semi .article-aside,
  body:has(.header--hidden) .article-optimalnaya-ploshchad-doma-dlya-semi .article-aside,
  .article-optimalnaya-ploshchad-doma-dlya-semi .article-aside.is-header-hidden {
    top: 24px;
  }

  .article-optimalnaya-ploshchad-doma-dlya-semi.header-is-hidden .toc__list,
  body.header-is-hidden .article-optimalnaya-ploshchad-doma-dlya-semi .toc__list,
  body:has(.header--hidden) .article-optimalnaya-ploshchad-doma-dlya-semi .toc__list,
  .article-optimalnaya-ploshchad-doma-dlya-semi .article-aside.is-header-hidden .toc__list {
    max-height: min(calc(100vh - 120px), 820px);
  }
}

/* Canonical TOC Mobile & Tablet Toggle */
.toc__toggle {
  display: none;
}

.toc.is-open .toc__toggle-icon {
  transform: rotate(45deg);
}

@media (max-width: 1080px) {
  .article-optimalnaya-ploshchad-doma-dlya-semi .article-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .article-optimalnaya-ploshchad-doma-dlya-semi .article-aside {
    position: static;
    margin-bottom: 24px;
  }

  .article-optimalnaya-ploshchad-doma-dlya-semi .toc {
    margin: 0 0 20px;
    border-radius: 18px;
    overflow: hidden;
  }

  .article-optimalnaya-ploshchad-doma-dlya-semi .toc__head {
    display: none;
  }

  .article-optimalnaya-ploshchad-doma-dlya-semi .toc__toggle {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border: 0;
    background: transparent;
    color: var(--hb-ink, #17201b);
    font-family: 'Montserrat', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .article-optimalnaya-ploshchad-doma-dlya-semi .toc__toggle:focus-visible {
    outline: 3px solid rgba(43, 109, 60, .32);
    outline-offset: -3px;
  }

  .article-optimalnaya-ploshchad-doma-dlya-semi .toc__toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(43, 109, 60, .1);
    color: var(--hb-green, #2B6D3C);
    font-family: 'Inter', sans-serif;
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1;
    transition: transform .25s ease, background-color .2s ease;
  }

  .article-optimalnaya-ploshchad-doma-dlya-semi .toc.is-open .toc__toggle-icon {
    transform: rotate(45deg);
    background: rgba(43, 109, 60, .18);
  }

  .article-optimalnaya-ploshchad-doma-dlya-semi .toc__list {
    max-height: 0;
    overflow: hidden;
    padding: 0 16px;
    opacity: 0;
    transition: max-height .3s cubic-bezier(0.16, 1, 0.3, 1), opacity .25s ease, padding .25s ease;
  }

  .article-optimalnaya-ploshchad-doma-dlya-semi .toc.is-open .toc__list {
    max-height: 58vh;
    overflow-y: auto;
    padding-top: 8px;
    padding-bottom: 16px;
    opacity: 1;
    -webkit-overflow-scrolling: touch;
  }

  .article-optimalnaya-ploshchad-doma-dlya-semi .toc__list a {
    padding: 10px 12px 10px 20px;
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .article-optimalnaya-ploshchad-doma-dlya-semi .toc__l2 a {
    padding-left: 28px;
  }

  .article-optimalnaya-ploshchad-doma-dlya-semi .toc__l3 a {
    padding-left: 38px;
  }
}

@media (max-width: 768px) {
  .article-optimalnaya-ploshchad-doma-dlya-semi .toc__toggle {
    font-size: 1rem;
    padding: 12px 16px;
  }

  .article-optimalnaya-ploshchad-doma-dlya-semi .toc__toggle-icon {
    width: 28px;
    height: 28px;
    font-size: 1.25rem;
  }

  .article-optimalnaya-ploshchad-doma-dlya-semi .toc.is-open .toc__list {
    max-height: 52vh;
  }

  .cta-banner {
    padding: 28px 20px;
    margin: 36px 0;
  }

  .cta-actions {
    flex-direction: column;
    gap: 12px;
  }

  .cta-actions .btn-primary,
  .cta-actions .btn-secondary {
    width: 100%;
    text-align: center;
  }
}

/* Content & Typography */
.article-optimalnaya-ploshchad-doma-dlya-semi .content {
  min-width: 0;
  font-family: 'Inter', sans-serif;
  color: #1e293b;
  line-height: 1.7;
}

.article-optimalnaya-ploshchad-doma-dlya-semi .content h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  font-weight: 700;
  color: var(--hb-ink);
  margin: 44px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hb-border);
  line-height: 1.3;
}

.article-optimalnaya-ploshchad-doma-dlya-semi .content h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin: 32px 0 14px;
  line-height: 1.35;
}

.article-optimalnaya-ploshchad-doma-dlya-semi .content h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--hb-green-dark);
  margin: 24px 0 10px;
  line-height: 1.4;
}

.article-optimalnaya-ploshchad-doma-dlya-semi .content p {
  margin: 0 0 18px;
  font-size: 1.02rem;
  line-height: 1.75;
}

.article-optimalnaya-ploshchad-doma-dlya-semi .content ul,
.article-optimalnaya-ploshchad-doma-dlya-semi .content ol {
  margin: 0 0 22px 24px;
  padding: 0;
}

.article-optimalnaya-ploshchad-doma-dlya-semi .content li {
  margin-bottom: 8px;
  font-size: 1.01rem;
  line-height: 1.65;
}

/* Figures */
.article-image-figure {
  margin: 34px 0;
}
.article-image-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.article-image-figure figcaption {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--hb-gray);
  text-align: center;
  font-style: italic;
}

/* Tables */
.table-wrapper {
  margin: 28px 0;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--hb-border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
}

.article-optimalnaya-ploshchad-doma-dlya-semi table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.94rem;
  background: #ffffff;
}

.article-optimalnaya-ploshchad-doma-dlya-semi table caption {
  padding: 12px 18px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  text-align: left;
  background: #f8fafc;
  border-bottom: 2px solid var(--hb-green);
  color: var(--hb-ink);
}

.article-optimalnaya-ploshchad-doma-dlya-semi table th {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hb-border);
  white-space: nowrap;
}

.article-optimalnaya-ploshchad-doma-dlya-semi table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: top;
}

.article-optimalnaya-ploshchad-doma-dlya-semi table tbody tr:nth-child(even) {
  background: #fcfdfc;
}

.article-optimalnaya-ploshchad-doma-dlya-semi table tbody tr:hover {
  background: rgba(43, 109, 60, 0.03);
}

/* Boxes */
.snippet-box {
  background: #f6faf7;
  border: 1px solid rgba(43, 109, 60, 0.22);
  border-left: 5px solid var(--hb-green);
  border-radius: 12px;
  padding: 22px 26px;
  margin: 28px 0;
}
.snippet-box .snippet-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--hb-green);
  margin-bottom: 10px;
}

.warning-box {
  background: #fffdf5;
  border: 1px solid #fde68a;
  border-left: 5px solid #d97706;
  border-radius: 12px;
  padding: 22px 26px;
  margin: 28px 0;
}
.warning-box .warning-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 8px;
}

.formula-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 5px solid var(--hb-green);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 24px 0;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

/* CTA Banner */
.cta-banner {
  background: linear-gradient(135deg, #1b3022 0%, #2c473e 100%);
  border-radius: 18px;
  padding: 40px 44px;
  color: #ffffff;
  margin: 50px 0;
  box-shadow: 0 15px 35px rgba(27, 48, 34, 0.2);
}
.content .cta-banner h3,
.cta-banner h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff !important;
  margin: 0 0 14px;
}
.cta-banner p {
  color: #e2e8f0;
  font-size: 1.05rem;
  margin: 0 0 24px;
  max-width: 800px;
}
.cta-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.cta-actions .btn-primary {
  background: #2B6D3C;
  color: #ffffff !important;
  padding: 14px 28px !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  border: none;
  cursor: pointer;
}
.cta-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff !important;
  padding: 14px 28px !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Author */
.article-optimalnaya-ploshchad-doma-dlya-semi .article-author {
  margin: 56px auto 12px;
  padding: 26px 30px;
  border: 1px solid rgba(43, 109, 60, .18);
  border-left: 4px solid var(--hb-green);
  border-radius: 16px;
  background: #f8faf7;
}
.article-optimalnaya-ploshchad-doma-dlya-semi .article-author__label {
  color: var(--hb-green);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.article-optimalnaya-ploshchad-doma-dlya-semi .article-author h2 {
  margin: 8px 0 10px;
  padding: 0;
  border: 0;
  font-size: 1.45rem;
  font-family: 'Montserrat', sans-serif;
}
.article-optimalnaya-ploshchad-doma-dlya-semi .article-author h2 a {
  color: var(--hb-ink);
  text-decoration: none;
}

/* Related Posts Collection styling */
.related-posts--collections {
  margin: 60px 0 40px;
}
.related-posts--collections .related-posts__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}
.related-posts--collections h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--hb-ink);
  margin: 0;
}
.related-posts__count {
  font-size: 0.95rem;
  color: var(--hb-gray);
  font-weight: 600;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.related-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
  padding: 24px 26px;
  border-radius: 16px;
  border: 1px solid var(--hb-border);
  text-decoration: none;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
  border-color: rgba(43, 109, 60, 0.4);
}
.related-card__tag {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hb-green);
  background: var(--hb-green-light);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.related-card strong {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--hb-ink);
  margin-bottom: 16px;
  flex-grow: 1;
}
.related-card__date {
  font-size: 0.85rem;
  color: var(--hb-gray);
}

/* Modals */
.call-modal.is-active,
.call-modal-overlay.is-active {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}


/* Architect Checklist: 10 Questions Cards Grid */
.architect-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 32px 0 38px;
}

@media (max-width: 768px) {
  .architect-checklist {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.architect-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.architect-card:hover {
  transform: translateY(-3px);
  border-color: rgba(43, 109, 60, 0.35);
  box-shadow: 0 10px 28px rgba(43, 109, 60, 0.08);
}

.architect-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.architect-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--hb-green);
  background: var(--hb-green-light);
  padding: 4px 12px;
  border-radius: 8px;
  letter-spacing: 0.04em;
}

.architect-card__tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.architect-card__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--hb-ink);
  margin: 0 0 10px;
  line-height: 1.35;
}

.architect-card__desc {
  font-size: 0.94rem;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 16px !important;
  flex-grow: 1;
}

.architect-card__impact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-left: 3px solid var(--hb-green);
  border-radius: 8px;
  font-size: 0.85rem;
  color: #1e293b;
  font-weight: 600;
  line-height: 1.4;
}

.architect-card__impact svg {
  color: var(--hb-green);
  flex-shrink: 0;
}

/* Quick answer snippet table: fit 100% without horizontal scroll */
.snippet-box .table-wrapper {
  margin: 18px 0 14px !important;
  padding: 0 !important;
  border: 1px solid var(--hb-border) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  background: #ffffff !important;
  overflow-x: auto !important;
}

.content .snippet-box table,
.snippet-box table {
  min-width: 0 !important;
  width: 100% !important;
  table-layout: fixed !important;
  border: none !important;
  border-collapse: collapse !important;
  margin: 0 !important;
  background: #ffffff !important;
}

.snippet-box table th,
.snippet-box table td {
  padding: 10px 12px !important;
  font-size: 0.88rem !important;
  line-height: 1.45 !important;
  vertical-align: top !important;
  border-bottom: 1px solid #f1f5f9 !important;
  border-right: 1px solid #f8fafc !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

.snippet-box table th:last-child,
.snippet-box table td:last-child {
  border-right: none !important;
}

.snippet-box table th {
  background: #f8fafc !important;
  color: var(--hb-ink) !important;
  font-weight: 700 !important;
  font-family: 'Montserrat', sans-serif !important;
  font-size: 0.84rem !important;
  letter-spacing: -0.01em !important;
}

.snippet-box table th:nth-child(1),
.snippet-box table td:nth-child(1) {
  width: 17% !important;
}

.snippet-box table th:nth-child(2),
.snippet-box table td:nth-child(2) {
  width: 14% !important;
  white-space: nowrap !important;
}

.snippet-box table th:nth-child(3),
.snippet-box table td:nth-child(3) {
  width: 36% !important;
}

.snippet-box table th:nth-child(4),
.snippet-box table td:nth-child(4) {
  width: 33% !important;
}

@media (max-width: 640px) {
  .snippet-box table {
    table-layout: auto !important;
    min-width: 520px !important;
  }
}

