/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body Styling */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    padding: 20px;
}

/* Gallery Container */
.gallery {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Category Section */
.category-section {
    margin-bottom: 30px;
}

/* Category Heading */
.category-heading {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #444;
}

/* Category Gallery */
.category-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    justify-items: center;
}

/* Gallery Item */
.gallery-item {
    position: relative;
    width: 100%;
    max-width: 250px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

/* Image Styling */
.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* Hover effect on the item */
.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

/* Caption Styling */
.gallery-caption {
    padding: 10px;
    background-color: #fff;
    color: #444;
}

/* Name Styling */
.name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

/* Subject Styling */
.subject {
    font-size: 14px;
    color: #777;
}

/* DOJ Styling */
.doj {
    font-size: 12px;
    color: #aaa;
}
/* ============================= */
/* 3D Flip Card System (Modular) */
/* ============================= */

.flip-wrapper {
    perspective: 1200px;
    width: 100%;
    max-width: 250px;
}

.flip-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
}

.flip-card.is-flipped {
    transform: rotateY(180deg);
}

.flip-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    overflow: hidden;
}

.flip-front {
    z-index: 2;
}

.flip-back {
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}

.flip-back-content a {
    display: inline-block;
    margin-top: 10px;
    text-decoration: none;
    font-weight: bold;
}
/* ============================= */
/* 3D Flip Fix (Grid Safe) */
/* ============================= */

.flip-card-container {
    perspective: 1000px;
    position: relative;
    height: 300px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
}

.flip-card-container.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    overflow: hidden;
}

.flip-back {
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
}
.flip-card-container {
    perspective: 1000px;
    position: relative;
    height: 100%;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
}

.flip-card-container.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    overflow: hidden;
}

.flip-front {
    background: white;
}

.flip-back {
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
}