/* drawings.css for WordPress Drawing Template - New Version */

/* DEBUG: Uncomment for layout debugging */
/* * {
    border: 1px solid red;
} */

h2 {
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 1.5s ease-out;
}

h2.show {
    opacity: 1;
}

/* =========================================================================
   Lightbox Styles
   ========================================================================== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at center, 
            rgba(0, 0, 0, 0) 50%,  
            rgba(0, 0, 0, 0.02) 70%,  
            rgba(0, 0, 0, 0.1) 100%  
        ),  
        url("../images/paper_gray_mid_light.jpg") repeat, 
        #aaa; 
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    position: relative;
    max-width: calc(90% - 3rem);
    width: calc(100% - 3rem);
    margin: 0 4rem;
    padding: 2rem;
    box-sizing: border-box;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
}

#lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 8rem);
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#lightbox-close {
    position: fixed;
    top: 3rem;
    right: 20px;
    padding: 0;
    cursor: pointer !important;
    background: transparent;
    border: 2px solid rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close-icon {
    width: 1.5rem;
    height: 1.5rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Für das Schließen-Icon */
.close-icon path {
    stroke: rgba(0, 0, 0, 0.7);
    stroke-width: 2;
}

#lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

#lightbox-close:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lightbox-caption {
    text-align: center;
    padding: 10px 0 0 0;
    color: #666;
    max-width: 100%;
}

#lightbox-prev,
#lightbox-next {
    position: fixed;
    top: 50%;
    margin-top: -1.5rem;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    padding: 0;
    cursor: pointer !important;
    text-align: center;
    transition: all 0.3s ease;
    z-index: 1001;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
}

#lightbox-prev {
    left: 20px;
}

#lightbox-next {
    right: 20px;
}

.nav-icon {
    width: 1.5rem;
    height: 1.5rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Für die Navigations-Icons (prev/next) */
.nav-icon path {
    stroke: rgba(0, 0, 0, 0.6);
    stroke-width: 2;
}

#lightbox-prev:hover,
#lightbox-next:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

#lightbox-prev:active,
#lightbox-next:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Gemeinsame Hover-Effekte für alle Lightbox-Buttons */
#lightbox-close:hover,
#lightbox-prev:hover,
#lightbox-next:hover {
    background-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#lightbox-close:active,
#lightbox-prev:active,
#lightbox-next:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.1s ease;
}

/* Einheitliche Basis-Eigenschaften für alle Buttons */
#lightbox-close,
#lightbox-prev,
#lightbox-next {
    background: transparent;
    border: 1.5px solid rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    cursor: pointer !important;
    transition: all 0.1s ease;
}

.lightbox.fade-in {
    display: flex;
    opacity: 0;
    animation: fadeIn 0.3s ease-in-out forwards;
}

.lightbox.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; display: none; }
}

/* Mobile Lightbox Button Adjustments */
@media (max-width: 480px) {
    #lightbox-prev {
        left: 10px;
    }
    #lightbox-next {
        right: 10px;
    }
    #lightbox-close {
        right: 10px;
    }
}

/* =========================================================================
   Right Container & Layout
   ========================================================================== */

@media (max-width: 1024px) {
    .right-container--main {
        min-width: 0;
    }
}

.nav-icon path {
    stroke: rgba(0, 0, 0, 0.6);
    stroke-width: 2;
}

#lightbox-prev:hover,
#lightbox-next:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

#lightbox-prev:active,
#lightbox-next:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Gemeinsame Hover-Effekte für alle Lightbox-Buttons */
#lightbox-close:hover,
#lightbox-prev:hover,
#lightbox-next:hover {
    background-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#lightbox-close:active,
#lightbox-prev:active,
#lightbox-next:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.1s ease;
}

/* Einheitliche Basis-Eigenschaften für alle Buttons */
#lightbox-close,
#lightbox-prev,
#lightbox-next {
    background: transparent;
    border: 1.5px solid rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    cursor: pointer !important;
    transition: all 0.1s ease;
}

.lightbox.fade-in {
    display: flex;
    opacity: 0;
    animation: fadeIn 0.3s ease-in-out forwards;
}

.lightbox.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; display: none; }
}

/* =========================================================================
   Section Title
   ========================================================================== */

.section-title {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1rem;
    margin-bottom: 2rem;
}

.section-title-text {
    font-family: "Crimson Pro", serif;
    font-size: 2rem;
    font-weight: 100;
    color: #111;
    margin: 0;
    padding-left: 1rem;
    text-align: left;
}

/* =========================================================================
   Layout System
   ========================================================================== */

.section-container {
    width: 100%;
    min-height: 90vh;
    display: flex;
    flex-direction: row;
}

.left-container--aside {
    flex: 1;
    padding: 2rem;
    text-align: right;
}

.right-container--main {
    min-width: calc(100vw - ((100vw - 680px) / 2));
    padding: 20px;
    padding-left: 1rem !important;
}

/* =========================================================================
   Drawing Container and Items
   ========================================================================== */

.drawing {
    width: 140px;
    height: 140px;
    border-radius: 5px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.drawing img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.drawing-inner-container {
    border-radius: 5px;
    display: block;
    text-decoration: none;
}

.drawing-inner-container:hover .drawing {
    transform: translate(-4px, -4px);
    box-shadow: 8px 8px 10px 0 rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.drawing--hidden {
    visibility: hidden;
}

.drawing-placeholder-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, 140px);
    gap: 20px;
    position: relative;
    z-index: 1;
    margin: 0px;
    padding: 0px;
    justify-content: start;
}

.drawing-positioner {
    position: absolute;
    background-color: transparent;
    border-radius: 16px;
    z-index: 1;
}

.drawing-placeholder {
    width: 100%;
    max-width: 140px;
    min-width: 140px;
    height: 140px;
    background-color: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    padding: 0;
    box-sizing: border-box;
}

/* =========================================================================
   Sortier- & Kategorisierungsmenüs
   ========================================================================== */
.sorting-menu {
    position: fixed;
    left: 2rem;
    top: max(350px, 50%);
    transform: translateY(-50%);
    line-height: 1.3;
    color: #333;
}

.sorting-menu p {
    margin-bottom: 0.25rem;
}

.sorting-menu-list {
    list-style: none !important;
    padding-left: 1rem;
    margin-bottom: 0.5rem;
}

.sorting-menu-link,
.category-menu-link {
    color: #777;
    text-decoration: none;
    letter-spacing: 0rem;
    font-weight: 300;
}

.sorting-menu-link:hover,
.category-menu-link:hover {
    color: #111;
    text-decoration: none;
    letter-spacing: -0.01rem;
    font-weight: 400;
}

.sorting-menu-link--selected,
.sorting-menu-link--selected:hover {
    color: #555;
    letter-spacing: -0.01rem;
    font-weight: 400;
}

.sorting-menu-container--large {
    display: block;
}

.sorting-menu-container--small {
    display: none;
}

.sorting-menu-dropdown-container {
    width: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.sorting-menu-dropdown {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: rgba(200, 200, 200, 0.2);
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px 40px 10px 15px;
    margin-left: 0.25rem;
    margin-right: 1rem;
    font-size: 16px;
    cursor: auto;
    background-position: right 15px center;
    background-size: 16px;
    width: 100%;
    transition: border-color 0.3s, box-shadow 0.3s;
    color: #333;
    text-align: left;
    font-weight: 550;
}

.sorting-menu-dropdown:focus {
    outline: none;
}

.sorting-title-container p {
    margin: 0;
    color: #777;
    font-weight: 300;
}

/* =========================================================================
   Karten
   ========================================================================== */
.placeholder-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
    margin: 0px;
    padding: 0px;
}

.card-positioner {
    position: absolute;
    background-color: transparent;
    border-radius: 16px;
    z-index: 1;
}

.placeholder {
    width: 100%;
    max-width: 650px;
    min-width: 160px;
    height: 160px;
    background-color: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    visibility: visible;
}

.article-card--selected {
    border: 2px solid rgba(0, 0, 0, 0.4);
}

.article-card--deselected {
    opacity: 0.7;
}

/* =========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .right-container--main {
        min-width: 0;
        padding-left: 1rem !important;
    }

    .sorting-menu-container--large {
        display: none;
    }

    .sorting-menu-container--small {
        margin-top: 2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
        padding: 0 1rem;
    }

    .drawing-placeholder-container {
        grid-template-columns: repeat(auto-fill, 140px);
        max-width: 720px;
        margin: 0 auto;
        justify-content: center;
    }

    /* Section Title zentriert im Mid-Modus */
    .section-title {
        padding: 0 1rem;
        padding-top: 1.5rem;
        padding-bottom: 0;
        text-align: center;
    }
    
    .section-title-text {
        padding-left: 0;
        text-align: center;
    }

    /* Hide aside and center main container */
    .left-container--aside {
        display: none;
    }

    .section-container {
        justify-content: center;
    }

    .right-container--main {
        max-width: 720px;
        margin: 0 auto;
        padding: 20px 1rem;
        padding-left: 1rem !important;
    }

    /* Section Title zentriert im Mid-Modus */
    .section-title {
        padding: 0 1rem;
        padding-top: 1.5rem;
        padding-bottom: 0;
        text-align: center;
    }
    
    .section-title-text {
        padding-left: 0;
        text-align: center;
    }
}

/* Switch to 3 columns when 4 columns don't fit comfortably */
@media (max-width: 680px) {
    .drawing-placeholder-container {
        grid-template-columns: repeat(auto-fill, 140px);
        max-width: 520px;
        margin: 0 auto;
        justify-content: center;
    }
}

@media (max-width: 570px) {
    .sorting-menu-container--small {
        justify-content: center;
        padding: 0px;
        margin-top: 1rem !important;
    }

    .sorting-menu-dropdown-container {
        flex-direction: column;
        align-content: center;
        align-items: center;
    }

    .sorting-menu-dropdown {
        padding: 0.5rem 0.5rem !important;
        text-align: left;
    }

    .sorting-menu-dropdown-container p {
        margin: 0rem 0rem 0.5rem 0rem;
        text-align: center;
    }

    .sorting-title-container {
        padding-left: 1rem;
    }
}

@media (max-width: 520px) {
    .drawing-placeholder-container {
        grid-template-columns: repeat(auto-fill, 140px);
        max-width: 460px;
        margin: 0 auto;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .drawing-placeholder {
        max-width: 100px;
        min-width: 100px;
        height: 100px;
        padding: 0;
        box-sizing: border-box;
    }

    .drawing {
        width: 100px;
        height: 100px;
    }

    .lightbox {
        justify-content: center;
        align-items: center;
    }

    .lightbox-content {
        position: relative;
        display: block;
        width: fit-content;
        max-width: calc(100% - 1rem);
        margin: 0 auto;
        padding: 0;
    }

    #lightbox-image {
        display: block;
        width: auto;
        max-width: calc(100% - 1rem);
        max-height: calc(80vh - 10rem);
        margin: 0 auto;
        vertical-align: top;
        touch-action: pan-x;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }

    #lightbox-prev,
    #lightbox-next {
        position: fixed;
        top: auto;
        bottom: 2rem;
        margin-top: 0;
        touch-action: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }

    #lightbox-prev {
        left: 2rem;
    }

    #lightbox-next {
        right: 2rem;
    }

    #lightbox-close {
        right: 1.5rem;
        top: 1.5rem;
        touch-action: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }

    .lightbox-caption {
        display: block;
        width: calc(100% - 1rem);
        margin: 0 auto;
        padding-top: 1rem;
        text-align: center;
        box-sizing: border-box;
    }

    .drawing-placeholder-container {
        grid-template-columns: repeat(auto-fill, 100px);
        gap: 15px;
        max-width: 360px;
        margin: 0 auto;
        justify-content: center;
    }

    .right-container--main {
        padding: 20px 0.5rem;
    }

    /* Sorting-Menu Anpassungen für ganz kleine Screens */
    .sorting-menu-container--small {
        justify-content: center;
        margin-top: 1rem !important;
    }
    .sorting-menu-dropdown-container {
        flex-direction: column;
        align-items: center;
    }
    .sorting-menu-dropdown {
        padding: 0.5rem !important;
        text-align: center;
    }
    .sorting-menu-dropdown-container p {
        margin: 0 0 0.5rem 0;
        text-align: center;
    }
    .sorting-title-container {
        text-align: center;
        padding-left: 0;
    }
}

/* Switch to 2 columns for very small screens */
@media (max-width: 360px) {
    .drawing-placeholder-container {
        grid-template-columns: repeat(auto-fill, 100px);
        gap: 15px;
        max-width: 230px;
        margin: 0 auto;
        justify-content: center;
    }
        justify-content: center;
    }

    .right-container--main {
        padding: 20px 0.25rem;
    }
}

/* Switch to 1 column for extremely small screens */
@media (max-width: 250px) {
    .drawing-placeholder-container {
        grid-template-columns: repeat(auto-fill, 100px);
        gap: 15px;
        max-width: 120px;
        margin: 0 auto;
        justify-content: center;
    }

    .right-container--main {
        padding: 20px 0.125rem;
    }

    .sorting-menu-container--small {
        padding: 0 0.5rem;
        margin-top: 1rem !important;
        justify-content: center;
    }

    .sorting-menu-dropdown {
        font-size: 14px;
        padding: 8px 10px;
    }
}

    #lightbox-image {
        touch-action: pinch-zoom;
    }
}