/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
}

/* Brand color variables */
:root {
    --brand-logo-color: #053664;
    --brand-accent: #3498db;
    --brand-yellow: #f4d83f;
}

/* Heading hierarchy: ensure h1 > h2 > h3 by default. More specific selectors below can override. */
h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

h2 {
    font-size: 1.6rem; /* intentionally larger than h3 */
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-weight: 700; /* use 700 which is broadly supported */
}

h3 {
    font-size: 1.25rem;
    color: #34495e; /* slightly lighter color so it doesn't read as heavy */
    margin-bottom: 0.5rem;
    font-weight: 400; /* standard regular weight */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header styles */
.header {
    background-color: #fff;
    box-shadow: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    flex-wrap: wrap; /* allow wrapping on small screens to avoid excessive shrink */
}

.logo h1 {
    color: var(--brand-logo-color); /* match logo blue via variable */
    font-size: 2.2rem; /* increased for better visibility */
    font-weight: 800;
    letter-spacing: 1px;
    margin: 0 0 4px 0; /* add spacing above tagline */
    line-height: 1.05; /* keep compact but not squashed */
}
/* Logo image style */
.logo-img {
    /* enlarge for stronger brand presence */
    width: 80px;
    height: 80px; /* increased to compensate for internal padding and match text block */
    flex-shrink: 0; /* prevent shrinking when space is tight */
    align-self: center; /* ensure image centers in the flex row */
    display: block;
    object-fit: contain;
    margin-right: 0;
}

.navigation {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    display: none;
    border: 0;
    background: transparent;
    padding: 6px;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: #2c3e50;
    border-radius: 2px;
    display: block;
}

.navigation a {
    color: #34495e;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s ease;
    text-transform: lowercase;
}

.navigation a:hover,
.navigation a.active {
    color: #3498db;
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center; /* vertically center text with image */
    gap: 4px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* left-align text within the text column */
    justify-content: center; /* center the text column vertically alongside the image */
}

.logo .tagline {
    font-size: 0.74rem;
}

/* Accent the site name with Swedish-flag inspired blue */
/* (Merged into the main .logo h1 rule above) */

.separator {
    color: #bdc3c7;
    font-weight: 300;
}

.next-page-arrow {
    position: fixed;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: #053664;
    color: var(--brand-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(5, 54, 100, 0.28);
    z-index: 1002;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.next-page-arrow span {
    display: flex;
    width: 1em;
    height: 1em;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transform: translate(2px, -2px);
}

.next-page-arrow:hover {
    background: #0a4d8f;
    transform: translateY(-50%) scale(1.05);
}

/* Main content styles */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    padding: 40px 0;
}

.hero-section {
    width: 100%;
}

.profile-section {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 60px;
    align-items: start;
    max-width: 1000px;
    margin: 0 auto;
}

.profile-image {
    position: relative;
}

/* Nudge the profile image down slightly and pull the text up to visually align
   the photo with the headings. Adjust value if you want more/less offset. */
.profile-image {
    margin-top: 10px; /* small downward nudge */
}

.profile-image img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background-color: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7f8c8d;
    font-size: 14px;
    text-align: center;
}

/* Placeholder styling when image is not available */
.profile-image img[src*="jonas-bylund.jpg"] {
    background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-image img[src*="jonas-bylund.jpg"]::after {
    content: "Professional Photo\AJonas Bylund";
    white-space: pre;
    text-align: center;
    font-weight: 500;
}

.profile-content h1 {
    font-size: 3rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
}

/* Raise the headings/text to better line up with the image */
.profile-content {
    transform: translateY(-18px); /* pulls content up to align with photo */
}

.profile-content h2 {
    font-size: 1.6rem; /* increased so h2 stays larger than h3 */
    color: #2c3e50; /* match global h2 color */
    font-weight: 500; /* lighter for a slimmer, more elegant look */
    margin-bottom: 30px;
    line-height: 1.35;
}

/* Typographic refinements for the combined subhead */
.profile-content .subhead {
    font-weight: 500; /* ensure consistent lighter weight on the subhead */
    letter-spacing: 0.1px;
    color: #243447; /* a touch deeper for contrast */
    text-wrap: balance;
}

.intro-text {
    margin-bottom: 30px;
}

.intro-text p {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.7;
}

/* vision-text removed */

.social-links {
    margin-top: 30px;
}

.linkedin-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #0077b5;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.linkedin-link:hover {
    background-color: #005582;
    transform: translateY(-2px);
}

.linkedin-link i {
    font-size: 1.2rem;
}

/* Footer styles */
.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 18px 0;
    margin-top: 60px;
    border-top: 2px solid rgba(255,255,255,0.03);
}

.footer .container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.footer p {
    font-size: 0.95rem;
    color: #ecf0f1;
    margin: 0;
    opacity: 0.95;
    line-height: 1;
}

.footer-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    column-gap: 0;
    row-gap: 4px;
}

.footer-segment {
    white-space: nowrap;
}

.footer-segment:not(:last-of-type)::after {
    content: "|";
    color: var(--brand-yellow);
    font-weight: 600;
    margin: 0 8px;
}

.footer-sep {
    display: none;
}

.footer a {
    color: #ecf0f1;
    text-decoration: underline;
}

.footer a:hover {
    color: #d1e9ff;
    text-decoration: none;
}

/* Optional small screens: slightly smaller footer text and stacked content */ 
@media (max-width: 420px) {
    .footer {
        padding: 14px 0;
    }
    .footer p {
        font-size: 0.85rem;
        text-align: center;
    }
}

/* On narrow screens, remove the vertical offsets so stacked layout remains natural */
@media (max-width: 700px) {
    .profile-image {
        margin-top: 0;
    }
    .profile-content {
        transform: none;
    }
}

/* Additional page styles */
.page-header {
    text-align: center;
    margin-bottom: 50px;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.page-header p {
    font-size: 1.2rem;
    color: #555;
}

/* Cases page styles */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.case-item {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.case-item:hover {
    transform: translateY(-5px);
}

.case-item h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.case-item p {
    color: #555;
    line-height: 1.6;
}

.case-meta {
    margin-top: 10px;
    color: #2a73b7;
    font-size: 0.95rem;
    line-height: 1.45;
    font-style: italic;
}

.ai-disclaimer {
    margin: 10px 0 3px;
    text-align: left;
    font-size: 0.82rem;
    color: #7a828a;
    font-style: italic;
}

.ai-disclaimer + .cases-grid,
.ai-disclaimer + .services-grid {
    margin-top: 20px;
}

.ai-disclaimer + .impact-section {
    margin-top: 21px;
}

.case-image {
    display: block;
    width: calc(100% + 60px);
    height: 190px;
    object-fit: cover;
    margin: -30px -30px 18px;
}

.case-video-playonce {
    cursor: pointer;
    object-fit: cover;
    object-position: center;
    z-index: 1;
}

.case-media {
    position: relative;
    width: calc(100% + 60px);
    height: 190px;
    margin: -30px -30px 18px;
    overflow: hidden;
}

.case-media .case-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
}

.case-video-poster {
    z-index: 2;
}

.case-media.is-playing .case-video-playonce {
    z-index: 3;
}

.case-media.is-playing .case-video-poster {
    opacity: 0;
    pointer-events: none;
}

/* Services page styles */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.services-intro {
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 600;
    margin-top: 8px;
}

.service-item {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: left;
    transition: transform 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
}

.service-item i {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 20px;
}

.service-item h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.service-item p {
    color: #555;
    line-height: 1.6;
}

.service-image {
    display: block;
    width: calc(100% + 60px);
    height: 190px;
    object-fit: cover;
    margin: -30px -30px 18px;
}

.service-video-playonce {
    cursor: pointer;
    object-fit: cover;
    object-position: center;
    z-index: 1;
}

.service-media {
    position: relative;
    width: calc(100% + 60px);
    height: 190px;
    margin: -30px -30px 18px;
    overflow: hidden;
}

.service-media .service-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
}

.service-video-poster {
    z-index: 2;
}

.service-media.is-playing .service-video-playonce {
    z-index: 3;
}

.service-media.is-playing .service-video-poster {
    opacity: 0;
    pointer-events: none;
}

.service-results {
    margin-top: 42px;
    background: white;
    padding: 28px 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.service-results h2 {
    font-size: 1.35rem;
    margin-bottom: 14px;
}

.results-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding-left: 0;
    color: #555;
}

.results-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-list li i {
    color: #3498db;
    font-size: 1.4rem;
    line-height: 1;
    width: 1.6rem;
    text-align: center;
    flex-shrink: 0;
}

.results-list li span {
    line-height: 1.55;
}

.impact-section {
    margin-top: 42px;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.impact-header h2 {
    font-size: 1.55rem;
    margin-bottom: 10px;
}

.impact-header p {
    color: #555;
    line-height: 1.65;
}

.impact-header p + p {
    margin-top: 8px;
}

.impact-media-grid {
    margin-top: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.impact-placeholder-card {
    margin: 0;
}

.impact-mobile-media {
    display: none;
}

.impact-image-placeholder {
    height: 170px;
    border: 1px dashed #bcc8d5;
    border-radius: 8px;
    background: linear-gradient(135deg, #eef3f8 0%, #e4ebf3 100%);
    color: #5f7286;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.impact-media-image {
    display: block;
    width: 100%;
    height: 186px;
    object-fit: cover;
    border-radius: 8px;
}

.impact-placeholder-card figcaption {
    margin-top: 8px;
    color: #5a6673;
    font-size: 0.9rem;
}

.impact-columns {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.impact-block {
    background: #f8fbff;
    border: 1px solid #e4ebf3;
    border-radius: 8px;
    padding: 18px;
}

.impact-block h2 {
    margin-bottom: 12px;
    font-size: 1.15rem;
}

.impact-block p {
    color: #555;
    line-height: 1.6;
}

.impact-block p + p {
    margin-top: 10px;
}

.impact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.impact-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #555;
    line-height: 1.5;
}

.impact-list li i {
    color: #3498db;
    font-size: 0.95rem;
    margin-top: 3px;
    flex-shrink: 0;
}

/* Contact page styles */
.contact-grid {
    --contact-pad: 28px;
    max-width: 900px;
    min-height: 430px;
    margin: 40px auto 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: var(--contact-pad);
    background: white;
    padding: 0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    align-items: stretch;
    overflow: hidden;
}

.contact-info {
    padding: var(--contact-pad) 0 var(--contact-pad) var(--contact-pad);
}

.contact-media {
    min-width: 0;
    align-self: stretch;
    position: relative;
    overflow: hidden;
}

.contact-hero-image {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 82%;
    border-radius: 0;
}

.contact-info h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.5rem;
    margin-top: 0;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.contact-item i {
    color: #3498db;
    font-size: 1.2rem;
    width: 20px;
}

.contact-item a {
    color: #3498db;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .header .container {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px 12px;
        padding: 10px 16px;
        align-items: center;
        position: relative;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .logo .tagline {
        font-size: 0.66rem;
        line-height: 1.1;
        display: block;
        white-space: normal;
    }

    .navigation {
        display: none;
        position: absolute;
        top: 100%;
        right: -16px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 142px;
        background: #ffffff;
        border-left: 1px solid #dfe5eb;
        border-bottom: 1px solid #dfe5eb;
        border-top: 0;
        border-right: 0;
        border-radius: 0 0 0 10px;
        box-shadow: none;
        overflow: hidden;
        z-index: 1001;
    }

    .navigation.open {
        display: flex;
    }

    .navigation .separator {
        display: none;
    }

    .navigation a {
        font-size: 0.88rem;
        padding: 8px 10px;
        width: 100%;
        text-align: left;
        line-height: 1.3;
    }

    .menu-toggle {
        display: inline-flex;
        justify-self: end;
    }

    .logo {
        min-width: 0;
    }

    .logo a {
        align-items: center;
    }

    .logo-text {
        min-width: 0;
        max-width: 220px;
    }

    /* cap logo size on smaller screens */
    .logo-img {
        /* slightly smaller for small screens */
        width: 74px;
        height: 74px;
    }

    .logo-text {
        transform: none;
    }

    .main-content {
        margin-top: 90px;
        padding: 20px 0;
    }

    .next-page-arrow {
        right: 10px;
        width: 50px;
        height: 50px;
        font-size: 2.2rem;
    }

    .profile-section {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .profile-image {
        max-width: 250px;
        margin: 0 auto;
    }

    .profile-image img {
        height: 280px;
    }

    .profile-content h1 {
        font-size: 2.2rem;
    }

    .profile-content h2 {
        font-size: 1.3rem; /* keep h2 larger than many h3s on smaller screens */
    }

    .intro-text p {
        font-size: 1rem;
    }

    .vision-text blockquote {
        font-size: 1.1rem;
    }

    @media (max-width: 480px) {
        .container {
            padding: 0 15px;
        }

        .main-content {
            margin-top: 96px;
        }

        .logo .tagline {
            font-size: 0.6rem;
        }

        .profile-content h1 {
            font-size: 1.8rem;
        }

        .vision-text {
            padding: 20px;
        }

        .vision-text blockquote {
            font-size: 0.9rem;
        }
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .cases-grid,
    .services-grid {
        grid-template-columns: 1fr;
    }

    .impact-media-grid,
    .impact-columns {
        grid-template-columns: 1fr;
    }

    .impact-media-grid {
        display: none;
    }

    .impact-columns {
        margin-top: 0;
        gap: 14px;
    }

    .impact-mobile-media {
        display: block;
    }

    .contact-grid {
        margin-top: 40px;
        grid-template-columns: 1fr;
        gap: 0;
        max-width: 760px;
        min-height: 0;
    }

    .contact-media {
        height: auto;
        line-height: 0;
    }

    .contact-hero-image {
        position: static;
        inset: auto;
        height: 220px;
    }

    .contact-info {
        padding: 24px;
    }

    .results-list {
        grid-template-columns: 1fr;
    }
}
