@font-face {
    font-family: 'YehudaCLM';
    src: url('../assets/fonts/yehudaclm-bold-webfont.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'VarelaRound';
    src: url('../assets/fonts/VarelaRound-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    direction: rtl;
    font-family: 'VarelaRound', Arial, sans-serif;
    background-color: #eeeeee;
    color: #222;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'YehudaCLM', Arial, sans-serif;
    font-weight: bold;
}

img {
    max-width: 100%;
    display: block;
}

/* ─── Doodle background ─── */

.doodles-bg {
    display: none;
}

/* ─── App frame ─── */

.app-frame {
    position: relative;
    width: 100%;
    min-height: 100vh;
    margin: 0 auto;
    overflow: clip;
    background-color: #ffffee;
}

.app-frame::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('../assets/ui/bg.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center top;
    opacity: 0.25;
    pointer-events: none;
    z-index: 0;
}

.app-bg {
    position: absolute;
    inset: 0;
}
 
/* ─── Header ─── */

.top-menu,
.site-section {
    position: relative;
    z-index: 1;
}

.top-menu {
    position: relative;
    z-index: 1;
    padding: 10px 12px 8px;
    background-color: rgba(255, 255, 255, 0.98);
    border-bottom: 2px solid #f3e5a5;
}

.top-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.logo-box {
    flex-shrink: 0;
}

.logo-image {
    height: 44px;
    width: auto;
}

.ai-tip-box {
    width: 100%;
    background: #fffce8;
    border: 1px solid #f3e189;
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.ai-tip-label {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #a07000;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.ai-tip-text {
    margin: 0;
    font-size: 20px;
    color: #444;
    line-height: 1.5;
}

/* ─── Navigation ─── */

.main-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.main-nav a {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    border: 1px solid #d8e4ff;
    border-radius: 12px;
    padding: 5px 6px;
    background-color: #fff;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background-color 0.15s, border-color 0.15s;
}

.main-nav a img {
    width: 20px;
    height: 20px;
    margin-left: 10px;
    object-fit: contain;
}

.main-nav a.active {
    background-color: #eef3ff;
    border-color: #9ab3ff;
    color: #1a3a8f;
    font-weight: bold;
}

/* ─── Sections ─── */

.site-section {
    margin: 25px;
    padding: 25px;
    border-radius: 18px;
    background-color: rgba(255, 255, 255, 0.93);
}

/* ── Home ── */

.home-section {
    border: 2px solid #ff9bb8;
    text-align: center;
}

.home-section .row {
    justify-content: center;
}

.home-section .d-flex {
    justify-content: center;
}


.home-title {
    font-size: clamp(24px, 4vw, 36px);
    margin-bottom: 12px;
}

.home-desc {
    font-size: 16px;
    line-height: 1.7;
    color: #444;
    margin-bottom: 20px;
}

/* ─── Buttons ─── */

.plain-button,
.pink-button {
    font-family: inherit;
    border-radius: 14px;
    padding: 10px 28px;
    cursor: pointer;
    font-weight: bold;
    font-size: 20px;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.plain-button {
    border: 1px solid #eadb8c !important;
    background-color: #fffdf7 !important;
    color: #222 !important;
}

.plain-button:hover {
    background-color: #fff5bf !important;
    transform: translateY(-2px);
}

.pink-button {
    border: 0 !important;
    color: white !important;
    background-color: #f278a6 !important;
    box-shadow: 0 4px 0 #d86693 !important;
}

.pink-button:hover {
    background-color: #e0609a !important;
    transform: translateY(-2px);
}

.plain-button:focus-visible,
.pink-button:focus-visible {
    outline: 3px solid #f278a6;
    outline-offset: 3px;
}

/* ─── Games map ─── */

.games-section { border: 2px solid #ffb357; }

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.section-icon {
    width: auto;
    height: 60px;
    object-fit: contain;
}

.map-wrapper {
    position: relative;
    border: 2px solid #ffb357;
    border-radius: 16px;
    overflow: hidden;
    background-color: #dff1c2;
}

.map-image {
    width: 100%;
    height: auto;
    display: block;
}

.map-point {
    position: absolute;
    width: 80px;
    text-decoration: none;
    color: #062f5f;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    z-index: 2;
    transition: transform 0.18s ease;
}

.map-point:hover {
    transform: scale(1.08);
}

.map-point img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    border: none;
    background: transparent;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.22));
    display: block;
}

.map-point span {
    display: inline-block;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 30px;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 800;
    color: #062f5f;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

@media (min-width: 576px) {
    .map-point {
        width: 92px;
    }
    .map-point span {
        padding: 3px 10px;
        font-size: 12px;
    }
}

@media (min-width: 768px) {
    .map-point {
        width: 180px;
    }
    .map-point span {
        padding: 4px 12px;
        font-size: 15px;
    }
}

@media (min-width: 1100px) {
    .map-point {
        width: 320px;
    }
    .map-point span {
        padding: 5px 16px;
        font-size: 20px;
    }
}

/* Percentage-based positions so labels follow the illustrated map content */
/* Desktop positions */
.school-point     { left: 3%;   bottom: 19%; }
.grocery-point    { left: 52%;  bottom: 62%; }
.home-point       { right: 2%;  bottom: 18%; }
.playground-point { left: 40%;  bottom: 15%; }

/* Mobile positions — adjust these to match park-mobile.png */
@media (max-width: 575px) {
    .map-point {
        width: 120px;
    }
    .map-point span {
        padding: 3px 10px;
        font-size: 11px;
    }
    .school-point     { left: 3%;   bottom: 65%; }
    .grocery-point    { left: 55%;  bottom: 7%; }
    .home-point       { right: 55%;  bottom: 18%; }
    .playground-point { left: 55%;  bottom: 40%; }
}


/* ─── Library Carousel ─── */

.library-section { border: 2px solid #ace4a1; }

.lib-carousel-outer {
    direction: ltr;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.lib-carousel-track {
    flex: 1;
    overflow: hidden;
}

.lib-carousel-inner {
    display: flex;
    gap: 20px;
    will-change: transform;
}

.lib-carousel-card {
    flex-shrink: 0;
    width: 70%;
    direction: rtl;
    background: #fff;
    border: 5px solid #9fd47c;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    color: #193914;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 576px) {
    .lib-carousel-card { width: 38%; }
}

@media (min-width: 992px) {
    .lib-carousel-card { width: 27%; }
}

.lib-carousel-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.lib-card-body {
    padding: 24px 28px;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    
}

.lib-card-body h3 {
    font-size: 22px;
    margin: 0;
    line-height: 1.5;
}

.lib-carousel-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #9fd47c;
    background: #fff;
    color: #3a7c2e;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
}

.lib-carousel-btn:hover { background: #edf7e9; }

/* ─── Popup ─── */

.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 16px;
    backdrop-filter: blur(2px);
}

.popup-overlay.active {
    display: flex;
}

.popup-box {
    background: white;
    border-radius: 22px;
    padding: 28px 28px 28px;
    max-width: 680px;
    width: 100%;
    max-height: 82vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    animation: popupFadeIn 0.25s ease;
}

@keyframes popupFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

/* X button on the left in RTL */
.popup-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: background 0.15s;
    flex-shrink: 0;
}

.popup-close:hover { background: #e0e0e0; color: #222; }

.popup-title {
    font-size: 22px;
    margin: 0 0 20px;
    padding-left: 44px; /* clear space from close button */
}

.popup-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.popup-content img {
    max-width: 100%;
    border-radius: 10px;
}

/* ─── Sub-pages (game & infographic pages) ─── */

.page-card {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    background: white;
    border: none;
    border-radius: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Remove Bootstrap body padding on game/info pages */
body:has(.page-card) {
    padding: 0 !important;
    margin: 0;
}

.back-link {
    display: inline-block;
    margin-bottom: 16px;
    text-decoration: none;
    color: #35466b;
    font-weight: bold;
}

.coming-soon-text {
    text-align: center;
    font-size: 1.6rem;
    color: #35466b;
    margin-top: 80px;
    font-family: 'YehudaCLM', Arial, sans-serif;
}

.place-image-large,
.video-box video {
    width: 50%;
    margin: 0 auto;
    border-radius: 18px;
    border: 2px solid #e4e4e4;
}

.info-list {
    margin: 14px 0 0;
    padding-right: 18px;
    line-height: 1.8;
}

.info-badge {
    display: inline-block;
    background: #fff0a9;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* ─── Footer ─── */

.site-footer {
    position: relative;
    z-index: 1;
    background-color: #ffffee;
    border-top: 2px solid #f3e5a5;
    text-align: center;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.footer-logo {
    height: 36px;
    width: auto;
    flex-shrink: 0;
}

.site-footer p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* ─── Responsive ─── */

@media (min-width: 576px) {
    .ai-tip-label {
        font-size: 26px;
    }
    

    .main-nav a {
        font-size: 11px;
        padding: 6px 8px;
    }

    .main-nav a img {
        width: 24px;
        height: 24px;
    }

}

@media (min-width: 992px) {
    .app-frame {
        max-width: 100%;
        margin-top: 0;
        margin-bottom: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .logo-image {
        height: 100px;
        margin-bottom: 10px;}

    .ai-tip-text {
        -webkit-line-clamp: unset;
        font-size: 18px;
    }

    .main-nav a {
        font-size: 24px;
        padding: 8px 12px;
    }

    .main-nav a img {
        width: 28px;
        height: 28px;
    }

}
