/* Cordery Castle - site styles. Plain CSS, no frameworks. */

@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url("../fonts/opensans-latin.woff2") format("woff2");
}
@font-face {
    font-family: "Open Sans";
    font-style: italic;
    font-weight: 300 800;
    font-display: swap;
    src: url("../fonts/opensans-italic-latin.woff2") format("woff2");
}
@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/montserrat-latin.woff2") format("woff2");
}

:root {
    --text: #7e8890;
    --heading: #333c4e;
    --accent: #f09a3e;
    --navy: #333c4e;
    --tint: #faf9f8;
    --tint-home: #f7f5f4;
    --border: #e9eaee;
    --header-h: 138px;
    --container: 1280px;
    --gutter: 30px;
    --font-body: "Open Sans", Arial, Helvetica, sans-serif;
    --font-head: Montserrat, Arial, Helvetica, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: #fff;
    color: var(--text);
    font: 400 15px/32px var(--font-body);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; vertical-align: top; border: 0; }

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--heading); }

p { margin: 0 0 20px; }

h1, h2, h3, h4, h5, h6 { color: var(--heading); margin: 0 0 20px; }
h2 { font: 600 34px/1.47 var(--font-head); }
h3 { font: 400 24px/1.4 var(--font-head); }
h4 { font: 600 15px/1.67 var(--font-body); }

ol, ul { margin: 15px 0; padding-left: 40px; }

.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--gutter);
}
.container.narrow { max-width: calc(836px + var(--gutter) * 2); }
.center { text-align: center; }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 8px 16px;
    background: var(--heading);
    color: #fff;
}
.skip-link:focus { left: 8px; top: 8px; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
    position: relative;
    z-index: 20;
    background: #fff;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-h);
}
.logo { display: block; margin: 31px 0; line-height: 0; }
.logo img { width: 290px; }

.main-nav ul {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}
.main-nav li + li { margin-left: 45px; }
.main-nav a {
    display: flex;
    align-items: center;
    height: var(--header-h);
    color: var(--heading);
    font: 700 14px/1 var(--font-body);
    letter-spacing: 1px;
}
.main-nav a:hover,
.main-nav .current a { color: var(--accent); }

.menu-toggle {
    display: none;
    padding: 6px;
    border: 0;
    background: none;
    color: var(--heading);
    cursor: pointer;
}
.menu-toggle svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.menu-toggle:hover, .menu-toggle[aria-expanded="true"] { color: var(--accent); }

/* ---------- Shared pieces ---------- */

.section { padding: 100px 0 60px; }

.tint { background: var(--tint); }

.separator {
    width: 170px;
    height: 0;
    margin: 30px auto;
    border: 0;
    border-top: 1px solid var(--accent);
}
.separator.wide { width: 50%; margin-top: 30px; }

.badge { display: block; margin: 0 auto 30px; }

.intro .title { margin-bottom: 20px; }
.intro .lead p,
.home-intro .lead p { font-size: 20px; line-height: 32px; }
.intro .separator { margin: 20px auto 40px; }
.intro-body p { margin-bottom: 20px; }
.intro { padding-bottom: 25px; }

.card {
    background: #fff;
    border: 1px solid var(--border);
}

.button {
    display: inline-block;
    padding: 13px 29px;
    background: var(--accent);
    color: #fff;
    font: 600 14px/17px var(--font-body);
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: background-color .2s;
}
.button:hover { background: #fff; color: var(--heading); }

/* ---------- Home ---------- */

.hero {
    position: relative;
    height: calc(100vh - var(--header-h));
    min-height: 400px;
    overflow: hidden;
    background: #2c2f39;
}
.hero-bg {
    position: absolute;
    /* Like the original slider: a full-viewport image that starts behind the header. */
    top: calc(-1 * var(--header-h));
    left: 0;
    right: 0;
    height: 100vh;
    min-height: calc(400px + var(--header-h));
    background: var(--hero-bg) center center / cover no-repeat;
    will-change: transform;
}
.hero-content {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    padding: 0 var(--gutter);
    text-align: center;
}
.hero-heading {
    display: inline-block;
    padding: 3px 15px;
    background: rgba(0, 0, 0, .4);
}
.hero h1 {
    margin: 0;
    color: #fff;
    font: 400 80px/1.2 var(--font-head);
    letter-spacing: 3px;
}
.hero-caption {
    display: flex;
    align-items: center;
    max-width: var(--container);
    margin: 15px auto 0;
    padding: 3px 15px;
    background: rgba(0, 0, 0, .4);
}
.hero-caption p {
    margin: 0 10px;
    color: #fff;
    font: 600 30px/1.2 var(--font-body);
}
.hero-caption .line { flex: 1; border-top: 1px solid #e7e4e2; }

.home-intro { padding: 90px 0 22px; }
.home-intro .badge { margin-bottom: 30px; }
.home-intro .title { margin-bottom: 30px; }
.home-intro .separator { margin: 30px auto 70px; }

.cols {
    display: flex;
    gap: 4%;
}
.cols > .col { flex: 1 1 0; min-width: 0; }

.reasons h3 { margin-bottom: 30px; }
.reasons .col:last-child { padding-top: 38px; }
.reasons .col:last-child img { width: 100%; }
.reasons .col:first-child { flex-basis: 55%; }
.reasons .col:last-child { flex-basis: 37.5%; }

.triangle-divider {
    background: var(--tint-home);
    line-height: 0;
    margin-top: 60px;
}
.triangle-divider svg {
    display: block;
    width: 100%;
    height: 99px;
    fill: #fff;
}

.home-projects {
    background: var(--tint-home);
    padding: 70px 0 40px;
}
.home-projects h3 { margin-bottom: 30px; }

.checklist { list-style: none; margin: 10px 0 0; padding: 0; font-size: 14px; line-height: 23.8px; }
.checklist li {
    position: relative;
    padding-left: 34px;
    margin-bottom: 10px;
}
.checklist li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 5px;
    width: 14px;
    height: 14px;
    background: var(--accent);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M173.9 439.4 7.5 273c-10-10-10-26.2 0-36.2l36.2-36.2c10-10 26.2-10 36.2 0L192 312.7 432.1 72.6c10-10 26.2-10 36.2 0l36.2 36.2c10 10 10 26.2 0 36.2L210.1 439.4c-10 10-26.2 10-36.2 0z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M173.9 439.4 7.5 273c-10-10-10-26.2 0-36.2l36.2-36.2c10-10 26.2-10 36.2 0L192 312.7 432.1 72.6c10-10 26.2-10 36.2 0l36.2 36.2c10 10 10 26.2 0 36.2L210.1 439.4c-10 10-26.2 10-36.2 0z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.tiles { display: flex; }
.tile {
    position: relative;
    flex: 1 1 0;
    display: block;
    overflow: hidden;
    aspect-ratio: 480 / 689;
    color: #fff;
    text-align: center;
}
.tile-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 1s, opacity 1s;
}
.tile:hover .tile-bg { transform: scale(1.1); opacity: .9; }
.tile-content {
    position: absolute;
    top: 43%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
}
.tile-title { font: 400 24px/1.4 var(--font-head); color: #fff; }
.tile-rule { width: 60px; margin: 18px 0 26px; border-top: 1px solid var(--accent); }
.tile-more { font: 600 15px/32px var(--font-body); color: #fff; }
.tile:hover .tile-more { color: var(--accent); }

.cta-band {
    background: var(--navy);
    padding: 50px 0 60px;
}
.cta-band h2 { color: #fff; margin: 50px 0 0; }
.cta-sub { font-size: 20px; margin: 0 0 40px; }
.cta-contacts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px 50px;
    margin-bottom: 40px;
}
.cta-contact {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 10px 24px;
    background: #444d63;
    color: #fff;
    font: 500 20px/1.4 var(--font-head);
}
.cta-contact svg { width: 18px; height: 18px; fill: var(--accent); flex: none; }
.cta-contact:hover { color: var(--accent); }

/* ---------- About ---------- */

.team { padding-top: 15px; padding-bottom: 50px; }
.framed {
    margin: 0;
    padding: 5px;
    background: #fff;
    border: 1px solid var(--border);
}
.framed img { width: 100%; }
.team .separator { margin: 40px auto 45px; }

.cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px 4%;
}
.testimonial {
    margin: 0;
    padding: 45px 30px 30px;
    text-align: center;
}
.testimonial img {
    width: 150px;
    height: 211px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 24px;
}
.testimonial blockquote { margin: 0; }
.testimonial blockquote p {
    margin: 0;
    font-size: 14px;
    font-style: italic;
    line-height: 32px;
    letter-spacing: 2px;
}
.testimonial blockquote::after {
    content: "";
    display: block;
    width: 30px;
    margin: 9px auto 0;
    border-top: 1px solid #808080;
}
.testimonial figcaption {
    margin-top: 24px;
    font-size: 18px;
    letter-spacing: 2px;
}

.logo-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: #fff;
}
.logo-item { border: 1px solid var(--border); margin-left: -1px; line-height: 0; }
.logo-item img { width: 100%; aspect-ratio: 288 / 153; object-fit: cover; }

/* ---------- Services ---------- */

.page-services .intro { padding-bottom: 70px; }
.services-tabs { padding: 10px 0 50px; }
.tabs { margin-bottom: 0; }
.tab-list { display: flex; border: 1px solid #ebeaea; border-bottom: 0; }
.tab-list button {
    flex: 1 1 0;
    margin: 0 1px 0 0;
    padding: 11px 10px;
    border: 0;
    border-top: 3px solid transparent;
    background: #f7f5f4;
    color: var(--heading);
    font: 600 15px/25px var(--font-body);
    cursor: pointer;
}
.tab-list button:last-child { margin-right: 0; }
.tab-list button[aria-selected="true"] { background: #fff; border-top-color: var(--accent); }
.tab-list button:hover { color: var(--accent); }
.tab-panel {
    padding: 15px 15px 15px;
    border: 1px solid #ebeaea;
    border-top: 0;
}
.tab-panel > img { width: 100%; margin-bottom: 25px; }
.tab-panel img { width: 100%; }
.tab-heading { display: none; }
.tab-panel strong { font-weight: 700; }

/* ---------- Projects / vacancies ---------- */

.projects { padding-top: 15px; padding-bottom: 50px; }
.project {
    margin-bottom: 48px;
    padding: 45px 30px 25px;
}
.project h3 { text-align: center; margin-bottom: 20px; }
.project > img { display: block; width: 100%; margin: 0 auto 25px; }
.project .separator { margin-top: 40px; }

.vacancies { padding-top: 15px; padding-bottom: 50px; }
.vacancies .card { padding: 45px 30px 25px; }

/* ---------- News ---------- */

.title-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 560px;
    padding: 0 30px;
    background: #2c2f39 var(--title-bg) center / cover no-repeat;
    text-align: center;
}
.title-bar h1 {
    margin: 0;
    color: #fff;
    font: 700 72px/1.3 var(--font-head);
}

.news-list { padding: 100px 0 100px; }
.news-container { max-width: calc(836px + var(--gutter) * 2); }
.news-item {
    display: flex;
    gap: 25px;
    margin-bottom: 80px;
}
.news-thumb { flex: 0 0 320px; line-height: 0; }
.news-thumb img { width: 320px; aspect-ratio: 320 / 202; object-fit: cover; }
.news-body { flex: 1 1 auto; min-width: 0; }
.news-body h2 {
    margin: 0 0 25px;
    font: 600 22px/32px var(--font-body);
    padding-right: 10px;
}
.news-body h2 a { color: var(--accent); }
.news-body h2 a:hover { color: var(--heading); }
.news-item:first-child .news-body h2 { margin-bottom: 30px; }

/* ---------- Single post ---------- */

.post { padding: 100px 0 60px; }
.post-container { max-width: calc(748px + var(--gutter) * 2); }
.post-title h2 {
    margin: 0;
    font: 600 55px/.9 var(--font-head);
}
.post-title p {
    margin: 12px 0 20px;
    font: 700 55px/1.15 var(--font-body);
}
.post-title p em, .post-title p strong { font-weight: 700; }
.post-content img { display: block; margin: 10px 0 20px; }
.post-content p img { display: inline-block; margin: 0; }
.post-content h2 { font-size: 34px; }
.post-content h3 { font-size: 24px; }
.post-content ul, .post-content ol { margin: 15px 0 20px; }
.post-content strong { font-weight: 700; }
.post-content blockquote {
    margin: 0 0 20px;
    padding: 0 0 0 20px;
    border-left: 4px solid var(--accent);
}
.post .separator.wide { margin-top: 30px; margin-bottom: 60px; }

/* ---------- Contact ---------- */

.page-contact .intro { padding-bottom: 0; }
.page-contact .intro .separator { margin-bottom: 20px; }
.contact-details { padding: 60px 0 80px; }
.contact-details h3 { font-size: 28px; line-height: 1.4; margin-bottom: 20px; }
.contact-details .separator { margin-top: 40px; }

/* ---------- Footer ---------- */

.site-footer {
    padding: 30px 0;
    background: #fff;
    border-top: 1px solid var(--border);
    text-align: center;
}
.site-footer p { margin: 0; font-size: 12px; line-height: 32px; }
.site-footer .sep { margin: 0 10px; }
.home .site-footer, .page-services .site-footer { border-top: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .menu-toggle { display: block; }
    .header-inner { flex-wrap: wrap; justify-content: center; min-height: 0; }
    .logo { margin: 38px 0 0; }
    .menu-toggle { width: 100%; display: flex; justify-content: flex-end; padding: 10px 0 18px; }
    .main-nav { width: 100%; display: none; }
    .main-nav.open { display: block; }
    .main-nav ul { display: block; border-top: 1px solid var(--border); }
    .main-nav li + li { margin-left: 0; }
    .main-nav li { border-bottom: 1px solid var(--border); }
    .main-nav a { height: auto; padding: 16px 0; }
    :root { --header-h: 138px; }
    .hero h1 { font-size: 60px; }
}

@media (max-width: 800px) {
    :root { --gutter: 20px; }
    .section { padding: 60px 0 40px; }
    .hero h1 { font-size: 26px; letter-spacing: 3px; line-height: 1.2; }
    .hero-heading { max-width: 330px; }
    .logo { margin-top: 30px; }
    .hero-caption { display: block; max-width: 330px; margin-top: 30px; padding: 6px 15px; }
    .hero-caption .line { display: none; }
    .hero-caption p { font-size: 24px; line-height: 1.2; margin: 0; }
    .home-intro { padding-top: 90px; }
    .home-intro .title { font-size: 24px; line-height: 1.47; }
    .home-intro .lead p { font-size: 20px; }
    .cols { flex-direction: column; gap: 30px; }
    .triangle-divider svg { height: 50px; }
    .tiles { flex-direction: column; }
    .tile { aspect-ratio: auto; height: 340px; }
    h2 { font-size: 26px; }
    .cards { grid-template-columns: 1fr; gap: 30px; }
    .logo-strip {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
    }
    .logo-item { flex: 0 0 80%; scroll-snap-align: start; }
    .tab-list { flex-direction: column; border-bottom: 1px solid #ebeaea; }
    .tab-list button { margin: 0 0 1px; text-align: left; padding-left: 15px; }
    .tab-panel { border-top: 1px solid #ebeaea; margin-top: -1px; }
    .title-bar { height: 280px; }
    .title-bar h1 { font-size: 46px; }
    .news-list { padding: 60px 0; }
    .news-item { flex-direction: column; gap: 20px; margin-bottom: 50px; }
    .news-thumb { flex-basis: auto; }
    .news-thumb img { width: 100%; }
    .post { padding-top: 60px; }
    .post-title h2, .post-title p { font-size: 34px; }
    .project, .vacancies .card { padding: 30px 20px 15px; }
    .contact-details h3 { font-size: 20px; overflow-wrap: anywhere; }
    .cta-contact { font-size: 17px; }
    .site-footer .sep { margin: 0 6px; }
}
