/*
Theme Name: Municipality News
Description: عرض أخبار البلدية بنمط بسيط بدون هيدر/فوتر
Version: 1.0
Text Domain: municipality-news
*/

:root {
  --primary: #2B388f;
  --tertiary: #C1AB7A;
  --secondary: #EEE8DE;
  --error: #ED1C24;
  --white: #fff;
  --gray: #f5f5f5;
  --black: #000
}

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


body {
  font-family: 'Nunito', 'Segoe UI', Tahoma, sans-serif;
  background-color: var(--secondary);
  color: #333;
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  padding: 0;
  margin: 0;
    background:url('assets/images/image.png') center/cover no-repeat;

}

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

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

.page-title{
  font-size: 2rem;
  color: var(--primary);
  text-align: right;
  margin: 20px 0;
  font-weight: 700;
}
.sticky-header-container {
  position: sticky;
  top: 0;
  /* background: var(--secondary); */
  z-index: 1000;
  width: 100%;
  /* box-shadow: 0 2px 10px rgba(0,0,0,0.05); */
  transition: all 0.3s ease;
}

.sticky-header-container.scrolled {
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  background: rgba(238, 232, 222, 0.95);
}

.category-tabs-container {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #ccc #f0f0f0;
  margin: 0 -20px;
  padding: 0 20px;
}

.category-tabs-container::-webkit-scrollbar {
  height: 6px;
}

.category-tabs-container::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 3px;
}

.category-tabs-container::-webkit-scrollbar-thumb {
  background: var(--tertiary);
  border-radius: 3px;
}

.category-tabs-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.category-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 2px 0;
  min-width: 100%;
  background-color: rgb(219, 218, 226);
  border-radius: 30px;
  border: 1px solid rgb(210, 210, 220);
}

.tab {
  padding: 3px 16px;
  border-radius: 50px;
  background: transparent;
  color: #555;
  text-align: center;
  white-space: nowrap;
  transition: all 0.25s ease;
  cursor: pointer;
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-width: 80px;
  margin-right: 5px;
}

.tab.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.tab:hover:not(.disabled):not(.active) {
  background: rgba(255,255,255,0.8);
  color: var(--primary);
}

.tab.disabled {
  background: #f0f0f0;
  color: #aaa;
  cursor: not-allowed;
  opacity: 0.7;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
  margin-top: 30px;
  align-items: center;
}

.news-card {
  background: var(--white);
  border-radius: 15px;
  border: 1px solid var(--tertiary);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: transform 0.3s ease;
}

.news-card:hover {
  transform: translateY(-5px);
}

.card-image {
  height: 250px;
  overflow: hidden;
  position: relative;
}

.card-img, .placeholder-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--tertiary);
}

.placeholder-img {
  background: linear-gradient(45deg, var(--tertiary), var(--primary));
}

.card-content {
  margin-top: 20px;
}

.post-date {
  display: inline-block;
  background: var(--tertiary);
  color: var(--black);
  padding: 4px 12px;
  border-radius: 12px 0 0 12px;
  font-size: 0.85rem;
  margin-bottom: 12px;
  position: relative;
  right: -15px;
}

.card-title {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--primary);
  transition: color 0.2s;
}

.card-title a:hover {
  color: var(--tertiary);
}

.card-excerpt {
  color: #555;
  margin: 12px 0;
  min-height: 60px;
  line-height: 1.5;
}

.read-more {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 5px 25px;
  border-radius: 30px;
  transition: all 0.2s;
  margin-top: 10px;
}

.read-more:hover {
  background: #1a256f;
  transform: translateX(5px);
}

.no-posts {
  text-align: center;
  padding: 40px;
  font-size: 1.2rem;
  color: #777;
}

.news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  margin-bottom: 20px;
  position: relative;
}

.news-header h1 {
  font-size: 1.6rem;
  color: var(--black);
  font-weight: 700;
  margin: 0;
  flex: 1;
  text-align: center;
}

.back-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--black);
  font-size: 1.3rem;
  text-decoration: none;
  position: absolute;
  right: 0;
}

.news-detail {
  margin-top: 15px;
}

.detail-value{
      width: 100%;
    text-align: left;
}
.featured-image {
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 20px;
  height: 500px;
  border: 2px solid var(--tertiary);
}

.news-img, .placeholder-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-card {
  background: var(--white);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  padding: 15px;
}

.card-header {
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.news-title {
  font-size: 1.6rem;
  color: var(--primary);
  font-weight: 700;
  margin: 0 0 10px 0;
}

.news-content {
  line-height: 1.8;
  color: #444;
}

.news-content p {
  margin-bottom: 15px;
  text-align: justify;
}

.news-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 500;
}

.loading i {
  margin-left: 10px;
  font-size: 1.5rem;
}

.error {
  text-align: center;
  padding: 30px;
  color: var(--error);
  background: rgba(237, 28, 36, 0.05);
  border-radius: 12px;
  margin: 20px 0;
}

@media (max-width: 768px) {
  .container {
    padding: 5px 10px;
  }
  
  .page-title {
    font-size: 1.5rem;
    margin: 15px 0 10px;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  .tab {
    padding: 7px 14px;
    font-size: 0.9rem;
    min-width: 90px;
  }
  
  .category-tabs {
    gap: 0px;
    padding: 2px 0;
    overflow: scroll;
  }
  
  .category-tabs-container {
    margin: 0 -15px;
    padding: 0 15px;
  }
  
  .category-tabs-container::-webkit-scrollbar {
    height: 5px;
  }
  
  .featured-image {
    height: 250px;
  }
  
  .news-card {
    padding: 20px 15px;
  }
  
  .news-title {
    font-size: 1.4rem;
  }
  
  .news-header {
    padding: 5px 0;
  }
  
  .news-header h1 {
    font-size: 1.4rem;
    padding: 0 40px;
  }
  
  .back-arrow {
    right: 20px;
  }
}

@media (max-width: 480px) {
  .post-date {
    padding: 3px 8px;
    font-size: 0.8rem;
  }
  
  .news-header h1 {
    font-size: 1.3rem;
    padding: 0 35px;
  }
  
  .back-arrow {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
  }
  
  .featured-image {
    height: 200px;
  }
}