/* Override Bulma's CSS custom properties for hot pink links */
:root {
    --bulma-link: #ff1493; /* Hot pink */
    --bulma-link-hover: #ff69b4; /* Lighter hot pink on hover */
    --bulma-link-active: #dc1470; /* Darker hot pink for active state */
}

body {
    font-family: "nirmala-ui", sans-serif;
}

/* Prevent flash of unstyled content - start content hidden */
#content {
    opacity: 0;
}

/* Additional specific overrides if needed */
.tabs li.is-active a {
    border-bottom-color: var(--bulma-link) !important;
}

header h1.title {
    font-family: "lullabies-regular", sans-serif;
    color: #ff1493;
}

/* Mobile responsiveness improvements */
@media (max-width: 768px) {
    #header {
        text-align: center !important;
        padding: 1rem;
    }
    
    #header h1.title {
        font-size: 1.75rem;
    }
    
    #header h2 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    #header h3 {
        font-size: 1rem;
    }
    
    .buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .buttons .button {
        width: 100%;
        max-width: 300px;
        margin-bottom: 0.75rem;
    }
}

/* Increase vertical spacing between list items inside the main content
   area only. This avoids changing lists used for navigation (tabs, menus).
   Use direct-child selector so nested lists keep their own spacing. */
.content ul > li,
.content ol > li {
    margin-bottom: 0.6rem;
}

/* Figure title overlay: center H1 horizontally and vertically over the image */
.figure-with-title {
    position: relative;
    display: block;
    max-width: 100%;
}
.figure-with-title .profile-image {
    display: block;
    width: 100%;
    height: auto;
}

.figure-with-title .hero-title {
    position: absolute;
    left: 8px;
    /* flush nearer the top; reduce padding so text sits visually higher */
    top: -35px;
    transform: none;
    margin: 0;
    padding: 0.5rem 0.9rem;
    z-index: 10; /* ensure the title is above the image */
    color: #fff;
    background: rgba(0,0,0,0.50);
    border-radius: 6px;
    /* Responsive hero size: minimum, preferred (vw), maximum */
    font-size: clamp(1.5rem, 5vw, 3rem);
    line-height: 1.05;
    text-align: left;
    white-space: normal; /* allow wrapping on very small screens */
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

@media (max-width: 768px) {
    .figure-with-title .hero-title {
        /* Ensure the clamp doesn't make it too large on small devices */
        font-size: clamp(1.25rem, 6vw, 1.75rem);
    padding: 0.35rem 0.75rem;
    }
}

/* Project list layout helpers */
.project-logo img {
    width: 128px;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
}
.thumbnail-placeholder {
    /* Fill column width, but allow the image to control height (preserve aspect ratio) */
    width: 100%;
    background: #222; /* dark theme background */
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e6e6e6; /* light text for contrast */
    font-size: 0.8rem;
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
    overflow: hidden;
}

/* Ensure we can absolutely position the zoom icon inside the thumbnail */
.thumbnail-placeholder {
    position: relative;
}

/* Magnifying glass button in the top-right of thumbnails */
.thumbnail-placeholder .thumb-zoom {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: 0;
    padding: 0.35rem 0.45rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 8;
}
.thumbnail-placeholder .thumb-zoom:hover {
    background: rgba(0,0,0,0.65);
}

/* Modal navigation buttons */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: 0;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    z-index: 1100;
}
.modal-prev { left: 1rem; }
.modal-next { right: 1rem; }

/* Ensure modal image scales nicely */
.modal-content {
    /* center modal content and allow it to grow to the viewport size */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content .image {
    /* let the image container size itself based on the image and viewport */
    max-width: 96vw;
    max-height: 92vh;
    display: block;
}

.modal-content .image img {
    /* scale the image to fit the container without clipping */
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
}

/* Ensure the modal container itself fits inside the window and centers content */

/* Keep modal hidden by default; only show when Bulma's .is-active class is present */
.modal {
    display: none;
}

.modal.is-active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem; /* small gap from viewport edges */
}

/* Force modal to be fixed to the viewport so it's not constrained by any ancestor container */
.modal {
    position: fixed !important;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
}

.modal .modal-content {
    /* constrain the modal to the viewport so it never overflows */
    max-width: 96vw;
    width: auto;
    max-height: 96vh;
    overflow: auto; /* allow the content to scroll if needed */
    box-sizing: border-box;
    margin: 0; /* avoid being constrained by ancestor margins */
    align-self: center;
}

/* On small devices, make the modal essentially full-screen but still padded */
@media (max-width: 480px) {
    .modal {
        padding: 0; /* use full width on tiny screens */
    }
    .modal .modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0; /* edge-to-edge feel */
    }
    .modal-nav.modal-prev, .modal-nav.modal-next {
        top: 50%;
        transform: translateY(-50%);
        padding: 0.45rem 0.6rem;
    }
}

/* Let images keep their natural aspect ratios; width fills container, height auto */
.thumbnail-placeholder img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover; /* harmless if image is larger than container */
    margin: 0;
}

/* Thumbnail grid: make up to 4 thumbnails per row and scale them to fit */
.project-thumbs .columns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.project-thumbs .column.is-narrow {
    /* Calculate 4 across minus gaps */
    flex: 0 0 calc((100% - 3 * 0.5rem) / 4);
    max-width: calc((100% - 3 * 0.5rem) / 4);
}

/* Responsive breakpoints: 3 per row, 2 per row, then 1 */
@media (max-width: 1000px) {
    .project-thumbs .column.is-narrow {
        flex: 0 0 calc((100% - 2 * 0.5rem) / 3);
        max-width: calc((100% - 2 * 0.5rem) / 3);
    }
}
@media (max-width: 640px) {
    .project-thumbs .column.is-narrow {
        flex: 0 0 calc((100% - 1 * 0.5rem) / 2);
        max-width: calc((100% - 1 * 0.5rem) / 2);
    }
}
@media (max-width: 420px) {
    .project-thumbs .column.is-narrow {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.project-links .button {
    margin-right: 0.5rem;
}
.project-links .button .icon {
    margin-right: 0.35rem;
    display: inline-flex;
    align-items: center;
}

/* Badge images used in place of .tag elements */
.tags img.tag-badge {
    margin-right: 0.35rem;
    height: 20px;
    vertical-align: middle;
}

.tags img.tag-badge:last-child {
    margin-right: 0;
}
.project-links .button:last-child {
    margin-right: 0;
}

/* Make project links smaller and stack under the logo */
.project-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
}
.project-links .button {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
}
.project-links .button.is-link {
    padding-left: 0.45rem;
}

/* Align project logo column to the top of the row instead of vertically centered */
.box .columns.is-vcentered {
    align-items: flex-start;
}

/* Responsive YouTube embed: full width of the content column */
.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}
.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Add a medium dark top border to any Bulma `.box` inside the main
   `.content` area, but avoid adding the border to the first/topmost
   `.box` (commonly used as the main content wrapper). */
.content .box {
    border-top: 2px solid #3a3a3a; /* medium dark gray */
}

/* If a page uses a single top-level box as the main content container,
   don't apply the border to that main box. */
.content > .box:first-child {
    border-top: none;
}