.basecontent {
	align-items: left;
	display: flex;
	flex-direction: column;
	margin-bottom: 10px;
}


.custom-post {
	background-color: #fff;
	border-radius: 22px;
	/* box-shadow: 0px 3px 6px rgb(0 0 0 / 16%); */
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	margin: 10px;
	overflow: hidden;
	transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.gallery__actions {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-content: center;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 10px;
}
.grid__more, .grid__toggle {
    background-color: #257126;
    color: #fff !important;
    margin-left: 20px;
    border-radius: 22px;
	box-shadow: 0px 3px 6px rgb(0 0 0 / 16%);
    color: #041204;
    cursor: pointer;
    height: 40px;
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    opacity: 1;
    width: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    align-content: center;
    flex-wrap: nowrap;
}

/* Default: 4 per row */
.custom-post-grid.posts-4 .custom-post {
    flex-basis: calc(25% - 20px);
    margin: 10px;
}

/* ACF option: 3 per row */
.custom-post-grid.posts-3 .custom-post {
   flex-basis: calc(33.33% - 20px);
    margin: 10px;
}


.custom-post-base {
	margin-bottom: 10px;
	position: relative;
	z-index: 2;
}
.custom-post-base-content {
	align-items: center;
	background-color: #fff;
	color: #257226 !important;
	display: flex;
	justify-content: space-between;
   margin-top: auto;
}

.main-post-base-content {
	align-items: center;
	background-color: #fff;
	color: #257226;
	display: flex;
	justify-content: space-between;
   margin-top: auto;
   padding: 0 20px;
}

.custom-post-content {
		  margin-top: auto; 
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	justify-content: space-between;
	padding: 5px 20px;
	position: relative;
	z-index: 2;
}


.custom-post-title {
	 margin-left: 20px;
    margin-right: 10px;
    margin-top: 15px;
    margin-bottom: 5px;
	  display: flex;
    flex-direction: column;
    flex: 1; /* Allow it to fill available space */
    position: relative;
    z-index: 2;
}

.custom-post-date-big {
	color: #041204;
	margin: 0;
	padding: 5px 20px;
	text-align: left;
}

.content_section.grid_section.followon {
      margin-top: -20px;
}

.custom-post-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	margin-left: -10px;
	margin-right: -10px;
	margin-top: 20px;
}
.custom-post-image {
	background-position: center;
	background-size: cover;
	padding-top: 60%;
	position: relative;
}
.custom-post-main-content {
	color: #000;
	height: 80px;
	max-height: 80px;
	min-height: 80px;
	text-decoration: none;
}
.custom-post-main-content a {
	color: #000 !important;
height: 80px;
	max-height: 80px;
	min-height: 80px;
	text-decoration: none;
    margin-bottom:10px;
}

.custom-post:active {
		box-shadow: 0px 3px 6px rgb(0 0 0 / 16%);
	transform: translate(2px,2px);
	transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.custom-post:hover {
	box-shadow: 0px 3px 6px rgb(0 0 0 / 16%);
	transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.duo-post {
	align-items: stretch;
	border-radius: 22px;
	/* box-shadow: 0px 3px 6px rgb(0 0 0 / 16%); */
	display: flex;
	flex-basis: calc(50% - 20px);
	flex-direction: column;
	justify-content: flex-start;
	margin: 10px;
	overflow: hidden;
	transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.duo-post-container {
	align-items: stretch;
	display: flex;
	flex-wrap: wrap;
}
.duo-post-content {
	align-items: flex-start;
	display: flex;
	flex-direction: column;
	flex: 0 1 auto;
	padding: 5px 20px;
	position: relative;
	text-align: left;
	text-decoration: none;
	z-index: 2;
}
.duo-post-grid {
	display: flex;
	flex-wrap: wrap;
	margin-left: -10px;
	margin-right: -10px;
	margin-top: 20px;
}
.duo-post-image {
	background-position: center;
	background-size: cover;
	flex: 1 1 auto;
	padding-top: 60%;
	position: relative;
}
.duo-post:active {
		box-shadow: 0px 3px 6px rgb(0 0 0 / 16%);
	transform: translate(2px,2px);
	transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.duo-post:hover {
	box-shadow: 0px 3px 6px rgb(0 0 0 / 16%);
	transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.gridheader {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
	   align-content: center;
    align-items: center;
}


.gridtitle h3 {
    margin-top: 0rem;
    margin-bottom: 0rem;
}

.gridtitle {
    display: flex;
    border-radius: 16px;
    height: 64px;
    margin-top: -30px;
    opacity: 1;
    padding: 8px 20px 8px 20px;
    position: absolute;
    top: 0;
    text-align: center;
    vertical-align: middle;
    min-width: 222px;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: center;
}


.gridtitle.above {
    border-radius: 2px;
    height: auto;
    margin-top: -80px;
    opacity: 1;
    padding: 8px;
    position: absolute;
    top: 0;
    text-align: center;
    vertical-align: middle;
    min-width: 222px;
}

.gridtitle.above.visible h3{
		color: #509E2F;
}

.linktext {
    font-weight: 700;
}

@media (max-width: 768px) {
	
.custom-post-grid {
    display: flex
;
    flex-wrap: wrap;
    justify-content: center;
    margin-left: -10px;
    margin-right: -10px;
    margin-top: 10px;
}


.custom-post-title a {
     text-decoration: none;
}	

	.custom-post-title {
    margin-left: 10px;
    margin-top: 10px;
}
	.custom-post-image {
    background-position: center;
    background-size: cover;
    padding-top: 90%;
    position: relative;
}
	
.custom-post-content {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: space-between;
    padding: 5px 10px;
    position: relative;
    z-index: 2;
}	

.custom-post-main-content {
    color: #000;
    height: auto;
        min-height: 30px;
    text-decoration: none;
}	
	.button-center {
		margin: 20px auto;
		position: relative;
		right: auto;
		text-align: center;
		top: 0;
		transform: none;
	}
	.button-center .button {
		display: inline-block;
		z-index: 2;
	}
	.column {
		max-width: 90%;
	}
	.duo-post-content {
		padding: 10px 15px;
	}
	.duo-post-image {
		padding-top: 100%;
	}
}
@media (min-width: 768px) and (max-width: 1260px) {
.text-content {
	flex: 1;
}
}

@media (max-width: 480px) {
	.column {
		max-width: 90%;
	}
	.custom-post {
		flex-basis: calc(100% - 20px);
		flex-basis: calc(100% - 40px);
	}
}

/* Base */
.custom-post-grid{
  display:grid;
  gap:2px;
}

/* Small: 1 column */
.custom-post-grid.posts-4,
.custom-post-grid.posts-3{
  grid-template-columns: 1fr;
}

/* Large phone / small tablet: 2 columns */
@media (min-width: 600px){
  .custom-post-grid.posts-4,
  .custom-post-grid.posts-3{
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet / laptop: 3 columns (BOTH layouts) */
@media (min-width: 900px){
  .custom-post-grid.posts-4,
  .custom-post-grid.posts-3{
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Big screens: posts-4 becomes 4 columns */
@media (min-width: 1400px){
  .custom-post-grid.posts-4{
    grid-template-columns: repeat(4, 1fr);
  }
  /* posts-3 stays 3 */
}

/* Mobile landscape: keep it comfy */
@media (orientation: landscape) and (max-height: 520px){
  .custom-post-grid.posts-4,
  .custom-post-grid.posts-3{
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Remove old flex assumptions */
.custom-post-grid .custom-post{
  margin:0;           /* important: kill old margin-based layout */
  width:auto;
  box-sizing:border-box;
}


.griddesc {
	width: 63%;
	margin-left: 6%;
}

@media (max-width: 980px) {
	.griddesc {
	width: 80%;
	margin-left: 6%;
}
}