/* css/republic-styles.css */

/* --- Секція Hero (без змін) --- */
#republic-hero {
  background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../images/republic-hero-bg.jpg') no-repeat center center/cover;
  padding: 60px 0;
  text-align: center;
  color: white;
  border-bottom: 3px solid var(--secondary-accent);
}
#republic-hero h1 { font-size: 3em; margin: 0; text-shadow: 2px 2px 4px rgba(0,0,0,0.7); }
#republic-hero p { font-size: 1.2em; opacity: 0.9; }

/* --- Основний макет: Сайдбар зліва --- */
#republic-page-content {
  padding: 40px 0 60px 0;
}
.republic-layout-sidebar-left {
  display: flex;
  flex-direction: row;
  gap: 30px;
}
.republic-sidebar {
  flex: 1; /* Займає 1 частину */
  min-width: 280px;
}
.republic-main-content {
  flex: 3; /* Займає 3 частини */
}

/* --- Сайдбар --- */
.sidebar-widget {
  background-color: var(--card-bg);
  padding: 20px 25px;
  border-radius: 8px;
  margin-bottom: 25px;
  border: 1px solid var(--border-color);
}
.sidebar-widget h3 {
  margin: 0 0 15px 0;
  font-size: 1.3em;
  color: var(--accent-color);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

/* --- Віджет Канцлера --- */
#chancellor-widget h3 { text-align: center; }
#chancellor-widget .chancellor-name {
  font-size: 1.8em;
  font-weight: bold;
  color: var(--secondary-accent);
  margin: 0;
  text-align: center;
}
#chancellor-widget .chancellor-term {
  margin: 5px 0 0 0;
  font-size: 0.9em;
  opacity: 0.8;
  text-align: center;
}

/* --- Віджет навігації --- */
.widget-nav-tabs {
  display: flex;
  flex-direction: column; /* Кнопки одна під одною */
  gap: 10px;
}
.tab-link {
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  background: none;
  color: var(--text-color);
  cursor: pointer;
  font-size: 1em;
  font-weight: 500;
  border-radius: 5px;
  text-align: left; /* Текст зліва */
  transition: all 0.2s ease-in-out;
}
.tab-link:hover {
  background-color: var(--border-color);
  border-color: var(--accent-color);
  color: var(--accent-color);
}
.tab-link.active {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}
html[data-theme="light"] .tab-link.active { color: white; }

/* --- Контент вкладок (згортання) --- */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.5s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.collapsible-item {
  background-color: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 15px;
  overflow: hidden;
}
.collapsible-item:last-child { margin-bottom: 0; }

.collapsible-item summary {
  display: block; /* Потрібно для <summary> */
  cursor: pointer;
  padding: 15px 20px;
  position: relative;
  transition: background-color 0.2s;
}
.collapsible-item summary:hover { background-color: var(--border-color); }
.collapsible-item[open] > summary { background-color: var(--card-bg); }

.collapsible-item summary::marker,
.collapsible-item summary::-webkit-details-marker { display: none; }

.collapsible-item summary::after { /* Кастомна стрілка */
  content: '\25B6'; /* ► */
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.2s ease-in-out;
  font-size: 1em;
  color: var(--text-color);
}
.collapsible-item[open] > summary::after { transform: translateY(-50%) rotate(90deg); }

.collapsible-item .item-title {
  font-size: 1.4em;
  margin: 0;
  color: var(--text-color);
  padding-right: 25px; /* Щоб не наїжджав на стрілку */
}
.collapsible-item .item-meta {
  font-size: 0.9em;
  opacity: 0.8;
  margin-top: 5px;
  display: flex;
  gap: 15px;
}
.item-meta .law-status {
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 4px;
  color: white;
  font-size: 0.8em;
}
.law-status.active { background-color: #28a745; }
.law-status.project { background-color: #fd7e14; }

.item-content-wrapper {
  padding: 0 25px 20px 25px;
  border-top: 1px solid var(--border-color);
  line-height: 1.7;
}

/* --- Адаптивність --- */
@media (max-width: 900px) {
  .republic-layout-sidebar-left {
    flex-direction: column; /* <--- ЗАМІНИ НА ЦЕ */
  }
  .republic-sidebar { min-width: auto; }
}
