/*
Theme Name: Places Atlas
Theme URI: https://playgroundsatlas.com
Author: Peter
Description: A custom theme for location-based place listings with filters and maps.
Version: 1.0
Text Domain: places-atlas
*/

/* -----------------------------
   Page wallpaper (body)
--------------------------------*/
body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background-color: #eeeeee; /* grey wallpaper on sides */
    margin: 0;
    padding: 0;
}

/* -----------------------------
   Page wrapper (centered content + sidebar)
--------------------------------*/
.page-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px; /* main + sidebar */
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
    background-color: #ffffff; /* white wrapper behind content */
}

/* Grid wrapper now only two columns */
.page-wrapper.archive-layout {
    display: grid;
    grid-template-columns: 1fr 300px; /* main | right sidebar */
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    padding: 10px;
    box-sizing: border-box;
}

/* -----------------------------
   Main content
--------------------------------*/
.content-area {
    background-color: #ffffff; /* white for main content */
    padding: 20px;
    min-width: 0;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.content-area img,
.content-area iframe,
.content-area .gallery-inner {
    display: block;
    max-width: 100%;
    height: auto;
}
.content-area {
    background-color: #ffffff;
    padding: 20px;
}

/* Gallery inner layout */
.gallery-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-inner img {
    flex: 1 1 200px;
    max-width: 100%;
    height: auto;
}

/* -----------------------------
   Sidebar
--------------------------------*/
.sidebar {
    background-color: #f4f4f4; /* slightly lighter grey sidebar */
    padding: 20px;
    min-width: 0;
}

/* -----------------------------
   Footer
--------------------------------*/
.site-footer {
    background-color: #e0e0e0;
    padding: 20px 0;
}

.site-footer .footer-inner {
    text-align: center;
    font-family: 'Roboto', sans-serif;
    color: #333;
    font-size: 14px;
}

/* -----------------------------
   Archive / Playgrounds
--------------------------------*/
.archive-places {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.playgrounds-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.playground-item {
    flex: 1 1 320px;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.2s;
}

.playground-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.featured-image img {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.playground-title {
    font-size: 1.2em;
    margin: 10px 0 5px;
}

.playground-address {
    font-size: 0.95em;
    color: #555;
    margin-bottom: 5px;
}

.playground-rating {
    font-size: 0.95em;
    color: #000;
    margin-bottom: 10px;
}

.playground-excerpt {
    font-size: 0.9em;
    color: #333;
}

/* -----------------------------
   Archive controls (search + taxonomy)
--------------------------------*/
.archive-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

/* Location search */
.location-search-form {
    flex: 1 1 200px;
}
.location-search-form input {
    width: 100%;
}

/* Taxonomy buttons */
.taxonomy-filter {
    position: relative;
}
.taxonomy-btn {
    white-space: nowrap;
}

/* Dropdowns */
.taxonomy-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ccc;
    padding: 10px;
    z-index: 999;
    min-width: 200px;
    max-height: 550px; /* allows "features" with many options to expand */
    overflow: auto;
}
.taxonomy-dropdown label {
    display: block;
    margin-bottom: 3px;
}

/* -----------------------------
   No results message
--------------------------------*/
.no-results {
    text-align: center;
    margin-top: 50px;
    padding: 40px;
    border: 2px solid #ff0000;
    background-color: #ffeaea;
    border-radius: 8px;
}
.no-results h2 {
    color: #d00000;
    margin-bottom: 15px;
}
.no-results p {
    color: #333;
}

/* -----------------------------
   Stars (ratings)
--------------------------------*/
.star-rating {
    display: inline-flex;
    gap: 2px; /* space between stars */
    font-size: 24px; /* controls overall star size */
}

.star-rating .star {
    color: gold; /* filled star color */
    display: inline-block;
    position: relative;
}

/* Empty stars */
.star-rating .star.empty {
    color: #ccc; /* grey for empty stars */
}

/* Half stars */
.star-rating .star.half::before {
    content: '★';
    color: gold;
    position: absolute;
    left: 0;
    width: 50%;       /* show half star */
    overflow: hidden;
}
.star-rating .star.half {
    color: #ccc;      /* empty portion of half star */
}

.archive-title {
    margin-top: 10px;   /* reduce space above */
    margin-bottom: 10px; /* reduce space below */
    margin-left: 10px; /* reduce space on left */
    font-size: 2em;      /* optional: adjust size */
}
/* Boxes for visual layout */
.sidebar-box, .content-box {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    color: #fff;
    font-weight: bold;
    min-height: 200px;
}

.archive-controls .location-search-form {
    flex: 0 1 300px;
    max-width: 170px;
}

.archive-controls .taxonomy-filter {
    flex: 0 0 auto;
}

/* =============================
   SINGLE PLACE MAP
============================= */

#map {
    width: 100%;
    height: 400px;          /* REQUIRED or Leaflet will not show */
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
}
/* =============================
   ARCHIVE PAGE WITH FIXED MAP
============================= */

/* Archive page content wrapper */
.archive-page-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px; /* main content | right sidebar */
    gap: 10px;
    width: calc(100% - 820px); /* 780px map + 40px gap for margins */
    margin-left: 820px;        /* offset for fixed map */
    padding: 20px;
    box-sizing: border-box;
    min-height: 80vh;
}

/* Map fills the sidebar */
#places-archive-map {
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* Fixed map */
.fixed-map {
    position: fixed;
    top: 55px;          /* same as grid padding */
    left: 20px;
    width: 780px;
    height: calc(100vh - 40px); /* full height minus top/bottom padding */
    background-color: #cce5ff; /* just for visibility */
}
/* -----------------------------
   Mobile / narrow screens
--------------------------------*/
@media (max-width: 900px) {
    .page-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
    }

    .sidebar {
        width: 100%;
        margin-top: 20px;
    }

    .archive-page-wrapper {
        grid-template-columns: 1fr;
        width: 100%;
        margin-left: 0;
        padding: 10px;
    }

    .fixed-map {
        position: relative;
        width: 100%;
        height: 300px;
        top: 0;
        left: 0;
        margin-bottom: 20px;
    }
}

