* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f4f4f4;
  color: #222;
}

/* Outer spacing wrapper */
.outer-container {
  padding: 20px;
  height: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}


/* Animation when load  */
section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}




/* Centered content area with nice spacing */

.visible{
    padding-top: 0px;
}

.page-container {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 40px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

h2 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 10px;
}

.subtext {
  color: #555;
  margin-bottom: 25px;
  font-size: 15px;
}

#content-area {
  display: flex;
  gap: 20px;
  flex-grow: 1;
}



/* Editor + preview styling */


/* Toolbar editing  */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.toolbar button {
  border: 1px solid #ffffff;
  background: #8345e7;
  padding: 6px 10px;
  font-size: 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.toolbar button:hover {
  background: #7f81c3;
}

.toolbar button.active {
  background-color: #ff8c42; /* warm orange */
  color: #ffffff;
  border-radius: 4px;
  /* box-shadow: 0 0 5px #ff8c42; */
}





/* Editor box */

.editor {
  width: 50%;
  height: 70vh;
  padding: 20px;
  border-radius: 8px;
  background: #E2DFD2;
  overflow-y: auto;
  font-size: 16px;
  line-height: 1.5;
}


textarea,
#preview {
  width: 50%;
  height: 70vh;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #E2DFD2;
  overflow: auto;
  font-size: 16px;
  line-height: 1.5;
  transition: all 0.2s ease;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

textarea:focus {
  border-color: #0077ff;
  background: #E2DFD2;
  outline: none;
  box-shadow: 0 0 4px rgba(0, 119, 255, 0.2);
}

#preview {
  white-space: pre-wrap;
  background: #E2DFD2;
  border: 1px solid #dddddd;
}



/* Action buttons */
.actions {
  margin-top: 25px;
  display: flex;
  justify-content: flex-end;
}



/* PUBLISH BUTTON  */
button {
  background-color: #0077ff;
  color: #fff;
  border: none;
  padding: 12px 20px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  background-color: #005fcc;
}



/* BACK TO HOME BUTTON  */
.back-home-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: #0077ff;
  color: white;
  padding: 10px 18px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-home-btn:hover {
  background-color: #005fcc;
}

.page-container {
  position: relative;
  padding: 20px;
}



/* ===== FOOTER (for write.html) ===== */

.site-footer {
  background: #fff;
  border-top: 1px solid #ddd;
  padding: 2rem 0;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-brand p {
  color: #555;
  font-size: 0.9rem;
  max-width: 280px;
  line-height: 1.5;
}

.footer-links h3,
.footer-legal h3,
.social h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #111;
}

.footer-links a,
.footer-legal a {
  display: block;
  color: #555;
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-legal a:hover {
  color: #0077ff;
}

.footer-links ul,
.footer-legal ul,
.social-links {
  list-style: none;
  padding: 0;
  margin: 0;
}


/* Social section */
.social-links {
  list-style: none;
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: #333;
  font-size: 1.4rem;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: #0077ff;
}


/* Copyright line */
.copyright {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: #666;
  border-top: 1px solid #eee;
  padding-top: 1rem;
}



/* Responsive */
@media (max-width: 768px) {
  #content-area {
    flex-direction: column;
  }

  textarea,
  #preview {
    width: 100%;
    height: 300px;
    resize: vertical;
    box-sizing: border-box;
  }
  .editor {
    width: 100%;
    height: 300px;
    resize: vertical;
    box-sizing: border-box;
  }

  .back-home-btn {
    padding: 10px;
    width: 40px;
    height: 40px;
    font-size: 18px;
    text-indent: -9999px; /* hide text off-screen */
    position: absolute;
  }
  .back-home-btn::before {
    content: "<-";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-indent: 0;
    font-size: 18px;
    color: white;
  }

    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

  .social-links {
    justify-content: center;
  }

  .footer-brand p {
    margin: 0 auto;
    text-align: center;
  }
}
