/* ============================================
   CSS Variable Override
   ============================================ */
:root {
  --color-hero-bg: #1a9958; /* Fatwas-specific hero background color */
}

/* ============================================
   Header Override - White Background Variant
   ============================================ */
.header {
  background: var(--color-bg-white);
}

.logo-text {
  color: #1e7f46; /* Dark green for logo */
}

.nav-link {
  color: #333333; /* Dark gray/black for navigation */
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--color-primary);
}

.btn-ask-question {
  background: var(--color-button-primary);
  border: none;
  box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);
}

.btn-ask-question:hover {
  background: #218838; /* Slightly darker on hover */
  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.btn-ask-question:active {
  transform: translateY(0);
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-icon {
  color: #28a745;
}



/* ============================================
   Main Content Layout
   ============================================ */
.main-content {
  margin-top: 85px;
  padding: var(--spacing-3xl) var(--container-padding);
  background: var(--color-bg-white);
}

.content-container {
  display: flex;
  flex-direction: row;
  gap: 24px;
  position: relative;
  overflow: hidden; /* ensures sidebar sliding out doesn’t overflow */
  max-width: 1298px;
  margin: 0 auto;
}

/* MAIN */
.content-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 774px;
  transition: all 0.3s ease;
}

/* SIDEBAR */
.content-sidebar {
    flex-shrink: 0;
    width: 500px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.6s ease;
    transform: translateX(0);
    opacity: 1;
    will-change: transform, opacity;
}

/* Hidden state */
.sidebar-hidden .content-sidebar {
    transform: translateX(100%);
  opacity: 0;
  position: absolute;   /* remove from flex layout visually */
  right: 0;
  top: 0;
  height: 100%;
  pointer-events: none;

  transform: translateX(100%); /* slide out to the right */
  transition: transform 0.6s cubic-bezier(0.4,0,0.2,1),
                opacity 0.5s ease 0.05s;
}

.sidebar-hidden .content-container {
    max-width: 100% !important;
    width: 100% !important;
}

.sidebar-hidden .content-main {
    max-width: 100% !important;
    width: 100% !important;
}

/* TOGGLE LINK */
.toggle-sidebar {
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
}

/* Optional: focus for accessibility */
.toggle-sidebar:focus {
  outline: none;
}

/* ============================================
   New Fatwas Section
   ============================================ */
.section-header {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  width: 100%;
}

.section-title {
  font-family: var(--font-secondary);
  font-size: 24px;
  line-height: 28px;
  font-weight: normal;
  color: #181d27;
  margin: 0;
}

.section-link {
  color: #079455;
  text-decoration: underline;
  text-decoration-skip-ink: none;
  text-underline-position: from-font;
  font-size: 16px;
  line-height: 20px;
  transition: color 0.2s;
}

.section-link:hover {
  color: var(--color-success-800);
}

/* Fatwa List Cards */
.fatwa-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.fatwa-list-item {
  background: var(--color-bg-white);
  border: var(--border-default);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: left;
  justify-content: space-between;
  gap: 0;
  margin-bottom: 10px;
}

.fatwa-list-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: right;
  max-width: 530px;
  text-align: right;
}

.fatwa-list-label-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: right;
  width: 100%;
  text-align: right;
}

.fatwa-list-title {
  font-family: var(--font-secondary);
  font-size: 18px;
  line-height: 28px;
  font-weight: normal;
  color: #414651;
  margin: 0;
  text-align: right;
  width: 100%;
}

.fatwa-list-meta {
  font-size: 14px;
  line-height: 24px;
  color: #085d3a;
  margin: 0;
  text-align: right;
  width: 100%;
}

.fatwa-list-time {
  font-size: 12px;
  line-height: 24px;
  color: #717680;
  margin: 0;
  text-align: right;
  width: 100%;
}

.fatwa-list-actions {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
  flex-shrink: 0;
}

.fatwa-list-icon-wrapper {
  background: #ecfdf3; /* var(--component-colors/utility/success/utility-success-50,#ecfdf3) */
  border: 1px solid #abefc6; /* var(--component-colors/utility/success/utility-success-200,#abefc6) */
  border-radius: 99px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  position: relative;
}

.fatwa-list-icon-inner {
  position: absolute;
  bottom: 50%;
  left: 50%;
  right: auto;
  top: auto;
  width: 24px;
  height: 24px;
  overflow: visible;
  transform: translate(-50%, 50%);
}

.fatwa-list-icon-img {
  width: 24px;
  height: 24px;
  display: block;
  transform: rotate(90deg);
  color: var(--color-success-700);
}

.fatwa-list-icon-img path {
  stroke: currentColor;
}

.fatwa-list-heart-img {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.load-more-button {
  width: auto;
  padding: 10px 16px;
  background: var(--color-button-primary);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: white;
  font-family: var(--font-secondary);
  font-size: 16px;
  line-height: 24px;
  font-weight: normal;
  cursor: pointer;
  margin-top: 32px;
  margin-left: auto;
  margin-right: 0;
  transition: background-color 0.2s;
  box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05), inset 0px 0px 0px 1px rgba(10, 13, 18, 0.18),
    inset 0px -2px 0px 0px rgba(10, 13, 18, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.load-more-button:hover {
  background: var(--color-success-800);
}

/* ============================================
   Sidebar - Topics Index
   ============================================ */
.sidebar-section {
  background: var(--color-bg-white);
  border: var(--border-default);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-section-header {
  background: #dcfae6;
  padding: 24px 24px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.sidebar-title {
  font-family: var(--font-secondary);
  font-size: 24px;
  line-height: 28px;
  font-weight: normal;
  color: #181d27;
  margin: 0;
  width: 100%;
  text-align: right;
}

.sidebar-subtitle {
  font-size: 14px;
  line-height: 20px;
  color: #535862;
  margin: 0;
  width: 100%;
  text-align: right;
  font-weight: normal;
}

.sidebar-section-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 808px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.sidebar-section-content::-webkit-scrollbar {
  width: 8px;
}

.sidebar-section-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-section-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.sidebar-section-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

.topic-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.topic-item {
  width: 100%;
  padding: 12px;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.2s;
  background: white;
}

/* First level nested items - light gray background */
.topic-children > .topic-item {
  background: #fafafa;
  border-bottom: 1px solid #e9eaeb;
  padding: 12px 16px;
}

/* Second level nested items - darker gray background */
.topic-children > .topic-item > .topic-children > .topic-child {
  background: #f5f5f5;
  padding: 10px 16px;
  border-bottom: 1px solid #d5d7da;
}

.topic-children > .topic-item > .topic-children > .topic-child:last-child {
  border-bottom: none;
}

.topic-item:hover {
  background: inherit;
}

.topic-item.active {
  background: white;
}

.topic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
}

.topic-header > div {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  flex: 1;
}

.topic-name {
  font-size: 16px;
  line-height: 24px;
  color: #414651;
  font-weight: normal;
}

/* Nested topic names - smaller font */
.topic-children .topic-name {
  font-size: 16px;
  line-height: 24px;
}

/* Deep nested topic names - even smaller */
.topic-children .topic-children .topic-name {
  font-size: 14px;
  line-height: 24px;
}

.topic-count {
  font-size: 14px;
  line-height: 24px;
  color: #085d3a;
  text-align: right;
}

.topic-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topic-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.topic-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Arrow pointing up (collapsed state - flipped) */
.topic-icon.topic-icon-down {
  transform: rotate(0deg);
}

/* Arrow pointing right (expanded state or items without children) */
.topic-icon.topic-icon-right {
  transform: rotate(90deg);
}

.topic-item.expanded > .topic-header > .topic-icon.topic-icon-down {
  transform: rotate(-90deg);
}

.topic-children {
  margin-top: 0;
  padding-right: 0;
  display: none;
  width: 100%;
}

.topic-item.expanded .topic-children {
  display: block;
}

.topic-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: right;
  width: 100%;
}

.topic-child .topic-name {
  font-size: 14px;
  color: #414651;
}

.topic-child .topic-count {
  font-size: 12px;
  color: #085d3a;
}

/* ============================================
   Sidebar - Important Fatwas
   ============================================ */
.important-fatwa-item {
  padding: var(--spacing-md);
  background: var(--color-bg-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  transition: background-color 0.2s;
}

.important-fatwa-item:hover {
  background: rgba(1, 145, 71, 0.05);
}

.important-fatwa-title {
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  margin: 0 0 var(--spacing-xs) 0;
}

.important-fatwa-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin: 0 0 var(--spacing-sm) 0;
}

.important-fatwa-link {
  color: var(--color-primary);
  text-decoration: none;
  font-size: var(--font-size-xs);
  transition: color 0.2s;
}

.important-fatwa-link:hover {
  color: var(--color-primary-dark);
}

/* ============================================
   Feature Cards Section
   ============================================ */
.feature-cards {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin: 0;
  padding: 0 var(--container-padding);
  position: relative;
}

.feature-cards-container {
  max-width: 1300px;
  margin: 0 auto;
  margin-top: var(--spacing-3xl);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 48px;
}



.feature-cards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
  flex-wrap: wrap;
}

.feature-cards-title-wrapper {
  display: flex;
  flex-direction: column;
  align-items: right;
  flex: 1;
  min-width: 0;
}

.feature-cards-title {
  font-family: var(--font-secondary);
  font-size: 42px;
  line-height: normal;
  font-weight: bold;
  color: #161c24;
  margin: 0;
  text-align: right;
  width: 100%;
}

.feature-cards-subtitle {
  font-family: var(--font-secondary);
  font-size: 16px;
  line-height: 24px;
  color: #252b37;
  margin: 0;
  text-align: right;
  max-width: 767px;
}

.feature-cards-load-more {
  border: 1px solid var(--color-success-600);
  padding: 10px 16px;
  background: transparent;
  border-radius: 8px;
  color: var(--color-primary);
  font-family: var(--font-secondary);
  font-size: 16px;
  line-height: 24px;
  font-weight: normal;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.feature-cards-load-more:hover {
  background: rgba(7, 148, 85, 0.05);
}

.feature-cards-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 16px;
  width: 100%;
}

@media(max-width:1500px){
  .feature-cards-grid .feature-card{
      min-width: 200px;
  }
}

.feature-card {
  background: #ecfdf3;
  border: 1px solid var(--color-success-200);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  min-width: 0;
  min-height: 208px;
}

.feature-card-icon-space {
  height: 24px;
  width: 100%;
  flex-shrink: 0;
}

.feature-card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: right;
  width: 100%;
  text-align: center;
  flex: 1;
  min-height: 0;
}

.feature-card-title {
  font-family: var(--font-secondary);
  font-size: 20px;
  line-height: 30px;
  font-weight: bold;
  color: #181d27;
  margin: 0;
  width: 100%;
  text-align: center;
}

.feature-card-text {
  font-size: 16px;
  line-height: 24px;
  color: #535862;
  margin: 0;
  width: 100%;
  text-align: center;
}

.feature-card-link {
  color: #085d3a;
  text-decoration: underline;
  text-decoration-skip-ink: none;
  text-underline-position: from-font;
  font-size: 16px;
  line-height: 24px;
  text-align: center;
  width: 100%;
  transition: color 0.2s;
}

.feature-card-link:hover {
  color: var(--color-success-800);
}

@media(max-width:800px){
  .feature-cards {
    width: 100%;
    display: block;
  }

  .feature-cards-container {
    max-width: 100%;
    display: block;
  }

  .feature-cards-grid {
    display: block;
  }

  .feature-card{
    margin: 20px 0;
  }
}
/* ============================================
   CTA Section
   ============================================ */
.cta-section {
  padding: var(--spacing-4xl) var(--container-padding);
  background: transparent;
}

.cta-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.cta-content {
  background: var(--color-primary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-7xl);
  position: relative;
  overflow: hidden;
  text-align: right;
}

.cta-pattern {
  position: absolute;
  pointer-events: none;
  opacity: 0.1;
}

.cta-pattern-top {
  top: -17.32%;
  right: 88%;
  bottom: 35.92%;
  left: -2.23%;
  background: url('../images/cta-pattern.svg') no-repeat center;
  background-size: contain;
}

.cta-pattern-bottom {
  top: 82.25%;
  right: -3.31%;
  bottom: -63.65%;
  left: 89.08%;
  background: url('../images/cta-pattern.svg') no-repeat center;
  background-size: contain;
}

.cta-text-content {
  text-align: right;
  color: var(--color-bg-white);
  max-width: 767px;
  min-width: 320px;
}

@media(max-width:1024px){
  .cta-text-content {
    text-align: center !important;
    min-width:auto !important;
  }

  .cta-text{
    width: auto !important;
  }
}

.cta-title {
  font-family: var(--font-secondary);
  font-size: 32px;
  font-weight: bold;
  color: var(--color-bg-white);
  line-height: 1.2;
  letter-spacing: -0.64px;
  margin: 0;
  width: 454px;
  max-width: 100%;
}

.cta-text {
  font-size: var(--font-size-sm);
  color: var(--color-bg-white);
  line-height: 1.5;
  margin: 0;
  width: 383px;
  max-width: 100%;
}

.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  align-items: left;
  position: absolute;
  left: 63px;
  top: 50%;
  transform: translateY(-50%);
}

.cta-button {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: 14px 22px;
  border-radius: var(--radius-lg);
  font-size: 18px;
  font-weight: normal;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-xs);
  position: relative;
  width: 100%;
  justify-content: center;
  min-height: auto;
}

.cta-button::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: var(--shadow-skeumorphic-inner);
}

.cta-button-primary {
  background: var(--color-success-950);
  color: var(--color-bg-white);
}

.cta-button-secondary {
  background: var(--color-bg-white);
  color: var(--color-primary);
}

.cta-button-primary {
  background: var(--color-success-950, #053321);
  color: var(--color-bg-white);
}

.cta-button-primary:hover {
  background: var(--color-success-800);
}

.cta-button-text {
  line-height: 1.55;
  white-space: nowrap;
}

.cta-button-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-button-icon img {
  width: 100%;
  height: 100%;
  display: block;
}
/* ============================================
   Responsive Design
   ============================================ */


/* MOBILE */
@media (max-width: 1024px) { 
  .toggle-sidebar{
    display: none;
  }
  
  .content-container {
      display: flex;
      flex-direction: column-reverse;
  }

  .content-main {
    max-width: 100%;
  }

  .content-sidebar { 
    width: 100%;
  }

  .feature-cards {
    grid-template-columns: 1fr;
  }

  .cta-content {
    text-align: center;
  }

  .cta-text-content {
    text-align: center;
  }

  .cta-buttons {
    position: static;
    transform: none;
    flex-direction: row;
    justify-content: center;
    width: 100%;
    margin-top: var(--spacing-xl);
  }
}

/*
@media (max-width: 1024px) {
  .content-container {
    flex-direction: column;
  }

  .content-main {
    max-width: 100%;
  }

  .content-sidebar {
    width: 100%;
    order: -1;
  }
}
*/
@media (max-width: 768px) {
  .hero {
    padding: 40px var(--spacing-lg) 120px var(--spacing-lg);
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-search {
    max-width: 100%;
    padding: var(--spacing-lg);
  }

  .hero-search-row {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .hero-search-button {
    width: 100%;
  }

  .hero-search-input-wrapper,
  .hero-search-select-wrapper {
    width: 100%;
  }

  .main-content {
    padding: var(--spacing-xl) var(--spacing-lg);
  }

  .cta-banner {
    padding: var(--spacing-2xl) var(--spacing-lg);
  }

  .cta-banner-container {
    flex-direction: column;
    padding: var(--spacing-2xl) var(--spacing-lg);
    gap: var(--spacing-xl);
  }

  .cta-banner-content {
    width: 100%;
    text-align: center;
  }

  .cta-banner-title {
    font-size: 24px;
    text-align: center;
    width: 100%;
  }

  .cta-banner-text {
    text-align: center;
    width: 100%;
  }

  .cta-banner-buttons {
    flex-direction: column;
    width: 100%;
    align-items: center;
  }

  .cta-button {
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }

  .cta-section {
    padding: var(--spacing-2xl) var(--spacing-lg);
  }

  .cta-content {
    padding: var(--spacing-3xl) var(--spacing-lg);
  }

  .cta-title {
    font-size: 28px;
    width: 100%;
  }

  .cta-text {
    width: 100%;
  }

  .cta-buttons {
    position: static;
    transform: none;
    flex-direction: column;
    width: 100%;
    margin-top: var(--spacing-xl);
  }

  .cta-button {
    width: 100%;
    justify-content: center;
  }
}
