* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', sans-serif; }
body { background: #f0f2f5; color: #1a1a1a; padding: 15px; }
.container { max-width: 1200px; margin: 0 auto; text-align: center; }
.single-page { max-width: 540px; }

header { text-align: center; margin-bottom: 30px; padding-bottom: 15px; border-bottom: 2px solid #e2e8f0; }
h1 { color: #2d3748; font-size: 2.2rem; }
.site-tagline { color: #718096; margin-top: 5px; font-size: 1.1rem; }

.gallery-empty { grid-column: 1 / -1; text-align: center; color: #888; }
.story-notice { max-width: 720px; margin: 0 auto 18px; padding: 12px 16px; border-left: 4px solid #e09f3e; background: #fff7e8; color: #6b4f1d; text-align: left; }

/* Story list */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; align-items: stretch; }
.story-card { min-height: 250px; background: white; border: 1px solid #e2e8f0; border-top: 5px solid #e09f3e; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.06); transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; text-align: left; }
.story-card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0,0,0,0.1); }
.story-card-info { height: 100%; padding: 22px; display: flex; flex-direction: column; }
.story-card-title { color: #25324a; font-family: Georgia, serif; font-size: 1.35rem; line-height: 1.25; margin-bottom: 14px; }
.story-card-excerpt { color: #475569; font-family: Georgia, serif; font-size: 1rem; line-height: 1.65; margin-bottom: 18px; }
.meme-date { font-size: 0.8rem; color: #718096; }
.story-card .meme-date { margin-top: auto; }
.gallery-error { grid-column: 1 / -1; color: #c53030; text-align: center; }

/* Single story */
.single-story { width: 100%; max-width: 760px; background: white; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); margin: 0 auto 20px; text-align: left; }
.story-meta { padding: 30px 34px 18px; border-bottom: 1px solid #e2e8f0; }
.story-meta h2 { color: #25324a; font-family: Georgia, serif; font-size: 2rem; line-height: 1.2; margin-bottom: 8px; }
.story-meta time { color: #718096; font-size: 0.85rem; }
.story-body { padding: 28px 34px 12px; color: #334155; font-family: Georgia, serif; font-size: 1.08rem; line-height: 1.82; }
.story-body p { margin-bottom: 1.25em; }
.story-actions { padding: 4px 34px 30px; display: flex; justify-content: center; }
.nav-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 0 auto 30px; }

.btn { padding: 10px 18px; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; transition: background 0.2s; }
.btn-primary { background: #3182ce; color: white; }
.btn-primary:hover { background: #2b6cb0; }
.btn-secondary { background: #48bb78; color: white; }
.btn-secondary:hover { background: #38a169; }
.btn-neutral { background: #e2e8f0; color: #1f2937; }
.btn-neutral:hover { background: #cbd5e0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.nav-hidden { display: none; }
.mobile-next-wrap { display: none; }
.mobile-next-wrap.nav-hidden { display: none !important; }

.loading { text-align: center; padding: 40px; color: #718096; font-size: 1.1rem; }
.ad-slot { margin: 18px auto; padding: 16px; border-radius: 14px; border: 1px dashed #cbd5e0; background: linear-gradient(135deg, rgba(49,130,206,0.08), rgba(72,187,120,0.08)); text-align: center; color: #4a5568; display: grid; gap: 4px; max-width: 720px; }
.ad-unit { min-height: 90px; align-items: center; justify-items: center; }
.ad-unit .adsbygoogle { display: block; width: 100%; min-height: 90px; }
.ad-slot strong { font-size: 1rem; color: #1a1a1a; }
.ad-label { display: inline-block; margin: 0 auto 6px; padding: 3px 10px; border-radius: 999px; background: rgba(0,0,0,0.08); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.ad-slot-top { margin-top: 0; }
.ad-slot-bottom { margin-bottom: 0; }
.ad-slot-inline { margin: 24px auto; padding: 8px; border-radius: 8px; }
.ad-slot-inline .adsbygoogle { min-height: 70px; }

.site-footer {
	margin: 28px auto 10px;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	font-size: 0.95rem;
	color: #4a5568;
	padding-top: 8px;
}

.site-footer a {
	color: #2b6cb0;
	text-decoration: none;
	font-weight: 600;
}

.site-footer a:hover {
	text-decoration: underline;
}

.site-footer .footer-separator {
	color: #94a3b8;
}

.legal-page {
	max-width: 880px;
	margin: 0 auto;
	padding: 10px 0 28px;
}

.legal-card {
	background: #ffffff;
	border-radius: 18px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.08);
	padding: 24px;
	text-align: left;
	line-height: 1.65;
	color: #334155;
}

.legal-card h2,
.legal-card h3 {
	color: #1e293b;
	margin-bottom: 10px;
}

.legal-card h2 {
	font-size: 1.7rem;
}

.legal-card h3 {
	font-size: 1.1rem;
	margin-top: 22px;
}

.legal-card p,
.legal-card li {
	margin-bottom: 10px;
}

.legal-card ul {
	padding-left: 20px;
}

.legal-updated {
	color: #64748b;
	font-size: 0.95rem;
	margin-bottom: 18px;
}

.consent-banner {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 50;
	max-width: 620px;
	margin: 0 auto;
	background: #1f2937;
	color: #f9fafb;
	border-radius: 12px;
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
	padding: 14px;
	display: grid;
	gap: 12px;
}

.consent-text p {
	margin: 0;
	color: #e5e7eb;
	line-height: 1.5;
	font-size: 0.95rem;
}
.consent-actions {
	display: flex;
	justify-content: flex-end;
	flex-wrap: wrap;
}
.consent-actions .btn { min-width: 120px; }

@media (max-width: 900px) {
  .container { max-width: 760px; }
  .gallery { grid-template-columns: repeat(auto-fit, minmax(200px, 300px)); }
}

@media (max-width: 640px) {
	body { padding: 10px; }
	.container { padding: 0 4px; }
	header { margin-bottom: 18px; }
	h1 { font-size: 1.8rem; }
	.site-tagline { font-size: 0.98rem; }
	.gallery { grid-template-columns: 1fr; gap: 14px; }
	.single-page { max-width: 100%; }
	.legal-card { padding: 18px; }
	.story-actions, .nav-buttons { flex-direction: column; gap: 8px; }
	.btn { width: 100%; max-width: 320px; margin: 0 auto; text-align: center; min-height: 44px; padding: 11px 14px; }
	.mobile-next-wrap {
		display: block;
		position: sticky;
		bottom: 10px;
		z-index: 20;
		padding: 8px 0 2px;
	}
	.mobile-next-btn {
		max-width: 360px;
		width: calc(100% - 8px);
		box-shadow: 0 10px 26px rgba(49,130,206,0.35);
	}
	.ad-slot { max-width: 100%; padding: 8px; margin: 12px auto; }
	.ad-unit { min-height: 70px; }
	.ad-unit .adsbygoogle { min-height: 70px; }
	.ad-slot-inline { margin: 18px auto; padding: 4px; }
	.ad-slot-inline .adsbygoogle { min-height: 60px; }
	.ad-label { margin-bottom: 4px; padding: 2px 8px; font-size: 0.68rem; }
	.story-card, .single-story { max-width: 100%; }
	.story-meta { padding: 22px 20px 14px; }
	.story-meta h2 { font-size: 1.55rem; }
	.story-body { padding: 22px 20px 8px; font-size: 1rem; line-height: 1.72; }
	.story-actions { padding: 4px 20px 24px; }
	.consent-banner { left: 10px; right: 10px; bottom: 10px; max-width: none; }
	.consent-actions { justify-content: stretch; }
	.consent-actions .btn { max-width: none; width: 100%; min-width: 0; }
}

@media (max-width: 420px) {
	body { padding: 8px; }
	h1 { font-size: 1.6rem; }
	.btn { max-width: 100%; }
	.ad-slot { padding: 6px; margin: 10px auto; }
	.ad-unit { min-height: 60px; }
	.ad-unit .adsbygoogle { min-height: 60px; }
}