/* ============================================
   RESPONSIVE DESIGN - TABLET & DESKTOP (1024px)
   ============================================ */

@media (max-width: 1024px) {
    .main {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        padding: 5%;
    }

    .welcome {
        width: 100%;
        font-size: 1.3rem;
        padding: 3%;
    }

    .d1, .d2 {
        width: 100%;
        padding: 3%;
    }

    .d2 {
        width: 100%;
        max-width: 400px;
        padding: 2%;
    }

    .d2 img {
        max-width: 100%;
        width: 100%;
    }

    .d3, .d4 {
        width: 95%;
    }

    .lightbox-image {
        max-width: 65%;
        max-height: 60vh;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 30px;
        width: 50px;
        height: 50px;
        padding: 10px 15px;
    }

    .lightbox-title {
        font-size: 1.4rem;
        gap: 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
        gap: 1.2rem;
    }
}

/* ============================================
   RESPONSIVE DESIGN - TABLET (768px)
   ============================================ */

@media (max-width: 768px) {
    .main {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding: 3%;
    }

    .welcome {
        width: 100%;
        font-size: 1.2rem;
        padding: 2%;
    }

    .d1, .d2 {
        width: 100%;
        padding: 2%;
        border-radius: 8px;
    }

    .d2 {
        width: 100%;
        max-width: 100%;
        padding: 2%;
    }

    .d2 img {
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    .d3, .d4 {
        width: 97%;
        padding: 2%;
    }

    .d3 .img_left,
    .d3 .img_right {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 12px 0;
    }

    table {
        width: 95%;
        margin: 1rem auto;
        font-size: 0.9rem;
    }

    th, td {
        padding: 8px 10px;
    }

    .lightbox {
        padding: 1rem;
    }

    .lightbox-image {
        max-width: 90%;
        max-height: 55vh;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 24px;
        width: 40px;
        height: 40px;
        padding: 8px 12px;
    }

    .lightbox-prev {
        position: absolute;
        left: 5%;
    }

    .lightbox-next {
        position: absolute;
        right: 5%;
    }

    .lightbox-title {
        font-size: 1.1rem;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
        font-size: 28px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE (480px)
   ============================================ */

@media (max-width: 480px) {
    /* Navigation fixes for mobile */
    nav {
        padding: 1% 2%;
    }

    .menu-container {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .dmolda_button {
        font-size: 1.45rem;
        padding: 8px 10px;
        width: auto;
        flex: 1;
        flex-wrap: 0;
        margin-bottom: 0;
        letter-spacing: 0.5px;
        min-width: 120px;
        white-space: nowrap;
    }

    .dropdown-content {
        position: absolute !important;
        display: none;
        top: 100%;
        right: 0;
        width: 200px;
        box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.5);
        background-color: rgba(0,0,0,0.9);
        border-top: 1px solid var(--accent-cyan);
        border-radius: 0;
        min-width: auto;
    }

    .dropdown-content.active {
        display: block;
    }

    .dropdown-content a {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .nested-dropdown-content {
        position: static !important;
        display: none;
        background-color: rgba(0,0,0,0.7);
        border-right: none;
        border-left: 2px solid var(--accent-cyan);
        margin-left: 15px;
        margin-top: 0px;
        box-shadow: none;
        width: calc(100% - 15px);
    }

    .nested-dropdown-content.active {
        display: block;
    }

    .nested-dropdown-content a {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .nested-dropdown > a::after {
        content: " ▼";
        float: right;
    }

    .nested-dropdown > a.active::after {
        content: " ▲";
    }

    /* Main layout */
    .main {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 0;
        width: 100%;
        margin-top: 80px;
    }

    .welcome {
        width: 100%;
        font-size: 1rem;
        padding: 1.5rem;
    }

    .d1, .d2 {
        width: 90%;
        padding: 1.5%;
        border-radius: 8px;
        margin: 0;
    }

    .d2 {
        width: 90%;
        max-width: 100%;
        padding: 1.5rem;
    }

    .d2 img {
        width: 90%;
        max-width: 100%;
        height: auto;
    }

    .d3, .d4 {
        width: 90%;
        padding: 1.5rem;
        font-size: 1rem;
        margin: 0;
        box-shadow: none;
    }

    .d3 h1, .d3 h2 {
        font-size: 1.7rem;
    }

    .d3 .img_left,
    .d3 .img_right {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 12px 0;
    }

    table {
        width: 95%;
        margin: 1rem auto;
        font-size: 0.9rem;
    }

    th, td {
        padding: 8px 10px;
    }

    .lightbox {
        padding: 0.5rem;
    }

    .lightbox-image {
        max-width: 100%;
        max-height: 50vh;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 20px;
        width: 36px;
        height: 36px;
        padding: 6px 10px;
    }

    .lightbox-title {
        font-size: 0.9rem;
        gap: 0.8rem;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 24px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        width: 100%;
        padding: 0;
    }

    #photography .image-wrapper {
        width: 100%;
        max-width: 100%;
    }

    #photography .image-wrapper img {
        width: 100%;
    }
}