/* ==========================================================================
   ===== RESPONSIVE MEDIA QUERIES =====
   ========================================================================== */

/* ===== TABLETS (Screens under 1024px) ===== */
@media screen and (max-width: 1024px) {

    /* Main Content Layout Adjustments */
    .content-left {
        max-width: 100%;
        /* Allows text to span normally without overlapping columns */
        padding-right: 0;
    }

    .gothic-title {
        font-size: 1.5rem;
        /* Scale down typography sizing dynamically */
    }

    /* Handle the floating logo so it doesn't collide with text */
    .content-logo {
        position: absolute;
        /* Removes "fixed" state */
        margin: 0 auto 30px auto;
        display: flex;
        justify-content: center;
        width: 100px;
        top: 3px;
        right: 5px;
    }

    .logo-img {
        width: 100px;
    }

    /* Forms simplification */
    .story-form {
        width: 100%;
        /* Expand form size for easier touch interactions */
    }

    /* Carousel sizing tweaks */
    .media-carousel-container {
        width: 100%;
    }

    .hamburger-btn {
        display: block;
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 5px;
        z-index: 1001;
    }

    .hamburger-line {
        display: block;
        width: 25px;
        height: 3px;
        background: white;
        margin: 4px 0;
        transition: var(--transition-default);
    }

    /* Animation du bouton en croix */
    .hamburger-btn.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger-btn.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .hamburger-btn.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .container {
        padding-top: 30px;
    }

    .sign-btn {
        right: 50px;
    }

}

/* ===== SMARTPHONES & SMALL TABLETS (Screens under 768px) ===== */
@media screen and (max-width: 768px) {

    /* Banner structural changes */
    .banner {
        height: 80px;
        /* Shorter header bar */
        padding: 0 10px;
    }

    /* Hide unneeded profile elements on narrow headers to make space */
    .banner-left,
    .banner-right,
    .banner-who {
        display: none;
    }

    .banner-center {
        margin-left: 50px;
        /* Offset to prevent title from clipping underneath hamburger */
        width: 100%;
        text-align: left;
    }

    .gothic-title {
        font-size: 1.8rem;
        /* Scale down typography sizing dynamically */
    }

    /* Show hamburger menu toggle button */
    .hamburger-btn {
        display: block;
    }

    /* Switch main column layout from horizontal Row to vertical Stack */
    .container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 80px);
    }

    /* Mobile Sidebar adaptation */
    .sidebar {
        width: 50%;
        display: none;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 5px 0;
    }

    .sidebar.active,
    .sidebar.open {
        display: block !important;
    }

    /* Optimize links for fat-finger mobile tapping rules */
    .sidebar-menu li {
        padding: 2px 10px;
    }

    .sidebar-menu a {
        padding: 12px 15px;
        /* Bigger touch target sizes */
    }

    .sidebar-menu a::before {
        left: 10px;
    }

    /* Content Area Settings */
    .main-content {
        padding: 15px;
        font-size: 18px;
        /* Slightly easier reading density for compact displays */
    }

    .content-left h1 {
        font-size: 22px;
    }

    .content-left h2 {
        font-size: 18px;
    }

    .content-left h3 {
        font-size: 18px;
    }

    .content-left a {
        font-size: 18px;
    }

    /* Switch Article Grid from 2-Column to 1-Column layout */
    .articles-container,
    .articles-container.detail {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .article-card {
        min-height: auto;
        /* Allow height to adapt dynamically based on inner text length */
    }

    /* Login Box refinement */
    .login-container {
        margin: 1rem auto;
        padding: 1.5rem 1rem;
    }

    /* Adjust Carousel Elements */
    .media-carousel .swiper-button-next,
    .media-carousel .swiper-button-prev {
        top: auto;
        bottom: 10px;
        /* Pull navigation buttons lower for reachability */
    }

    .media-carousel .swiper-button-prev {
        left: 20px;
    }

    .media-carousel .swiper-button-next {
        right: 20px;
    }

    /* Pour le conteneur Swiper */
.swiper {
  width: 100%;
  height: auto; /* ou une hauteur fixe si nécessaire */
}

/* Pour les slides */
.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* Empêche le débordement */
  object-fit: contain;
}

/* Pour les images dans les slides */
.swiper-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* ou 'cover' selon tes besoins */
  width: auto;
  height: auto;
}


/* ===== EXTRA SMALL PHONE SCREENS (Screens under 480px) ===== */
@media screen and (max-width: 480px) {
    .gothic-title {
        font-size: 0.8rem;
    }

    .article-meta {
        flex-direction: column;
        /* Stack metadata fields over each other */
        gap: 4px;
    }

    .hamburger-btn {
        display: block;
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 5px;
        z-index: 1001;
    }

    .hamburger-line {
        display: block;
        width: 25px;
        height: 3px;
        background: white;
        margin: 4px 0;
        transition: var(--transition-default);
    }

    /* Animation du bouton en croix */
    .hamburger-btn.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger-btn.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .hamburger-btn.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .sign-btn {
        position: absolute;
        top: 70px;
        left: 20px;
        width: 20px;
        height: 20px;
    }

    .story-edit {
        position: relative;
        /* Obligatoire pour positionner l'infobulle par rapport au lien */
        width: 25px;
        height: 25px;
        background: var(--dark-color);
        display: inline-flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        transition: background 0.3s ease;
        text-decoration: none;
        color: #ccc;
    }

    /* Style de l'icône */
    .story-edit i {
        font-size: 0.6rem;
    }

   
}
