/* =========================================
   GO CYBERNETICS - GALLERY (TILE/LIST FLIP)
   ========================================= */

.gc-gallery-page {
    min-height: 80vh;

    padding: 50px 40px;

    margin-top: -60px;

    /* background-color: #f6f6f6; */  /* grey white */
    /*background-color: #f5ead2; */   /* grey pink */
    /* background-color: #fbf0d7 */   /* PINK YELLOWISH */
     /* background-color: #F8F7F8 */
     background-color: #e2e2e2
}


.gc-gallery-heading {
    text-align: center;

    margin-bottom: -30px;
}


.gc-gallery-heading h2 {
    font-family: 'Open Sans', Arial, sans-serif;

    font-weight: 700;

    color: #223D78;

    margin-top: 30px;
}


.articles {
    display: grid;

    grid-gap: 2.5rem;

    place-items: center;

    max-width: 1100px;

    margin: 0 auto;

    --duration: 0.5s;
    --easing: cubic-bezier(0.6, 0, 0.4, 1);
}


.articles * {
    box-sizing: border-box;

    position: relative;

    transition-duration: var(--duration);
    transition-timing-function: var(--easing);
}


.articles > header {
    grid-column: 1 / -1;

    display: flex;

    justify-content: flex-end;
    margin-top: -15px;              /* Updated */
    margin-bottom: -10px;           /* Updated */
    width: 100%;

    max-width: 1100px;
}


.articles article {
    display: grid;

    font-family: 'Open Sans', Arial, sans-serif;

    width: 100%;

    background: #3B3B6D;

    border-radius: 12px;

    overflow: hidden;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}


.articles article:hover {
    transform: translateY(-4px);

    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}


.articles article .image {
    overflow: hidden;

    transition-property: transform, border-radius;

    transform-origin: top left;

    margin-top: 40px;
}


.articles article .image[data-flipping] {
    border-radius: calc((var(--dw)) * 12px) / calc((var(--dh)) * 12px);
}


.articles article .image img {
    display: block;

    width: 100%;

    height: 100%;

    object-fit: cover;

    transition: inherit;

    transform-origin: top left;
}


.articles article .image[data-flipping] {
    transition: none;

    transform: translate(calc(-1px * var(--dx)), calc(-1px * var(--dy)))
        scale(calc(1 / var(--dw)), calc(1 / var(--dh)));
}


.articles article .image[data-flipping] img {
    transform: scale(calc(var(--dw)), calc(var(--dh)));
}


.articles article .content {
    padding: 1.5rem;

    z-index: 2;

    display: grid;

    align-content: center;

    justify-content: start;

    grid-gap: 0.6rem 0;

    background-color: #ffffff;
}


.articles article h1 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: #000;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
}


.articles article .tags {
    color: #636363;
    font-size: 1.25rem;
    align-items: center;
    display: flex;
    font-weight: 600;
}


.articles article time {
    color: #aaa;

    font-size: 0.8rem;
}


.articles article .tags i,
.articles article time i {
    margin-right: 6px;
}


/* =========================================
   TOGGLE BUTTON
   ========================================= */

.toggle {
    /* background: #e6a545; */   /*ORG*/
    /* background: #223D78; */   /*ORG*/

    background: #bac3cf;

    color: #fff;

    opacity: 0.9;

    border: none;
    border-radius: 50%;

    padding: 0;

    width: 44px;
    height: 44px;

    font-size: 1.1rem;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: opacity 0.3s, background-color 0.3s;
}


.toggle:hover {
    opacity: 1;

    /* background: #e6a545; */   /*ORG*/
    /* background: #223D78; */   /*ORG*/
    /* background: #a47a0f; */
    background: #e6a545;
}


.toggle svg {
    width: 1em;
    height: 1em;

    fill: currentColor;

    display: none;
}


[data-view="list"] .toggle [data-view="list"],
[data-view="card"] .toggle [data-view="card"] {
    display: block;
}


/* =========================================
   FLIP TARGETS (shared)
   ========================================= */

[data-flip] {
    transition-property: transform;
}


[data-flip][data-flipping] {
    transition: none;

    transform: translate(calc(-1px * var(--dx)), calc(-1px * var(--dy)));
}


/* =========================================
   CARD VIEW (grid)
   ========================================= */

.articles[data-view="card"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}


.articles[data-view="card"] article {
    grid-template-rows: auto auto;
}


.articles[data-view="card"] article .image {
    /* aspect-ratio: 3 / 4; */
    aspect-ratio: 3 / 3;
    /* for height of each card (article) decrease the second number : 4 -> 3 -> 2 -> 1 */
}


/* =========================================
   LIST VIEW
   ========================================= */

.articles[data-view="list"] {
    grid-template-columns: 1fr;
}


.articles[data-view="list"] article {
    grid-template-columns: 160px 1fr;
}


.articles[data-view="list"] article .image {
    height: 110px;

    align-self: center;

    margin: 12px;

    border-radius: 8px;

    overflow: hidden;

    display: flex;

    align-items: center;
    justify-content: center;
}


.articles[data-view="list"] article .image img {
    display: block;

    width: auto;
    height: 100%;

    aspect-ratio: 3 / 4;

    object-fit: cover;

    margin: 0;
}


.articles article > a.gc-gallery-link {
    display: contents;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 900px) {
    .articles[data-view="card"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 600px) {
    .articles[data-view="card"] {
        grid-template-columns: 1fr;
    }

    .articles[data-view="list"] article {
        grid-template-columns: 110px 1fr;
    }

    .gc-gallery-page {
        padding: 40px 16px;
    }
}


