/* Квадрат Піфагора (психоматриця) онлайн: /numerology/kvadrat-pifahora/.
   Підключається лише на цій сторінці (inc/tools/pythagoras.php). */

.pyth-main{padding-block:34px 100px}

/* «Хлібні крихти» */
.pyth-crumbs{margin-bottom:22px;font-size:13px;font-weight:750;line-height:1.5}
.pyth-crumbs ol{display:flex;flex-wrap:wrap;gap:0;margin:0;padding:0;list-style:none}
.pyth-crumbs li{display:inline-flex;align-items:center;min-width:0;min-height:44px}
.pyth-crumbs li+li::before{content:"›";margin:0 10px;color:var(--dim);font-weight:500}
.pyth-crumbs a{display:inline-flex;align-items:center;min-height:44px;text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:4px}
.pyth-crumbs a:hover{color:var(--blue)}
.pyth-crumbs [aria-current]{color:var(--dim)}

/* Заголовок сторінки */
.pyth-head{max-width:860px;padding-bottom:44px}
.pyth-head h1{font-size:clamp(36px,4.6vw,64px);line-height:1.1;letter-spacing:-.065em;margin:14px 0 20px;white-space:normal;overflow-wrap:break-word}
.pyth-lead{font-size:18px;line-height:1.55;max-width:640px}

/* Калькулятор: ліворуч форма, праворуч квадрат; значення — на всю ширину під ними */
.pyth-tool{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:40px 56px;padding:44px;background:var(--lilac);border:2px solid var(--ink);box-shadow:7px 7px 0 var(--ink)}
.pyth-tool>*{min-width:0}
.pyth-tool-intro h2{font-size:clamp(29px,3vw,43px);line-height:1.18;letter-spacing:-.065em;margin:16px 0}
.pyth-tool-intro h2 em{font-style:normal;color:var(--blue)}
.pyth-tool-intro>p:not(.eyebrow){font-size:15px;line-height:1.6;max-width:36ch}
.pyth-form{display:flex;align-items:end;gap:14px;margin-top:28px}
.pyth-form .field{flex:1;margin:0;min-width:0}
.pyth-form .button{flex-shrink:0;margin:0}
.pyth-form .button[aria-busy=true]{opacity:.75;cursor:progress}
.pyth-error{margin-top:16px;padding:12px 14px;background:#fffdf8;border:2px solid var(--ink);border-left:6px solid var(--coral);font-size:14px;font-weight:700;line-height:1.5}
.pyth-tool .notice{margin-top:24px}

/* Квадрат 3×3 */
.pyth-board{align-self:start}
.pyth-board-title{font-size:clamp(20px,2vw,26px);line-height:1.2;letter-spacing:-.05em;margin:8px 0 18px}
.pyth-board-title:focus{outline:none}
.pyth-board-title:focus-visible{outline:2px solid var(--blue);outline-offset:4px}
.pyth-grid{width:100%;max-width:480px;table-layout:fixed;border-collapse:collapse;background:#fffdf8;border:2px solid var(--ink);box-shadow:6px 6px 0 var(--ink)}
.pyth-grid td{position:relative;height:clamp(96px,9.4vw,124px);padding:26px 6px 26px;border:2px solid var(--ink);text-align:center;vertical-align:middle}
.pyth-cell-n{position:absolute;top:6px;left:8px;font-size:12px;font-weight:900;line-height:1;color:var(--dim)}
.pyth-cell-digits{display:block;font-family:var(--font-display);font-size:clamp(20px,2.2vw,28px);font-weight:800;line-height:1.15;letter-spacing:-.02em;color:var(--blue);overflow-wrap:anywhere;word-break:break-all}
.pyth-cell--long .pyth-cell-digits{font-size:clamp(15px,1.5vw,19px)}
.pyth-cell--zero .pyth-cell-digits,.pyth-grid--empty .pyth-cell-digits{color:#8a86a6;font-weight:500}
.pyth-cell--zero{background:var(--ivory)}
.pyth-cell-name{position:absolute;left:4px;right:4px;bottom:6px;font-size:10px;font-weight:850;letter-spacing:.08em;line-height:1.2;text-transform:uppercase;color:var(--ink);overflow-wrap:anywhere}
.pyth-board-note{margin-top:22px;font-size:13px;line-height:1.55;color:var(--dim);max-width:480px}

/* Робочі числа */
.pyth-working{max-width:480px;margin-top:26px}
.pyth-mini-title{font-family:var(--font-body);font-size:12px;font-weight:900;letter-spacing:.12em;text-transform:uppercase;margin:0 0 10px}
.pyth-working-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0;padding:0;list-style:none}
.pyth-working-list li{display:grid;gap:2px;padding:10px 12px;background:#fffdf8;border:2px solid var(--ink)}
.pyth-working-list span{font-size:10px;font-weight:900;letter-spacing:.1em;text-transform:uppercase;color:var(--dim)}
.pyth-working-list strong{font-family:var(--font-display);font-size:26px;font-weight:800;line-height:1.1;letter-spacing:-.04em;color:var(--blue)}
.pyth-steps{margin-top:12px;background:#fffdf8;border:2px solid var(--ink)}
.pyth-steps summary{display:flex;align-items:center;min-height:44px;padding:8px 14px;font-size:14px;font-weight:800;cursor:pointer;list-style:none}
.pyth-steps summary::-webkit-details-marker{display:none}
.pyth-steps summary::after{content:"";width:8px;height:8px;margin-left:auto;border-right:2px solid var(--ink);border-bottom:2px solid var(--ink);transform:rotate(45deg) translate(-2px,-2px);transition:transform .15s ease}
.pyth-steps[open] summary::after{transform:rotate(-135deg) translate(-2px,-2px)}
.pyth-steps summary:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.pyth-steps ol{display:grid;gap:8px;margin:0;padding:4px 14px 0 34px;list-style:decimal;font-size:14px;line-height:1.5}
.pyth-steps ol b{font-variant-numeric:tabular-nums;white-space:nowrap}
.pyth-rule{margin:12px 14px 14px;padding-top:10px;border-top:1px solid #211f4633;font-size:13px;line-height:1.5;color:var(--dim)}
.pyth-lifepath{margin-top:14px;font-size:14px;line-height:1.55}
.pyth-lifepath .text-link{display:inline-flex;align-items:center;min-height:44px;margin-left:4px;font-size:14px}

/* Значення: клітинки й лінії */
.pyth-details{grid-column:1/-1;padding-top:36px;border-top:2px solid var(--ink)}
.pyth-details-title{font-size:clamp(24px,2.6vw,34px);line-height:1.2;letter-spacing:-.055em;margin:0 0 20px}
.pyth-details-title:not(:first-child){margin-top:44px;margin-bottom:10px}
.pyth-details-note{font-size:14px;line-height:1.55;color:var(--dim);max-width:64ch;margin-bottom:20px}
.pyth-meanings{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:0;padding:0;list-style:none}
.pyth-meaning{min-width:0;padding:18px 20px 20px;background:var(--ivory);border:2px solid var(--ink)}
.pyth-meaning-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px}
.pyth-meaning-n{display:grid;place-items:center;width:34px;height:34px;background:var(--blue);color:var(--ivory);border:2px solid var(--ink);font-family:var(--font-display);font-size:16px;font-weight:800}
.pyth-meaning h4{font-family:var(--font-display);font-size:17px;font-weight:750;line-height:1.2;letter-spacing:-.04em;margin:0;overflow-wrap:break-word}
.pyth-meaning-digits{max-width:7.5em;font-family:var(--font-display);font-size:18px;font-weight:800;line-height:1.15;color:var(--blue);text-align:right;overflow-wrap:anywhere;word-break:break-all}
.pyth-meaning--zero .pyth-meaning-digits{color:#8a86a6;font-weight:500}
.pyth-meaning-about{margin-top:12px;font-size:12px;line-height:1.5;color:var(--dim)}
.pyth-meaning-text{margin-top:8px;font-size:15px;line-height:1.6}

.pyth-lines{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:0;padding:0;list-style:none}
.pyth-line{min-width:0;padding:16px 20px 20px;background:#fffdf8;border:2px solid var(--ink)}
.pyth-line-group{display:inline-block;padding:3px 9px;border:2px solid var(--ink);background:var(--mint);font-size:10px;font-weight:900;letter-spacing:.1em;line-height:1.4;text-transform:uppercase}
.pyth-line--column .pyth-line-group{background:var(--coral)}
.pyth-line--diagonal .pyth-line-group{background:var(--lilac)}
.pyth-line-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 14px;margin-top:12px}
.pyth-line-head h4{font-family:var(--font-display);font-size:20px;font-weight:750;line-height:1.2;letter-spacing:-.045em;margin:0}
.pyth-line-sum{font-size:14px;font-weight:800}
.pyth-line-level{display:flex;align-items:center;gap:10px;margin-top:8px;font-size:12px;font-weight:900;letter-spacing:.1em;text-transform:uppercase;color:var(--blue)}
.pyth-meter{flex-shrink:0;overflow:visible}
.pyth-meter rect{fill:transparent;stroke:var(--ink);stroke-width:2}
.pyth-line--low .pyth-meter-1,.pyth-line--mid .pyth-meter-1,.pyth-line--mid .pyth-meter-2,.pyth-line--high .pyth-meter rect{fill:var(--blue)}
.pyth-line p[data-slot=text]{margin-top:10px;font-size:15px;line-height:1.6}

/* Пропозиція під результатом */
.pyth-offer{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:18px 32px;margin-top:40px;padding:26px 28px;background:var(--mint);border:2px solid var(--ink);box-shadow:5px 5px 0 var(--ink)}
.pyth-offer>div{flex:1 1 360px;min-width:0}
.pyth-offer .eyebrow{color:var(--ink)}
.pyth-offer h3{font-size:clamp(21px,2.2vw,28px);line-height:1.2;letter-spacing:-.05em;margin:8px 0 10px}
.pyth-offer p:not(.eyebrow){font-size:15px;line-height:1.6;max-width:62ch}
.pyth-offer .button{margin:0;gap:16px}

/* Пояснення під калькулятором */
.pyth-explain{max-width:820px;margin-top:80px}
.pyth-section{padding:34px 0;border-top:2px solid var(--ink)}
.pyth-section:first-child{border-top:0;padding-top:0}
.pyth-section h2{display:flex;align-items:baseline;gap:12px;font-size:clamp(23px,2.4vw,32px);line-height:1.2;letter-spacing:-.05em;margin:0 0 14px;overflow-wrap:break-word;min-width:0}
.pyth-section h2::before{content:"";flex-shrink:0;width:12px;height:12px;border:2px solid var(--ink);background:var(--lilac);transform:translateY(-1px)}
.pyth-section--how h2::before{background:var(--mint)}
.pyth-section p{font-size:17px;line-height:1.7;max-width:68ch}
.pyth-section p+p,.pyth-section .pyth-diagram+p{margin-top:14px}
.pyth-example{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,300px);gap:26px 40px;align-items:start;margin-top:22px}
.pyth-example-lead{font-weight:800}
.pyth-example-steps{display:grid;gap:10px;margin:12px 0 0;padding-left:24px;list-style:decimal;font-size:16px;line-height:1.6}
.pyth-example-figure{margin:0}
.pyth-example-figure .pyth-grid{box-shadow:4px 4px 0 var(--ink)}
.pyth-example-figure .pyth-grid td{height:88px;padding:22px 4px}
.pyth-example-figure .pyth-cell-digits{font-size:19px}
.pyth-example-figure .pyth-cell-name{font-size:9px}
.pyth-example-figure figcaption{margin-top:14px;font-size:13px;line-height:1.5;color:var(--dim)}

/* Схема ліній */
.pyth-diagram{display:grid;grid-template-columns:repeat(3,minmax(0,150px));gap:18px;margin:22px 0 6px}
.pyth-diagram-item{margin:0;min-width:0}
.pyth-diagram-item svg{display:block;width:100%;max-width:120px;height:auto;font-family:var(--font-body)}
.pyth-diagram-item figcaption{margin-top:8px;font-size:13px;line-height:1.4}
.pyth-diagram-item strong{display:block;font-size:11px;font-weight:900;letter-spacing:.1em;text-transform:uppercase;color:var(--blue)}

/* Пропозиція й посилання */
.pyth-cta{display:grid;gap:22px;margin-top:30px;padding:clamp(22px,3.4vw,36px);background:var(--mint);border:2px solid var(--ink);box-shadow:7px 7px 0 var(--ink)}
.pyth-cta .eyebrow{color:var(--ink)}
.pyth-cta h2{font-size:clamp(24px,2.8vw,34px);line-height:1.15;letter-spacing:-.055em;margin:8px 0 10px}
.pyth-cta p:not(.eyebrow){font-size:15px;line-height:1.6;max-width:60ch}
.pyth-cta-actions{display:flex;flex-wrap:wrap;align-items:center;gap:16px 18px}
.pyth-cta-actions .button{margin:0;gap:14px;text-align:left}
.pyth-related{margin-top:64px;padding-top:34px;border-top:2px solid var(--ink)}
.pyth-related h2{font-size:clamp(24px,2.8vw,34px);line-height:1.2;letter-spacing:-.055em;margin-bottom:22px}
.pyth-related-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:0;padding:0;list-style:none}
.pyth-related-list a{position:relative;display:grid;align-content:start;gap:6px;height:100%;min-height:44px;padding:18px 44px 18px 18px;background:#fffdf8;border:2px solid var(--ink);box-shadow:4px 4px 0 var(--ink);transition:transform .15s ease,box-shadow .15s ease,background .15s ease}
.pyth-related-list a:hover{background:var(--lilac);transform:translate(2px,2px);box-shadow:2px 2px 0 var(--ink)}
.pyth-related-list strong{font-family:var(--font-display);font-size:17px;font-weight:750;line-height:1.25;letter-spacing:-.04em}
.pyth-related-list span{font-size:13px;line-height:1.45;color:var(--dim)}
.pyth-related-list svg{position:absolute;top:16px;right:14px}

/* Форма не «прилипає» під час прокрутки: значення клітинок ідуть на всю ширину під нею,
   і прилипла форма наїжджала б на них. */
@media(min-width:901px){
  .pyth-tool-intro{align-self:start}
}
@media(max-width:1100px){
  .pyth-meanings{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:900px){
  .pyth-tool{grid-template-columns:minmax(0,1fr);gap:30px;padding:32px}
  .pyth-tool-intro>p:not(.eyebrow){max-width:none}
  .pyth-grid,.pyth-working,.pyth-board-note{max-width:none}
  .pyth-example{grid-template-columns:minmax(0,1fr)}
  .pyth-example-figure{max-width:320px}
  .pyth-related-list{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:700px){
  .pyth-lines{grid-template-columns:minmax(0,1fr)}
  .pyth-meanings{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:620px){
  .pyth-main{padding-block:12px 70px}
  .pyth-crumbs{margin-bottom:10px;font-size:12px}
  .pyth-crumbs li+li::before{margin:0 7px}
  /* Поле дати й кнопка мають уміститися на першому екрані телефона */
  .pyth-head{padding-bottom:24px}
  .pyth-head h1{font-size:clamp(28px,8.4vw,34px);letter-spacing:-.06em;margin:10px 0 14px}
  .pyth-lead{font-size:15px;line-height:1.5}
  .pyth-tool{padding:20px 18px 24px;box-shadow:4px 4px 0 var(--ink)}
  .pyth-tool-intro h2{font-size:25px;margin:10px 0}
  .pyth-tool-intro h2 br{display:none}
  .pyth-form{margin-top:18px}
  .pyth-form{flex-direction:column;align-items:stretch}
  .pyth-form .button{width:100%;white-space:normal;justify-content:space-between}
  .pyth-grid{box-shadow:4px 4px 0 var(--ink)}
  .pyth-grid td{height:92px;padding:22px 3px}
  .pyth-cell-digits{font-size:20px}
  .pyth-cell--long .pyth-cell-digits{font-size:15px}
  .pyth-cell-name{font-size:9px;letter-spacing:.05em}
  .pyth-working-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .pyth-working-list strong{font-size:22px}
  .pyth-details{padding-top:28px}
  .pyth-details-title:not(:first-child){margin-top:34px}
  .pyth-meaning,.pyth-line{padding:16px}
  .pyth-meaning-text,.pyth-line p[data-slot=text]{font-size:14px}
  .pyth-offer{padding:20px;margin-top:30px;box-shadow:4px 4px 0 var(--ink)}
  .pyth-offer .button{width:100%;white-space:normal;justify-content:space-between}
  .pyth-explain{margin-top:56px}
  .pyth-section{padding:28px 0}
  .pyth-section h2{font-size:22px;gap:10px}
  .pyth-section h2::before{width:10px;height:10px}
  .pyth-section p{font-size:16px;line-height:1.65}
  .pyth-example-steps{font-size:15px;padding-left:20px}
  .pyth-diagram{gap:10px}
  .pyth-diagram-item figcaption{font-size:12px}
  .pyth-cta{box-shadow:4px 4px 0 var(--ink)}
  .pyth-cta-actions{display:grid}
  .pyth-cta-actions .button{width:100%;white-space:normal;padding-inline:16px;justify-content:space-between}
  .pyth-related{margin-top:48px;padding-top:28px}
}
@media(prefers-reduced-motion:reduce){
  .pyth-related-list a,.pyth-steps summary::after{transition:none}
}
