/* Общий шаблон main.php и style.css адаптированы из материалов курса. */
:root {
    --teal: #2f6364;
    --teal-dark: #214b4c;
    --paper: #f7f5ef;
    --ink: #213b3c;
    --muted: #5e6e69;
    --line: #d7ded5;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 "Segoe UI", Arial, sans-serif; }
a { color: var(--teal); text-underline-offset: 5px; }
button, input, select { font: inherit; }
a, button, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #ae612e; outline-offset: 5px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.12; }
h1 { font: 400 clamp(40px, 5vw, 64px)/1.1 Georgia, "Times New Roman", serif; letter-spacing: -1.7px; margin-bottom: 22px; }
h2 { font: 400 30px/1.2 Georgia, "Times New Roman", serif; }
h3 { font: 400 27px/1.2 Georgia, "Times New Roman", serif; }
.header { border-bottom: 1px solid var(--line); }
.header-inner, .layout, .footer { max-width: 1184px; margin: auto; padding-left: 40px; padding-right: 40px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 100px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.15; }
.brand-symbol { background: var(--teal); color: var(--paper); width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font: italic 36px Georgia, serif; padding-bottom: 5px; }
.brand-subtitle { font-size: 14px; font-weight: 400; }
.header nav { display: flex; gap: 28px; flex-wrap: wrap; }
.header nav a { padding: 10px 0; color: var(--muted); font-size: 14px; text-decoration: none; border-bottom: 2px solid transparent; }
.header nav a[aria-current], .header nav a:hover { color: var(--teal); border-bottom-color: var(--teal); }
.layout { padding-top: 36px; padding-bottom: 64px; min-height: calc(100vh - 235px); }
.intro { display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; padding: 42px 46px; background: var(--teal); color: var(--paper); border-radius: 4px; overflow: hidden; }
.eyebrow { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600; margin-bottom: 18px; }
.intro h1 { font-size: clamp(56px, 6vw, 78px); line-height: .99; margin-bottom: 24px; }
.intro h1 em { font-weight: 400; }
.intro-text { max-width: 380px; color: #e1ece5; font-size: 16px; line-height: 1.65; margin-bottom: 26px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 28px; border: 1px solid var(--teal); background: var(--teal); color: white; padding: 12px 20px; font-size: 14px; font-weight: 600; text-decoration: none; border-radius: 3px; cursor: pointer; }
.button:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.button-light { color: var(--teal-dark); background: #f2f0df; border-color: #f2f0df; }
.button-light:hover { color: var(--teal-dark); background: #fff; border-color: white; }
.button:disabled { opacity: .6; cursor: default; }
.walk-drawing { position: relative; align-self: center; margin-top: 10px; }
.walk-drawing svg { width: 100%; overflow: visible; }
.drawing-grid { stroke: #ffffff; stroke-opacity: .08; }
.drawing-river { stroke: #9ab9ad; stroke-width: 34; opacity: .4; }
.drawing-route { stroke: #f2e3b9; stroke-width: 3; stroke-dasharray: 8 7; }
.walk-drawing circle { fill: #f2e3b9; stroke: var(--teal); stroke-width: 4; }
.drawing-start, .drawing-end { position: absolute; font-size: 12px; color: #e1ece5; }
.drawing-start { top: 11%; left: 5%; }
.drawing-end { right: 0; bottom: 9%; }
.route-section { margin-top: 42px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; }
.muted { color: var(--muted); font-size: 14px; }
.route-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.route-card { padding: 26px; border: 1px solid var(--line); background: #fffefa; display: flex; flex-direction: column; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.route-number { font: italic 30px Georgia, serif; color: var(--teal); }
.distance { font-size: 12px; background: #e8eee6; padding: 4px 12px; border-radius: 20px; color: var(--teal-dark); white-space: nowrap; }
.route-card h3 { margin-bottom: 16px; }
.route-card h3 a { color: var(--ink); text-decoration: none; }
.route-card h3 a:hover { color: var(--teal); text-decoration: underline; }
.route-card p { font-size: 14px; color: var(--muted); margin-bottom: 28px; }
.text-link { font-size: 14px; font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.route-card .text-link { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; }
.planner-note { display: flex; gap: 22px; align-items: center; margin-top: 30px; border-bottom: 1px solid var(--line); padding: 24px 0; }
.planner-note h2 { font-size: 24px; margin-bottom: 4px; }
.planner-note p { font-size: 14px; color: var(--muted); margin-bottom: 0; }
.planner-note .text-link { margin-left: auto; white-space: nowrap; }
.note-symbol { font-size: 42px; color: var(--teal); }
.footer { min-height: 105px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 12px; color: var(--muted); }
.footer p { margin: 0; }
.footer a { text-decoration: none; }
.footer-brand { font-weight: 600; }
.back-link { display: inline-block; font-size: 14px; text-decoration: none; margin-bottom: 42px; }
.back-link:hover { text-decoration: underline; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 70px; }
.article-body h1 { overflow-wrap: anywhere; }
.byline { color: var(--muted); font-size: 13px; padding-bottom: 26px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.article-description h2 { font-size: 26px; }
.article-description p { max-width: 590px; font-size: 18px; margin-bottom: 22px; }
.article-tip { margin-top: 32px; }
.route-summary { padding: 30px; background: #e8eee6; align-self: start; border-top: 4px solid var(--teal); }
.big-distance { font: 400 64px/1 Georgia, serif; color: var(--teal); margin-bottom: 30px; }
.big-distance span { font: 20px "Segoe UI", sans-serif; }
.route-summary hr { border: 0; border-top: 1px solid #c9d6cb; margin: 0 0 24px; }
.route-summary h2 { font-size: 26px; }
.route-summary > p:not(.eyebrow):not(.big-distance) { font-size: 14px; }
.route-summary .button { width: 100%; gap: 16px; }
.fine-print { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 20px 0 0; }
.page-heading { max-width: 700px; margin-bottom: 32px; }
.page-heading > p:last-child { color: var(--muted); }
.planner-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
.planner-form { max-width: 480px; }
.planner-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.planner-form input, .planner-form select { display: block; width: 100%; border: 1px solid #8eaaa2; color: var(--ink); background: #fffefa; border-radius: 3px; min-height: 48px; padding: 10px 12px; }
.planner-form select { margin-bottom: 24px; }
.field-help { color: var(--muted); font-size: 12px; margin: 8px 0 24px; }
.calculation { background: #e8eee6; border-top: 4px solid var(--teal); padding: 32px; align-self: start; }
.calculation h2 { font-size: 27px; }
.result-number { font: 400 clamp(64px, 8vw, 86px)/1.1 Georgia, serif; margin-bottom: 20px; color: var(--teal); overflow-wrap: anywhere; }
.result-number span { font: 20px "Segoe UI", sans-serif; }
.result-details { margin: 26px 0 0; }
.result-details div { display: flex; justify-content: space-between; border-top: 1px solid #cad7cc; gap: 16px; padding: 10px 0; font-size: 14px; }
.result-details dd { margin: 0; font-weight: 600; }
.calculation .text-link { display: inline-block; margin-top: 24px; }
.about-page { max-width: 690px; margin: 0 auto; padding: 10px 0 35px; }
.about-page h2 { margin-top: 36px; }
.about-page .lead { font-size: 21px; color: var(--teal); }
.about-page .button { margin-top: 16px; }
.message-page { padding: 60px 0; }
.message-page h1 { overflow-wrap: anywhere; }
.skip-link { position: absolute; top: -100px; left: 10px; background: white; padding: 12px; z-index: 10; }
.skip-link:focus { top: 10px; }
@media (max-width: 900px) {
    .header-inner, .layout, .footer { padding-left: 24px; padding-right: 24px; }
    .intro { padding: 32px; gap: 16px; }
    .route-grid { gap: 12px; }
    .route-card { padding: 20px; }
    .route-card h3 { font-size: 24px; }
    .article-layout { gap: 32px; grid-template-columns: minmax(0, 1fr) 290px; }
    .planner-layout { gap: 28px; }
}
@media (max-width: 650px) {
    .header-inner { align-items: flex-start; flex-direction: column; padding-top: 18px; gap: 14px; padding-bottom: 12px; }
    .header nav { width: 100%; justify-content: space-between; gap: 10px; }
    .layout { padding-top: 24px; padding-bottom: 40px; }
    .intro { grid-template-columns: 1fr; padding: 28px; }
    .intro h1 { font-size: 64px; }
    .walk-drawing { display: none; }
    .route-grid, .article-layout, .planner-layout { grid-template-columns: 1fr; }
    .section-heading { display: block; }
    .section-heading .muted { display: inline-block; margin-top: 8px; }
    .card-top { margin-bottom: 20px; }
    .route-card p { margin-bottom: 20px; }
    .planner-note { flex-wrap: wrap; }
    .planner-note > div { flex: 1; }
    .planner-note .text-link { margin-left: 0; flex-basis: 100%; }
    .footer { padding-top: 24px; padding-bottom: 24px; flex-wrap: wrap; }
    .footer p { width: 100%; order: 3; }
    .back-link { margin-bottom: 30px; }
    .planner-form { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
