/* =========================
   VARIABLES (LIGHT MODE)
========================= */
:root {
  --radius: 14px;
  --gap: 14px;
  --bg: #fff7f6;
  --text: #2c1216;
  --muted: #7a3b44;
  --accent: #7b1e2d;
  --card: #fff;
  --glass: rgba(255,246,246,0.7);
  --cover-gradient: linear-gradient(180deg, rgba(0,0,0,0.06), rgba(0,0,0,0.08));
  --transition: 0.4s cubic-bezier(0.77,0,0.175,1);
}

/* =========================
   VARIABLES (DARK MODE)
========================= */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --text: #e6e6e6;
    --muted: #b0a6a8;
    --accent: #ff6b6b;
    --card: rgba(28,28,30,0.9);
    --glass: rgba(40,40,40,0.6);
    --cover-gradient: linear-gradient(180deg, rgba(0,0,0,0.3), rgba(0,0,0,0.6));
  }
}

/* =========================
   GLOBAL STYLES
========================= */
html, body {
  height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }

/* =========================
   APP LAYOUT
========================= */
.app {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--gap) + env(safe-area-inset-top,16px)) var(--gap) var(--gap);
  transition: transform var(--transition), filter var(--transition);
}

/* =========================
   HEADER
========================= */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.burger {
  width: 30px;
  height: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform var(--transition);
}

.burger span {
  display: block;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  transition: all var(--transition);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0px;
  position: relative;
  padding-left: 60px;
}

.logo svg {
  width: 75px;
  height: 75px;
  position: absolute;
  left: -13px;
  top: -13px;
}

/* =========================
   MARKERS & TEXT
========================= */
.mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.muted a { text-decoration: none; }

/* =========================
   SIDEBAR
========================= */
#menuToggle { display: none; }

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 250px;
  height: 100%;
  background: var(--card);
  padding: 20px;
  box-shadow: -2px 0 18px rgba(0,0,0,0.2);
  transform: translateX(100%) scale(0.95);
  opacity: 0;
  transition: transform var(--transition), opacity var(--transition);
  overflow-y: auto;
  z-index: 100;
}

#menuToggle:checked ~ .sidebar {
  transform: translateX(0) scale(1);
  opacity: 1;
}

.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { padding: 7px 0; cursor: pointer; font-weight: 600; }
.sidebar li > ul { padding-left: 15px; display: none; }
.sidebar li:hover > ul { display: block; }
.sidebar a { color: var(--text); text-decoration: none; }

/* Push content and fade */
#menuToggle:checked ~ .app {
  transform: translateX(-250px) scale(0.98);
  filter: brightness(0.85);
}

/* =========================
   SECTIONS & CARDS
========================= */
.sections { display: flex; flex-direction: column; gap: 14px; }

.section-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  margin: 6px 2px;
}

.card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, background 0.3s ease;
}

.card:hover { transform: scale(1.02); }

.cover {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  border-radius: var(--radius);
  position: relative;
  background: linear-gradient(180deg, rgba(123,30,45,0.92), rgba(123,30,45,0.76)), var(--cover-gradient);
  color: white;
  background-position: center;
  background-size: cover;
  aspect-ratio: 3/1;
  background-repeat: no-repeat;
}

.cover .title {
  font-size: 16px;
  margin: 0;
  background: rgba(0,0,0,0.6);
  padding: 5px 10px;
  border-radius: 10px;
  width: fit-content;
}

.cover .subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.9);
  margin-top: 4px;
  font-weight: 600;
  background: rgba(0,0,0,0.4);
  padding: 5px 10px;
  border-radius: 10px;
  width: fit-content;
}

.excerpt {
  padding: 12px 14px 16px;
  font-size: 13px;
  color: var(--muted);
}

.grid-item svg {
    max-width: 60%;
    height: auto;
    margin: 10px auto 0 auto;
    width: auto;
    display: block;
}

/* =========================
   ARTICLES & COMMENTS
========================= */
.article {
  margin-top: 14px;
  padding: 16px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 6px 18px rgba(0,0,0,0.04);
  transition: transform 0.4s ease, background 0.3s ease;
}

.article h1 {
  margin-top: 0;
  font-size: 18px;
  margin-bottom: 0;
}

.article img { width: 100%; border-radius: 5px; }

.comments { margin-top: 24px; }

.comments h2 { font-size: 16px; margin-bottom: 10px; }

.comment-list { display: flex; flex-direction: column; gap: 10px; }

.comment {
  background: var(--card);
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.comment .author { font-weight: 700; color: var(--accent); }
.comment .text { font-size: 14px; margin-top: 4px; }

/* =========================
   FORM
========================= */
form.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

form.comment-form input,
form.comment-form textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: var(--glass);
  color: var(--text);
}

form.comment-form button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
}

/* =========================
   FOOTER
========================= */
footer {
  text-align: center;
  background: var(--accent);
  color: white;
  padding: 1rem;
  font-size: 0.9rem;
}

footer a {
  color: #ffeaea;
  margin: 0 0.5rem;
  text-decoration: none;
}

footer a:hover { text-decoration: underline; }

/* =========================
   PAGINATION
========================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin: 2rem 0;
  opacity: 0;
}

.pagination a {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 5px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.3s ease, color 0.3s ease;
}

.pagination a:hover {
  background: var(--accent);
  color: white;
}

.pagination a.active {
  background: var(--accent);
  color: white;
}

/* =========================
   TAGS
========================= */

.tags {
	margin-bottom: 1em;
}

.tags .tag {
	display: inline-block;
	margin: 0 .2em .2em 0;
	padding: .3em .5em;
	background: rgba(0,0,0,0.6);
	color: #fff;
	border-radius: 10px;
}

/* =========================
   BLOCKS
========================= */
.blocks {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.block {
  display: flex;
  gap: 1rem;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 0.5rem;
  opacity: 0;
}

.block .cover {
  flex: 0 0 120px;
  height: 120px;
  overflow: hidden;
  border-radius: 12px;
}

.block .content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.block .title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.3rem 0;
}

.block .desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.5rem 0;
}

.block .more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

.block .more:hover { color: #b03030; }

/* =========================
   GRID BLOCKS
========================= */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin: 1rem 0;
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

.grid-item {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
  padding: 0 1em 0 1em;
}

.grid-item:hover {
  transform: scale(1.02);
}

.grid-item .cover, .grid-item img {
width: 85%;
    aspect-ratio: 4 / 3;
    background-position: center;
    background-size: cover;
    border-radius: var(--radius);
    position: relative;
    margin: 1em auto 0 auto;
}

.grid-item .title, .grid-item h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0.5rem;
  text-align: center;
}

/* =========================
   ANIMATIONS
========================= */
.fade-up {
  transform: translateY(10px);
  animation: fadeUp 0.8s ease forwards;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}