/**
 * Frontend styles for IPAF Weather Forecast plugin
 */
:root {
	--ipaf-weather-primary: #0f2f55;
	--ipaf-weather-accent: #c6a15b;
	--ipaf-weather-text: #172033;
	--ipaf-weather-muted: #667085;
	--ipaf-weather-background: #ffffff;
	--ipaf-weather-border: rgba(15, 47, 85, 0.12);
	--ipaf-weather-radius: 20px;
}

/* Container Wrap */
.ipaf-weather-wrap {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: var(--ipaf-weather-text);
	background: var(--ipaf-weather-background);
	border: 1px solid var(--ipaf-weather-border);
	border-radius: var(--ipaf-weather-radius);
	padding: 24px;
	box-shadow: 0 4px 20px rgba(15, 47, 85, 0.04);
	margin: 20px 0;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
}

/* Prevent layout breaking */
.ipaf-weather-wrap *,
.ipaf-weather-wrap *::before,
.ipaf-weather-wrap *::after {
	box-sizing: border-box;
}

/* Header */
.ipaf-weather-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 20px;
	border-bottom: 2px solid rgba(198, 161, 91, 0.2); /* Accent color under title */
	padding-bottom: 10px;
}

.ipaf-weather-title {
	font-size: 20px;
	font-weight: 700;
	color: var(--ipaf-weather-primary);
	margin: 0;
	padding: 0;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ipaf-weather-city {
	font-size: 16px;
	color: var(--ipaf-weather-accent);
	font-weight: 600;
}

/* Grid System */
.ipaf-weather-grid {
	display: grid;
	gap: 20px;
	width: 100%;
	margin-bottom: 20px;
}

/* Cards Layout */
.ipaf-weather-layout-cards .ipaf-weather-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Card item */
.ipaf-weather-card {
	background: #fafbfc;
	border: 1px solid var(--ipaf-weather-border);
	border-radius: calc(var(--ipaf-weather-radius) - 4px);
	padding: 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	min-width: 0;
}

.ipaf-weather-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 15px rgba(15, 47, 85, 0.06);
	border-color: rgba(198, 161, 91, 0.4);
}

/* Date rendering */
.ipaf-weather-date {
	display: flex;
	flex-direction: column;
	margin-bottom: 12px;
}

.ipaf-weather-day-num {
	font-size: 18px;
	font-weight: 700;
	color: var(--ipaf-weather-primary);
}

.ipaf-weather-day-name {
	font-size: 13px;
	color: var(--ipaf-weather-muted);
	margin-top: 2px;
}

/* Card Body */
.ipaf-weather-card-body {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 15px;
	width: 100%;
}

.ipaf-weather-icon-wrap {
	margin-bottom: 12px;
	color: var(--ipaf-weather-primary);
	display: flex;
	justify-content: center;
	align-items: center;
}

.ipaf-weather-icon-wrap svg {
	width: 48px;
	height: 48px;
	color: var(--ipaf-weather-primary);
	stroke: var(--ipaf-weather-primary);
}

/* Add custom gold accents to clean SVGs */
.ipaf-weather-clear svg,
.ipaf-weather-mainly-clear svg {
	color: var(--ipaf-weather-accent);
	stroke: var(--ipaf-weather-accent);
}

.ipaf-weather-temp {
	font-size: 24px;
	font-weight: 700;
	color: var(--ipaf-weather-primary);
	display: flex;
	align-items: center;
	gap: 4px;
	margin-bottom: 6px;
}

.ipaf-weather-temp-divider {
	color: var(--ipaf-weather-accent);
	font-weight: 400;
	font-size: 20px;
}

.ipaf-weather-temp-min {
	color: var(--ipaf-weather-muted);
	font-weight: 500;
}

.ipaf-weather-desc {
	font-size: 14px;
	font-weight: 500;
	color: var(--ipaf-weather-text);
}

/* Detail Rows */
.ipaf-weather-detail {
	width: 100%;
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	padding: 6px 0;
	border-top: 1px dashed var(--ipaf-weather-border);
	color: var(--ipaf-weather-muted);
}

.ipaf-weather-detail strong {
	color: var(--ipaf-weather-text);
}

/* Unavailable card style */
.ipaf-weather-unavailable-card {
	background: #fdfdfd;
	border-style: dashed;
	opacity: 0.8;
}

.ipaf-weather-unavailable-card .ipaf-weather-icon-wrap svg {
	color: var(--ipaf-weather-muted);
	stroke: var(--ipaf-weather-muted);
}

.ipaf-weather-unavailable-card .ipaf-weather-desc {
	color: var(--ipaf-weather-muted);
	font-style: italic;
}

/* Compact Layout Override */
.ipaf-weather-layout-compact .ipaf-weather-grid {
	grid-template-columns: 1fr;
	gap: 12px;
}

.ipaf-weather-layout-compact .ipaf-weather-card {
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	text-align: left;
	padding: 12px 24px;
}

.ipaf-weather-layout-compact .ipaf-weather-date {
	margin-bottom: 0;
	min-width: 120px;
}

.ipaf-weather-layout-compact .ipaf-weather-card-body {
	flex-direction: row;
	margin-bottom: 0;
	width: auto;
	gap: 20px;
}

.ipaf-weather-layout-compact .ipaf-weather-icon-wrap {
	margin-bottom: 0;
}

.ipaf-weather-layout-compact .ipaf-weather-temp {
	margin-bottom: 0;
	font-size: 20px;
}

/* Footer Section */
.ipaf-weather-footer {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: var(--ipaf-weather-muted);
	padding-top: 14px;
	border-top: 1px solid var(--ipaf-weather-border);
	margin-top: 10px;
}

.ipaf-weather-source-link {
	color: var(--ipaf-weather-accent);
	text-decoration: none;
	font-weight: 500;
}

.ipaf-weather-source-link:hover {
	text-decoration: underline;
}

/* Info and Error Messages */
.ipaf-weather-message {
	padding: 16px 20px;
	border-radius: calc(var(--ipaf-weather-radius) - 8px);
	font-size: 14px;
	line-height: 1.5;
}

.ipaf-weather-info-block {
	background-color: rgba(198, 161, 91, 0.06);
	border-left: 4px solid var(--ipaf-weather-accent);
	color: var(--ipaf-weather-text);
	font-weight: 500;
}

.ipaf-weather-error-block {
	background-color: #fdf2f2;
	border-left: 4px solid #f05252;
	color: #9b1c1c;
}

.ipaf-weather-admin-notice {
	background-color: #fff8e1;
	border-left: 4px solid #ffb300;
	color: #5d4037;
	padding: 8px 12px;
	font-size: 12px;
	border-radius: 4px;
	margin-bottom: 15px;
}

/* Accessibility: Screen Reader Only */
.ipaf-weather-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
	.ipaf-weather-layout-cards .ipaf-weather-grid {
		/* Tablet: 3 columns if space allows, otherwise wraps automatically */
		grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	}
}

@media (max-width: 600px) {
	.ipaf-weather-layout-cards .ipaf-weather-grid {
		/* Mobile: 1 column */
		grid-template-columns: 1fr;
	}
	
	.ipaf-weather-card {
		padding: 16px;
	}
	
	.ipaf-weather-layout-compact .ipaf-weather-card {
		flex-direction: column;
		text-align: center;
		padding: 16px;
	}
	
	.ipaf-weather-layout-compact .ipaf-weather-date {
		margin-bottom: 8px;
		min-width: 0;
	}
	
	.ipaf-weather-layout-compact .ipaf-weather-card-body {
		flex-direction: column;
		gap: 8px;
	}
	
	.ipaf-weather-wrap {
		padding: 16px;
	}
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
	.ipaf-weather-card {
		transition: none;
	}
	.ipaf-weather-card:hover {
		transform: none;
	}
}
