/* Font
   ========================================================================== */

@font-face {
    font-family: 'MorePerfectDOSVGA-LT';
    src: url('../fonts/MorePerfectDOSVGA-LT.woff2') format('woff2'),
         url('../fonts/MorePerfectDOSVGA-LT.ttf') format('truetype');
    font-display: swap; /* Use the swap value to display fallback text immediately */
}

/* Variables
   ========================================================================== */
:root {
    --bsidesvnoblue: #6cdefd;
    --backgroundblack: rgb(41, 41, 41);
    --navbarblack: rgb(23, 23, 23);
    --content-max-width: 1024px;
    --content-padding: 15px;  /* Define padding as a variable for consistency */
}

/* Base Styles
   ========================================================================== */
html {
    scroll-behavior: smooth; /* Smooth scroll when clicked on navbar menu item */
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {  
    padding-top: 80px; /* Increased to match navbar_wrap height */
    background-color: white;
    color: var(--backgroundblack);
    font-size: 130%;
    line-height: 1.5;
    font-family: 'MorePerfectDOSVGA-LT', Courier, monospace;
    display: flex;
    flex-direction: column;
}

* {
    overflow-wrap: break-word;
    box-sizing: border-box;
}

/* Links
   ========================================================================== */
a {
    text-decoration: none;
    color: blue;
}

a:hover {
    text-decoration: underline;
}

/* Layout
   ========================================================================== */
#content {
    max-width: var(--content-max-width);
    width: 100%;
    margin: 0 auto;
    border-radius: 50px;
    background-color: white;
    padding: 0;
    flex: 1 0 auto;
    box-sizing: border-box;
}

#content > div {
    padding-left: var(--content-padding);
    padding-right: var(--content-padding);
}

.content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    letter-spacing: normal;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    padding-left: var(--content-padding);
    padding-right: var(--content-padding);
}

main {
   margin: 0 200px;
}

/* Responsive / fluid images */
.content img {  
    height: auto;
    max-width: 100%;
    object-fit: contain;
    margin: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

figure {
    text-align: center;
    margin: 0;
    padding: 0;
}

figcaption {
    font-style: italic;
    font-size: 0.8em;
    color: #6900af;
}

/* Navbar
   ========================================================================== */
.navbar_wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--navbarblack);
    z-index: 1000;
    height: 80px;
}

.navbar {
    position: relative;
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    background: var(--navbarblack);
    box-sizing: border-box;
    padding: 0 var(--content-padding);
}

.navbar-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.navbar__left {
    flex: 1;
}

.navbar__right {
    display: flex;
    justify-content: flex-end;
    flex: 2;
}

.navbar__left a,
.navbar__right a {
    text-decoration: none;
    font-size: 140%;
    color: var(--bsidesvnoblue);
    margin-right: 15px; /* Reduced from 30px to 15px to decrease space between items */
    transition: all 100ms;
    padding: 20px 12px;
    line-height: 1.5;
    display: inline-block;
}

.navbar__left a {
    padding-left: 0; /* Remove left padding to align with content */
}

.navbar__right a:last-child {
    margin-right: 0;
}

.navbar__left a:hover,
.navbar__right a:hover {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    text-decoration: underline;
}

/* Remove underline specifically from BSides Vilnius text on hover */
.navbar__left a:hover {
    text-decoration: none;
}

.navbar__menu-icon {
    display: none; /* Initially hide the menu icon */
    cursor: pointer;
}

.navbar__menu-icon span {
    display: block;
    height: 3px; /* Slightly thicker lines */
    width: 30px; /* Slightly wider lines */
    background-color: var(--bsidesvnoblue);
    margin: 7px 0; /* More space between lines */
    transition: 0.4s;
}

.navbar__menu-icon.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.navbar__menu-icon.active span:nth-child(2) {
    opacity: 0;
}

.navbar__menu-icon.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Hero Section
   ========================================================================== */
.hero-container {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 0;
    overflow-x: hidden;
}

.hero-image {
    position: relative;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px; /* Space between rectangles */
    width: 100%;
    margin: 0;
    padding: 0;
}

.hero-content {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.9);
    border: 5px solid #000;
    border-radius: 25px;
    padding: 15px 30px;
    color: #000;
    max-height: 80vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.hero-content h1 {
    font-size: min(5em, 10vw);
    margin-bottom: 20px;
}

.hero-content h2 {
    font-size: min(2em, 6vw);
}

.hero-content h3 {
    font-size: min(1.5em, 5vw);
}

.hero-content p {
    font-size: min(1.2em, 4vw);
    margin-bottom: 30px;
}

/* Hero Logo */
.hero-logo {
    width: 80%;
    max-width: 500px;
    height: auto;
    margin-bottom: 20px;
}

/* Sponsors Section
   ========================================================================== */
.sponsors-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2rem 0;
    padding: 0 15px;
    box-sizing: border-box;
}

.sponsors-header-container {
    width: 100%;
    text-align: center;
    margin-bottom: 2rem;
}

.sponsors-header {
    font-weight: bold;
    font-size: 1.5rem;
    margin: 0;
    width: 100%;
    text-align: center;
}

.sponsors-grid-container {
    width: 100%;
    height: auto;
    background-color: white;
    padding: 20px 0;
}

.sponsors-grid {
    max-width: var(--content-max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    row-gap: 40px;
    column-gap: 20px;
    align-items: center;
    justify-items: center;
    padding: 0 20px;
}

.sponsors-grid img {
    max-height: 150px;
    width: auto;
    object-fit: contain;
    transition: all 0.2s ease-in-out;
}

.sponsors-grid a {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.sponsors-grid a:hover img {
    filter: brightness(1.2);
    transform: scale(1.05);
}

.sponsors-content h2 {
    margin: 0 0 15px 0;
    font-size: 1.5em;
}

.sponsors-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.sponsor-logo {
    max-width: 150px;
    height: auto;
    margin: 20px;
    object-fit: contain;
}

/* Update mobile styles for sponsors */
@media only screen and (max-width: 768px) {
    /* Sponsors section mobile adjustments */
    .sponsors-grid-container {
        height: auto;
        min-height: 200px;
        padding: 15px 0;
    }

    .sponsors-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet */
        gap: 20px;
        padding: 0 10px;
        grid-auto-rows: 120px;
    }

    .sponsors-grid img {
        max-height: 80px;
    }

    .sponsors-section {
        padding: 0 15px;
        width: 100%;
    }
}

@media only screen and (max-width: 480px) {
    .sponsors-grid {
        grid-template-columns: repeat(1, 1fr); /* 1 column on small phones */
        gap: 15px;
        grid-auto-rows: 100px;
    }
}

/* Blog
   ========================================================================== */
.blog__title {  
    font-size: 150% !important;  
    font-weight: bolder;  
}

.blog__container {
    margin: 0 auto;
    max-width: var(--content-max-width);
}

.blog__details {  
    display: flex; 
    align-items: center;  
}  

.blog__info {  
    margin-left: 20px;  
    flex: 1;  
}  

.blog__info p {  
    margin-block-start: 2px;  
    margin-block-end: 2px;  
    font-size: 16px;  
}   

.blog__image > img {  
    height: auto;  
    width: 100%;  
    object-fit: contain;  
    margin: 10px 0;  
}  

.blog__categories {  
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}  

.category {  
    padding: 5px 5px;  
    background: blue;
    font-size: 80%;  
    border-radius: 5px;  
    width: auto;  
    margin-right: 7px;  
}  

.category a {  
    color: #fff;  
}

.category:hover {  
    background: rgb(103, 117, 245);
}

.blog__navigateButtons {
    margin: 0 auto;
    max-width: var(--content-max-width);
    display: flex;  
    justify-content: space-between;  
    align-items: center;  
}  
    
.blog__navigate {  
    margin-bottom: 20px;  
}  

.blog__navigate button {  
    border: none;  
    outline: none;  
    background: rgb(41, 41, 41);
    color: #fff;  
    padding: 10px 20px;  
    border-radius: 5px;  
    cursor: pointer;  
    transition: all 200ms;  
}  

.blog__navigate button:hover {  
    background: rgb(103, 117, 245);
}  

.blog__navigate a {
    font-size: 16px;
    font-family: 'MorePerfectDOSVGALT', 'Georgia', serif;
    color: #fff;  
}

/* Code / Pre
   ========================================================================== */
pre code {
    /* Wrap code*/
    white-space: pre-wrap;
    word-break: keep-all;
}

pre {
    max-width: 100%;
    overflow-x: auto;
}

/* Footer
   ========================================================================== */
footer {
    background-color: var(--navbarblack);
    color: var(--bsidesvnoblue);
    padding: 15px;
}

footer a {
    color: var(--bsidesvnoblue);
    flex-shrink: 0;
}

footer a:hover {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    text-decoration: underline;
    color: var(--bsidesvnoblue);
}

/* Helper Classes
   ========================================================================== */
.hidden {
    display: none !important;
}

/* To make sure that # links are under top navbar */
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
    scroll-margin-top: 100px !important;
}

/* Utility for email protection */
.pastas:before {
    content: attr(data-website) "\0040" attr(data-user);
    unicode-bidi: bidi-override;
    direction: rtl;
}

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

/* Tablets and small desktops */
@media only screen and (max-width: 768px) {
    /* Base layout adjustments */
    body {
        padding-top: 80px; /* Match new navbar height */
        font-size: 110%;
        width: 100%;
    }

    /* Content and layout */
    #content,
    .content,
    main,
    .blog__container,
    .blog__navigateButtons {
        margin: 0;
        padding: 0 10px;
        width: 100%;
    }

    /* Mobile navbar */
    .navbar_wrap {
        height: 80px; /* Match desktop height */
    }
    
    .navbar {
        height: 80px; /* Match desktop height */
    }
    
    .navbar__menu-icon {
        display: block;
    }

    .navbar__right {
        display: none;
        position: absolute;
        top: 80px; /* Position right below navbar */
        left: 0;
        background: var(--navbarblack);
        width: 100%;
        flex-direction: column;
        align-items: flex-end; /* Change from flex-start to flex-end */
        text-align: right; /* Change from left to right */
        padding: 20px;
        box-shadow: 0 5px 5px rgba(0,0,0,0.2); /* Add shadow for better separation */
    }

    .navbar__right a {
        margin: 10px 0;
        font-size: 24px;
        width: 100%;
        text-align: right; /* Change from left to right */
        padding-right: 20px; /* Add some padding on the right side */
    }

    .navbar__right.active {
        display: flex;
        align-items: flex-end; /* Change from flex-start to flex-end */
    }

    /* Hero section mobile adjustments */
    .hero-container {
        width: 100vw;
        margin-left: -50vw;
        margin-right: -50vw;
        left: 50%;
        right: 50%;
        padding: 0;
    }

    .hero-image {
        width: 100vw;
        height: 100vh;
        margin: 0;
        padding: 0;
        left: 0;
        right: 0;
        position: relative;
    }

    .hero-background {
        width: 100vw;
        height: 100%;
        object-fit: cover;
    }

    .hero-wrapper {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .hero-content {
        width: 85%;
        max-width: 400px;
        margin: 0 auto;
        padding: 15px;
        border-width: 5px;
        position: relative;
        left: 0;
        right: 0;
        transform: none;
        text-align: center;
        max-height: 70vh;
    }

    .hero-logo {
        display: block;
        margin: 0 auto 15px auto;
        width: 80%;
        max-width: 300px;
    }

    .hero-content h1 {
        font-size: min(2.5em, 8vw);
    }

    .hero-content h2 {
        font-size: min(1.2em, 5vw);
    }

    .hero-content p {
        font-size: 1em;
        margin-bottom: 15px;
    }

    /* Blog mobile adjustments */
    .blog__details {
        flex-direction: column;
    }

    .blog__info {
        margin-left: 0;
        width: 100%;
    }

    /* Keep consistent alignment on mobile */
    .navbar__left a {
        padding-left: 0;
    }
}

/* Small phones */
@media only screen and (max-width: 480px) {
    body {
        padding: 80px 5px 0;
    }

    #content,
    .content,
    main,
    .blog__container,
    .blog__navigateButtons {
        padding: 0 5px;
    }

    /* Hide the middle navbar image */
    .navbar__middle {
        display: none;
    }

    /* Adjust hero wrapper for smaller screens */
    .hero-wrapper {
        top: calc(50% + 15px);
    }
}