/* ============================================================
   ARTICLES.CSS — Swipeable Card System · TOC · Article Layout
   Requires: base.css, components.css
   ============================================================ */

/* Page Hero (Article Pages) */
.page-hero {
  padding: 1.5rem 0 1rem;
  text-align: center;
  background-color: var(--color-dark);
  color: var(--color-beige);
  border-bottom: 5px solid #000;
}

/* Tip / Alert / Success Boxes */
.tip-box,
.alert-box,
.success-box {
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.tip-box {
  background: #FFF3CD;
  border: 4px solid #d39e00;
  border-right: 8px solid #d39e00;
}

.alert-box {
  background: #FFD6D6;
  border: 4px solid #dc3545;
  border-right: 8px solid #dc3545;
}

.success-box {
  background: #D4EDDA;
  border: 4px solid #28a745;
  border-right: 8px solid #28a745;
}

.tip-box h5,
.alert-box h5,
.success-box h5 {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #1a1a1a;
  font-weight: bold;
  margin-bottom: .5rem;
}

.tip-box h5 i {
  color: #d39e00;
}

.alert-box h5 i {
  color: #dc3545;
}

.success-box h5 i {
  color: #28a745;
}

.tip-box p,
.alert-box p,
.success-box p {
  color: #1a1a1a;
}

/* TOC Sidebar */
.toc-sidebar {
  position: fixed;
  right: -420px;
  top: 80px;
  width: 400px;
  max-height: calc(100vh - 100px);
  background: #F8F8F8;
  border: 5px solid #000;
  border-radius: 15px 0 0 15px;
  box-shadow: -15px 8px 25px rgba(0, 0, 0, .25);
  overflow-y: auto;
  z-index: 999;
  transition: right .4s cubic-bezier(.68, -.55, .265, 1.55);
  scrollbar-width: none;
}

.toc-sidebar.active {
  right: 0;
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 1.5rem;
  background: #009185;
  color: #fff;
  border-bottom: 5px solid #000;
  box-shadow: 0 6px 0 0 #000;
}

.toc-header h2 {
  flex: 1;
  margin: 0;
  font-size: 1.3rem;
  font-weight: bold;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, .1);
}

.toc-close-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 3px solid #000;
  border-radius: 50%;
  color: var(--color-primary);
  font-size: 1.3rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 2px 2px 0 0 #000;
  transition: all .2s ease;
}

.toc-close-btn:hover {
  background: #00C9B0;
  transform: scale(1.15);
  box-shadow: 3px 3px 0 0 #000;
}

.toc-close-btn:active {
  box-shadow: 1px 1px 0 0 #000;
}

.toc-items {
  padding: 1.2rem;
}

.toc-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  padding: 1rem 1.2rem;
  margin-bottom: .8rem;
  background: #009185;
  color: #fff;
  border: 3px solid #000;
  border-radius: 10px;
  cursor: pointer;
  font-size: .95rem;
  font-weight: bold;
  text-align: right;
  box-shadow: 5px 5px 0 0 #000;
  transition: all .3s cubic-bezier(.68, -.55, .265, 1.55);
}

.toc-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .1);
  opacity: 0;
}

.toc-item:hover {
  transform: translateY(-3px);
  box-shadow: 7px 7px 0 0 #000;
  padding-right: 1.4rem;
}

.toc-item:hover::before {
  opacity: 1;
}

.toc-item:hover .toc-icon {
  transform: scale(1.15);
}

.toc-item:active {
  box-shadow: 2px 2px 0 0 #000;
  transform: translateY(-1px);
}

.toc-item.active {
  background: #00B5A0;
  border-color: #000;
  box-shadow: 5px 5px 0 0 #000;
}

.toc-item.active::after {
  content: '✓';
  margin-left: .5rem;
  font-size: 1.2rem;
  font-weight: bold;
}

.toc-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform .3s ease;
}

.toc-text {
  flex: 1;
  line-height: 1.4;
}

/* TOC Toggle Button */
.toc-toggle-btn {
  position: fixed;
  right: 20px;
  top: 20px;
  width: 55px;
  height: 55px;
  background: #009185;
  border: 4px solid #000;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 998;
  box-shadow: 6px 6px 0 0 #000;
  transition: all .3s cubic-bezier(.68, -.55, .265, 1.55);
}

.toc-toggle-btn:hover {
  background: #007A6B;
  transform: scale(1.12);
  box-shadow: 8px 8px 0 0 #000;
}

.toc-toggle-btn:active {
  transform: scale(1.05);
  box-shadow: 3px 3px 0 0 #000;
}

.toc-toggle-btn.active {
  background: #00B5A0;
  right: 430px;
  box-shadow: 6px 6px 0 0 #000;
}

/* Swipeable Card Section */
.swipeable-section {
  padding: 5rem 0 3rem;
  background: #F5F5F5;
  background-size: 10px 10px;
  position: relative;
  overflow: visible;
}

.cards-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  height: 750px;
  margin: 2rem 0 3rem;
  padding: 3rem 0 4rem;
  touch-action: pan-y;
}

.swipeable-card {
  position: absolute;
  width: 100%;
  max-width: 1400px;
  height: 650px;
  background: #fff;
  border: 5px solid #000;
  border-radius: 20px;
  box-shadow: 10px 10px 0 0 rgba(0, 0, 0, .15);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  cursor: grab;
  user-select: none;
  scrollbar-width: none;
  overscroll-behavior: contain;
  transform: scale(.85) translateX(120px);
  transition: all .4s cubic-bezier(.68, -.55, .265, 1.55);
}

.swipeable-card.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateX(0);
  z-index: 10;
}

.swipeable-card.prev {
  transform: scale(.85) translateX(-120px);
}

.card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: flex-start;
}

.card-icon-large {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 1rem;
  text-align: left;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, .2));
}

.swipeable-card h2 {
  font-size: 2.2rem;
  margin-bottom: 1.3rem;
  color: #1a1a1a;
  font-family: var(--font-body), cursive;
  font-weight: bold;
  border-bottom: 4px solid var(--color-primary);
  padding-bottom: .8rem;
}

.card-content {
  flex: 1;
  overflow-y: auto;
  padding-right: .5rem;
  scrollbar-width: none;
  overscroll-behavior: contain;
}

.card-content p {
  font-size: 1.15rem;
  line-height: 2;
  color: #1a1a1a;
  margin-bottom: .9rem;
}

.card-content h3 {
  font-size: 1.35rem;
  font-weight: bold;
  color: #008c7d;
  margin-top: 1.2rem;
  margin-bottom: .6rem;
}

/* Card Navigation */
.cards-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: nowrap;
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  direction: ltr;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-dots-container {
  display: flex;
  justify-content: center;
  gap: .8rem;
  flex-wrap: wrap;
  flex-direction: row-reverse;
  direction: rtl;
}

.nav-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid #000;
  background: #fff;
  cursor: pointer;
  box-shadow: 3px 3px 0 0 #000;
  transition: all .3s ease;
}

.nav-dot.active {
  background: var(--color-primary);
  transform: scale(1.2);
}

.nav-dot:hover {
  transform: scale(1.1);
}

.card-nav-btn {
  position: static;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  border: 4px solid #000;
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 4px 4px 0 0 #000;
  z-index: 150;
  transition: all .3s ease;
}

.card-nav-btn:hover {
  background: var(--color-primary-dk);
  transform: scale(1.1);
}

.card-nav-btn:active {
  box-shadow: 2px 2px 0 0 #000;
}

.card-nav-prev {
  order: -1;
}

.card-nav-next {
  order: 1;
}

/* Scroll hint */
.card-scroll-hint {
  position: sticky;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background: rgba(0, 169, 157, 0.15);
  border: 2px solid rgba(0, 169, 157, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
  z-index: 10;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.card-scroll-hint i {
  color: var(--color-primary);
  font-size: 1.2rem;
}

.card-content:hover .card-scroll-hint {
  opacity: 0.3;
}

/* Conclusion Section */
.conclusion-section {
  padding: 3rem 0;
  margin-top: 3rem;
  background: var(--color-dark);
  color: var(--color-beige);
  border-top: 5px solid #000;
  text-align: center;
}

.conclusion-section h2 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  text-shadow: 3px 3px 0 #000;
}

.conclusion-section p {
  font-size: 1.2rem;
  line-height: 1.8;
  max-width: 900px;
  margin: 0 auto 2rem;
}
