/* RehabConnekt - public site. Palette and feel carried over from the old Blocksy theme:
   green #3fc75f (buttons), blue #0343a4 (headings/hover), slate text, white header with soft shadow. */

@font-face {
    font-family: 'Source Sans 3';
    src: url('../fonts/source-sans-3.woff2') format('woff2');
    font-weight: 300 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Source Sans 3';
    src: url('../fonts/source-sans-3-italic.woff2') format('woff2');
    font-weight: 400; font-style: italic; font-display: swap;
}

:root {
    --green: #3fc75f;
    --green-dark: #2fa64c;
    --blue: #0343a4;
    --slate: #3a4f66;
    --purple: #8429db;
    --text: #363636;
    --line: #e1e8ed;
    --bg-soft: #f2f5f7;
    --bg: #ffffff;
    --error: #b3261e;
    --font: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.65 var(--font); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
a:hover { color: var(--green-dark); }
:focus-visible { outline: 3px solid #5b8def; outline-offset: 2px; }

h1, h2, h3, h4, h5, h6 { color: var(--slate); font-weight: 700; line-height: 1.25; margin: 1.4em 0 .5em; }
h1 { font-size: 2.3rem; } h2 { font-size: 1.85rem; } h3 { font-size: 1.45rem; } h4 { font-size: 1.2rem; } h5 { font-size: 2rem; } h6 { font-size: 1rem; }

.wrap { width: min(100% - 40px, 1240px); margin-inline: auto; }
.narrow { max-width: 820px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: #fff; box-shadow: 0 10px 20px rgba(44, 62, 80, .05); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 96px; }
.brand img { max-height: 77px; width: auto; }
.brand-text { font-size: 1.6rem; font-weight: 700; color: var(--slate); }
.brand { text-decoration: none; flex-shrink: 0; }
.main-nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 4px 26px; }
.main-nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current] { color: var(--green-dark); border-bottom-color: var(--green); }
.search input { width: 130px; padding: 7px 12px; font: inherit; font-size: .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft); transition: width .2s; }
.search input:focus { width: 190px; }
.nav-toggle { display: none; }

/* ---------- content ---------- */
.site-main { min-height: 55vh; padding-bottom: 70px; }
.page-hero { background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 38px 0 34px; margin-bottom: 40px; }
.page-hero h1 { margin: 0; }
.page-hero .content { margin-top: 10px; }
.page > .content:first-child, .page > .notice + .content { padding-top: 40px; }
.breadcrumbs { font-size: .9rem; color: #6b7785; margin: 30px 0 18px; }
.breadcrumbs span { margin: 0 4px; color: #aab4be; }

.content > :first-child { margin-top: 0; }
.content p { margin: 0 0 1.1em; }
.content img { border-radius: 6px; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 46px 0; }
.content ul { list-style: none; padding-left: 1.1em; margin-left: 20px; }
.content ul li { position: relative; margin-bottom: .35em; }
.content ul li::before { content: '›'; position: absolute; left: -1em; top: -.32em; color: #1e73be; font-weight: 900; font-size: 24px; }
.content table { border-collapse: collapse; width: 100%; margin: 1.2em 0 2em; font-size: .95rem; }
.content th, .content td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.content th { background: var(--bg-soft); }
.table-scroll { overflow-x: auto; }

/* building blocks produced by the importer / usable in the HTML view of the editor */
.el-section { padding: 26px 0; }
.el-section.has-bg { padding: 40px 28px; border-radius: 8px; margin: 20px 0; }
.el-row { display: flex; flex-wrap: wrap; gap: 30px 40px; align-items: flex-start; }
.el-row.v-center, .el-grid.v-center { align-items: center; }
.el-row > * { flex: 1 1 280px; min-width: 0; }
.el-stack > * + * { margin-top: 18px; }
.el-grid { display: grid; gap: 30px 40px; align-items: start; }
.el-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.el-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.el-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.el-grid.cols-2 > .el-grid, .el-grid.cols-2 > h1, .el-grid.cols-2 > h2, .el-grid.cols-2 > hr { grid-column: 1 / -1; }
.el-buttons { display: flex; flex-wrap: wrap; gap: 14px; }
.align-center { text-align: center; } .align-right { text-align: right; }
.align-center img { margin-inline: auto; }

.button, button.button {
    display: inline-block; font: inherit; font-weight: 600; color: #fff; text-decoration: none; cursor: pointer;
    background: var(--green); border: 0; border-radius: 4px; padding: 12px 26px; transition: background .15s;
}
.button:hover { background: var(--blue); color: #fff; }

details.accordion { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; background: #fff; }
details.accordion > summary { cursor: pointer; padding: 15px 20px; font-weight: 700; color: var(--slate); list-style: none; position: relative; }
details.accordion > summary::-webkit-details-marker { display: none; }
details.accordion > summary::after { content: '+'; position: absolute; right: 20px; font-size: 1.3rem; line-height: 1.2; color: var(--green-dark); }
details.accordion[open] > summary::after { content: '–'; }
details.accordion[open] > summary { border-bottom: 1px solid var(--line); }
details.accordion > .accordion-body { padding: 18px 20px; }

.notice { padding: 14px 18px; margin: 0 0 22px; border-left: 4px solid; background: var(--bg-soft); border-radius: 0 4px 4px 0; }
.notice-success { border-color: var(--green-dark); background: #e9f8ed; }
.notice-error { border-color: var(--error); background: #fbeceb; }

/* ---------- post listings ---------- */
.card-grid { list-style: none; margin: 0 0 30px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px 28px; }
.card a { display: block; text-decoration: none; color: inherit; text-align: center; }
.card-image { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--bg-soft); }
.card-image img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform .3s ease; }
.card a:hover .card-image img { transform: scale(1.04); }
.card-grid-logo .card-image { aspect-ratio: 3 / 2; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; padding: 20px; }
.card-grid-logo .card-image img { width: auto; height: auto; max-width: 100%; max-height: 120px; object-fit: contain; }
.card-title { display: block; margin-top: 14px; font-weight: 700; font-size: 1.08rem; color: var(--slate); }
.card a:hover .card-title { color: var(--green-dark); }
.card-excerpt { display: block; font-size: .92rem; color: #5d6b79; margin-top: 4px; }
.no-image { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 3rem; font-weight: 700; color: #c3cdd6; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 40px; }
.pagination a, .pagination .current, .pagination .gap { min-width: 40px; padding: 7px 10px; text-align: center; text-decoration: none; border: 1px solid var(--line); border-radius: 4px; }
.pagination .current { background: var(--green); border-color: var(--green); color: #fff; }
.pagination .gap { border: 0; }
.empty { padding: 30px 0 60px; }

/* ---------- single post ---------- */
.post h1 { margin-top: .2em; }
.post-image { border-radius: 8px; margin: 0 0 26px; max-height: 520px; width: auto; }
.post-image-logo { max-height: 160px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 50px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-nav a { text-decoration: none; font-weight: 700; color: var(--slate); }
.post-nav a:hover { color: var(--green-dark); }
.post-nav small { display: block; font-weight: 400; color: #6b7785; text-transform: uppercase; letter-spacing: .05em; font-size: .75rem; }
.post-nav .next { text-align: right; grid-column: 2; }

/* ---------- forms ---------- */
.form-section { margin-top: 30px; }
.form p { margin: 0 0 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-row-3 { grid-template-columns: repeat(3, 1fr); }
.form label, .form legend { display: block; font-weight: 600; margin-bottom: 6px; color: var(--slate); }
.form fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.form input[type=text], .form input[type=email], .form input[type=tel], .form textarea, .form select, .newsletter-form input[type=email] {
    width: 100%; padding: 11px 18px; font: inherit; color: var(--text); background: #fff; border: 1px solid #4f84ab; border-radius: 4px;
}
.form label.check { font-weight: 400; display: flex; align-items: flex-start; gap: 9px; margin: 0 0 7px; cursor: pointer; color: var(--text); }
.form label.check input { margin-top: .35em; }
.form [aria-invalid=true] { border-color: var(--error); }
.form .help { display: block; font-size: .88rem; color: #6b7785; margin-top: 4px; }
.field-error { display: block; color: var(--error); font-size: .9rem; margin-top: 4px; }
.req { color: var(--error); }
.hp { position: absolute !important; left: -9999px; height: 0; overflow: hidden; }

/* ---------- footer ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); padding: 54px 0 0; color: var(--slate); }
.site-footer h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 16px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 50px; padding-bottom: 44px; }
.footer-logo { max-height: 70px; width: auto; margin-bottom: 14px; mix-blend-mode: multiply; }
.footer-links { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.footer-links li { margin-bottom: 8px; break-inside: avoid; }
.footer-links a { color: var(--slate); text-decoration: none; }
.footer-links a:hover { color: var(--green-dark); text-decoration: underline; }
.newsletter-form { display: flex; gap: 8px; flex-wrap: wrap; }
.newsletter-form input[type=email] { flex: 1 1 200px; width: auto; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; padding: 22px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.socials { display: flex; gap: 10px; }
.socials a { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 1px solid var(--line); color: var(--slate); }
.socials a:hover { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
    .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .el-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .nav-toggle { display: flex; flex-direction: column; gap: 5px; padding: 12px; background: none; border: 0; cursor: pointer; }
    .nav-toggle span:not(.visually-hidden) { width: 26px; height: 3px; border-radius: 2px; background: var(--slate); }
    .header-inner { flex-wrap: wrap; min-height: 80px; }
    .brand img { max-height: 60px; }
    .main-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 16px; }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
    .search { margin-top: 12px; } .search input, .search input:focus { width: 100%; }
}
@media (max-width: 700px) {
    h1 { font-size: 1.8rem; } h2 { font-size: 1.5rem; } h5 { font-size: 1.55rem; }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
    .el-grid.cols-2, .el-grid.cols-3, .el-grid.cols-4 { grid-template-columns: 1fr; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 34px; }
    .footer-bottom { justify-content: center; text-align: center; }
    .el-section.has-bg { padding: 28px 18px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .card-image img { transition: none; }
}

/* contact form: labels hidden, placeholders carry the wording (as on the old site) */
.form-section { margin-top: 30px; }
.el-row .form-section { margin-top: 10px; }
.form-placeholders input::placeholder, .form-placeholders textarea::placeholder { color: #6b7785; opacity: 1; }

/* ---------- dropdown sub-menu ---------- */
.has-sub { position: relative; display: flex; align-items: center; }
.sub-toggle { width: 22px; height: 22px; margin-left: 2px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; }
.sub-toggle::after { content: ''; position: absolute; left: 7px; top: 5px; width: 7px; height: 7px; border-right: 2px solid var(--slate); border-bottom: 2px solid var(--slate); transform: rotate(45deg); transition: transform .15s; }
.has-sub.sub-active > a { color: var(--green-dark); border-bottom-color: var(--green); }
.sub-menu { display: none; position: absolute; top: 100%; left: -18px; min-width: 260px; padding: 8px 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 14px 30px rgba(44, 62, 80, .12); z-index: 30; }
.sub-menu a { display: block; padding: 9px 20px; border-bottom: 0; font-weight: 500; }
.sub-menu a:hover, .sub-menu a[aria-current] { background: var(--bg-soft); color: var(--green-dark); }
.has-sub:hover .sub-menu, .has-sub:focus-within .sub-menu, .has-sub.open .sub-menu { display: block; }
.has-sub.open .sub-toggle::after, .has-sub:hover .sub-toggle::after { transform: rotate(225deg); top: 9px; }
@media (max-width: 1000px) {
    .has-sub { flex-wrap: wrap; align-items: stretch; }
    .has-sub > a { flex: 1; }
    .sub-toggle { width: 44px; height: auto; border-bottom: 1px solid var(--line); }
    .sub-toggle::after { left: 18px; top: 16px; }
    .sub-menu, .has-sub:hover .sub-menu, .has-sub:focus-within .sub-menu { display: none; position: static; width: 100%; min-width: 0; padding: 0 0 6px 18px; border: 0; box-shadow: none; }
    .has-sub.open .sub-menu { display: block; }
    .sub-menu a { padding: 10px 4px; border-bottom: 1px solid var(--line); }
}
