/* ============================================================
   ZHAW Job Ad – Main Stylesheet
   Font: Inter | Colors: #333333 (text), #C11E48 (pink), #FFA70E (golden)
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    /* Reserve space equal to the sticky header so anchor links don't hide under it */
    scroll-padding-top: 140px;
}

body {
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    font-size: 20px;
    line-height: 32px;
    color: #333333;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    color: #333333;
    font-weight: 700;
}

h1 {
    font-size: 72px;
    line-height: 80px;
}

h2 {
    font-size: 48px;
    line-height: 60px;
    margin-bottom: 24px;
}

h3 {
    font-size: 20px;
    line-height: 32px;
    font-weight: 700;
    margin-bottom: 24px;
}

p, a, li, span, body {
    font-size: 20px;
    line-height: 32px;
}

p {
    margin-bottom: 16px;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: #333333;
    text-decoration: underline;
}

a:hover {
    color: var(--primary-color, #C11E48);
}

ul, ol {
    padding-left: 32px;
    margin-bottom: 16px;
}

li {
    margin-bottom: 4px;
}

b, strong {
    font-weight: 700;
}

/* ---- Layout ---- */
/*
 * Key dimensions:
 *   left-edge 16px | sidebar 160px | gap 48px | content 924px | right-pad 48px
 *   body-max = 16 + 160 + 48 + 924 + 48 = 1196px
 */
:root {
    --left-edge:      16px;
    --sidebar-width:  160px;
    --col-gap:        48px;
    --content-width:  924px;
    --body-max:      1196px;
    --outer-pad:      48px; /* right-side padding */
}

.page-wrapper {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

/* ---- Site Header ---- */
.site-header {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 0;
    z-index: 200;
}

/*
 * __inner is NOT position:relative — the logo escapes to .site-header
 * (position:sticky, full-width) so left:16px = 16px from the page edge,
 * matching the hero image left edge. Nav is centered within __inner.
 */
.site-header__inner {
    max-width: var(--body-max);
    margin: 0 auto;
    min-height: 120px;
    display: flex;
    align-items: flex-end;
}

.site-header__logo-link {
    position: absolute;
    left: var(--left-edge);
    bottom: 16px;
    display: flex;
    align-items: flex-end;
    text-decoration: none;
    z-index: 1;
}

.site-header__logo {
    height: 80px;
    width: auto;
    display: block;
}

.site-header__nav {
    width: 100%;
    /* Nav aligns with the content column: left-edge + sidebar + gap */
    padding-left: calc(var(--left-edge) + var(--sidebar-width) + var(--col-gap));
    padding-right: var(--outer-pad);
    padding-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.site-header__nav-item {
    font-size: 20px;
    line-height: 20px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}

.site-header__nav-item:hover,
.site-header__nav-item.active {
    font-weight: 700;
    text-decoration: none;
    color: #333;
}

/* ---- Burger Menu Button ---- */
.site-header__burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
}

.site-header__burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #333333;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---- Hero Image ---- */
.header-image-wrap {
    width: 100%;
    overflow: hidden;
}

@keyframes hero-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.header-image {
    display: block;
    width: 100%;
    object-fit: cover;
    object-position: center top;
    animation: hero-fade 1.2s ease both;
}

/* ---- Section slide-up animation ---- */
.fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.65s ease, transform 0.65s ease;
    will-change: opacity, transform;
}

.fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Title box: sits at top of main-col, overlaps hero by 64px via page-body margin-top */
.header-title-box {
    width: 100%;
    padding: 32px;
    background-color: var(--primary-color, #C11E48);
    border-radius: 24px;
    margin-bottom: 40px;
    min-height: 304px;
    display: flex;
    align-items: center;
}

.job-title { 
    color: var(--secondary-color, #FFA70E);
    font-size: 72px;
    line-height: 80px;
    font-weight: 700;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* ---- Two-column page body ---- */
.page-body {
    width: 100%;

    position: relative;
    z-index: 100;
}

.page-body__inner {
    max-width: var(--body-max);
    margin: 0 auto;
    /* Left edge = 16px so sidebar/button aligns with logo */
    padding: 0 var(--outer-pad) 0 var(--left-edge);
    display: flex;
    align-items: flex-start;
    gap: var(--col-gap);
}

/* ---- Left sidebar with sticky apply button ---- */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    padding-top: 56px;
    /* Spacer only — button itself is fixed at left: 16px */
}

@keyframes btn-slide-up {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar__sticky {
    position: fixed;
    left: 16px;
    bottom: 40px;
    z-index: 50;
    animation: btn-slide-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

/* Floating button: mobile/tablet only (≤1220px) */
.btn-apply-float {
    display: none;
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;}

.btn-apply {
    display: block;
    background-color: var(--primary-color, #C11E48);
    color: #ffffff;
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    font-size: 24px;
    line-height: 28px;
    font-weight: 400;
    text-decoration: none;
    padding: 22px 48px;
    border-radius: 999px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    text-align: center;
}
.btn-apply-float .btn-apply {
    border:solid 1px #fff;
}

.btn-apply:hover {
    opacity: 0.88;
    color: #ffffff;
    text-decoration: none;
}

/* ---- Right content column ---- */
.main-col {
    flex: 1;
    min-width: 0;
    max-width: var(--content-width);
    padding-bottom: 80px;
}

/* ---- Meta Bar (top of main-col) ---- */
.meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 40px 0px;
    margin-bottom: 120px;
}

.meta-item {
    width: calc(100% / 3);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    line-height: 24px;
    color: #333333;
}

.meta-item b {
    font-weight: 400;
}

.meta-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: block;
}

/* ---- Lead Text ---- */
.section-lead {
    margin-bottom: 56px;
    /* Extend right edge to align with the hero image.
     * = outer-pad (right padding of page-body__inner)
     * + auto-margin of page-body__inner within page-wrapper (1440px max-width).
     * max(0px, …) clamps to zero when viewport < body-max so the formula
     * degrades gracefully at narrower widths. */
    width: calc(100% + var(--outer-pad) + max(0px, (min(100vw, 1440px) - var(--body-max)) / 2));
    margin-right: calc(-1 * (var(--outer-pad) + max(0px, (min(100vw, 1440px) - var(--body-max)) / 2)));
}

.lead-text {
    font-size: 32px;
    line-height: 48px;
    color: #333333;
    font-weight: 400;
}

/* ---- Body Sections (Tasks / Requirements / About) ---- */
.section-body {
    margin-bottom: 56px;
}

.section-body h2 b,
.section-body h2 strong {
    font-weight: 700;
}
.section-body p {
    margin-bottom: 40px;
}

.section-about p {
    font-size: 20px;
    line-height: 32px;
}
.section-about .link-more {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.section-about .link-more svg {
    width: 28px;
    height: 28px;
}
.section-about .link-more a {    
    font-size: 20px;
    line-height: 32px;
    color: #333333;
    text-decoration: underline;
    font-weight: 400;
}

/* ---- Apply CTA Box ---- */
.apply-cta-box {
    background-color: var(--secondary-color, #FFA70E);
    border-radius: 32px;
    padding: 48px;
    margin-bottom: 56px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

.apply-cta-title {
    font-size: 48px;
    line-height: 60px;
    color: var(--primary-color, #C11E48);
    font-weight: 700;
    margin-bottom: 0;
}

.apply-cta-title b,
.apply-cta-title strong {
    font-weight: 700;
}

.apply-cta-text {
    font-size: 20px;
    line-height: 32px;
    color: #333;
    margin-bottom: 0;
}

.btn-apply--cta {
    text-decoration: none;
    display: block;
    margin: 32px auto 0px;
}

/* ---- Contact Section ---- */
.section-contact {
    padding-top: 16px;
}

.contact-section-title {
    font-size: 48px;
    line-height: 60px;
    font-weight: 700;
    margin-bottom: 32px;
    color: #333333;
}

.contact-section-title b,
.contact-section-title strong {
    font-weight: 700;
}

.contact-group-title b,
.contact-group-title strong {
    font-weight: 700;
}

/* No contact images — full-width box */
.contact-box {
    background-color: var(--primary-color, #C11E48);
    border-radius: 24px;
    padding: 28px 32px;
    margin-bottom: 32px;
}

.contact-box--full {
    width: 100%;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-name {
    margin-bottom: 24px;
    color: #ffffff;
}

.contact-name b,
.contact-name strong {
    font-weight: 700;
}

.contact-phone,
.contact-email {
    margin-bottom: 0;
}

.contact-phone a,
.contact-email a,
p.contact-phone,
p.contact-email {
    color: #ffffff;
    text-decoration: underline;
}

/* ============================================================
   Print Overrides
   ============================================================ */
@media print {
    .sidebar {
        display: none;
    }

    .sidebar__sticky,
    .btn-apply-float {
        display: none;
    }
}

/* ============================================================
   Responsive
   ============================================================ */

/* At narrow widths where sidebar would squeeze content, hide it */
@media (max-width: 1220px) {
    .sidebar__sticky {
        display: none;
    }

    .btn-apply-float {
        display: block;
    }

    .main-col {
        padding-bottom: 120px;
    }

    /* Give the burger space from the viewport edge; shrink header to match */
    .site-header__inner {
        min-height: 64px;
        align-items: center;
        padding-right: 16px;
    }

    .site-header__logo-link {
        bottom: 8px;
    }

    .site-header__logo {
        height: 48px;
    }

    /* Burger button */
    .site-header__burger {
        display: flex;
    }

    /* Nav becomes hamburger dropdown */
    .site-header__nav {
        display: none;
        position: absolute;
        height: 100vh;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 40px 0;
        background: var(--primary-color, #C11E48);
    }

    .site-header.is-nav-open .site-header__nav {
        display: flex;
    }

    .site-header__nav-item {
        padding: 14px 20px;
        font-size: 24px;
        color: #ffffff;
    }

    .site-header__nav-item:hover {
        color: #ffffff;
        text-decoration: underline;
    }

    .site-header__nav-item.active {
        color: #ffffff;
        text-decoration: underline;
    }

    /* Burger → X animation */
    .site-header.is-nav-open .site-header__burger span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .site-header.is-nav-open .site-header__burger span:nth-child(2) {
        opacity: 0;
    }

    .site-header.is-nav-open .site-header__burger span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}

@media (max-width: 1100px) {
    :root {
        --outer-pad: 32px;
    }
}

@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .page-body__inner {
        display: block;
        padding: 0 24px;
    }

    .header-title-box {
        padding-left: 24px;
        padding-right: 24px;
    }

    /* Reset section-lead extension — layout is single-column at this width */
    .section-lead {
        width: 100%;
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .header-title-box {
        min-height: unset;
    }

    .page-body {
        margin-top: -40px;
    }

    :root {
        --outer-pad: 16px;
    }

    .site-header__inner {
        padding-right: 16px;
    }

    /* Apply button fixed at bottom, centered — already handled by ≤1220px rule */

    h1,
    .job-title {
        font-size: 40px;
        line-height: 48px;
    }

    h2,
    .apply-cta-title,
    .contact-section-title {
        font-size: 32px;
        line-height: 40px;
    }

    .lead-text {
        font-size: 22px;
        line-height: 32px;
    }

    .header-image {
        height: 300px;
    }

    .meta-bar {
        gap: 16px 24px;
    }

    .apply-cta-box {
        padding: 32px 24px;
    }

    .apply-cta-text {
        font-size: 18px;
        line-height: 28px;
    }

    .main-col {
        padding-bottom: 120px;
    }
}

