/* Base styles for the grid and list layouts */
#post-display-search-results,
.post-list {
    width: 100%;
}

.author-icon, .date-icon, .comments-icon {
    font-weight: bold;
    margin-right: 10px;
    font-size: 14px;
    vertical-align: middle;
}

#post-display-search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-gap: 20px;
    width: 100%;
}

.post-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 1200px;
    margin: 0 auto;
    grid-gap: 20px;
}

/* Styles for individual post cards in grid layout */
#post-display-search-results .post-card {
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
	min-height: 590px;
	position: relative;
}

#post-display-search-results .post-card .post-content .post-excerpt {
	min-height: 165px;
	max-height: 250px;
}

/* Styles for individual post list items in list layout */
.post-list .post-list-item {
    display: flex;
    flex-direction: row-reverse;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    transition: transform 0.2s ease;
    width: calc(50% - 16px); 
    height: 290px;
    padding: 0;
    box-sizing: border-box;
}

.post-list .post-list-item:hover {
    transform: scale(1.02);
}

.post-list .post-list-item .post-thumbnail {
    width: 260px;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 0 8px 8px 0;
    margin: 0;
}

.post-list .post-list-item .post-content {
    padding: 15px 0 1px 20px;
    flex: 1;
}

.post-list .post-list-item .post-content .post-title {
    margin: 0;
    font-size: 1.25em;
    color: #333;
}

.post-list .post-list-item .post-content .post-excerpt p {
    margin: 8px 0;
    color: #555;
}

.post-list .post-list-item .post-content .post-excerpt .star-rating {
    font-size: 14px;
    margin-bottom: 8px;
}

.post-list .post-list-item .post-content .read-more {
    color: #d18ac4;
    text-decoration: none;
    font-weight: bold;
    margin-top: 8px;
    display: inline-block;
}

.post-list .post-list-item .post-content .read-more:hover {
    text-decoration: underline;
}

#post-display-search-results .post-card .post-thumbnail {
	width: 100%;
	min-height: 300px;
	object-fit: cover;
	margin-bottom: 10px;
	max-height: 300px;
}

/* List layout */
.post-list .post-thumbnail {
    width: 250px;
    height: 300px;
    object-fit: cover;
    margin: 10px 30px 20px 10px;
}

#post-display-search-results .post-title {
    font-size: 20px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Styling for post excerpts and details */
#post-display-search-results .post-excerpt,
#post-display-search-results .post-details {
    color: #666;
    margin-bottom: 10px;
}

.author-info,
.date-icon,
.comments-icon {
    font-weight: bold;
    margin-right: 10px;
    font-size: 14px;
    vertical-align: middle;
}

#post-display-search-results .read-more {
	display: inline-block;
	padding: 10px 20px;
	border: 2px solid #333;
	border-radius: 5px;
	background-color: transparent;
	color: #333;
	text-decoration: none;
	transition: background-color 0.3s, color 0.3s;
	position: absolute;
	bottom: -15px;
	left: 50%;
	transform: translate(-50%, -50%);
}

#post-display-search-results .read-more:hover {
    background-color: #333;
    color: #fff;
}

#post-display-search-results .post-content {
    flex-grow: 1;
} 

.entry-content .post-list li {
	margin-left: 0em;
	margin-bottom: 6px;
}
/* Adjust for smaller screens */
@media (max-width: 1520px) {
  #post-display-search-results .post-card {
    min-height: calc(590px - (1920px - 115vw) * 0.25);
  }
}

@media (max-width: 1205px) {
    #post-display-search-results {
        grid-template-columns: repeat(3, 30vw);
    }
}

@media (max-width: 900px) {
    #post-display-search-results {
        grid-template-columns: repeat(2, 40vw);
    }
}

@media (max-width: 768px) {
	.post-list {
		width: 100%;
		overflow: auto;
		max-width: 100%;
	}
    .post-list .post-list-item {
        width: 10em;
        flex-direction: column;
        height: auto;
        margin: 8px 0;
    }

    .post-list .post-list-item .post-thumbnail {
        width: 100%;
        height: 180px;
        border-radius: 0 0 8px 8px;
    }

    .post-list .post-list-item .post-content {
        padding: 12px;
    }
}

@media (max-width: 758px) {
    #post-display-search-results {
        grid-template-columns: repeat(1, 90vw);
    }
}

@media (max-width: 568px) {
    #post-display-search-results .post-thumbnail {
        height: 150px;
    }

    #post-display-search-results .post-list-item,
    #post-display-search-results .post-card {
        flex-direction: column;
    }

    #post-display-search-results .post-thumbnail {
        width: 100%;
        margin-bottom: 10px;
    }

    #post-display-search-results .post-excerpt,
    #post-display-search-results .post-details {
        font-size: 16px;
    }
}
/* === PDS widget additions === */
.pds-tags-wrap { position: relative; display: inline-block; width: 100%; max-width: 420px; }
.pds-suggest { position:absolute; left:0; top:calc(100% + 4px); z-index:9999; max-height:220px; overflow:auto; border:1px solid #ddd; background:#fff; border-radius:6px; padding:4px 0; box-shadow:0 4px 14px rgba(0,0,0,.1); width:100%; box-sizing:border-box; }
.pds-suggest li { list-style:none; padding:8px 10px; cursor:pointer; }
.pds-suggest li:hover, .pds-suggest li.active { background:#f3f4f6; }
.pds-ms { position: relative; display: inline-block; min-width: 260px; }
.pds-ms-toggle { border: 1px solid #ddd; background: #fff; padding: 8px 10px; border-radius: 6px; cursor: pointer; min-width: 260px; text-align: left; }
.pds-ms-panel { position: absolute; left: 0; top: calc(100% + 6px); background: #fff; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 8px 18px rgba(0,0,0,.12); padding: 10px; width: 320px; max-height: 320px; overflow: hidden; z-index: 10000; }
.pds-ms-search { width: 100%; padding: 8px; border: 1px solid #e5e7eb; border-radius: 6px; margin-bottom: 8px; }
.pds-ms-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; }
.pds-ms-list li { padding: 6px 2px; }
.pds-ms-actions { display: flex; gap: 8px; margin-top: 8px; }
.pds-ms-actions button { border: 1px solid #ddd; background: #f9fafb; padding: 6px 10px; border-radius: 6px; cursor: pointer; }

/* New style below */
   /* Base */
  #post-display-search-form, #post-display-search-form * { box-sizing: border-box; }
  #post-display-search-form {
    --gap-x: 24px;
    --gap-y: 12px;
    --border: #dfe3e8;
    --text: #2c3e50;
    --muted: #8a97a3;
    --blue: #1f5da6;
    --blue-dark: #174777;

    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "label-year   label-month"
      "year         month"
      "label-tags   label-tags"
      "tags         tags"
      "submit       .";
    column-gap: var(--gap-x);
    row-gap: var(--gap-y);
    max-width: 520px;    /* tweak to taste */
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    font-weight: 600;
  }

  /* Place items on the grid */
  #post-display-search-form label[for="search-year"]  { grid-area: label-year; }
  #post-display-search-form #search-year             { grid-area: year; }
  #post-display-search-form label[for="search-month"]{ grid-area: label-month; }
  #post-display-search-form #search-month            { grid-area: month; }
  #post-display-search-form label[for="search-tags"] { grid-area: label-tags; }
  #post-display-search-form .pds-tags-wrap           { grid-area: tags; }
  #post-display-search-form button[type="submit"]    { grid-area: submit; }

  /* Labels */
  #post-display-search-form label {
    font-size: 14px;
    line-height: 1.2;
    margin-bottom: 2px;
  }

  /* Inputs */
  #post-display-search-form input[type="text"],
  #post-display-search-form input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    color: var(--text);
    outline: none;
    box-shadow: inset 0 1px 2px rgba(16,24,40,.04);
  }
  #post-display-search-form input::placeholder { color: var(--muted); }
  #post-display-search-form input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 1px var(--blue);
  }

  /* Tags wrapper (so suggestions can sit under it if you add them) */
  #post-display-search-form .pds-tags-wrap { position: relative; }
  #post-display-search-form .pds-suggest {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px);
    margin: 0; padding: 6px 0; list-style: none;
    border: 1px solid var(--border); border-radius: 4px; background: #fff;
    max-height: 220px; overflow: auto;
  }

  /* Submit button */
  #post-display-search-form button[type="submit"] {
    align-self: start;
    padding: 1px 10px;
    border: 0;
    border-radius: 6px;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
  }
  #post-display-search-form button[type="submit"]:hover { background: var(--blue-dark); }
  #post-display-search-form button[type="submit"]:active { transform: translateY(1px); }

  /* Small screens: stack nicely */
  @media (max-width: 520px) {
    #post-display-search-form {
      grid-template-columns: 1fr;
      grid-template-areas:
        "label-year" "year"
        "label-month" "month"
        "label-tags" "tags"
        "submit";
    }
  }