
/* 1. LARGE SCREENS (Up to 1400px) */
@media screen and (max-width: 1400px) {
  #profile, #contact {
        height: auto;
        min-height: auto;
        margin-bottom: 4rem;
    }

    .logo-img {
        width: auto !important; 
        height: 60px;
        object-fit: contain;
    }
}

/* 2. TABLETS & DESKTOP SWITCH (Up to 1200px) */
@media screen and (max-width: 1200px) {
   #desktop-nav { display: none; }
    
    #hamburger-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 1.5rem;
        height: 70px;
    }

    #hamburger-nav .logo-img {
        height: 45px; 
        width: auto;
    }

    .arrow, .arrow-contact, .details-container img[onclick] {
        display: none;
    }
}

/* 3. MOBILE PHONES (Up to 768px) */

@media screen and (max-width: 768px) {

    section {
        padding-top: 2rem; /* Even smaller gap for mobile */
    }

 #profile {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        margin-top: 1.5rem;
        text-align: center;
    }

/* 2. Remove side margins from the picture container */
.section__pic-container {
    width: auto;
    height: auto;
    flex: none; /* This kills the 350px basis that's pushing the text down */
  }

  .section__text {
    margin-top: 5rem;
    margin-bottom: 1rem; /* Pulls the text upward slightly if needed */
  }

/* 3. Ensure title is responsive (Move below main class) */
.title {
    text-align: center;
    font-size: 2.8rem;
}

    .section__text__p2 {
        font-size: 1.5rem;
        margin: 0.4rem 0;
        line-height: 1.9;
    }

    .profile-subtitle {
        font-size: 1.25rem; 
        margin: 0.4rem 0;
        line-height: 1.4;
        color: #555555;
    }

    .btn-container {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
        width: 100%;
        margin-top: 1rem;
    }

    .btn-container .btn {
        width: auto; 
        min-width: 140px;
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }

    
    #experience .article-container {
        display: grid;
        grid-template-columns: max-content; 
        justify-content: center; 
        justify-items: start; 
        width: 85%;
        margin: 0 auto;
        align-items: center;
    }

    /* Blog Section */
    .blog-header {
        text-align:justify;
        position: relative;
        margin-bottom: 2rem;
    }

    .blog-header::after {
        content: "";
        display: block;
        width: 60px;
        height: 4px;
        background: #2563eb;
        margin: 0.5rem auto 0;
    }

    .blog-list {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
        width: 100%;
        max-width: 800px;
        margin: 3rem auto;
    }

    #blog .BlogVerticalScroller {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        height: 950px;           
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 10px;
        scroll-behavior: smooth;
    }

    #blog .blog-container {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        height: 950px; 
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 10px;
    }

    .blog-article-card {
        flex: 0 0 300px;
        width: 100%;
        display: flex;
        flex-direction: column;
        padding: 1.2rem;
        border-radius: 1.5rem;
        text-align: left;
    }

    .blog-article-card h3,
    .blog-article-card p {
        text-align: justify;
        width: 100%;
    }

    .blog-article-card h3 {
        font-size: 1.15rem;
        margin-bottom: 0.3rem;
    }

    .blog-article-card p {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    .blog-post {
        max-width: 95%;        /* Takes up more screen width on tablets */
        padding: 3rem 2rem;    /* Reduced padding for better text flow */
        margin: 1.5rem auto;   /* Added vertical margin to separate from nav/footer */
        border-radius: 8px;
    }

    .blog-title {
        font-size: 2.1rem;     /* Slightly scaled down from 2.4rem */
        line-height: 1.3;
    }

    .blog-content {
        font-size: 1.1rem;     /* Slightly larger for comfortable tablet reading */
    }

    #blog .BlogVerticalScroller::-webkit-scrollbar,
    #blog .blog-container::-webkit-scrollbar {
        width: 6px;
    }

    #blog .BlogVerticalScroller::-webkit-scrollbar-thumb,
    #blog .blog-container::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }

    /* Contact Section */
    #contact {
        width: 100%;
        padding: 2rem 5%;
        min-height: auto !important;
    }

    .contact-form-container {
        width: 100%;
        max-width: 90vw;
        margin: 0 auto;
    }

    .contact-info-upper-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    .contact-form-container .btn {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    a {
        text-decoration: none !important;
    }

    footer nav {
        height: auto;             
        display: flex;
        justify-content: center;   
        padding: 0;                
    }

    footer .nav-links {
        display: flex;
        flex-wrap: wrap;           
        justify-content: center;
        gap: 1rem;               
        margin: 1rem 0;            
        list-style: none;
        padding: 0;
    }

    footer p {
        margin: 0;
        font-size: 0.9rem;
        color: var(--secondary);   
    }

    footer .nav-links li {
        margin: 0;
    }

    footer .nav-links a {
        text-decoration: none;  
    }
}

/* 4. SMALL MOBILE (Up to 480px) */
@media screen and (max-width: 480px) {

 
  
  /* The Fix for the gap */
  #profile {
    gap: 0.5rem; /* Tighten the space between pic and text */
  }

   .profile-subtitle,
    .section__text__p2 {
    font-size: 0.88rem; 
    font-weight: 500;
    line-height: 1.4;
    margin-top: 0.2rem;
    white-space: nowrap; 
    text-align: center;
}

   .title {
    font-size: 1.65rem;
    letter-spacing: -0.5px;
  }

.profile-pic {
    width: 170px;
    height: 170px;
    margin-bottom: 1rem;
}

/* Touch-Friendly Interaction */
.btn-container {
    gap: 0.75rem;
}

.btn-container .btn {
    min-width: 130px;
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
}

/* Form & Footer */
#contact-form input, 
#contact-form textarea {
    font-size: 16px; /* Prevents iOS auto-zoom on click */
    padding: 0.9rem;
}

footer .nav-links {
    gap: 0.8rem;
    font-size: 0.85rem;
}

footer p {
    font-size: 0.75rem;
    line-height: 1.4;
    }
}
