/* Public subpages only. Keep the personal homepage and its motion untouched. */
main:has(> .page-heading) {
  --if-page-rule: #d1c7b5;
  --if-page-wash: #f1eadc;
  --if-page-gap: clamp(32px, 5vw, 76px);
}

/* A quiet editorial masthead: title and introduction have different roles. */
main:has(> .page-heading) > .if-breadcrumbs { border-top-color: var(--if-page-rule); }
main:has(> .page-heading) > .if-breadcrumbs ol { padding-block: 18px; }
main:has(> .page-heading) > .page-heading {
  background: linear-gradient(110deg, #eee6d7, #f5efe3 72%, #eee9dd);
  border-block: 1px solid var(--if-page-rule);
  padding-block: clamp(50px, 6vw, 88px);
  text-align: left;
}
main:has(> .page-heading) > .page-heading > .shell {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  column-gap: var(--if-page-gap);
  align-items: start;
}
main:has(> .page-heading) > .page-heading .eyebrow {
  grid-column: 1 / -1;
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
main:has(> .page-heading) > .page-heading .eyebrow::before {
  content: '';
  width: 30px;
  height: 1px;
  background: currentColor;
  flex: 0 0 auto;
}
main:has(> .page-heading) > .page-heading h1 {
  margin: 0;
  max-width: 17ch;
  font-size: clamp(48px, 5.2vw, 76px);
  line-height: 1.03;
  text-wrap: balance;
}
/* Headings use the editorial hierarchy instead of the old animated underline. */
main:has(> .page-heading) > .page-heading h1::after,
main:has(> .page-heading) .if-heading-ambient::after { content: none; display: none; animation: none; }
main:has(> .page-heading) > .page-heading .lead {
  max-width: 43ch;
  margin: 7px 0 0;
  padding: 12px 0 12px 28px;
  border-left: 1px solid #bcb29e;
  font-size: 15px;
  line-height: 1.95;
}
/* Own articles use a narrower, single-column masthead. */
main:has(> .page-heading) > .page-heading > .shell.narrow { display: block; max-width: 880px; }
main:has(> .page-heading) > .page-heading > .shell.narrow h1 { max-width: 22ch; }
main:has(> .page-heading) > .page-heading > .shell.narrow .lead { max-width: 68ch; margin-top: 28px; }

/* Section rhythm, reading measure and open layouts. */
main:has(> .page-heading) > .section { padding-block: clamp(60px, 7vw, 104px); }
main:has(> .page-heading) :is(.section-top, .editor-note, .personal-layout, .contact-layout, .if-sitemap-grid) > * { min-width: 0; }
main:has(> .page-heading) .section-top {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: var(--if-page-gap);
  align-items: start;
  margin-bottom: 54px;
}
main:has(> .page-heading) .section-top h2,
main:has(> .page-heading) .personal-layout h2 { font-size: clamp(38px, 4vw, 56px); line-height: 1.09; text-wrap: balance; }
main:has(> .page-heading) .section-top > p,
main:has(> .page-heading) .section-top > div > p:not(.eyebrow) { line-height: 1.95; max-width: 58ch; }
main:has(> .page-heading) .section-top .text-link { margin-top: 24px; }
main:has(> .page-heading) .if-section-heading { text-align: left; max-width: none; margin: 0 0 40px; font-size: clamp(34px, 3vw, 44px); }
main:has(> .page-heading) .editor-note {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: var(--if-page-gap);
  padding-top: 46px;
  margin-top: 64px;
  align-items: start;
  border-color: var(--if-page-rule);
}
main:has(> .page-heading) .editor-note h2 { max-width: 18ch; font-size: clamp(36px, 3.4vw, 46px); line-height: 1.13; text-wrap: balance; }
main:has(> .page-heading) .section > .shell > .editor-note:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
main:has(> .page-heading) .prose p { line-height: 1.95; }
main:has(> .page-heading) .prose ul,
main:has(> .page-heading) .prose ol { padding-left: 24px; line-height: 1.9; }
main:has(> .page-heading) .prose li + li { margin-top: 12px; }
main:has(> .page-heading) .prose table { max-width: 100%; border-collapse: collapse; }
main:has(> .page-heading) .prose th,
main:has(> .page-heading) .prose td { border-bottom: 1px solid var(--if-page-rule); padding: 14px 12px; text-align: left; overflow-wrap: anywhere; }
main:has(> .page-heading) .section > article.prose { max-width: 780px; }
main:has(> .page-heading) .section > article.prose h2 { font-size: clamp(30px, 3vw, 38px); line-height: 1.18; margin-bottom: 20px; }
main:has(> .page-heading) .section > article.prose h2:not(:first-child) { margin-top: 44px; padding-top: 30px; border-top: 1px solid var(--if-page-rule); }
main:has(> .page-heading) .if-inline-note { max-width: none; padding: 22px 0 0; margin-top: 32px; border-color: var(--if-page-rule); line-height: 1.9; }
main:has(> .page-heading) .if-inline-note h2 { font-size: 30px; margin-bottom: 14px; }
main:has(> .page-heading) .if-inline-note p { max-width: 76ch; }
main:has(> .page-heading) .actions { gap: 16px 28px; margin-top: 34px; }

/* Support topics: deliberately spacious rows, rather than six identical cards. */
main:has(> .page-heading) .area-list { border-top-color: var(--if-page-rule); }
main:has(> .page-heading) .area-list > article {
  grid-template-columns: 52px minmax(0, .95fr) minmax(0, 1.15fr);
  gap: 26px 36px;
  padding-block: 35px;
  border-bottom-color: var(--if-page-rule);
}
main:has(> .page-heading) .area-list .index { padding-top: 3px; font: 400 28px/1.1 Cormorant, Georgia, serif; }
main:has(> .page-heading) .area-list h3 { max-width: 19ch; font-size: clamp(29px, 2.5vw, 36px); line-height: 1.16; }
main:has(> .page-heading) .area-list p { font-size: 14px; line-height: 1.95; }

/* Three steps keep their numbering, but the reading hierarchy is stronger. */
main:has(> .page-heading) .process { gap: 40px; }
main:has(> .page-heading) .process > article { border-top-color: var(--if-page-rule); padding-top: 26px; }
main:has(> .page-heading) .process > article > span { font-size: 52px; line-height: 1; margin-bottom: 26px; }
main:has(> .page-heading) .process h3 { font-size: 33px; line-height: 1.14; margin-bottom: 18px; }
main:has(> .page-heading) .process p { font-size: 14px; line-height: 1.95; }

/* A restrained portrait frame works for both the placeholder and a CMS photo. */
main:has(> .page-heading) .personal-layout { gap: var(--if-page-gap); grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); }
main:has(> .page-heading) .personal-layout > div > p { font-size: 15px; line-height: 1.95; }
main:has(> .page-heading) .if-portrait-placeholder {
  max-width: 400px;
  border-color: var(--if-page-rule);
  background: linear-gradient(145deg, var(--paper), #ece4d4);
  box-shadow: 14px 14px 0 #e8e3d5;
}
main:has(> .page-heading) .if-portrait-placeholder figcaption { padding-block: 24px; font-size: 31px; }
/* Only the exact built-in SVG placeholder is hidden. CMS photographs remain visible. */
main:has(> .page-heading) .personal-layout > figure.if-portrait-placeholder:not(.if-portrait-real):has(> svg[aria-label="Placeholder portretu Izabeli Faber"]):not(:has(img)) { display: none; }
main:has(> .page-heading) .personal-layout:has(> figure.if-portrait-placeholder:not(.if-portrait-real) > svg[aria-label="Placeholder portretu Izabeli Faber"]):not(:has(> figure.if-portrait-placeholder img)) { grid-template-columns: minmax(0, 1fr); }
main:has(> .page-heading) .personal-layout:has(> figure.if-portrait-placeholder:not(.if-portrait-real) > svg[aria-label="Placeholder portretu Izabeli Faber"]):not(:has(> figure.if-portrait-placeholder img)) > div {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 20px var(--if-page-gap);
  align-items: start;
}
main:has(> .page-heading) .personal-layout:has(> figure.if-portrait-placeholder:not(.if-portrait-real) > svg[aria-label="Placeholder portretu Izabeli Faber"]):not(:has(> figure.if-portrait-placeholder img)) > div > h2 { grid-column: 1; grid-row: 1 / 4; margin-bottom: 0; max-width: 17ch; }
main:has(> .page-heading) .personal-layout:has(> figure.if-portrait-placeholder:not(.if-portrait-real) > svg[aria-label="Placeholder portretu Izabeli Faber"]):not(:has(> figure.if-portrait-placeholder img)) > div > p { grid-column: 2; margin: 0; }
main:has(> .page-heading) .personal-layout:has(> figure.if-portrait-placeholder:not(.if-portrait-real) > svg[aria-label="Placeholder portretu Izabeli Faber"]):not(:has(> figure.if-portrait-placeholder img)) > div > .actions { grid-column: 2; margin-top: 8px; }
main:has(> .page-heading) .if-detail-list > div {
  grid-template-columns: minmax(140px, .4fr) minmax(0, 1fr);
  gap: 26px 48px;
  padding-block: 27px;
  border-color: var(--if-page-rule);
}
main:has(> .page-heading) .if-detail-list dd { max-width: 76ch; font-size: 14px; line-height: 1.95; }
main:has(> .page-heading) .if-detail-list dt { font-size: 13px; padding-top: 3px; }
main:has(> .page-heading) .reading { background: #e9ecdf; border-block: 1px solid #d8ddce; }

/* FAQ: generous click targets, stable plus/minus, clear open state. */
main:has(> .page-heading) .faq-list { border-color: var(--if-page-rule); }
main:has(> .page-heading) .faq-list details { padding: 0; border-color: var(--if-page-rule); }
main:has(> .page-heading) .faq-list summary { align-items: center; padding: 25px 4px; line-height: 1.65; }
main:has(> .page-heading) .faq-list summary::after {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--if-page-rule);
  border-radius: 50%;
  color: var(--wine);
}
main:has(> .page-heading) .faq-list details[open] { background: #f3edde; padding-inline: 22px; }
main:has(> .page-heading) .faq-list details[open] summary { color: var(--wine); }
main:has(> .page-heading) .faq-list details p { font-size: 14px; max-width: 72ch; padding: 0 4px 23px; line-height: 1.95; }
main:has(> .page-heading) .faq-list details p + p { margin-top: -10px; }
main:has(> .page-heading) .faq-list details a { overflow-wrap: anywhere; }

/* Direct contact stays easy to scan; secondary information gets a quiet rail. */
main:has(> .page-heading) .contact-layout { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: var(--if-page-gap); align-items: start; }
main:has(> .page-heading) .contact-layout h2 { font-size: clamp(42px, 4vw, 56px); }
main:has(> .page-heading) .contact-layout .email-link { font-size: clamp(15px, 1.5vw, 19px); line-height: 1.8; }
main:has(> .page-heading) .contact-help { max-width: 54ch; font-size: 12px; line-height: 1.9; }
main:has(> .page-heading) .contact-details { border-left: 0; background: #eee9dc; padding: 35px 34px 38px; }
main:has(> .page-heading) .contact-details h3 { font-size: 29px; line-height: 1.15; margin-bottom: 15px; }
main:has(> .page-heading) .contact-details h3:not(:first-child) { border-top: 1px solid var(--if-page-rule); padding-top: 26px; margin-top: 30px; }
main:has(> .page-heading) .contact-details p { font-size: 13px; line-height: 1.95; }
main:has(> .page-heading) .contact-details .text-link { font-size: 12px; }
main:has(> .page-heading) .if-contact-template { padding: 0; margin-top: 30px; border-color: var(--if-page-rule); }
main:has(> .page-heading) .if-contact-template > summary { padding-block: 23px; align-items: center; line-height: 1.75; }
main:has(> .page-heading) .if-contact-template > :not(summary) { margin-top: 0; padding-bottom: 22px; line-height: 1.95; }
main:has(> .page-heading) .if-copy-button { min-height: 48px; padding-inline: 22px; }
main:has(> .page-heading) .crm-contact-section { margin-top: 42px; padding-top: 34px; }
main:has(> .page-heading) .crm-contact-fields { gap: 24px; }
main:has(> .page-heading) .crm-contact-form input:not([type=checkbox]),
main:has(> .page-heading) .crm-contact-form textarea { padding: 14px 16px; border-color: #b4a995; border-radius: 2px; background: #fffaf1; }
main:has(> .page-heading) .crm-contact-form textarea { min-height: 170px; }
main:has(> .page-heading) .crm-contact-form :focus-visible { outline-color: var(--wine); outline-width: 2px; }
main:has(> .page-heading) :is(a, button, summary):focus-visible { outline: 2px solid var(--wine); outline-offset: 5px; }
main:has(> .page-heading) .contact-band :is(a, button):focus-visible { outline-color: var(--paper); }

/* Publication rows have a title column and a short reading introduction. */
main:has(> .page-heading) .if-publication-filters { margin: 0 0 20px; gap: 12px 32px; }
main:has(> .page-heading) [data-if-publication-count] { border: 0; padding: 0; margin: 0 0 26px; }
main:has(> .page-heading) .if-publication-list { border-top-color: var(--if-page-rule); }
main:has(> .page-heading) .if-publication {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 18px var(--if-page-gap);
  padding-block: 38px 42px;
  border-bottom-color: var(--if-page-rule);
  align-items: start;
}
main:has(> .page-heading) .if-publication-meta { grid-column: 1; grid-row: 1; margin: 0; font-size: 11px; line-height: 1.8; }
main:has(> .page-heading) .if-publication :is(h2, h3) { grid-column: 1; grid-row: 2 / 4; margin: 0; max-width: 22ch; font-size: clamp(34px, 3.3vw, 46px); line-height: 1.12; }
main:has(> .page-heading) .if-publication > p:not(.if-publication-meta) { grid-column: 2; grid-row: 2; font-size: 14px; line-height: 1.95; margin: 0; }
main:has(> .page-heading) .if-publication > .text-link { grid-column: 2; grid-row: 3; justify-self: start; margin-top: 2px; font-size: 13px; }
main:has(> .page-heading) .if-publication:has(.if-publication-image) > .if-publication-image { grid-column: 1 / -1; grid-row: 1; max-width: 620px; margin: 0 0 8px; aspect-ratio: 16 / 9; }
main:has(> .page-heading) .if-publication:has(.if-publication-image) > .if-publication-meta { grid-row: 2; }
main:has(> .page-heading) .if-publication:has(.if-publication-image) > :is(h2, h3) { grid-row: 3 / 5; }
main:has(> .page-heading) .if-publication:has(.if-publication-image) > p:not(.if-publication-meta) { grid-row: 3; }
main:has(> .page-heading) .if-publication:has(.if-publication-image) > .text-link { grid-row: 4; }
main:has(> .page-heading) .if-article-image { border-radius: 2px; margin-block: 0 40px; }
main:has(> .page-heading) .if-sitemap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
main:has(> .page-heading) .if-sitemap-grid section { padding-top: 27px; border-top-color: var(--if-page-rule); }
main:has(> .page-heading) .if-sitemap-grid h2 { font-size: 34px; margin-bottom: 26px; }
main:has(> .page-heading) .if-sitemap-grid a { min-height: 38px; font-size: 13px; }

@media (hover: hover) and (pointer: fine) {
  main:has(> .page-heading) .area-list > article:hover { transform: none; background: linear-gradient(90deg, transparent, #efe8d957, transparent); }
  main:has(> .page-heading) .process > article:hover,
  main:has(> .page-heading) .if-publication:hover { transform: none; }
  main:has(> .page-heading) .faq-list summary:hover { color: var(--wine); }
}

@media (max-width: 1000px) {
  main:has(> .page-heading) { --if-page-gap: 36px; }
  main:has(> .page-heading) > .page-heading > .shell { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  main:has(> .page-heading) > .page-heading .lead { padding-left: 22px; font-size: 14px; }
  main:has(> .page-heading) .area-list > article { grid-template-columns: 36px minmax(0, .9fr) minmax(0, 1.1fr); gap: 22px; }
  main:has(> .page-heading) .process { gap: 26px; }
  main:has(> .page-heading) .process h3 { font-size: 29px; }
  main:has(> .page-heading) .contact-details { padding: 28px 24px; }
  main:has(> .page-heading) .if-sitemap-grid { gap: 30px; }
}

@media (max-width: 700px) {
  main:has(> .page-heading) { --if-page-gap: 28px; }
  main:has(> .page-heading) > .if-breadcrumbs ol { padding-block: 13px; }
  main:has(> .page-heading) > .page-heading { padding-block: 42px 46px; }
  main:has(> .page-heading) > .page-heading > .shell { display: block; }
  main:has(> .page-heading) > .page-heading .eyebrow { margin-bottom: 22px; gap: 12px; font-size: 10px; }
  main:has(> .page-heading) > .page-heading h1 { font-size: clamp(40px, 10.8vw, 54px); max-width: 20ch; line-height: 1.07; }
  main:has(> .page-heading) > .page-heading .lead { border-left: 0; border-top: 1px solid #c8bea9; padding: 21px 0 0; margin: 24px 0 0; max-width: 58ch; font-size: 14px; line-height: 1.9; }
  main:has(> .page-heading) > .section { padding-block: 54px; }
  main:has(> .page-heading) .section-top,
  main:has(> .page-heading) .editor-note,
  main:has(> .page-heading) .personal-layout,
  main:has(> .page-heading) .contact-layout { grid-template-columns: minmax(0, 1fr); }
  main:has(> .page-heading) .section-top { margin-bottom: 36px; gap: 24px; }
  main:has(> .page-heading) .editor-note { margin-top: 40px; padding-top: 32px; gap: 22px; }
  main:has(> .page-heading) .editor-note h2 { max-width: 22ch; font-size: 36px; }
  main:has(> .page-heading) .if-section-heading { font-size: 34px; margin-bottom: 30px; }
  main:has(> .page-heading) .area-list > article { grid-template-columns: 32px minmax(0, 1fr); gap: 12px 18px; padding-block: 27px; }
  main:has(> .page-heading) .area-list .index { font-size: 24px; padding-top: 4px; }
  main:has(> .page-heading) .area-list h3 { font-size: 30px; max-width: none; }
  main:has(> .page-heading) .area-list p { grid-column: 2; font-size: 13px; }
  main:has(> .page-heading) .process { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  main:has(> .page-heading) .process > article { grid-template-columns: 42px minmax(0, 1fr); gap: 12px 18px; padding-top: 23px; }
  main:has(> .page-heading) .process > article > span { font-size: 40px; margin-bottom: 0; }
  main:has(> .page-heading) .process h3 { font-size: 29px; margin-bottom: 0; }
  main:has(> .page-heading) .process p { font-size: 13px; }
  main:has(> .page-heading) .if-portrait-placeholder { max-width: 290px; margin-bottom: 12px; box-shadow: 9px 9px 0 #e8e3d5; }
  main:has(> .page-heading) .personal-layout:has(> figure.if-portrait-placeholder:not(.if-portrait-real) > svg[aria-label="Placeholder portretu Izabeli Faber"]):not(:has(> figure.if-portrait-placeholder img)) > div { display: block; }
  main:has(> .page-heading) .personal-layout:has(> figure.if-portrait-placeholder:not(.if-portrait-real) > svg[aria-label="Placeholder portretu Izabeli Faber"]):not(:has(> figure.if-portrait-placeholder img)) > div > h2 { max-width: 20ch; margin-bottom: 24px; }
  main:has(> .page-heading) .personal-layout:has(> figure.if-portrait-placeholder:not(.if-portrait-real) > svg[aria-label="Placeholder portretu Izabeli Faber"]):not(:has(> figure.if-portrait-placeholder img)) > div > p + p { margin-top: 18px; }
  main:has(> .page-heading) .personal-layout:has(> figure.if-portrait-placeholder:not(.if-portrait-real) > svg[aria-label="Placeholder portretu Izabeli Faber"]):not(:has(> figure.if-portrait-placeholder img)) > div > .actions { margin-top: 28px; }
  main:has(> .page-heading) .if-detail-list > div { grid-template-columns: minmax(0, 1fr); gap: 10px; padding-block: 23px; }
  main:has(> .page-heading) .if-detail-list dd { font-size: 13px; }
  main:has(> .page-heading) .faq-list summary { padding-block: 22px; gap: 16px; font-size: 13px; }
  main:has(> .page-heading) .faq-list summary::after { width: 30px; height: 30px; font-size: 22px; }
  main:has(> .page-heading) .faq-list details[open] { padding-inline: 12px; }
  main:has(> .page-heading) .faq-list details p { font-size: 13px; padding-bottom: 21px; }
  main:has(> .page-heading) .contact-layout { gap: 38px; }
  main:has(> .page-heading) .contact-details { border-top: 1px solid var(--if-page-rule); padding: 28px 22px; }
  main:has(> .page-heading) .contact-details h3 { font-size: 28px; }
  main:has(> .page-heading) .contact-layout .email-link { font-size: 15px; }
  main:has(> .page-heading) .crm-contact-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
  main:has(> .page-heading) .crm-contact-form input:not([type=checkbox]),
  main:has(> .page-heading) .crm-contact-form textarea,
  main:has(> .page-heading) select { font-size: 16px; }
  main:has(> .page-heading) .if-publication { display: block; padding-block: 29px 32px; }
  main:has(> .page-heading) .if-publication-meta { margin-bottom: 18px; }
  main:has(> .page-heading) .if-publication :is(h2, h3) { font-size: 35px; margin-bottom: 20px; }
  main:has(> .page-heading) .if-publication > .text-link { margin-top: 20px; font-size: 12px; }
  main:has(> .page-heading) .if-publication:has(.if-publication-image) > .if-publication-image { margin-bottom: 23px; }
  main:has(> .page-heading) .if-publication > p:not(.if-publication-meta) { font-size: 13px; }
  main:has(> .page-heading) .if-publication-filters { gap: 10px 23px; }
  main:has(> .page-heading) .if-sitemap-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  main:has(> .page-heading) .section > article.prose h2 { font-size: 30px; }
  main:has(> .page-heading) .section > article.prose h2:not(:first-child) { margin-top: 34px; padding-top: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  main:has(> .page-heading) .area-list > article,
  main:has(> .page-heading) .process > article,
  main:has(> .page-heading) .if-publication { transition: none; transform: none; }
}

@media print {
  main:has(> .page-heading) > .page-heading { padding-block: 24px; background: none; }
  main:has(> .page-heading) > .page-heading > .shell { display: block; }
  main:has(> .page-heading) > .page-heading h1 { font-size: 38px; max-width: none; }
  main:has(> .page-heading) > .page-heading .lead { border: 0; padding: 0; margin-top: 18px; max-width: none; }
  main:has(> .page-heading) > .section { padding-block: 28px; }
  main:has(> .page-heading) .contact-details { background: none; padding: 0; }
  main:has(> .page-heading) .if-portrait-placeholder { box-shadow: none; }
  main:has(> .page-heading) .if-publication,
  main:has(> .page-heading) .process > article { break-inside: avoid; }
}
