/* =========================================================
   KannadaGK
   Karnataka History - Common CSS
   Responsive Chapter Layout

   HTML STRUCTURE:
   SIDEBAR FIRST
   CONTENT SECOND

   DESKTOP:
   Sidebar 280px | Content remaining

   MOBILE:
   Sidebar dropdown
   Content below
   ========================================================= */


/* =========================================================
   BASE
   ========================================================= */

.history-page {
  width: 100%;
  padding: 20px 0 50px;
  margin-top:50px;
}

.history-container {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
}

.history-content {
  min-width: 0;
  width: 100%;
}


/* =========================================================
   BREADCRUMB
   ========================================================= */

.history-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;

  font-size: 14px;

  margin-bottom: 18px;

  color: #666;
}

.history-breadcrumb a {
  color: #004aad;
  text-decoration: none;
}

.history-breadcrumb a:hover {
  text-decoration: underline;
}


/* =========================================================
   DESKTOP LAYOUT
   IMPORTANT

   HTML order:
   1. Sidebar
   2. Content

   Therefore:
   280px | 1fr
   ========================================================= */

.history-layout {
  display: grid;

  grid-template-columns:
    minmax(230px, 280px)
    minmax(0, 1fr);

  gap: 25px;

  align-items: start;

  width: 100%;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.history-sidebar {
  grid-column: 1;

  width: 100%;
  min-width: 0;

  background: #fff;

  border-radius: 10px;

  overflow: hidden;

  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.08);

  position: sticky;

  top: 100px;
}


/* =========================================================
   MAIN CONTENT
   ========================================================= */

.history-content {
  grid-column: 2;

  width: 100%;
  min-width: 0;
}


/* =========================================================
   SIDEBAR TITLE
   ========================================================= */

.history-sidebar-title {
  background: #004aad;

  color: #fff;

  padding: 16px;
}

.history-sidebar-title h2 {
  margin: 0;

  color: #fff;

  font-size: 19px;

  line-height: 1.4;
}

.history-sidebar-title p {
  margin: 3px 0 0;

  color: #e8f1ff;

  font-size: 13px;
}


/* =========================================================
   CHAPTER MENU
   ========================================================= */

.history-menu {
  list-style: none;

  padding: 10px;

  margin: 0;
}

.history-menu li {
  margin: 3px 0;
}

.history-menu a {
  display: block;

  padding: 9px 11px;

  border-radius: 6px;

  color: #333;

  text-decoration: none;

  font-size: 14px;

  line-height: 1.5;

  transition:
    background 0.2s,
    color 0.2s;
}

.history-menu a:hover {
  background: #edf5ff;

  color: #004aad;
}

.history-menu a.active {
  background: #004aad;

  color: #fff;

  font-weight: 600;
}


/* =========================================================
   CHAPTER CATEGORY
   ========================================================= */

.history-group {
  color: #777;

  font-size: 12px;

  font-weight: 700;

  padding: 12px 8px 5px;

  border-bottom: 1px solid #eee;
}


/* =========================================================
   ARTICLE HEADER
   ========================================================= */

.history-article-header {
  background:
    linear-gradient(
      135deg,
      #e4f1ff,
      #cce4ff
    );

  border-left: 5px solid #004aad;

  padding: 25px;

  border-radius: 10px;

  margin-bottom: 20px;

  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.07);
}

.history-label {
  display: inline-block;

  background: #004aad;

  color: #fff;

  padding: 5px 10px;

  border-radius: 20px;

  font-size: 12px;

  margin-bottom: 10px;
}

.history-article-header h1 {
  color: #004aad;

  font-size: 30px;

  margin: 0 0 10px;

  line-height: 1.35;
}

.history-article-header p {
  margin: 0;

  color: #444;

  font-size: 15px;

  line-height: 1.8;
}


/* =========================================================
   ARTICLE
   ========================================================= */

.history-article {
  background: #fff;

  padding: 25px;

  border-radius: 10px;

  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.07);
}

.history-article section {
  margin-bottom: 30px;
}

.history-article section:last-child {
  margin-bottom: 0;
}

.history-article h2 {
  color: #004aad;

  font-size: 23px;

  padding-bottom: 8px;

  border-bottom: 2px solid #e7edf5;

  margin: 0 0 15px;

  line-height: 1.45;
}

.history-article h3 {
  color: #174a80;

  font-size: 19px;

  margin: 22px 0 9px;
}

.history-article p {
  color: #333;

  font-size: 16px;

  line-height: 1.85;

  margin: 0 0 14px;
}

.history-article ul,
.history-article ol {
  padding-left: 25px;

  margin-bottom: 18px;
}

.history-article li {
  margin-bottom: 7px;

  line-height: 1.7;
}


/* =========================================================
   ADVERTISEMENT
   ========================================================= */

.history-ad {
  min-height: 90px;

  display: flex;

  align-items: center;

  justify-content: center;

  background: #f4f6f9;

  border: 1px dashed #ccc;

  border-radius: 8px;

  color: #888;

  font-size: 13px;

  margin: 20px 0;
}


/* =========================================================
   IMPORTANT EXAM BOX
   ========================================================= */

.exam-important {
  background: #fff8dc;

  border-left: 4px solid #e0a800;

  padding: 16px;

  border-radius: 7px;

  margin: 20px 0;
}

.exam-important strong {
  color: #806000;
}

.exam-important ul {
  margin-bottom: 0;
}


/* =========================================================
   QUICK REVISION
   ========================================================= */

.quick-revision {
  background: #eef7ff;

  border-left: 4px solid #004aad;

  padding: 18px;

  border-radius: 7px;

  margin: 20px 0;
}

.quick-revision h3 {
  color: #004aad;

  margin-top: 0;
}

.quick-revision ul {
  margin-bottom: 0;
}


/* =========================================================
   TABLE
   ========================================================= */

.history-table-wrapper {
  width: 100%;

  overflow-x: auto;

  margin: 20px 0;
}

.history-table {
  width: 100%;

  min-width: 600px;

  border-collapse: collapse;

  font-size: 15px;
}

.history-table th {
  background: #004aad;

  color: #fff;

  padding: 11px;

  text-align: left;

  border: 1px solid #ddd;
}

.history-table td {
  padding: 10px;

  border: 1px solid #ddd;

  line-height: 1.6;
}

.history-table tr:nth-child(even) {
  background: #f5f8fc;
}

.history-table tr:hover {
  background: #eaf2fb;
}


/* =========================================================
   RELATED CHAPTERS
   ========================================================= */

.history-related {
  background: #fff;

  padding: 20px;

  border-radius: 10px;

  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.07);

  margin-top: 20px;
}

.history-related h2 {
  color: #004aad;

  font-size: 21px;

  margin: 0 0 12px;
}

.history-related p {
  margin-bottom: 15px;
}

.history-related-links {
  display: flex;

  flex-wrap: wrap;

  gap: 8px;
}

.history-related-links a {
  background: #eef5ff;

  color: #004aad;

  padding: 8px 12px;

  border-radius: 5px;

  text-decoration: none;

  font-size: 14px;
}

.history-related-links a:hover {
  background: #004aad;

  color: #fff;
}


/* =========================================================
   PREVIOUS / NEXT
   ========================================================= */

.history-navigation {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 12px;

  margin-top: 25px;
}

.history-navigation a {
  background: #fff;

  border: 1px solid #ddd;

  border-radius: 7px;

  padding: 13px;

  text-decoration: none;

  color: #004aad;

  font-weight: 600;
}

.history-navigation a:hover {
  background: #004aad;

  color: #fff;

  border-color: #004aad;
}


/* =========================================================
   CHAPTER CARDS
   ========================================================= */

.history-card-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 14px;
}

.history-card {
  background: #fbfdff;

  border: 1px solid #e1e7ef;

  border-radius: 9px;

  padding: 18px;

  transition:
    transform 0.2s,
    box-shadow 0.2s,
    border-color 0.2s;
}

.history-card:hover {
  transform: translateY(-3px);

  border-color: #004aad;

  box-shadow:
    0 6px 18px rgba(0, 74, 173, 0.12);
}

.card-number {
  display: inline-flex;

  align-items: center;

  justify-content: center;

  width: 30px;

  height: 30px;

  background: #eaf3ff;

  color: #004aad;

  border-radius: 50%;

  font-size: 12px;

  font-weight: 700;

  margin-bottom: 8px;
}

.history-card h3 {
  color: #004aad;

  font-size: 19px;

  margin: 0 0 7px;
}

.history-card p {
  color: #555;

  font-size: 14px;

  line-height: 1.65;

  margin: 0 0 12px;
}

.history-card a {
  display: inline-block;

  background: #004aad;

  color: #fff;

  padding: 7px 12px;

  border-radius: 5px;

  text-decoration: none;

  font-size: 13px;

  font-weight: 600;
}

.history-card a:hover {
  background: #ffd700;

  color: #004aad;
}


/* =========================================================
   EXAM BOX
   ========================================================= */

.history-exam-box {
  background: #fff8dc;

  border-left: 4px solid #e0a800;

  padding: 20px;

  border-radius: 8px;

  margin-bottom: 20px;
}

.history-exam-box h2 {
  color: #806000;

  font-size: 21px;

  margin: 0 0 10px;
}

.history-exam-box ul {
  margin: 0;

  padding-left: 22px;
}

.history-exam-box li {
  margin-bottom: 7px;

  line-height: 1.6;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) and (min-width: 769px) {

  .history-container {
    width: 94%;
  }

  .history-layout {
    grid-template-columns:
      230px
      minmax(0, 1fr);

    gap: 18px;
  }

  .history-sidebar {
    width: 100%;
  }

  .history-article-header {
    padding: 20px;
  }

  .history-article-header h1 {
    font-size: 27px;
  }

  .history-article {
    padding: 20px;
  }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

  .history-page {
    padding: 8px 0 35px;
  }

  .history-container {
    width: 94%;
  }


  /* -----------------------------------------
     MOBILE LAYOUT

     SIDEBAR FIRST
     CONTENT SECOND
  ----------------------------------------- */

  .history-layout {
    display: flex;

    flex-direction: column;

    gap: 12px;

    width: 100%;
  }


  /* -----------------------------------------
     MOBILE CONTENT
  ----------------------------------------- */

  .history-content {
    order: 1;

    width: 100%;

    min-width: 0;
  }


  /* -----------------------------------------
     MOBILE SIDEBAR
  ----------------------------------------- */

  .history-sidebar {
    order: 0;

    width: 100%;

    min-width: 0;

    position: static;

    overflow: visible;

    background: transparent;

    box-shadow: none;

    border-radius: 0;
  }


  /* -----------------------------------------
     MOBILE CHAPTER BUTTON
  ----------------------------------------- */

  .history-sidebar-title {
    position: relative;

    cursor: pointer;

    background: #004aad;

    color: #fff;

    padding: 12px 50px 12px 15px;

    border-radius: 8px;

    box-shadow:
      0 3px 10px rgba(0, 0, 0, 0.12);
  }

  .history-sidebar-title h2 {
    color: #fff;

    font-size: 17px;

    line-height: 1.4;

    margin: 0;
  }

  .history-sidebar-title p {
    color: #e8f1ff;

    font-size: 12px;

    margin: 2px 0 0;
  }


  /* -----------------------------------------
     RIGHT ARROW
  ----------------------------------------- */

  .history-sidebar-title::after {
    content: "⌄";

    position: absolute;

    right: 17px;

    top: 50%;

    transform:
      translateY(-55%);

    font-size: 26px;

    font-weight: 400;

    transition:
      transform 0.2s;
  }


  /* -----------------------------------------
     ROTATE ARROW
  ----------------------------------------- */

  .history-sidebar.open
  .history-sidebar-title::after {

    transform:
      translateY(-45%)
      rotate(180deg);
  }


  /* -----------------------------------------
     CHAPTER MENU HIDDEN
  ----------------------------------------- */

  .history-menu {
    display: none;

    width: 100%;

    margin: 7px 0 0;

    padding: 7px;

    background: #fff;

    border: 1px solid #dfe5ec;

    border-radius: 8px;

    box-shadow:
      0 5px 16px rgba(0, 0, 0, 0.12);

    max-height: 60vh;

    overflow-y: auto;
  }


  /* -----------------------------------------
     OPEN MENU
  ----------------------------------------- */

  .history-sidebar.open
  .history-menu {
    display: block;
  }


  /* -----------------------------------------
     MOBILE CHAPTER LINKS
  ----------------------------------------- */

  .history-menu li {
    margin: 1px 0;
  }

  .history-menu li a {
    display: block;

    padding: 10px 12px;

    font-size: 14px;

    line-height: 1.5;

    border-radius: 6px;
  }


  /* -----------------------------------------
     CATEGORY
  ----------------------------------------- */

  .history-menu .history-group {
    padding: 9px 12px;

    margin-top: 4px;

    background: #f1f5f9;

    color: #004aad;

    font-size: 12px;

    font-weight: 700;

    border-bottom: none;

    border-radius: 5px;
  }


  /* -----------------------------------------
     ACTIVE CHAPTER
  ----------------------------------------- */

  .history-menu a.active {
    background: #004aad;

    color: #fff;

    font-weight: 700;
  }


  /* -----------------------------------------
     ARTICLE HEADER
  ----------------------------------------- */

  .history-article-header {
    padding: 18px 15px;

    margin-bottom: 14px;

    border-left-width: 4px;
  }

  .history-article-header h1 {
    font-size: 24px;

    line-height: 1.4;
  }

  .history-article-header p {
    font-size: 14px;

    line-height: 1.75;
  }

  .history-label {
    font-size: 11px;

    padding: 4px 8px;
  }


  /* -----------------------------------------
     ARTICLE
  ----------------------------------------- */

  .history-article {
    padding: 17px 14px;

    border-radius: 8px;
  }

  .history-article section {
    margin-bottom: 25px;
  }

  .history-article h2 {
    font-size: 20px;

    line-height: 1.45;

    margin-bottom: 12px;
  }

  .history-article h3 {
    font-size: 17px;

    margin-top: 19px;
  }

  .history-article p {
    font-size: 15px;

    line-height: 1.8;
  }

  .history-article ul,
  .history-article ol {
    padding-left: 21px;
  }

  .history-article li {
    font-size: 14px;

    line-height: 1.7;
  }


  /* -----------------------------------------
     TABLE
  ----------------------------------------- */

  .history-table-wrapper {
    width: 100%;

    overflow-x: auto;

    -webkit-overflow-scrolling: touch;
  }

  .history-table {
    min-width: 600px;

    font-size: 14px;
  }


  /* -----------------------------------------
     ADS
  ----------------------------------------- */

  .history-ad {
    min-height: 80px;

    margin: 15px 0;
  }


  /* -----------------------------------------
     RELATED
  ----------------------------------------- */

  .history-related {
    padding: 16px 14px;

    margin-top: 15px;
  }

  .history-related h2 {
    font-size: 19px;
  }


  /* -----------------------------------------
     PREVIOUS / NEXT
  ----------------------------------------- */

  .history-navigation {
    grid-template-columns: 1fr;

    gap: 8px;
  }


  /* -----------------------------------------
     CARDS
  ----------------------------------------- */

  .history-card-grid {
    grid-template-columns: 1fr;
  }


  /* -----------------------------------------
     BREADCRUMB
  ----------------------------------------- */

  .history-breadcrumb {
    font-size: 12px;

    margin-bottom: 10px;

    overflow-x: auto;

    white-space: nowrap;
  }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

  .history-container {
    width: 95%;
  }


  .history-article-header h1 {
    font-size: 22px;
  }


  .history-article {
    padding: 15px 12px;
  }


  .history-article h2 {
    font-size: 19px;
  }


  .history-article p {
    font-size: 14.5px;
  }


  .history-sidebar-title {
    padding: 11px 45px 11px 13px;
  }


  .history-sidebar-title h2 {
    font-size: 16px;
  }

}