/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
    font-family: "Inter", "Segoe UI", sans-serif;
    min-height: 100%;
    background: #071428;
    margin: 0;
    padding: 0;
    color: #222;
}

.post-detail-title {
    font-size: 2.1rem;
    margin-bottom: 20px;
    font-weight: 700;
    color: #222;
}

.post-detail-meta {
    color: #777;
    font-size: .9rem;
    margin-bottom: 25px;
}

.post-detail-content {
    font-size: 1.1rem;
    color: #333;
}

.back-link {
    display:block;
    margin: 20px;
    text-decoration: none;
    font-size: 1rem;
    color: #444;
    background: #f3f3f3;
    padding: 8px 14px;
    border-radius: 8px;
    transition: .2s;
}

.back-link:hover {
    background: #e0e0e0;
} 


@media (max-width: 600px) {

    .post-detail-title {
        font-size: 1.7rem;
    }

    .post-detail-content {
        font-size: 1rem;
    }
}

.post-image {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 12px;
    margin: 20px 0;
    display: block;
}

.post-detail-image img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}


h1, h2 {
    margin-bottom: 20px;
    text-align: center;
}


input, textarea {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
}

button {
    background: #4a6cf7;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
}

button:hover {
    background: #3d59d8;
}


.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box button {
    width: 120px;
}


.admin-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.admin-bar a {
    background: #4a6cf7;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
}

.post {
    background: #fafafa;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.post h2 a {
    color: #222;
    text-decoration: none;
}


.post-img-box {
    width: 100%;
    overflow: hidden;     /* opcional */
    border-radius: 10px;
    margin-bottom: 12px;
}

.post-img {
    width: 100%;
    height: auto;         
    object-fit: contain;  
    display: block;
}

.edit-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 7px 12px;
    background: #333;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
}

.pagination {
    text-align: center;
    margin-top: 25px;
}

.pagination a {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin: 2px;
    text-decoration: none;
    color: #333;
}

.pagination a.active {
    background: #4a6cf7;
    color: #fff;
}

@media (max-width: 600px) {
    .search-box {
        flex-direction: column;
    }
    .post-img-box {
        height: 180px;
    }
} 


/* HEADER */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 800;
}

/* ADMIN BUTTON */
.admin-btn {
  background: #4a6cf7;
  color: white;
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: .2s;
}

.admin-btn:hover {
  background: #365ae0;
}

/* SEARCH BAR */
.search-box {
  margin-bottom: 30px;
  display: flex;
  gap: 10px;
}

.search-box input {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 1rem;
}

.search-box button {
  background: #4a6cf7;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

/* GRID DE POSTS */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

/* POST CARD */
.post {
    position: relative;
}

.post-footer {
    text-align: right;
    margin-top: 10px;
}

.post:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

.post h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.post h2 a {
  text-decoration: none;
  color: #111;
}

.post p {
  color: #555;
  margin-bottom: 12px;
  line-height: 1.6;
}

.post small {
  font-size: .85rem;
  color: #777;
}

/* PAGINACIÓN */
.pagination {
  text-align: center;
  margin-top: 30px;
}

.pagination a {
  display: inline-block;
  padding: 10px 15px;
  margin: 5px;
  border-radius: 8px;
  text-decoration: none;
  background: #fff;
  border: 1px solid #ddd;
}

.pagination a.active {
  background: #4a6cf7;
  color: #fff;
  border-color: #4a6cf7;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    gap: 12px;
  }
  .search-box {
    flex-direction: column;
  }
}

/* --- FORM Nuevo Post --- */
.container {
    width: 100%;
    max-width: 800px;
    margin: 60px auto;
    background: #ffffff;
    padding: 40px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}



h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 25px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

form input,
form textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 1rem;
    background: #fafafa;
}

form input:focus,
form textarea:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.25);
}

button {
    background: #4a6cf7;
    color: white;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 700;
    transition: .2s ease;
}

button:hover {
    background: #365ae0;
}

a {
    display: inline-block;
    margin-top: 18px;
    text-decoration: none;
    font-weight: 600;
    color: #4a6cf7;
}

a:hover {
    text-decoration: underline;
}

.btn-read {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: #4a6cf7;
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: .2s ease;
}

.btn-read:hover {
    background: #365ae0;
}

.btn-read::after {
    content: " →";
}


/* Logo section Starts */
.btn-logo {
  position: absolute;
  width: 77px;
  height: 77px;
  top: 7px;
  /*bottom:20px;*/
  left: 9px;
  background: transparent;
  z-index: 5000;
}

.img-responsive3 {
  width: 100px;
  top: 45px;
  left: 5px;
}

@media only screen and (min-width: 320px) and (max-width: 768px) {
  .btn-logo {
    width: 55px;
  }
}
/* Logo section Ends */



/* Logo section Starts */
.btn-wa {
  position: fixed;
  width: 77px;
  height: 77px;
  bottom:20px;
  right: 15px;
  background: transparent;
  z-index: 5000;
}

.img-responsive-wa {
  width: 70px;
  bottom: 55px;
  right: 15px;
}

@media only screen and (min-width: 320px) and (max-width: 768px) {
  .btn-wa {
    width: 35px;
  }
}
/* Logo section Ends */

footer {
  margin-top: auto;
    text-align: center;
    color: #FFFFFF;
}

.volver-container {
    text-align: right;
    width: 100%;
}

.btn-volver {
    align-content: right;
    display: inline-block;
    padding: 10px 20px;
    color: #f8f9fb;
    font-weight: 600;
    text-decoration: none;       
    transition: 0.25s ease;    
}

.btn-volver:hover {    
    color: #00e5ff;
    transform: translateY(-2px);    
}
