/* =========================
   RESET + VARIÁVEIS
========================= */
:root {
  --bg: #f4f4f4;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #666;
  --accent: #ff3d00;
  --header: #111;
  --shadow: rgba(0,0,0,.08);
  --radius: 14px;
  --transition: .25s ease;
}

body.dark {
  --bg: #0e0e0e;
  --card: #161616;
  --text: #f1f1f1;
  --muted: #999;
  --accent: #ff5722;
  --header: #000;
  --shadow: rgba(0,0,0,.6);
}

/* =========================
   BASE (MOBILE FIRST)
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  opacity: .85;
}

/* =========================
   HEADER (FLEX)
========================= */
header {
  background: linear-gradient(135deg, #000, #1a1a1a);
  color: #fff;
  padding: 16px;
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

header h1 {
  margin: 0;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

nav a {
  color: #ddd;
  font-weight: 500;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

nav a:hover::after {
  width: 100%;
}

/* =========================
   DARK MODE BOTÃO
========================= */
.toggle {
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 1.3rem;
  cursor: pointer;
}

/* =========================
   CONTAINER (GRID)
========================= */
.container {
  width: 100%;
  padding: 20px 14px;
  display: grid;
  gap: 32px;
}

/* =========================
   POST CARD
========================= */
.post {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 20px 40px var(--shadow);
  animation: fadeUp .6s ease both;
  transition: transform var(--transition), box-shadow var(--transition);
}

.post:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 60px var(--shadow);
}

.post p {
  font-size: clamp(.95rem, 2.5vw, 1.05rem);
}

.post h1,
.post h2,
.post h3 {
  margin-top: 1.4em;
}

.post small {
  display: block;
  margin-top: 14px;
  font-size: .85rem;
  color: var(--muted);
}

/* =========================
   TAGS (FLEX)
========================= */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tags a {
  background: rgba(255,61,0,.1);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: .8rem;
}

.tags a:hover {
  background: var(--accent);
  color: #fff;
}

/* =========================
   PAGINAÇÃO
========================= */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination a {
  padding: 10px 16px;
  background: var(--card);
  border-radius: 50px;
  box-shadow: 0 8px 20px var(--shadow);
  font-weight: 600;
}

.pagination a:hover {
  background: var(--accent);
  color: #fff;
}

/* =========================
   ADMIN
========================= */
.admin-box {
  background: var(--card);
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: 0 20px 40px var(--shadow);
}

.admin-post {
  padding: 14px 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.admin-post:last-child {
  border-bottom: none;
}

/* =========================
   BOTÕES
========================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 50px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), #ff8a50);
  color: #fff;
  box-shadow: 0 10px 25px rgba(255,61,0,.4);
  transition: var(--transition);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(255,61,0,.6);
}

/* =========================
   FORMULÁRIOS
========================= */
input,
textarea {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid #ddd;
  font-size: 1rem;
  margin-bottom: 14px;
}

body.dark input,
body.dark textarea {
  background: #111;
  border-color: #222;
  color: #fff;
}

/* =========================
   ANIMAÇÃO
========================= */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* =========================
   TABLET (>= 600px)
========================= */
@media (min-width: 600px) {
  .container {
    padding: 30px 20px;
  }

  .post {
    padding: 26px;
  }
}

/* =========================
   DESKTOP (>= 1024px)
========================= */
@media (min-width: 1024px) {

  .header-inner {
    flex-direction: row;
    justify-content: space-between;
    max-width: 1100px;
    margin: auto;
  }

  .container {
    max-width: 900px;
    margin: auto;
  }
}
/* =========================
   LOGIN PAGE
========================= */
.login-wrapper {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #000, #1a1a1a);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  padding: 32px 26px;
  border-radius: var(--radius);
  box-shadow: 0 30px 60px rgba(0,0,0,.35);
  animation: fadeUp .6s ease both;
}

.login-card h1 {
  margin: 0 0 8px;
  text-align: center;
  font-size: 1.5rem;
}

.login-card p {
  margin: 0 0 22px;
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
}

.login-card input {
  margin-bottom: 14px;
}

.login-card .btn {
  width: 100%;
  margin-top: 6px;
}

.login-error {
  background: rgba(255, 0, 0, .1);
  color: #ff3d00;
  padding: 10px 14px;
  border-radius: 8px;
  text-align: center;
  font-size: .9rem;
  margin-bottom: 14px;
}
/* =========================
   ADMIN POST PAGE
========================= */
.post-form {
  display: grid;
  gap: 16px;
}

.muted {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 10px;
}

/* Upload bonito */
.file-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
  color: var(--accent);
}

.file-upload input {
  display: none;
}

.file-upload span {
  background: rgba(255,61,0,.1);
  padding: 10px 16px;
  border-radius: 50px;
  transition: var(--transition);
}

.file-upload:hover span {
  background: var(--accent);
  color: #fff;
}

/* TinyMCE */
.tox-tinymce {
  border-radius: var(--radius) !important;
  overflow: hidden;
}
/* =========================
   INDEX / POSTS
========================= */
.post {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-image img {
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Conteúdo do TinyMCE */
.post-content {
  line-height: 1.7;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin-top: 1.4em;
}

.post-footer {
  display: flex;
  justify-content: flex-end;
  color: var(--muted);
  font-size: .85rem;
  border-top: 1px solid rgba(0,0,0,.05);
  padding-top: 10px;
}

/* Paginação melhorada */
.pagination a {
  opacity: .6;
}

.pagination a.active {
  background: var(--accent);
  color: #fff;
  opacity: 1;
  box-shadow: 0 12px 30px rgba(255,61,0,.5);
}

.pagination a:hover {
  opacity: 1;
}
