/*
Theme Name: Silo
Theme URI: https://example.com/silo-theme
Author: MyBlog
Author URI: https://example.com
Description: Silo is a clean, SEO-friendly WordPress theme with category-based silo structure. Perfect for blogs and news sites.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: silo
Tags: blog, news, seo, two-columns, right-sidebar, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* =============================================
   RESET & BASE
============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #222;
  background: #f5f5f0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =============================================
   HEADER
============================================= */
#site-header {
  background: #fff;
  border-bottom: 1px solid #e5e5e0;
  position: sticky;
  top: 0;
  z-index: 999;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}

.site-branding .site-title {
  font-size: 22px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.5px;
}

.site-branding .site-title span { color: #e05a2b; }

.site-branding .site-logo img {
  max-height: 44px;
  width: auto;
}

/* PRIMARY NAV */
#primary-menu-wrap { display: flex; align-items: center; }

#primary-menu {
  display: flex;
  gap: 2px;
  align-items: center;
}

#primary-menu li a {
  font-size: 13px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 4px;
  color: #444;
  display: block;
  transition: background 0.15s, color 0.15s;
}

#primary-menu li a:hover,
#primary-menu li.current-menu-item > a,
#primary-menu li.current_page_item > a {
  background: #f0ede8;
  color: #e05a2b;
}

#primary-menu li.menu-item-has-children { position: relative; }

#primary-menu li.menu-item-has-children > .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 0.5px solid #e0ddd8;
  border-radius: 6px;
  min-width: 180px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 9999;
  padding: 6px 0;
}

#primary-menu li.menu-item-has-children:hover > .sub-menu { display: block; }

#primary-menu .sub-menu li a {
  padding: 8px 16px;
  border-radius: 0;
  font-size: 13px;
}

/* Hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #333;
  border-radius: 2px;
  transition: all 0.3s;
}

/* =============================================
   CATEGORY TABS
============================================= */
#cat-tabs-bar {
  background: #fff;
  border-bottom: 1px solid #e5e5e0;
}

.cat-tabs-inner {
  display: flex;
  overflow-x: auto;
  gap: 0;
  scrollbar-width: none;
}

.cat-tabs-inner::-webkit-scrollbar { display: none; }

.cat-tabs-inner a {
  font-size: 13px;
  font-weight: 500;
  padding: 11px 17px;
  display: block;
  color: #555;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.cat-tabs-inner a:hover,
.cat-tabs-inner a.active {
  color: #e05a2b;
  border-bottom-color: #e05a2b;
}

/* =============================================
   MAIN LAYOUT
============================================= */
#page-wrap {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 28px;
}

/* =============================================
   SECTION TITLES
============================================= */
.section-heading {
  font-size: 14px;
  font-weight: 700;
  color: #111;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-left: 3px solid #e05a2b;
  padding-left: 10px;
  margin-bottom: 16px;
}

/* =============================================
   POST GRID
============================================= */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.post-card {
  background: #fff;
  border-radius: 6px;
  border: 0.5px solid #e8e5e0;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}

.post-card .post-thumb {
  height: 160px;
  overflow: hidden;
  background: #e8e4dc;
  position: relative;
}

.post-card .post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.post-card:hover .post-thumb img { transform: scale(1.04); }

.post-card .no-thumbnail {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ede9e0 0%, #d8d4cb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 32px;
}

.post-card .card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 4px;
}

.cat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #e05a2b;
}

.post-date-small {
  font-size: 10px;
  color: #aaa;
}

.post-card .card-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  padding: 4px 12px 8px;
  color: #111;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card .card-title a { color: #111; }
.post-card .card-title a:hover { color: #e05a2b; }

.post-card .card-author {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 10px;
  border-top: 0.5px solid #f0ece8;
}

.author-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e8e4db;
  overflow: hidden;
  flex-shrink: 0;
}

.author-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.author-avatar-sm .avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #888;
}

.card-author-name { font-size: 11px; color: #777; }

/* =============================================
   LOAD MORE
============================================= */
.load-more-wrap {
  text-align: center;
  margin-bottom: 32px;
}

.load-more-btn {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #e05a2b;
  border: 1px solid #e05a2b;
  padding: 8px 24px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  transition: background 0.15s, color 0.15s;
}

.load-more-btn:hover {
  background: #e05a2b;
  color: #fff;
}

/* =============================================
   PAGINATION
============================================= */
.navigation.pagination {
  margin: 20px 0 32px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.navigation.pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; }

.navigation.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  border: 0.5px solid #e0ddd8;
  background: #fff;
  transition: all 0.15s;
}

.navigation.pagination .page-numbers.current,
.navigation.pagination .page-numbers:hover {
  background: #e05a2b;
  color: #fff;
  border-color: #e05a2b;
}

/* =============================================
   SIDEBAR
============================================= */
.sidebar-area { }

.widget-block {
  background: #fff;
  border-radius: 6px;
  border: 0.5px solid #e8e5e0;
  padding: 16px;
  margin-bottom: 20px;
}

.widget-block-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #999;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid #eee;
}

/* Author Widget */
.author-widget-inner { text-align: center; }

.author-big-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  margin: 0 auto 10px;
  overflow: hidden;
  background: #e8e4db;
  display: flex;
  align-items: center;
  justify-content: center;
}

.author-big-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-big-avatar .initials { font-size: 22px; font-weight: 600; color: #bbb; }

.author-widget-name { font-size: 15px; font-weight: 700; color: #111; }
.author-widget-bio { font-size: 12px; color: #888; line-height: 1.65; margin: 7px 0 12px; }

.author-socials {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.author-socials a {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  transition: opacity 0.15s;
}

.author-socials a:hover { opacity: 0.85; }
.author-socials .s-fb { background: #1877f2; }
.author-socials .s-tw { background: #1da1f2; }
.author-socials .s-yt { background: #ff0000; }
.author-socials .s-ext { background: #e05a2b; }

/* Social Plugin Widget */
.social-links-list { display: flex; flex-direction: column; gap: 10px; }

.social-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #444;
}

.social-icon-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* Popular Posts Widget */
.popular-post-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 0.5px solid #f0ece8;
}

.popular-post-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.popular-thumb {
  width: 64px;
  height: 54px;
  border-radius: 4px;
  overflow: hidden;
  background: #e8e4db;
  flex-shrink: 0;
}

.popular-thumb img { width: 100%; height: 100%; object-fit: cover; }

.popular-meta { flex: 1; }
.popular-cat { font-size: 9px; font-weight: 600; text-transform: uppercase; color: #e05a2b; letter-spacing: 0.4px; }
.popular-title { font-size: 11.5px; font-weight: 600; color: #111; line-height: 1.4; margin-top: 2px; }
.popular-title a { color: #111; }
.popular-title a:hover { color: #e05a2b; }

/* Labels Widget */
.labels-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

.label-tag {
  font-size: 11px;
  color: #555;
  background: #f0ece8;
  border-radius: 3px;
  padding: 3px 9px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, color 0.15s;
}

.label-tag:hover { background: #e05a2b; color: #fff; }
.label-tag .tag-count { font-size: 10px; color: #aaa; }
.label-tag:hover .tag-count { color: rgba(255,255,255,0.75); }

/* Simple Links Widget */
.simple-links-list li {
  font-size: 12px;
  color: #666;
  padding: 5px 0;
  border-bottom: 0.5px solid #f5f5f2;
}

.simple-links-list li:last-child { border-bottom: none; }
.simple-links-list li a { color: #666; }
.simple-links-list li a:hover { color: #e05a2b; }

/* =============================================
   SINGLE POST
============================================= */
.single-post-wrap { background: #fff; border-radius: 6px; border: 0.5px solid #e8e5e0; overflow: hidden; }

.single-featured-img img { width: 100%; max-height: 420px; object-fit: cover; }

.single-post-body { padding: 24px; }

.single-post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.single-post-title { font-size: 24px; font-weight: 700; color: #111; line-height: 1.35; margin-bottom: 16px; }

.single-post-author-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 0.5px solid #f0ece8;
  border-bottom: 0.5px solid #f0ece8;
  margin-bottom: 20px;
}

.single-author-avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: #e8e4db; }
.single-author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.single-author-name { font-size: 13px; font-weight: 600; color: #333; }
.single-author-date { font-size: 11px; color: #aaa; }

.entry-content { font-size: 15px; line-height: 1.8; color: #333; }
.entry-content p { margin-bottom: 16px; }
.entry-content h2 { font-size: 20px; font-weight: 700; margin: 24px 0 12px; }
.entry-content h3 { font-size: 17px; font-weight: 700; margin: 20px 0 10px; }
.entry-content ul, .entry-content ol { padding-left: 24px; margin-bottom: 16px; }
.entry-content li { margin-bottom: 6px; }
.entry-content a { color: #e05a2b; }
.entry-content blockquote { border-left: 3px solid #e05a2b; padding-left: 16px; color: #666; font-style: italic; margin: 20px 0; }

/* Tags */
.post-tags { margin-top: 20px; padding-top: 16px; border-top: 0.5px solid #f0ece8; display: flex; flex-wrap: wrap; gap: 6px; }
.post-tags .tag-link { font-size: 11px; color: #666; background: #f0ece8; padding: 3px 9px; border-radius: 3px; }
.post-tags .tag-link:hover { background: #e05a2b; color: #fff; }

/* Comments */
.comments-area { margin-top: 24px; background: #fff; border-radius: 6px; border: 0.5px solid #e8e5e0; padding: 24px; }
.comments-title { font-size: 16px; font-weight: 700; margin-bottom: 20px; }

.comment-list { margin-bottom: 28px; }
.comment { padding: 14px 0; border-bottom: 0.5px solid #f0ece8; }
.comment:last-child { border-bottom: none; }
.comment-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.comment-author-name { font-size: 13px; font-weight: 600; }
.comment-date { font-size: 11px; color: #aaa; }
.comment-body { font-size: 13px; color: #555; line-height: 1.7; }

.comment-form-wrap .form-group { margin-bottom: 14px; }
.comment-form-wrap label { font-size: 12px; font-weight: 600; color: #555; display: block; margin-bottom: 5px; }
.comment-form-wrap input,
.comment-form-wrap textarea {
  width: 100%;
  padding: 9px 12px;
  border: 0.5px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  background: #fafaf8;
  transition: border-color 0.15s;
}
.comment-form-wrap input:focus,
.comment-form-wrap textarea:focus { outline: none; border-color: #e05a2b; }
.comment-form-wrap textarea { height: 110px; resize: vertical; }
.submit-btn {
  background: #e05a2b;
  color: #fff;
  border: none;
  padding: 9px 22px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.submit-btn:hover { background: #c94d22; }

/* =============================================
   FOOTER
============================================= */
#site-footer {
  background: #fff;
  border-top: 0.5px solid #ddd;
  margin-top: 20px;
}

.footer-top {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 20px 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
}

.footer-brand .site-title { font-size: 20px; font-weight: 700; color: #111; margin-bottom: 10px; }
.footer-brand .site-title span { color: #e05a2b; }
.footer-brand p { font-size: 12px; color: #888; line-height: 1.7; max-width: 240px; }

.footer-col-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #888;
  margin-bottom: 12px;
}

.footer-link-list li { margin-bottom: 7px; }
.footer-link-list li a { font-size: 12.5px; color: #666; transition: color 0.15s; }
.footer-link-list li a:hover { color: #e05a2b; }

.footer-bottom {
  border-top: 0.5px solid #eee;
  padding: 14px 20px;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-bottom-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-bottom-nav a { font-size: 11.5px; color: #999; }
.footer-bottom-nav a:hover { color: #e05a2b; }
.footer-credit { font-size: 11.5px; color: #bbb; }
.footer-credit a { color: #e05a2b; }

/* =============================================
   COOKIE NOTICE
============================================= */
#cookie-notice {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #222;
  color: #eee;
  font-size: 12.5px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 9999;
  flex-wrap: wrap;
}

#cookie-notice a { color: #e05a2b; }

.cookie-accept-btn {
  background: #e05a2b;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 900px) {
  #page-wrap {
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 10px; }

  .menu-toggle { display: flex; }

  #primary-menu-wrap {
    display: none;
    width: 100%;
    padding-bottom: 10px;
  }

  #primary-menu-wrap.active { display: flex; }

  #primary-menu {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 2px;
  }

  #primary-menu li { width: 100%; }
  #primary-menu li a { width: 100%; }

  .post-grid { grid-template-columns: 1fr; }

  .footer-top { grid-template-columns: 1fr; }

  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* =============================================
   ARCHIVE / CATEGORY PAGE
============================================= */
.archive-header {
  background: #fff;
  border: 0.5px solid #e8e5e0;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.archive-title { font-size: 18px; font-weight: 700; color: #111; }
.archive-description { font-size: 13px; color: #888; margin-top: 4px; }

/* =============================================
   404 PAGE
============================================= */
.error-404-wrap {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: 6px;
  border: 0.5px solid #e8e5e0;
}

.error-404-wrap h1 { font-size: 80px; font-weight: 700; color: #e05a2b; line-height: 1; }
.error-404-wrap h2 { font-size: 22px; color: #333; margin: 10px 0 6px; }
.error-404-wrap p { font-size: 14px; color: #888; margin-bottom: 20px; }
.error-404-wrap .back-home { display: inline-block; background: #e05a2b; color: #fff; padding: 10px 24px; border-radius: 4px; font-size: 13px; font-weight: 600; }

/* =============================================
   SEARCH FORM
============================================= */
.search-form { display: flex; gap: 0; margin-bottom: 20px; }
.search-form input[type="search"] {
  flex: 1;
  padding: 9px 14px;
  border: 0.5px solid #ddd;
  border-right: none;
  border-radius: 4px 0 0 4px;
  font-size: 13px;
  font-family: inherit;
}
.search-form button {
  padding: 9px 16px;
  background: #e05a2b;
  color: #fff;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 13px;
}
