/* ==========================================================================
   Additions for the admin-managed content & blog (loaded after style.css)
   ========================================================================== */

/* Active menu item */
.topnav a.nav-active { color: var(--primary-color); font-weight: 600; }

/* Footer extras */
.footer-plain-link { color: inherit; text-decoration: none; }
.footer-plain-link:hover { color: var(--primary-color); }
.footer-copyright {
  text-align: center;
  font-size: 0.85rem;
  padding: 1rem;
  border-top: 1px solid #eee;
  color: #555;
  background: #fff;
}

/* Form validation notice */
.form-notice {
  max-width: 640px;
  margin: 1.5rem auto 0;
  padding: 0.9rem 1.2rem;
  border-radius: 8px;
  background: #fff4e5;
  border: 1px solid #ffc27a;
  color: #7a4100;
  text-align: center;
}
.form-intro { max-width: 900px; margin: 1rem auto 0; padding: 0 1.5rem; text-align: center; }

/* Rich text written in the admin editor */
.cms-content img { max-width: 100%; height: auto; border-radius: 8px; }
.cms-content iframe { max-width: 100%; }
.cms-content .ql-align-center { text-align: center !important; }
.cms-content .ql-align-right { text-align: right !important; }
.cms-content .ql-align-justify { text-align: justify !important; }
.cms-content blockquote { border-left: 4px solid var(--primary-color); padding: 0.4rem 1rem; margin: 1rem 0; font-style: italic; }
.cms-content pre { background: #1e1e1e; color: #eee; padding: 1rem; border-radius: 8px; overflow-x: auto; }
.cms-content ul, .cms-content ol { margin: 0.8rem 0 0.8rem 1.4rem; }

/* ---------- Blog: listing ---------- */
.blog-hero {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  background: linear-gradient(135deg, rgba(255, 125, 0, 0.12), rgba(100, 149, 237, 0.15));
}
.blog-hero h1 { font-size: clamp(1.8rem, 3.5vw, 3rem); margin-bottom: 0.6rem; }
.blog-hero-text { max-width: 720px; margin: 0 auto 1.4rem; color: #444; }
.blog-search { display: flex; max-width: 460px; margin: 0 auto; border: 2px solid #222; border-radius: 40px; overflow: hidden; background: #fff; }
.blog-search input { flex: 1; border: 0; padding: 0.75rem 1.2rem; font-size: 1rem; outline: none; background: transparent; }
.blog-search button { border: 0; background: var(--primary-color); color: #fff; padding: 0 1.3rem; cursor: pointer; font-size: 1rem; }
.blog-search button:hover { background: var(--button-pressed); }

.blog-wrap { max-width: 1200px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.blog-cats { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-bottom: 2rem; }
.blog-cats a {
  padding: 0.45rem 1rem; border: 2px solid #222; border-radius: 30px;
  color: #222; text-decoration: none; font-size: 0.9rem;
}
.blog-cats a.active, .blog-cats a:hover { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.blog-result-note { text-align: center; margin-bottom: 1.5rem; color: #555; }
.blog-result-note a { color: var(--primary-color); }

.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; width: 100%; }
.blog-card {
  background: #fff; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08); transition: transform 0.25s, box-shadow 0.25s;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12); }
.blog-card.is-featured { outline: 3px solid var(--primary-color); }
.blog-card-img { display: block; aspect-ratio: 16 / 9; background: #f2f2f2; overflow: hidden; }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s; }
.blog-card:hover .blog-card-img img { transform: scale(1.04); }
.blog-card-placeholder {
  display: flex; align-items: center; justify-content: center; height: 100%;
  font-size: 3rem; color: #fff; background: linear-gradient(135deg, #ff7d00, #ffc46b);
}
.blog-card-body { padding: 1.2rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.blog-card-body h3 { font-size: 1.15rem; line-height: 1.4; margin: 0.4rem 0 0.6rem; }
.blog-card-body h3 a { color: #111; text-decoration: none; }
.blog-card-body h3 a:hover { color: var(--primary-color); }
.blog-card-body p { font-size: 0.92rem; color: #555; line-height: 1.6; flex: 1; }
.blog-read-more { margin-top: 1rem; color: var(--primary-color); font-weight: 600; text-decoration: none; font-size: 0.9rem; }
.blog-meta { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.8rem; color: #777; align-items: center; }
.blog-cat { background: rgba(255, 125, 0, 0.12); color: var(--button-pressed); padding: 0.15rem 0.6rem; border-radius: 20px; font-weight: 600; }

.blog-empty { text-align: center; color: #777; padding: 3rem 1rem; }
.blog-empty i { color: var(--primary-color); margin-bottom: 1rem; }
.blog-empty h1 { margin-bottom: 0.6rem; }
.blog-empty .homepage-section-cta-btn, .home-blog .homepage-section-cta-btn { display: inline-block; width: auto; padding: 0 1.8rem; line-height: 45px; white-space: nowrap; }
.blog-empty .homepage-section-cta-btn { margin-top: 1.5rem; }

.blog-pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem; margin-top: 2.5rem; }
.blog-pagination a { padding: 0.45rem 0.85rem; border: 1px solid #ccc; border-radius: 6px; color: #222; text-decoration: none; }
.blog-pagination a.active, .blog-pagination a:hover { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }

/* Homepage "latest posts" */
.home-blog { display: flex; flex-direction: column; align-items: center; padding: 4vw 7vw; background: var(--grey-bg); }
.home-blog .blog-grid { margin-bottom: 2.5rem; }

/* ---------- Blog: single post ---------- */
.post { max-width: 820px; margin: 0 auto; padding: 3rem 1.5rem 2rem; }
.post-breadcrumb { font-size: 0.85rem; color: #777; margin-bottom: 1rem; }
.post-breadcrumb a { color: var(--primary-color); text-decoration: none; }
.post-header h1 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); line-height: 1.25; margin-bottom: 0.9rem; }
.post-header .blog-meta { font-size: 0.9rem; margin-bottom: 1.8rem; }
.post-cover { width: 100%; max-height: 460px; object-fit: cover; border-radius: 14px; margin-bottom: 2rem; }
.post-content { font-size: 1.05rem; line-height: 1.85; color: #222; }
.post-content p { margin-bottom: 1.1rem; }
.post-content h2, .post-content h3, .post-content h4 { margin: 2rem 0 0.8rem; line-height: 1.3; }
.post-content a { color: var(--primary-color); }
.post-tags { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.post-tags a { background: #f2f2f2; color: #333; padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.85rem; text-decoration: none; }
.post-tags a:hover { background: var(--primary-color); color: #fff; }
.post-share { margin-top: 1.8rem; display: flex; align-items: center; gap: 0.8rem; }
.post-share a {
  width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: #222; color: #fff; text-decoration: none;
}
.post-share a:hover { background: var(--primary-color); }
.post-author { display: flex; gap: 1rem; align-items: center; margin-top: 2.2rem; padding: 1.2rem; border-radius: 12px; background: #fafafa; border: 1px solid #eee; }
.post-author img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.post-author p { font-size: 0.9rem; color: #555; margin-top: 0.2rem; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #eee; }
.post-nav a { color: #222; text-decoration: none; font-weight: 600; max-width: 48%; }
.post-nav a:hover { color: var(--primary-color); }
.related-posts { background: #fff; }

/* ---------- Responsive ---------- */
@media screen and (max-width: 1000px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .home-blog { padding: 10vw 5vw; }
  .post-nav { flex-direction: column; }
  .post-nav a { max-width: 100%; }
}
