:root {
    --background: #f8f5ef;
    --card: #faf7f0;
    --white: #ffffff;

    --text: #24211e;
    --muted: #706b63;

    --green: #243a2d;
    --line: #dcd5c9;

    --gold: #d99b28;

    --serif: "Playfair Display", serif;
    --sans: "Plus Jakarta Sans", sans-serif;
}


/* =========================================
                    GENERAL
========================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background: var(--background);

    color: var(--text);

    font-family: var(--sans);
}

button,
a {
    font-family: inherit;
}


/* =========================================
                    HEADER
========================================= */

.main-header {
    width: 92%;
    max-width: 1180px;

    height: 78px;

    margin: 0 auto;

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;
}


/* LOGO */

.logo {
    position: absolute;

    left: 0;
    top: 50%;

    transform: translateY(-50%);

    color: var(--text);

    text-decoration: none;

    font-family: var(--serif);

    font-size: 26px;
    font-weight: 600;

    letter-spacing: 3px;
}


/* NAV */

.nav-links {
    display: flex;
    align-items: center;

    gap: 52px;
}

.nav-links a {
    position: relative;

    padding: 8px 0;

    color: var(--text);

    text-decoration: none;

    font-family: var(--serif);

    font-size: 16px;
    font-weight: 500;
}

.nav-links a.active::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 1px;

    background: var(--text);
}


/* HEADER ICONS */

.header-actions {
    position: absolute;

    right: 0;
    top: 50%;

    transform: translateY(-50%);

    display: flex;
    align-items: center;

    gap: 13px;
}

.header-icon {
    width: 28px;
    height: 28px;

    padding: 3px;

    border: none;

    background: transparent;

    color: var(--text);

    text-decoration: none;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
}

.header-icon svg {
    width: 20px;
    height: 20px;

    stroke-width: 1.6;
}


/* =========================================
                 COMMUNITY PAGE
========================================= */

.community-page {
    width: 92%;
    max-width: 1080px;

    margin: 15px auto 70px;
}


/* =========================================
                  PAGE HEADING
========================================= */

.community-heading {
    min-height: 230px;

    padding: 35px 10px 40px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 40px;

    border-bottom: 1px solid var(--line);
}

.eyebrow {
    margin: 0 0 12px;

    color: var(--green);

    font-size: 9px;
    font-weight: 600;

    letter-spacing: 2px;
}

.community-heading h1 {
    margin: 0;

    font-family: var(--serif);

    font-size: clamp(42px, 5vw, 62px);
    font-weight: 500;

    line-height: 0.98;

    letter-spacing: -1.5px;
}

.heading-description {
    max-width: 520px;

    margin: 18px 0 0;

    color: var(--muted);

    font-size: 12px;

    line-height: 1.7;
}


/* SHARE EXPERIENCE */

.share-experience-btn {
    min-width: 205px;
    height: 46px;

    padding: 0 20px;

    flex-shrink: 0;

    border-radius: 30px;

    background: var(--green);

    color: white;

    text-decoration: none;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    font-size: 11px;
    font-weight: 500;

    transition: 0.2s ease;
}

.share-experience-btn svg {
    width: 16px;
    height: 16px;
}

.share-experience-btn:hover {
    transform: translateY(-2px);
}


/* =========================================
                    FILTERS
========================================= */

.filters {
    padding: 22px 0 26px;

    display: flex;
    align-items: center;

    gap: 8px;

    overflow-x: auto;
}

.filter-btn {
    min-width: 70px;

    padding: 9px 17px;

    border: 1px solid #d4cdc1;

    border-radius: 30px;

    background: transparent;

    color: var(--text);

    font-size: 10px;

    white-space: nowrap;

    cursor: pointer;

    transition: 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--green);
}

.filter-btn.active {
    background: var(--green);

    border-color: var(--green);

    color: #ffffff;
}


/* =========================================
                EXPERIENCES GRID
========================================= */

.experiences-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 22px;
}


/* =========================================
                 EXPERIENCE CARD
========================================= */

.experience-card {
    min-width: 0;

    overflow: hidden;

    background: var(--card);

    border: 1px solid #e0d9cd;

    border-radius: 12px;
}


/* USER */

.card-user {
    height: 68px;

    padding: 10px 14px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;

    gap: 10px;

    color: var(--text);

    text-decoration: none;
}

.user-avatar {
    width: 39px;
    height: 39px;

    border-radius: 50%;

    object-fit: cover;
}

.user-info h3 {
    margin: 0 0 3px;

    font-family: var(--serif);

    font-size: 13px;
    font-weight: 600;
}

.user-info p {
    margin: 0;

    color: var(--muted);

    font-size: 8px;
}

.more-button {
    padding: 5px;

    border: none;

    background: transparent;

    color: var(--text);

    font-size: 15px;

    cursor: pointer;
}


/* =========================================
                    MAIN IMAGE
========================================= */

.experience-photo {
    width: 100%;
    height: 290px;

    display: block;

    object-fit: cover;
}


/* =========================================
                   CARD CONTENT
========================================= */

.card-content {
    padding: 15px 16px 13px;
}


/* PLACE */

.place-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;
}

.category {
    display: block;

    margin-bottom: 3px;

    color: var(--muted);

    font-size: 8px;

    text-transform: uppercase;

    letter-spacing: 1px;
}

.place-row h2 {
    margin: 0;

    font-family: var(--serif);

    font-size: 22px;
    font-weight: 600;
}

.rating {
    flex-shrink: 0;

    color: var(--gold);

    font-size: 11px;
}


/* EXPERIENCE TEXT */

.experience-text {
    min-height: 47px;

    margin: 10px 0 14px;

    color: #59554f;

    font-size: 10px;

    line-height: 1.55;
}


/* =========================================
                    CARD FOOTER
========================================= */

.card-footer {
    padding-top: 10px;

    border-top: 1px solid #e9e3d9;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-actions {
    display: flex;
    align-items: center;

    gap: 15px;
}

.action-btn {
    padding: 0;

    border: none;

    background: transparent;

    color: var(--text);

    display: flex;
    align-items: center;

    gap: 4px;

    font-size: 9px;

    cursor: pointer;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.action-btn:hover {
    transform: scale(1.05);
}

.action-btn svg {
    width: 15px;
    height: 15px;

    stroke-width: 1.5;
}


/* =========================================
             LIKE / SAVE JS STATES
========================================= */

/* دعم الكود القديم */

.like-btn.active {
    color: #c85860;
}

.like-btn.active svg {
    fill: #c85860;
    stroke: #c85860;
}


/* الحالة المستخدمة في community.js الجديد */

.like-btn.liked {
    color: #c85860;
}

.like-btn.liked svg {
    fill: currentColor;
    stroke: currentColor;
}


/* SAVE - old state */

.save-btn.active {
    color: var(--green);
}

.save-btn.active svg {
    fill: var(--green);
    stroke: var(--green);
}


/* SAVE - community.js new state */

.save-btn.saved {
    color: var(--green);
}

.save-btn.saved svg {
    fill: currentColor;
    stroke: currentColor;
}


/* =========================================
                     TABLET
========================================= */

@media (max-width: 850px) {

    .main-header {
        width: 95%;
    }

    .nav-links {
        gap: 27px;
    }

    .community-page {
        width: 94%;
    }

    .community-heading h1 {
        font-size: 45px;
    }

    .experience-photo {
        height: 240px;
    }
}


/* =========================================
                     MOBILE
========================================= */

@media (max-width: 650px) {

    /* HEADER */

    .main-header {
        width: 100%;
        height: 62px;

        padding: 0 15px;
    }

    .logo {
        left: 15px;

        font-size: 19px;

        letter-spacing: 2px;
    }

    .nav-links {
        gap: 13px;
    }

    .nav-links a {
        font-size: 10px;
    }

    .header-actions {
        right: 15px;

        gap: 6px;
    }

    .header-icon {
        width: 22px;
        height: 22px;
    }

    .header-icon svg {
        width: 16px;
        height: 16px;
    }


    /* PAGE */

    .community-page {
        width: calc(100% - 28px);

        margin-top: 5px;
    }


    /* HEADING */

    .community-heading {
        min-height: auto;

        padding: 35px 0 28px;

        flex-direction: column;
        align-items: flex-start;

        gap: 25px;
    }

    .community-heading h1 {
        font-size: 40px;
    }

    .heading-description {
        font-size: 10px;
    }

    .share-experience-btn {
        min-width: 190px;

        height: 42px;
    }


    /* FILTER */

    .filters {
        padding: 18px 0 20px;
    }


    /* CARDS */

    .experiences-grid {
        grid-template-columns: 1fr;

        gap: 17px;
    }

    .experience-photo {
        height: 260px;
    }
}


/* =========================================
                  SMALL MOBILE
========================================= */

@media (max-width: 450px) {

    .nav-links {
        display: none;
    }

    .community-heading h1 {
        font-size: 36px;
    }

    .experience-photo {
        height: 225px;
    }
}
