/* --- Typography and Font Setup --- */
body {
    font-family: 'Montserrat', sans-serif; /* Classy sans-serif for body */
    font-weight: 400;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Lora', serif; /* Classy serif for headings */
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- UTILITY STYLES --- */
[id] {
    scroll-margin-top: 100px; /* Offset for anchor links so header doesn't cover them */
}
img:not([src])::after,
img[src=""]::after {
    content: "Image not found: " attr(alt);
    display: block;
    text-align: center;
    color: #999;
    background-color: #f0f0f0;
    padding: 10px;
    border: 1px dashed #ccc;
}


/* --- MAIN LAYOUT --- */
.site-wrapper {
    width: 100%;
    max-width: 1200px;
    background-color: #dcdcdc;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.site-header {
    background-color: #dcdcdc;
    padding: 20px;
    height: 280px;
    position: relative;
    box-sizing: border-box;
}

.header-text-svg {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 98%;
    max-width: 1200px;
    height: auto;
    z-index: 2;
}

.site-logo {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 177px;
    height: 130px;
    background-image: url('logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 4;
    cursor: pointer;
}

.email-link {
    position: absolute;
    right: 160px;
    top: 60px;
    width: 230px;
    height: 60px;
    transform: rotate(7deg);
    transform-origin: top right;
    z-index: 5;
    cursor: pointer;
}

.main-content {
    background-color: #efefef;
    color: #000;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-top: -80px;
    padding-top: 20px;
    z-index: 1;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 160px;
    background-color: #000;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    transform: translateY(-80px) scaleX(1.26);
    z-index: -1;
}

.home-page-content {
    background-color: #000;
    color: #fff;
}


/* --- HOMEPAGE SPECIFIC STYLES --- */
.profile-intro-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 40px;
    padding-top: 25px;
}

.home-page-content .profile-intro-section {
    padding-top: 0;
    margin-top: 20px;
}

.profile-area {
    text-align: center;
    flex-shrink: 0;
}

.home-page-content .profile-image {
    width: 280px;
    height: 280px;
    margin-top: 0;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.profile-caption {
    margin-top: 15px;
    font-size: 0.9em;
    color: #ccc;
}

.profile-caption a {
    color: #fff;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.3s ease;
}

.profile-caption a:hover {
    color: #ff8a8a;
}

.intro-text {
    flex-basis: 500px;
    flex-grow: 1;
    text-align: left;
}

.intro-text h2 {
    font-size: 2.4em;
    color: #fff;
    margin-bottom: 15px;
    line-height: 1.3;
}

.intro-text p {
    font-size: 1.1em;
    color: #ddd;
    line-height: 1.6;
}

/* Services Section Styling */
.services-container, .credentials-container {
    width: 100%;
    max-width: 1100px;
    margin: 30px auto;
    padding: 25px;
    box-sizing: border-box;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.services-container h3, .credentials-container h3 {
    font-size: 2.2em;
    color: #fff;
    text-align: center;
    margin-bottom: 40px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.service-link {
    display: block;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-link:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.service-item {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    text-align: left;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.service-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}
.book-image-container .service-image {
    object-fit: cover;
}


.service-text {
    padding: 25px;
    flex-grow: 1;
}

.service-item h4 {
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 10px;
    color: #fff;
}

.service-item p {
    font-size: 0.95em;
    color: #ccc;
    line-height: 1.6;
}

/* Slideshow Styles */
.service-image-container {
    position: relative;
    width: 100%;
    height: 160px;
    background-color: #111;
}

.service-image-container.slideshow .service-image {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
}

.service-image-container.slideshow .service-image.active {
    opacity: 1;
}

/* Credentials Section */
.credentials-container .main-nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px 40px;
    padding: 0;
    list-style: none;
}
.credentials-container .main-nav li {
    margin-bottom: 0;
}
.credentials-container .main-nav li a {
    font-size: 1.5em;
    font-weight: 700;
    color: #fff;
    transition: text-shadow 0.3s ease;
}
.credentials-container .main-nav li a:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 15px rgba(255, 0, 0, 0.4);
}

.bottom-link {
    margin-top: 60px;
    margin-bottom: 30px;
    font-size: 1.2em;
    text-align: center;
}
.home-page-content .bottom-link {
    color: #fff;
}

/* --- STYLES FOR INNER PAGES (BIO, BIBLIO, SERVICES, ETC.) --- */
.content-section,
.biography-content,
.bibliography-content,
.services-page-content,
.inussuk-book-content {
    width: 90%;
    max-width: 800px;
    padding: 20px;
    box-sizing: border-box;
    line-height: 1.6;
    text-align: left;
    background-color: transparent;
}

.content-section h2, .biography-content h2, .bibliography-content h2, .services-page-content h2, .inussuk-book-content h2 {
    font-size: 2.8em;
    color: #000;
    margin-bottom: 25px;
    text-align: center;
}
.content-section h3, .biography-content h3, .bibliography-content h3, .services-page-content h3, .inussuk-book-content h3 {
    font-size: 1.8em;
    color: #000;
    margin-top: 35px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    padding-bottom: 5px;
}
.content-section p, .biography-content p, .bibliography-content p, .services-page-content p, .inussuk-book-content p {
    font-size: 1.1em;
    margin-bottom: 15px;
}
.content-section .last-updated, .biography-content .last-updated, .bibliography-content .last-updated, .services-page-content .last-updated, .inussuk-book-content .last-updated {
    font-size: 0.9em;
    color: #888;
    text-align: right;
    margin-top: 40px;
}

/* Description List for Bio, Film, Audio pages */
.description-list { display: grid; grid-template-columns: min-content 1fr; gap: 10px 15px; list-style: none; padding: 0; margin: 0; }
.description-list dt { font-weight: 500; color: #000; font-size: 1.05em; text-align: left; line-height: 1.5; white-space: nowrap; }
.description-list dd { font-size: 1.05em; line-height: 1.5; margin-left: 0; padding-left: 0; word-break: break-word; }
.publication-list { display: grid; grid-template-columns: min-content 1fr; gap: 10px 15px; list-style: none; padding: 0; margin: 0; }
.publication-list dt { font-weight: 500; color: #000; font-size: 1.05em; text-align: right; line-height: 1.5; white-space: nowrap; }
.publication-list dd { font-size: 1.05em; line-height: 1.5; margin-left: 0; padding-left: 0; word-break: break-word; }
.publication-list dd a, .inussuk-book-content a, .services-page-content a, .description-list dd a { color: #00008b; text-decoration: underline; }
.publication-list dd a:hover, .inussuk-book-content a:hover, .services-page-content a:hover, .description-list dd a:hover { color: #0000cd; text-decoration: none; }
.publication-group { margin-bottom: 40px; padding-top: 20px; border-top: 1px dashed rgba(0, 0, 0, 0.2); }
.publication-group:first-of-type { border-top: none; padding-top: 0; }
.publication-group h4 { font-size: 1.5em; color: #000; margin-bottom: 20px; text-align: center; }

/* Specifics for Services Page */
.services-page-content .services-intro { text-align: center; font-size: 1.1em; margin-bottom: 40px; max-width: 600px; margin-left: auto; margin-right: auto; }
.services-page-content .service-detail { margin-bottom: 40px; padding-bottom: 30px; border-bottom: 1px dashed #ccc; }
.services-page-content .service-detail:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.services-page-content .service-detail h3 { font-size: 1.8em; margin-bottom: 15px; border-bottom: none; }
.services-page-content .service-detail p { font-size: 1.05em; }
.services-page-content .service-detail ul { list-style: disc; padding-left: 25px; margin-top: 0; }
.services-page-content .service-detail li { margin-bottom: 8px; font-size: 1.05em; }

/* Styles for Language Switching */
.language-selector { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.lang-button { background-color: #ddd; color: #000; border: 1px solid #ccc; padding: 10px 15px; border-radius: 5px; cursor: pointer; font-size: 1.1em; font-weight: 500; display: flex; align-items: center; transition: background-color 0.3s ease, border-color 0.3s ease; }
.lang-button img { width: 20px; height: 15px; margin-right: 8px; border: 1px solid #999; object-fit: cover; }
.lang-button:hover { background-color: #c0c0c0; border-color: #b0b0b0; }
.lang-button.active { background-color: #8B0000; color: #fff; border-color: #8B0000; }
.lang-button.active img { border: 1px solid #fff; }
.lang-content { display: none; }
.lang-content.active { display: block; width: 100%; }

/* Homepage-specific button styles */
.home-page-content .language-selector { margin-bottom: 0; }
.home-page-content .lang-button { background-color: #282828; color: #ccc; border-color: #444; padding: 3px 5px; font-size: 1em; }
.home-page-content .lang-button img { width: 24px; height: 15px; border-color: #666; }
.home-page-content .lang-button:hover { background-color: #404040; border-color: #666; }
.home-page-content .lang-button.active { background-color: #8B0000; color: #fff; border-color: #8B0000; }
.home-page-content .lang-button.active img { border-color: #fff; }


/* Specifics for Inussuk Book Page */
.inussuk-book-content h3 { text-align: center; border-bottom: none; margin-bottom: 0; }
.inussuk-book-content h4 { font-size: 1.4em; color: #000; margin-top: 30px; margin-bottom: 15px; text-align: center; }
.inussuk-book-content h5 { font-size: 1.2em; color: #000; margin-top: 20px; margin-bottom: 10px; text-align: left; }
.inussuk-book-content ul { list-style: disc; margin-left: 25px; padding: 0; font-size: 1.0em; }
.inussuk-book-content li { margin-bottom: 8px; }
.inussuk-book-content .lang-content p { text-align: center; }
.book-layout-container { display: flex; align-items: flex-start; gap: 30px; width: 100%; max-width: 800px; margin-bottom: 20px; }
.book-image-area { flex-shrink: 0; width: 280px; }
.inussuk-book-image { width: 100%; height: auto; display: block; border-radius: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.book-text-area { flex-grow: 1; }
.toggle-appendixes { background-color: #8B0000; color: #fff; border: none; padding: 8px 15px; margin-top: 15px; border-radius: 5px; cursor: pointer; font-size: 0.95em; transition: background-color 0.3s ease; display: block; margin-left: auto; margin-right: auto; }
.toggle-appendixes:hover { background-color: #a02020; }
.appendixes-hidden { margin-top: 15px; }


/* --- FOOTER STYLES --- */
.site-footer-contact { background-color: #f8f8f8; padding: 40px 20px; margin-top: 50px; border-top: 1px solid #e0e0e0; text-align: center; font-family: 'Montserrat', sans-serif; color: #333; }
.footer-content-wrapper { display: flex; align-items: center; justify-content: center; gap: 40px; max-width: 800px; margin: 0 auto; flex-wrap: wrap; }
.footer-logo img { max-height: 80px; display: block; }
.footer-info { text-align: left; line-height: 1.7; font-size: 0.95rem; }
.footer-info a { color: #00008b; text-decoration: none; }
.footer-info a:hover { text-decoration: underline; }
.footer-info .cvr-number { margin-top: 10px; font-size: 0.85rem; color: #666; }
.home-page-content + .site-footer-contact { background-color: #000; border-top: 1px solid rgba(255, 255, 255, 0.2); margin-top: 0; padding-top: 60px; padding-bottom: 60px; }
.home-page-content + .site-footer-contact .footer-info,
.home-page-content + .site-footer-contact .footer-info .cvr-number { color: #ccc; }
.home-page-content + .site-footer-contact .footer-info strong { color: #fff; }
.home-page-content + .site-footer-contact .footer-info a { color: #fff; }
.home-page-content + .site-footer-contact .footer-info a:hover { color: #ff8a8a; text-decoration: none; }

/* === STYLING FOR MEDIA PLAYERS === */
.description-list video {
    width: 100%;
    max-width: 560px;
    height: auto;
    display: block;
    margin-top: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    background-color: #000;
}
.video-embed-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin-top: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.video-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
/* Style for audio player */
.description-list audio {
    width: 100%;
    max-width: 560px; /* Match video player width */
    display: block;
    margin-top: 15px; /* Space between text and player */
}


/* --- RESPONSIVE STYLES --- */
@media (max-width: 1024px) {
    .site-header { height: 220px; }
    .header-text-svg { top: 75px; max-width: 850px; }
    .site-logo { width: 135px; height: 135px; top: 15px; }
    .email-link { right: 40px; top: 85px; width: 200px; height: 40px; }
    .main-content { margin-top: -70px; padding-top: 20px; }
    .main-content::before { height: 110px; transform: translateY(-55px) scaleX(1.26); }
    .book-image-area { width: 250px; }
}

@media (max-width: 768px) {
    .site-header { height: 180px; }
    .header-text-svg { top: 55px; max-width: 600px; }
    .site-logo { width: 90px; height: 90px; top: 10px; }
    .email-link { right: 20px; top: 65px; width: 150px; height: 30px; }
    .main-content { margin-top: -90px; padding-top: 20px; }
    .main-content::before { height: 90px; transform: translateY(-45px) scaleX(1.26); }
    .profile-intro-section { flex-direction: column; gap: 20px; padding-top: 10px; }
    .home-page-content .profile-image { width: 200px; height: 200px; }
    .intro-text { text-align: center; }
    .intro-text h2 { font-size: 2em; }
    .services-container, .credentials-container { padding: 20px 15px; }
    .content-section, .services-page-content, .inussuk-book-content, .biography-content, .bibliography-content { padding: 25px; }
    .content-section h2, .services-page-content h2, .inussuk-book-content h2, .biography-content h2, .bibliography-content h2 { font-size: 2.2em; }
    .book-layout-container { flex-direction: column; align-items: center; gap: 20px; }
    .book-image-area { width: 80%; max-width: 250px; }
    .lang-button { padding: 6px 10px; font-size: 0.9em; }
    .lang-button img { width: 22px; height: 14px; }
    .footer-content-wrapper { flex-direction: column; gap: 20px; }
    .footer-info { text-align: center; }
}

@media (max-width: 480px) {
    body { padding-left: 10px; padding-right: 10px; }
    .site-header { height: 140px; }
    .header-text-svg { top: 35px; max-width: 350px; }
    .site-logo { width: 73px; height: 73px; top: 0; }
    .email-link { right: 10px; top: 45px; width: 100px; height: 20px; transform: rotate(0deg); }
    .main-content { padding-top: 20px; margin-top: -30px; }
    .main-content::before { height: 70px; transform: translateY(-35px) scaleX(1.26); }
    .home-page-content .profile-image { width: 150px; height: 150px; }
    .intro-text h2 { font-size: 1.8em; }
    .services-grid { grid-template-columns: 1fr; }
    .bottom-link { font-size: 1em; }
    .content-section, .services-page-content, .inussuk-book-content, .biography-content, .bibliography-content { padding: 20px 15px; }
    .content-section h2, .services-page-content h2, .inussuk-book-content h2, .biography-content h2, .bibliography-content h2 { font-size: 2em; }
    .book-image-area { width: 90%; max-width: 200px; }
    .lang-button { padding: 5px 8px; font-size: 0.85em; gap: 5px; }
    .lang-button img { width: 20px; height: 12px; }
}