/* ===========================
   RESET
   =========================== */
* {
	padding: 0;
	margin: 0;
}


/* ===========================
   BASE / TYPOGRAPHY / LAYOUT
   =========================== */
body {
	background: #fff;
	color: #111;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 17px;
	line-height: 1.6;
	padding: 0 16px;
}

header,
main {
	max-width: 760px;
	margin: 0 auto;
	padding: 0 16px;
}

footer {
	max-width: 760px;
	margin: 0 auto;
	padding: 30px 16px;
}

h1, h2, h3, h4 {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-weight: 600;
}

h1, h2 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 19px; }
h4 { font-size: 17px; }

article p { margin: 5px 0; }
article ul, article ol { margin-left: 20px; }
article ul li, article ol li { margin: 5px 0; }

.a_line {
	margin: 10px 0;
	border-bottom: 1px dashed #ccc;
}


/* ===========================
   LINKS
   =========================== */
a {
	color: #0077cc;
	text-decoration: none;
}
a:hover { text-decoration: underline; }

.site-title {
	font-family: inherit;
	font-size: 32px;
	font-weight: 600;
	text-decoration: none;
}

h1 a,
.site-title a {
	text-decoration: none;
}


/* ===========================
   LOGO
   =========================== */
.logo {
	display: block;
	width: 400px;
	margin: 10px 10px 10px 0;
	background: url('/img/logo.svg') no-repeat;
	background-size: contain;
	aspect-ratio: 499.80139/84.481972;
}

@media (max-width: 800px) { .logo { width: 200px; } }
@media (max-width: 600px) { .logo { width: 160px; } }
@media (max-width: 420px) { .logo { width: 130px; } }


/* ===========================
   NAVIGATION
   =========================== */
.nav {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin: 15px 0;
}

.nav a {
	color: #0E0E0E;
	font-weight: 500;
	padding: 4px 0;
	transition: .2s;
	text-decoration: none;
}

.nav a:hover {
	color: #111;
	text-decoration: underline;
	text-decoration-color: #DD0303;
	text-underline-offset: 4px;
}


/* ===========================
   FORMS
   =========================== */
input[type="text"],
input[type="password"],
textarea,
select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 16px;
	font-family: inherit;
	background: #fff;
	color: #111;
	transition: .2s;
}

input:focus,
textarea:focus,
select:focus {
	border-color: #0077cc;
	box-shadow: 0 0 0 2px rgba(0,119,204,0.15);
	outline: none;
}

textarea {
	min-height: 160px;
	resize: vertical;
}

select {
	cursor: pointer;
	appearance: none;
	background-image:
		linear-gradient(45deg, transparent 50%, #555 50%),
		linear-gradient(135deg, #555 50%, transparent 50%),
		linear-gradient(to right, #ccc, #ccc);
	background-position:
		calc(100% - 18px) calc(50% - 3px),
		calc(100% - 12px) calc(50% - 3px),
		calc(100% - 32px) 50%;
	background-size: 6px 6px, 6px 6px, 1px 60%;
	background-repeat: no-repeat;
}

#txt.dragover {
    border: 2px dashed #5b8cff;
    background: #eef4ff;
}


/* ===========================
   BUTTONS
   =========================== */
button,
input[type="submit"],
a.button {
	background: #0077cc;
	color: #fff;
	padding: 10px 18px;
	font-size: 16px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: .2s;
	text-decoration: none;
	display: inline-block;
}

button:hover,
a.button:hover,
input[type="submit"]:hover {
	background: #005fa3;
}

button:active,
a.button:active,
input[type="submit"]:active {
	transform: scale(.97);
}


button.delete-btn {
	background: #cc0000;
	color: #fff;
	padding: 10px 18px;
	font-size: 16px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: .2s;
	text-decoration: none;
	display: inline-block;
}

button.delete-btn:hover {
	background: #a60000;
}

button.delete-btn:active {
	transform: scale(.97);
}



/* ===========================
   POST CARDS
   =========================== */
.post-card {
	display: flex;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid #eee;
	align-items: flex-start;
	min-height: 110px;
}

.post-thumb img {
	width: 120px;
	height: 120px;
	object-fit: cover;
	border-radius: 6px;
	background: #eee;
	display: block;
}

.post-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 120px;
}

.post-card h2 {
	margin-bottom: 3px;
	font-size: 20px;
	line-height: 1.3;
}

.post-meta {
	font-size: 13px;
	color: #777;
	margin-bottom: 6px;
}

.post-excerpt {
	flex-grow: 1;
	color: #333;
	font-size: 15px;
	line-height: 1.45;
	max-height: 3em;
	overflow: hidden;
}

.read-more {
	font-size: 14px;
	color: #005bbb;
	font-weight: 500;
	text-decoration: none;
}

.content .p {
    padding: 7px 0;
}


/* ===========================
   ADMIN PANEL
   =========================== */
.admin-title { margin-bottom: 20px; }

.admin-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
}

.admin-menu .admin-btn {
	padding: 14px 22px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fafafa;
	color: #005bbb;
	font-weight: 600;
	text-decoration: none;
	transition: .2s;
}

.admin-menu .admin-btn:hover {
	background: #e9f2ff;
	border-color: #bcd9ff;
}

.admin-page { max-width: 750px; }

.admin-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.admin-header .admin-btn {
	background: #005bbb;
	color: #fff;
	padding: 6px 12px;
	border-radius: 4px;
	font-size: 14px;
}

.posts-table { border-top: 1px solid #ddd; margin-top: 10px; }

.post-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px solid #eee;
}

.admin-empty { color: #666; padding: 20px 0; }


/* ===========================
   MEDIA MANAGER
   =========================== */
.media-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, 150px);
	gap: 16px;
	margin-top: 20px;
}

.upload-area {
	border: 2px dashed #bbb;
	border-radius: 10px;
	padding: 50px 20px;
	text-align: center;
	background: #fafafa;
	transition: .2s;
	margin-bottom: 15px;
	position: relative;
	cursor: pointer;
}

.upload-area:hover { background: #f5faff; border-color: #0077cc; }
.upload-area.dragover { background: #e8f4ff; }

.upload-area input[type="file"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
}

.media-thumb {
	width: 150px;
	height: 150px;
	border: 1px solid #ddd;
	border-radius: 6px;
	overflow: hidden;
	position: relative;
	background: #fafafa;
}

.media-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.media-item .media-name {
	font-size: 11px;
	margin-top: 5px;
	color: #555;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	width: 150px;
}

.media-del {
	position: absolute;
	top: 6px;
	right: 6px;
	background: rgba(0,0,0,0.7);
	color: #fff;
	padding: 3px 8px;
    border: 1px solid transparent;
	border-radius: 4px;
	font-size: 13px;
	opacity: 0;
	transition: opacity .2s;
		z-index: 5;
}

.media-thumb:hover .media-del,
.media-thumb:hover .media-copy { opacity: 1; }

.media-del:hover {
	background: #c00;
	text-decoration: none;
    border: 1px solid #ccc;
}

.media-copy {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(255,255,255,0.9);
    padding: 3px 6px;
    font-size: 14px;
	color: #333;
    border: 1px solid transparent;
    border-radius: 4px;
    opacity: 0;
    cursor: pointer;
    transition: 0.2s;
		z-index: 5;
}

.media-copy:active {
    transform: scale(0.9);
	text-decoration: none;
    border: 1px solid #ccc;
}
.media-copy:hover {
	color: #fff;
    border: 1px solid #ccc;
}


/* ===========================
   HERO IMAGE
   =========================== */
.hero {
	position: relative;
	height: 400px;
	border-radius: 12px;
	background-size: cover;
	background-position: center;
	margin: 0 auto 30px;
	max-width: 760px;
	overflow: hidden;
}

.hero-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.35);
}

.hero-text {
	position: absolute;
	left: 30px;
	bottom: 40px;
	color: #fff;
	max-width: 80%;
}

.hero-text h1 {
	font-size: 36px;
	font-weight: 600;
	margin-bottom: 8px;
}

.hero-text p {
	font-size: 19px;
	line-height: 1.5;
	color: #f0f0f0;
}


/* ===========================
   IMAGES IN CONTENT
   =========================== */
.content img {
	display: block;
	max-width: 80%;
	width: 80%;
	margin: 0 auto;
	border-radius: 6px;
}

@media (max-width: 760px) {
	.content img {
		max-width: 100%;
		width: 100%;
		margin: 15px 0;
	}
}


/* ===========================
   FLOAT BLOCKS
   =========================== */
.content .align-left,
.content .align-right {
	width: 47%;
	display: block;
}

.content .align-left { float: left; margin: 0 14px 10px 0; }
.content .align-right { float: right; margin: 0 0 10px 14px; }

.content .align-left img,
.content .align-right img {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    display: block;
    border-radius: 6px;
}

.content::after {
	content: "";
	display: block;
	clear: both;
}


/* ============================
   MOBILE / TABLET
   ============================ */

@media (max-width: 760px) {
    .content .align-left,
    .content .align-right {
        width: 47%;
        margin: 2px 0;
    }

	.content .align-left  { margin: 2px 10px 2px 0; }
	.content .align-right { margin: 2px 0 2px 10px; }

    .content .align-left img,
    .content .align-right img {
        width: 100%;
        max-width: 100%;
    }
}


/* ===========================
   PAGINATION
   =========================== */
.pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 25px 0;
	font-size: 17px;
}

.pagination a {
	color: #005bbb;
	padding: 4px 8px;
	border-radius: 4px;
	text-decoration: none;
	transition: .2s;
}

.pagination a:hover { background: #eef6ff; }
.pagination .active { font-weight: 700; color: #111; }
.pagination .dots { color: #777; }


/* ===========================
   404 PAGE
   =========================== */
.box {
	max-width: 420px;
	margin: 0 auto;
	padding: 40px 0 70px;
	text-align: center;
}

.box h1 {
	font-size: 96px;
	font-weight: 700;
	letter-spacing: -4px;
}

.box p {
	font-size: 18px;
	color: #555;
	margin: 15px 0 30px;
	line-height: 1.5;
}

a.button_404 {
	display: inline-block;
	padding: 12px 28px;
	background: #111;
	color: #fff;
	border-radius: 8px;
	text-decoration: none;
	transition: .25s;
}


/* ===========================
   COOKIE BANNER
   =========================== */
.cookie-banner {
	display: none;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: #222;
	color: #fff;
	padding: 18px 20px;
	font-size: 16px;
	z-index: 9999;
	gap: 18px;
	justify-content: space-between;
	align-items: center;
}

.cookie-banner.show {
	display: flex;
}

.cookie-link {
	color: #9cf;
	text-decoration: underline;
}

.cookie-link:hover { color: #cde; }

.cookie-btn {
	background: #0077cc;
	color: #fff;
	border: none;
	padding: 10px 18px;
	border-radius: 6px;
	cursor: pointer;
}


/* ===========================
   RICH TEXT EDITOR
   =========================== */
input.format {
	background: #f9f6f2;
	border: 1px solid #b3c1c2;
	border-radius: 4px;
	color: #000;
	font-size: .8em;
	padding: .2em .8em;
	margin: 0 3px 2px 0;
	cursor: pointer;
	float: left;
}

.strong { font-weight: bold; }
.em { font-style: italic; }
.underline { text-decoration: underline; }
.del { text-decoration: line-through; }


/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 1000px) {
	body { font-size: 16.5px; padding: 0 20px; }

	header, main, footer {
		max-width: 95%;
		padding: 16px 20px;
	}

	.hero { height: 320px; border-radius: 10px; }
	.hero-text p { font-size: 16px; }

	.media-grid {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	}
}

@media (max-width: 760px) {
	body { font-size: 16px; padding: 0 12px; }

	header, main, footer {
		padding: 10px 12px;
	}

	.nav { gap: 12px; font-size: 15px; }

	.hero { height: 240px; border-radius: 0; }

	.post-card {
		flex-direction: column;
		gap: 10px;
		padding: 12px 0 20px;
	}

	.post-thumb img {
		aspect-ratio: 6 / 3;
		width: 100%;
		height: auto;
		display: block;
	}

	.admin-menu { flex-direction: column; gap: 10px; }

	.media-grid {
		grid-template-columns: repeat(auto-fill, minmax(45%, 1fr));
	}
}

@media (max-width: 360px) {
	body { font-size: 15px; padding: 0 8px; }

	.nav { gap: 8px; font-size: 14px; }

	.hero { height: 200px; }

	.post-card h2 { font-size: 17px; }
	.post-excerpt { font-size: 14px; }

	.media-grid { grid-template-columns: 1fr; }
}

@media (max-width: 490px) {
	.post-thumb img {
		aspect-ratio: 4 / 3;
		width: 100%;
		height: auto;
		display: block;
	}
}
