﻿/* -------------------------------------------------------
   NEWS GRID LAYOUT
------------------------------------------------------- */

.af-news-captions {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	margin: 0;
	grid-gap: 10px;
	width: 100%;
}


/* -------------------------------------------------------
   NEWS TILE WRAPPER
------------------------------------------------------- */

.af-news-caption {
	display: block;
	position: relative;
	overflow: hidden;
	border-radius: 0px;
	text-decoration: none !important;
	color: inherit;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	border-radius:8px;
}

	/* Subtle zoom on hover
	.af-news-caption:hover {
		transform: scale(1.01);
		box-shadow: 0 6px 16px rgba(0,0,0,0.25);
		cursor: pointer;
	} */


/* -------------------------------------------------------
   SQUARE TILE WRAPPER
------------------------------------------------------- */

.af-news-item {
	position: relative;
	width: 100%;
	padding-top: 100%; /* 1:1 square */
}


/* -------------------------------------------------------
   IMAGE
------------------------------------------------------- */

.af-news-photo {
	position: absolute;
	inset: 0;
}

	.af-news-photo img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}


/* -------------------------------------------------------
   CAPTION OVERLAY
------------------------------------------------------- */

.af-news-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	width: calc(100% - 40px);
	/* Initial collapsed height */
	height: 60px;
	background: rgba(0, 55, 125, 0.75); /* blue with transparency */
	padding: 10px 20px;
	color: #fff;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	transition: height 0.35s ease, background 0.35s ease;
}

/* Hover effect — reveal full overlay */
.af-news-caption:hover .af-news-overlay {
	height: 100%;
	background: rgba(0, 55, 125, 0.85);
}


/* -------------------------------------------------------
   TITLE
------------------------------------------------------- */

.af-news-title {
	font-size: 1.3rem;
	font-weight: 500;
	font-family: 'Fredoka', sans-serif;
	line-height: 1.2;
	margin-bottom: 6px;
	text-shadow: 0 2px 4px rgba(0,0,0,0.45);
	height:50px;
	overflow:hidden;
	margin-top:0px;
}


/* -------------------------------------------------------
   EXCERPT (hidden until hover)
------------------------------------------------------- */

.af-news-excerpt {
	font-size: 1rem;
	font-weight: 300;
	opacity: 0;
	height: 0;
	overflow: hidden;
	transition: opacity 0.3s ease 0.1s, height 0.3s ease;
}

.af-news-caption:hover .af-news-excerpt {
	opacity: 1;
	height: calc(100% - 100px); /* enough to show several lines */
}


/* -------------------------------------------------------
   DATE (OPTIONAL)
   If you want to show a date ribbon, uncomment.
------------------------------------------------------- */

/*
.af-news-date {
    position: absolute;
    bottom: 0;
    left: 0;
    background: #444;
    color: #fff;
    padding: 6px 10px;
    font-size: 0.9rem;
    opacity: 0.9;
}
*/

.news-list {
	display: flex;
	flex-wrap: wrap;
	gap: 23px; /* replaces margin! */
	margin:20px 0px;
}

.news-item {
	width: 280px;
	height: 445px;
	perspective: 1000px; /* enables 3D flip */
	position: relative;
	display: inline-block;
	vertical-align: top;
	color: inherit;
}

/* INNER WRAPPER */
.news-item-inner {
	width: 100%;
	height: 100%;
	position: relative;
	transition: transform .6s;
	transform-style: preserve-3d;
}

/* When flipped */
.news-item.flip .news-item-inner {
	transform: rotateY(180deg);
}

/* FRONT & BACK PANELS */
.news-item-front,
.news-item-back {
	backface-visibility: hidden;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	padding: 15px;
	box-sizing: border-box;
	border: 1px solid #ccc;
	border-radius: 8px;
	background: #fff;
	box-shadow: 1px 1px 9px #ddd;
	line-height: 1.3em;
}

.news-item-pic {
	width: 280px;
	height: 210px;
	overflow: hidden;
	margin-left: -15px;
	margin-top: -15px;
	border-top-left-radius: 8px;
	border-top-right-radius: 8px;
}

	.news-item-pic img {
		width: 100%;
	}

/* BACK SIDE */
.news-item-back {
	transform: rotateY(180deg);
	background: #f7f7f7;
}

/* Flip icon */
.news-item-flip {
	text-align: right;
	position: absolute;
	z-index: 10;
	bottom: 5px;
	right: 10px;
	width: 36px;
	transition: 0.25s;
	filter: grayscale(1);
	opacity: 0.5;
}

	.news-item-flip:hover {
		filter: grayscale(0);
		opacity: 1;
		cursor: pointer;
	}

	.news-item-flip img {
		width: 100%;
	}

/* Simple example styling */
.news-item-title {
	font-size: 1.1em;
	font-weight: 600;
	margin-top: 10px;
	margin-bottom: 3px;
	color: #155CAC;
}

.news-item-summary {
	font-size: 0.9em;
	color: #888;
	margin-bottom: 8px;
	line-height: 1.4em;
	height: 60px;
	overflow: hidden;
}

.news-item-line {
	font-size: 1.0em;
	margin-bottom: 5px;
	font-weight: 400;
	max-height:75px;
	overflow:hidden;
	width:calc(100% - 40px);
}

.news-item-desc {
	font-size: 0.9em;
	line-height: 1.4;
	height: 100%;
	overflow-y: auto;
	margin-left: -15px;
	margin-top: -15px;
	padding: 15px;
	width: 100%;
}

.news-item-details .news-item-desc { 
	font-size:1.0em;
}

.news-item-details .news-item-date {
	font-size: 1.2em;
}

.news-item-link { 
	margin-bottom:20px;
}

	.news-item-link a:link, .news-item-link a:active, .news-item-link a:visited {
		text-decoration: none;
		color: #145CAB;
		transition:0.25s;
	}

		.news-item-link a:link:hover, .news-item-link a:active:hover, .news-item-link a:visited:hover {
			text-decoration: none;
			color: #54A6FF;
		}

.news-items .box {
	display: inline-block;
	vertical-align: middle;
	margin-right: 10px;
}

.news-items .clear {
	clear: both;
	height: 10px;
}

.news-items .input:focus {
	outline: none;
}

.news-item .category-name {
	display: inline-block;
	vertical-align: middle;
	background: #155CAC;
	color: #fff;
	font-size: 0.8em;
	padding: 5px 10px;
	margin-right: 5px;
	margin-top: 5px;
	border-radius: 3px;
	font-weight:300;
}

.news-item-gallery {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	white-space: nowrap;
	padding: 5px 0;
	scroll-behavior: smooth;
	margin: 30px 0px;
}

	.news-item-gallery::-webkit-scrollbar {
		height: 8px;
	}

	.news-item-gallery::-webkit-scrollbar-thumb {
		background: #999;
		border-radius: 4px;
	}

.news-item-gallery-thumb {
	height: 300px;
	width: auto;
	border-radius: 4px;
	object-fit: cover;
	display: inline-block;
}

