html, body {
    height: 100%; /* Ensure the body takes full height */
    margin: 0; /* Remove any default margins */
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensure the body takes at least the full height of the viewport */
}

header {
    background: #333;
    color: #fff;
    padding: 10px 0;
}

.fixed-navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: #333;
    overflow: hidden;
    z-index: 1000;
    height: 60px; /* Explicit height for the navbar */
}

.fixed-navbar ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.fixed-navbar ul li {
    margin: 0 15px;
}

.fixed-navbar ul li a {
    text-decoration: none;
    color: white;
    padding: 14px 20px;
    display: block;
}

.fixed-navbar ul li a:hover {
    background-color: #575757;
}

.fixed-navbar ul li a:focus {
    background-color: #444;
    outline: none;
}

main {
    margin-top: 60px; /* Adjust for navbar height */
    padding: 20px;
    flex-grow: 1; /* Ensures that the main content takes available space */
}

footer {
    text-align: center;
    padding: 10px;
    background-color: #333;
    color: white;
    margin-top: auto; /* Ensures the footer stays at the bottom */
}

/* Responsive design */
@media (max-width: 768px) {
    .fixed-navbar ul {
        flex-direction: column;
        align-items: center;
    }
    .fixed-navbar ul li {
        margin: 10px 0;
    }
}

/* Universal box-sizing for consistency */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Main Content */
.content-container {
    margin: 0 auto;
    width: 80%; /* Adjust this to control the width of the CV section */
    padding: 20px;
}

.pdf-container {
    width: 80%; /* Set a specific width, e.g., 80% of the container */
    max-width: 900px; /* Max width to ensure it doesn’t get too large on wide screens */
    margin: 0 auto; /* Center the container */
    overflow: hidden; /* Prevent overflow of the PDF viewer */
}

.pdf-container object {
    width: 100%; /* Ensure the object (PDF viewer) takes up 100% of its container */
    height: 600px; /* Set a fixed height for the PDF viewer */
}

#videos-podcasts {
    text-align: center;
    margin: 40px 0;
}

.channel-tiles {
    display: grid;
    flex-wrap: wrap;
    justify-content: center; 
    align-items: center;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Creates a responsive grid */
    gap: 20px;
    padding: 20px;
}

.tile {
    background-color: #333;
    color: white;
    padding: 10px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column; /* Stack iframe and text vertically */
    justify-content: center;
    align-items: center;
}

.tile iframe {
    width: 100%;
    height: 200px; /* Fixed height for iframe */
}

.tile:hover {
    transform: scale(1.05);
}

.tile p {
    margin-top: 10px;
    font-size: 1.1em;
}

.tile a {
    text-decoration: none;
    color: white;
    text-align: center;
}

.tile a:hover {
    text-decoration: underline;
}

/* Responsive layout for small screens */
@media (max-width: 768px) {
    .tile iframe {
        height: 150px; /* Smaller iframe for smaller screens */
    }
}

form {
    width: 80%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 15px;
}

label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

input, textarea {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

textarea {
    resize: vertical;
}

button {
    background-color: #333;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #575757;
}

.auth-status {
    text-align: right;
    padding: 10px;
}
.auth-status a {
    color: #333;
    text-decoration: none;
}
.auth-status a:hover {
    color: black;
}

.book-entry {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 40px;
}

.book-image {
    width: 6in;
    height: 4in;
    object-fit: cover;
}

.book-entry div {
    flex: 1;
}

/* Channel profile picture */
.channel-profile-pic {
    width: 151.2px; /* 4 cm converted to pixels */
    height: 151.2px; /* 4 cm converted to pixels */
    border-radius: 50%; /* This makes the image circular */
    object-fit: cover; /* Ensures the image fills the circle without distortion */
    margin-bottom: 10px; /* Adds some spacing below the image */
}

/* Change text color of all content inside .tile to white */
.tile {
    color: white !important;  /* Set the text color of everything inside the tile to white */
}

/* Optional: Styling for the channel name */
.tile p {
    font-size: 14px; /* Adjust text size */
    font-weight: bold; /* Make the name stand out */
}

/*for the home page */


/* General Reset */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

/* Profile Container */
.profile-container {
    width: 100%; /* Full width */
    margin: 0;
    background-color: transparent; /* Remove background color */
    border: none; /* Remove border */
    box-shadow: none; /* Remove shadow */
}

/* Header Section */
.header {
    position: relative;
    text-align: center;
}

/* Profile Banner with Image */
.profile-banner {
    background-image: url('/static/images/profile-banner.jpg'); /* Replace with the actual image path */
    background-size: cover; /* Make the image cover the entire banner */
    background-position: center; /* Center the image */
    background-repeat: no-repeat; /* Avoid repeating the image */
    height: 400px; /* Adjust height as needed */
}

/* Profile Details */
.profile-details {
    display: flex;
    padding: 20px;
    align-items: center;
    gap: 20px;
    margin-top: -60px; /* Overlap with banner */
    justify-content: center; /* Center the content */
}

/* Profile Picture */
.profile-picture img {
    border: 4px solid white; /* Optional: Border for profile picture */
    border-radius: 50%; /* Make it circular */
    width: 3in;
    height: 3in;
    object-fit: cover;
}

/* Profile Info */
.profile-info h1 {
    font-size: 24px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1px;
}

.verified-badge {
    color: black
}

.profile-info .designation {
    font-size: 16px;
    color: #666;
    margin: 5px 0;
}

.profile-info .location,
.profile-info .contact-info {
    font-size: 14px;
    margin: 3px 0;
}

.profile-info a {
    color: black; 
    text-decoration: none;
}

/* Connections */
.connections p {
    margin: 10px 0 0;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

/* Action Buttons */
.actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border-top: none; /* Remove top border */
    background-color: transparent; /* Remove background */
}

.action-button {
    padding: 10px 15px;
    background-color: black;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.action-button:hover {
    background-color: black;
}

/* Responsive Design */
@media (max-width: 768px) {
    .profile-details {
        flex-direction: column;
        text-align: center;
    }
}


/* Button Styling */
.action-button {
    text-decoration: none;
    background-color: black;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    cursor: pointer;
    margin: 5px;
}

.action-button:hover {
    background-color: #005582;
}

/* Popup Styling */
.popup {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow: auto; /* Allow scrolling if necessary */
}

.popup-content {
    position: relative;
    background: white;
    padding: 20px;
    margin: 15% auto;
    width: 80%;
    border-radius: 10px;
    overflow-y: auto; /* Enable vertical scrolling if the content overflows */
    text-align: left; /* Ensure text is left-aligned */
}

.popup-content h3 {
    margin-bottom: 15px;
    font-size: 20px;
    color: black;
}

.popup-content p {
    font-size: 14px;
    color: #333;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #555;
    font-weight: bold;
}

.close:hover {
    color: #000;
}

/* Styling for iframe (PDF Viewer) */
iframe {
  border: none;
}
.photo-gallery {
    display: flex;
    flex-direction: column; /* Stack items vertically */
    align-items: center; /* Center-align items */
    justify-content: center; /* Center-align in the available space */
    gap: 20px; /* Space between each photo item */
    padding: 20px;
}

.photo-tile {
    display: flex;
    flex-direction: column; /* Image and text stacked */
    align-items: center; /* Center-align image and text */
}

.photo-tile img {
    border: 2px solid black; /* Black border */
    width: 6in; /* Fixed width */
    height: 6in; /* Fixed height */
    object-fit: cover; /* Prevent distortion by cropping to fit */
    display: block; /* Prevent inline spacing issues */
}

.photo-tile p {
    margin-top: 10px; /* Space between the image and text */
    font-size: 14px; /* Text size */
    color: #333; /* Text color */
    text-align: center; /* Center-align text */
}

/* Blog Page Styling */
.blogs-container {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

h2 {
    text-align: center;
    color: #444;
    margin-bottom: 20px;
}

.technical-blogs {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.blog-tile {
    width: 150px;
    height: 150px;
    background-color: #333; /* Dark gray color */
    border: 2px solid black;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    color: white;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.3s;
    border-radius: 5px;
}

.blog-tile:hover {
    transform: scale(1.05);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    border-radius: 8px;
    position: relative;
}

.modal-content iframe {
    border: none;
}

.close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

#modalTitle {
    text-align: center;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

/* Home page */
.home-page {
    width: min(100%, 1080px);
    margin: 32px auto;
    padding: 36px clamp(20px, 5vw, 64px);
    background: #fff;
    border: 1px solid #e4eaf0;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(20, 42, 66, 0.08);
}

.home-page .header {
    text-align: left;
}

.home-page .profile-details {
    justify-content: flex-start;
    gap: clamp(24px, 5vw, 56px);
    margin: 0;
    padding: 8px 0 32px;
}

.home-page .profile-picture img {
    display: block;
    width: clamp(150px, 20vw, 220px);
    height: clamp(150px, 20vw, 220px);
    border: 5px solid #eef3f7;
    box-shadow: 0 8px 22px rgba(20, 42, 66, 0.12);
}

.home-page .profile-info h1 {
    display: block;
    color: #142a42;
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.home-page .profile-info .designation {
    max-width: 560px;
    margin-top: 12px;
    color: #52677c;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.6;
}

.home-page .additional-info {
    border-top: 1px solid #e4eaf0;
    padding-top: 28px;
}

.home-page .home-copy {
    max-width: 880px;
    margin: 0 auto;
    color: #34485c;
    font-size: 1.025rem;
    line-height: 1.8;
}

.home-page .home-copy > p:first-child {
    color: #20374e;
    font-size: 1.15rem;
    font-weight: 500;
}

.home-page .home-copy p {
    margin: 0 0 16px;
}

.home-page .home-copy h2 {
    margin: 36px 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dce7ef;
    color: #142a42;
    font-size: 1.45rem;
    text-align: left;
}

.home-page .home-copy ul {
    margin: 0 0 22px;
    padding-left: 24px;
}

.home-page .home-copy li {
    margin: 0 0 10px;
    padding-left: 4px;
}

.home-page .home-copy li::marker {
    color: #28748a;
}

.home-page .home-copy a {
    color: #17657d;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.home-page .home-copy a:hover {
    color: #10475a;
}

.home-page .actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
    padding: 22px 0 0;
    border-top: 1px solid #e4eaf0;
}

.home-page .action-button {
    margin: 0;
    border-radius: 6px;
    background: #173b56;
}

.home-page .action-button:hover {
    background: #216b7e;
}

.home-page .action-button:focus-visible {
    outline: 3px solid #7ab7c5;
    outline-offset: 3px;
}

@media (max-width: 640px) {
    .home-page {
        margin: 16px auto;
        padding: 24px 20px;
        border-radius: 10px;
    }

    .home-page .profile-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding-bottom: 24px;
    }

    .home-page .profile-picture img {
        width: 156px;
        height: 156px;
    }

    .home-page .home-copy {
        font-size: 1rem;
    }

    .home-page .actions {
        justify-content: center;
    }
}

.home-page .popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
    background: rgba(13, 27, 42, 0.68);
    backdrop-filter: blur(5px);
}

.home-page .popup.is-open {
    display: flex;
    animation: popup-fade-in 180ms ease-out;
}

.home-page .popup-content {
    position: relative;
    width: min(100%, 820px);
    max-height: min(84vh, 900px);
    margin: auto;
    padding: clamp(24px, 4vw, 40px);
    overflow-y: auto;
    border: 1px solid rgba(218, 228, 237, 0.9);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(6, 20, 34, 0.3);
    color: #34485c;
    text-align: left;
    animation: popup-rise-in 220ms ease-out;
}

.home-page .popup-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e4eaf0;
}

.home-page .popup-eyebrow {
    margin: 0 0 5px;
    color: #28748a;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-transform: uppercase;
}

.home-page .popup-content h3 {
    margin: 0;
    color: #142a42;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    line-height: 1.25;
}

.home-page .popup-content h4 {
    margin: 26px 0 10px;
    color: #20374e;
    font-size: 1.08rem;
}

.home-page .popup-intro {
    margin: 0 0 20px;
    color: #5a6f82;
    font-size: 0.98rem;
    line-height: 1.7;
}

.home-page .popup-content ul {
    padding-left: 24px;
    line-height: 1.7;
}

.home-page .popup-content li {
    margin-bottom: 8px;
    padding-left: 3px;
}

.home-page .popup-content li::marker {
    color: #28748a;
}

.home-page .popup-content iframe {
    display: block;
    width: 100%;
    height: min(58vh, 620px);
    border: 1px solid #dce5ec;
    border-radius: 8px;
    background: #f4f7f9;
}

.home-page .popup-content iframe.reference-document {
    width: calc(100% + var(--pdf-sidebar-width));
    height: 100%;
    max-width: none;
    border: 0;
    border-radius: 0;
    transform: translateX(calc(-1 * var(--pdf-sidebar-width)));
}

.home-page .reference-document-viewport {
    --pdf-sidebar-width: clamp(90px, 22vw, 300px);
    width: 100%;
    height: min(58vh, 620px);
    overflow: hidden;
    border: 1px solid #dce5ec;
    border-radius: 8px;
    background: #f4f7f9;
}

.home-page .close {
    position: sticky;
    top: 0;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: -4px -4px 0 0;
    border: 1px solid #dce5ec;
    border-radius: 50%;
    background: #f5f8fa;
    color: #34485c;
    font: inherit;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.home-page .close:hover {
    border-color: #173b56;
    background: #173b56;
    color: #fff;
}

.home-page .popup-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 7px;
    background: #173b56;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 160ms ease, transform 160ms ease;
}

.home-page .popup-link:hover {
    transform: translateY(-1px);
    background: #216b7e;
    color: #fff;
}

.home-page .close:focus-visible,
.home-page .popup-link:focus-visible {
    outline: 3px solid #7ab7c5;
    outline-offset: 3px;
}

body.modal-open {
    overflow: hidden;
}

@keyframes popup-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popup-rise-in {
    from { opacity: 0; transform: translateY(12px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
    .home-page .popup {
        align-items: flex-end;
        padding: 10px;
    }

    .home-page .popup-content {
        width: 100%;
        max-height: 92vh;
        padding: 24px 20px;
        border-radius: 14px;
    }

    .home-page .popup-content iframe {
        height: 58vh;
    }

}

/* Consistent page layout and visual system */
:root {
    --site-ink: #142a42;
    --site-muted: #52677c;
    --site-accent: #17657d;
    --site-border: #e1e8ee;
    --site-surface: #ffffff;
    --site-background: #f2f5f8;
}

html,
body {
    min-height: 100%;
}

body {
    background: var(--site-background);
    color: #34485c;
    font-family: Arial, sans-serif;
}

.fixed-navbar {
    display: flex;
    align-items: center;
    height: 68px;
    padding: 0 20px;
    background: #142a42;
    box-shadow: 0 4px 18px rgba(13, 27, 42, 0.16);
}

.fixed-navbar ul {
    width: min(100%, 1120px);
    margin: 0 auto;
    align-items: center;
    gap: 6px;
}

.fixed-navbar ul li {
    flex: 0 0 auto;
    margin: 0;
}

.fixed-navbar ul li a {
    padding: 12px 16px;
    border-radius: 6px;
    color: #e8eef3;
    font-size: 0.94rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 150ms ease, color 150ms ease;
}

.fixed-navbar ul li a:hover,
.fixed-navbar ul li a:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.fixed-navbar ul li a:focus-visible {
    outline: 2px solid #8fc6d1;
    outline-offset: 2px;
}

.site-main {
    width: min(100%, 1240px);
    margin: 0 auto;
    margin-top: 68px;
    padding: 40px 28px 56px;
}

.page-panel,
.home-page {
    width: 100%;
    margin: 0 auto 24px;
    padding: clamp(24px, 4vw, 44px);
    border: 1px solid var(--site-border);
    border-radius: 14px;
    background: var(--site-surface);
    box-shadow: 0 12px 32px rgba(20, 42, 66, 0.06);
}

.page-heading {
    margin: 0 0 28px;
}

.page-eyebrow {
    margin: 0 0 7px;
    color: var(--site-accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-transform: uppercase;
}

.page-heading h1,
.page-panel > h1 {
    margin: 0 0 10px;
    color: var(--site-ink);
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    letter-spacing: -0.035em;
    line-height: 1.2;
    text-align: left;
}

.page-heading > p:last-child {
    max-width: 760px;
    margin: 0;
    color: var(--site-muted);
    font-size: 1.02rem;
    line-height: 1.7;
}

.page-panel h2 {
    color: var(--site-ink);
    text-align: left;
}

.page-panel p {
    color: #41566a;
    line-height: 1.75;
}

.page-panel a:not(.tile a) {
    color: var(--site-accent);
    text-underline-offset: 3px;
}

.page-panel a:hover {
    color: #10475a;
}

footer {
    padding: 18px 20px;
    background: #142a42;
    color: #d8e1e9;
    font-size: 0.9rem;
}

footer p {
    margin: 0;
}

/* Books and research */
.container.page-panel {
    max-width: none;
}

.book-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(200px, 270px);
    align-items: start;
    gap: clamp(24px, 4vw, 44px);
    margin: 0 0 24px;
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--site-border);
    border-radius: 12px;
    background: #fbfcfd;
}

.book-entry:last-child {
    margin-bottom: 0;
}

.book-details h2,
.publication-entry h2 {
    margin: 0 0 14px;
    font-size: clamp(1.25rem, 2.6vw, 1.65rem);
    line-height: 1.35;
}

.book-details p,
.publication-entry p {
    margin: 0 0 16px;
    text-align: left;
}

.book-details h3 {
    margin: 24px 0 10px;
    color: var(--site-ink);
    font-size: 1rem;
}

.store-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.store-links a {
    display: inline-flex;
    padding: 8px 12px;
    border: 1px solid #cbd9e2;
    border-radius: 6px;
    background: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.store-links a:hover {
    border-color: var(--site-accent);
    background: #f1f8fa;
}

.book-cover {
    display: flex;
    justify-content: center;
    padding: 14px;
    border: 1px solid var(--site-border);
    border-radius: 10px;
    background: #fff;
}

.book-image {
    display: block;
    width: 100%;
    max-width: 230px;
    height: auto;
    max-height: 340px;
    border: 0;
    border-radius: 4px;
    object-fit: contain;
    box-shadow: 0 8px 22px rgba(20, 42, 66, 0.13);
}

.publication-entry {
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--site-border);
    border-radius: 12px;
    background: #fbfcfd;
}

.publication-link {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    font-weight: 700;
}

/* Teaching, video channels, and contact */
.teaching-list {
    max-width: 960px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.teaching-entry {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid var(--site-border);
}

.teaching-entry:first-child {
    padding-top: 4px;
}

.teaching-entry:last-child {
    padding-bottom: 4px;
    border-bottom: 0;
}

.teaching-year {
    padding-top: 2px;
    color: var(--site-accent);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.teaching-details h2 {
    margin: 0 0 7px;
    color: var(--site-ink);
    font-size: 1.08rem;
    line-height: 1.5;
}

.teaching-details p {
    margin: 0;
    color: var(--site-muted);
    font-size: 0.98rem;
}

.teaching-details a {
    color: var(--site-accent);
    text-underline-offset: 3px;
}

.teaching-details a:hover {
    color: #10475a;
}

#videos-podcasts {
    margin: 0 auto 24px;
    text-align: left;
}

.channels-page .page-heading {
    margin-bottom: 28px;
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid #dce9eb;
    border-radius: 12px;
    background: linear-gradient(120deg, #f0f7f7, #f8fafc 72%);
}

.channel-tiles {
    width: min(100%, 920px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 0 auto;
    padding: 0;
}

.channel-tiles .tile {
    min-height: 244px;
    padding: 24px 18px;
    border: 1px solid #dfe8ed;
    border-top: 3px solid #397d86;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff 0%, #f7fafb 100%);
    box-shadow: 0 6px 18px rgba(20, 42, 66, 0.07);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.channel-tiles .tile:hover {
    transform: translateY(-4px);
    border-color: #bfd5da;
    border-top-color: #17657d;
    box-shadow: 0 12px 24px rgba(20, 42, 66, 0.12);
}

.channel-tiles .tile a {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    color: var(--site-ink);
    text-decoration: none;
}

.channel-tiles .tile a:focus-visible {
    border-radius: 8px;
    outline: 3px solid #7ab7c5;
    outline-offset: 5px;
}

.channel-tiles .channel-profile-pic {
    width: 128px;
    height: 128px;
    margin: 0 auto 12px;
    border: 4px solid #fff;
    box-shadow: 0 0 0 1px #dce7eb, 0 5px 14px rgba(20, 42, 66, 0.12);
}

.channel-tiles .tile p {
    margin: 6px 0 0;
    padding: 7px 11px;
    border-radius: 999px;
    background: #eaf2f4;
    color: #244b5c;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
    text-align: center;
}

.channel-tiles .tile:hover p {
    background: #dcebed;
    color: #173b56;
}

.contact-page .page-heading {
    margin-bottom: 26px;
}

.contact-page form {
    width: min(100%, 760px);
    max-width: none;
    margin: 0;
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--site-border);
    border-radius: 12px;
    background: #fbfcfd;
    box-shadow: none;
}

.contact-page .form-group {
    margin-bottom: 20px;
}

.contact-page label {
    margin-bottom: 7px;
    color: var(--site-ink);
    font-size: 0.94rem;
}

.contact-page input,
.contact-page textarea {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #cbd6df;
    border-radius: 7px;
    background: #fff;
    color: #20374e;
    font: inherit;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.contact-page textarea {
    min-height: 160px;
}

.contact-page input:focus,
.contact-page textarea:focus {
    border-color: var(--site-accent);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(23, 101, 125, 0.14);
}

.contact-page .btn-submit {
    padding: 12px 20px;
    border-radius: 7px;
    background: #173b56;
    font: inherit;
    font-weight: 700;
    transition: background-color 150ms ease, transform 150ms ease;
}

.contact-page .btn-submit:hover {
    transform: translateY(-1px);
    background: #216b7e;
}

@media (max-width: 700px) {
    .fixed-navbar {
        height: 62px;
        padding: 0 8px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .fixed-navbar::-webkit-scrollbar {
        display: none;
    }

    .fixed-navbar ul {
        width: max-content;
        min-width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0;
    }

    .fixed-navbar ul li a {
        padding: 10px 12px;
        font-size: 0.84rem;
    }

    .site-main {
        margin-top: 62px;
        padding: 22px 14px 36px;
    }

    .page-panel,
    .home-page {
        margin-bottom: 16px;
        padding: 22px 18px;
        border-radius: 11px;
    }

    .page-heading {
        margin-bottom: 22px;
    }

    .book-entry {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        padding: 18px;
    }

    .book-cover {
        grid-row: 1;
    }

    .book-image {
        max-width: 180px;
        max-height: 270px;
    }

    .publication-entry {
        padding: 18px;
    }

    .teaching-entry {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
        padding: 18px 0;
    }

    .teaching-year {
        font-size: 0.8rem;
    }

    .channel-tiles {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .channel-tiles .tile {
        min-height: 164px;
        padding: 14px 6px;
    }

    .channel-tiles .tile p {
        padding: 5px 4px;
        font-size: 0.68rem;
        letter-spacing: -0.02em;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .channel-tiles .channel-profile-pic {
        width: 76px;
        height: 76px;
    }

    .contact-page form {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-page .popup.is-open,
    .home-page .popup-content {
        animation: none;
    }
}

@media (max-width: 700px) {
    .home-page .reference-document-viewport {
        --pdf-sidebar-width: 90px;
        --pdf-sidebar-offset: -72px;
    }

    .home-page .popup-content iframe.reference-document {
        width: calc(125% + var(--pdf-sidebar-width));
        height: 125%;
        transform: translateX(var(--pdf-sidebar-offset)) scale(0.8);
        transform-origin: top left;
    }
}
