/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    font-size: 1.1rem;
    color: #222;
    background-color: #fdfdfd;
}

/* HEADER */
header {
    background-color: #004080;
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo img {
    height: 48px;
    width: 48px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

header .logo img:hover {
    transform: scale(1.05);
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 1.2rem;
}

header nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
}

header nav a:hover,
header nav a.active {
    border-bottom: 2px solid #ffd700;
}

/* HERO */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: #f0f6ff;
    color: #002855;
}

.hero h2 {
    font-size: 2.3rem;
    margin-bottom: 1rem;
}

.hero p {
    max-width: 700px;
    margin: 0 auto;
    color: #333;
    font-size: 1.15rem;
}

/* SEARCH + FILTERS */
.search-section {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
    text-align: center;
}

.search-section h3 {
    color: #004080;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

#searchBar {
    width: 100%;
    padding: 0.8rem;
    border-radius: 10px;
    border: 1px solid #bbb;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filters select {
    flex: 1;
    padding: 0.7rem;
    border-radius: 10px;
    border: 1px solid #bbb;
    font-size: 1rem;
    min-width: 180px;
}

/* CARD GRID */
.card-grid {
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.6rem;
}

/* CARD STYLES BELOW*/

/* LOAD MORE BUTTON */
.load-more-container {
    text-align: center;
    margin: 2rem 0 3rem 0;
}

.load-more-btn {
    padding: 0.9rem 2rem;
    background: #004080;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.25s ease;
}

.load-more-btn:hover {
    background: #003060;
}

/* FOOTER */
footer {
    background-color: #002855;
    color: #fff;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    font-size: 0.95rem;
}

footer a {
    color: #ffd700;
    text-decoration: none;
    margin: 0 0.3rem;
}

footer a:hover {
    text-decoration: underline;
}

/* RESPONSIVE */
@media (max-width: 768px) {

    body {
        font-size: 1rem;
    }

    header {
        flex-direction: column;
        gap: 0.8rem;
    }

    header nav ul {
        flex-direction: column;
        align-items: center;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .card-grid {
        padding: 1.5rem;
        grid-template-columns: 1fr;
    }

    .org-card {
        padding: 1.3rem;
    }

    .filters select {
        min-width: 100%;
    }
}






                    /* CARD STYLES */

    /* ORIGINAL ONE CARD STYLE */
.org-card {
    background: #fff;
    padding: 1.6rem;
    border-radius: 14px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 5px solid #004080;
}

.org-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

.org-logo {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.org-card h3 {
    color: #004080;
    font-size: 1.35rem;
    margin-bottom: 0.6rem;
}

.org-card p {
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.org-card strong {
    color: #002855;
}

        /* FLIP CARD BASE */
.flip-card {
    perspective: 1000px;
    cursor: pointer;
    border-left: none; /* we'll apply border-left on the faces, not the wrapper */
    height: 550px; /* Increased height to fit description */
    position: relative;
}

/* Inner wrapper */
.flip-inner {
    width: 100%;
    height: 100%; /* Fill parent */
    position: relative;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

/* Flip on hover (or click if you prefer JS version) */
.flip-card.flipped .flip-inner {
    transform: rotateY(180deg);
}

/* FRONT & BACK FACES — identical styling to .org-card */
.flip-front,
.flip-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1.6rem;
    border-radius: 14px;
    background: #f0f6ff84;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border-left: 5px solid #004080;   /* same accent */
    
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden; /* iOS fix */
    overflow-y: auto; /* Allow scrolling if content is too long */
}

/* FRONT SIDE */
.flip-front {
    transform: rotateY(0deg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* BACK SIDE */
.flip-back {
    transform: rotateY(180deg);
    text-align: left;
}

/* Apply your original text styles */
.flip-front h3,
.flip-back h3 {
    color: #004080;
    font-size: 1.35rem;
    margin-bottom: 0.6rem;
}

.flip-front p,
.flip-back p {
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.flip-front strong,
.flip-back strong {
    color: #002855;
}

/* Style the click note */
.click-note {
    position: relative;
    margin-top: auto;
    margin-bottom: 0;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    color: #666;
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
    background: transparent;
}

/* Description paragraph */
.org-description {
    margin-bottom: 0.2rem;
    margin-top: -.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    z-index: 1;
    max-height: 4.5em; /* About 3 lines of text */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    white-space: normal;
}

/* Logo identical to original */
.flip-front .org-logo,
.flip-back .org-logo {
    width: 70px;
    height: 70px;
    min-height: 70px;
    max-height: 70px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 1rem;
    display: block;
}

/* FLOATING HOVER ANIMATION (same as original card hover) */
.flip-card:hover {
    transform: translateY(-6px);
}

/* Remove unwanted outer white box */
.flip-card {
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}







/* =============== CLEANER CARD DESIGN =============== */

/* Base card wrapper */
.flip-card {
    perspective: 1200px;
    cursor: pointer;
    border-left: none;
    height: 500px; /* cleaner balanced height */
    position: relative;
    transition: transform 0.25s ease;
}

/* Hover animation */
.flip-card:hover {
    transform: translateY(-5px);
}

/* Flip inner container */
.flip-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.65s ease;
    transform-style: preserve-3d;
}

/* Trigger flip */
.flip-card.flipped .flip-inner {
    transform: rotateY(180deg);
}

/* Both card faces */
.flip-front,
.flip-back {
    position: absolute;
    inset: 0;
    padding: 1.6rem 1.5rem 2rem 1.5rem;
    border-radius: 14px;
    background: #ffffff;
    border-left: 6px solid #004080;
    box-shadow: 0 3px 10px rgba(0,0,0,0.10);

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* FRONT FACE */
.flip-front {
    transform: rotateY(0deg);
}

/* BACK FACE */
.flip-back {
    transform: rotateY(180deg);
}

/* Title */
.flip-front h3,
.flip-back h3 {
    color: #004080;
    font-size: 1.32rem;
    margin-bottom: 0.7rem;
    font-weight: 600;
}

/* Regular text */
.flip-front p,
.flip-back p {
    margin-bottom: 0.45rem;
    font-size: 0.98rem;
    color: #222;
}

/* Labels */
.flip-front strong,
.flip-back strong {
    color: #002855;
}

/* Logo */
.org-logo {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 1rem;
    align-self: center;
}

/* Description (3-line clamp) */
.org-description {
    font-size: 0.92rem;
    line-height: 1.45;
    color: #333;
    margin-bottom: 0.8rem;

    max-height: 4.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Click note */
.click-note {
    margin-top: auto;
    text-align: center;
    padding-top: 0.7rem;
    border-top: 1px solid #e0e0e0;
    font-style: italic;
    font-size: 0.85rem;
    color: #666;
    opacity: 0.9;
}

/* Scrollbar cleaner */
.flip-front::-webkit-scrollbar,
.flip-back::-webkit-scrollbar {
    width: 6px;
}

.flip-front::-webkit-scrollbar-thumb,
.flip-back::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.18);
    border-radius: 10px;
}

/* Remove outer white box */
.flip-card {
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* === Responsive Improvements === */
@media (max-width: 768px) {
    .flip-card {
        height: 460px;
    }
}

/* One-line location */
.location-line {
    font-size: 1rem;
    color: #222;
    margin-bottom: 0.5rem;
}

/* Status tag */
.status-tag {
    display: inline-block;
    background: #e6f0ff;
    color: #004080;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin: 0.5rem 0 0 0;
    font-weight: 600;
    position: absolute;
    bottom: 5rem;
}

/* Description on back */
.back-description {
    font-size: 0.95rem;
    line-height: 1.45;
    margin-bottom: 1rem;
    color: #333;
}

/* =============== END CLEANER CARD DESIGN =============== */