/* Custom CSS to override Django documentation styles */

/* Base body font settings */
body {
  font-size: 16px !important; /* Change this value to your preferred size */
  line-height: 1.1 !important; /* Change this value to your preferred line height */
  hyphens: auto !important; /* Enable automatic hyphenation */
  -webkit-hyphens: auto !important; /* Safari support */
  -moz-hyphens: auto !important; /* Firefox support */
}

/* Main content area */
.main-content,
.document,
.body,
.section {
  font-size: 16px !important;
  line-height: 1.1 !important;
  hyphens: auto !important; /* Enable automatic hyphenation */
  -webkit-hyphens: auto !important; /* Safari support */
  -moz-hyphens: auto !important; /* Firefox support */
}

/* Paragraphs */
p {
  font-size: 16px !important;
  line-height: 1.1 !important;
  hyphens: auto !important; /* Enable automatic hyphenation */
}

/* Lists */
ul,
ol,
li {
  font-size: 16px !important;
  line-height: 1.1 !important;
  hyphens: auto !important; /* Enable automatic hyphenation */
  -webkit-hyphens: auto !important; /* Safari support */
  -moz-hyphens: auto !important; /* Firefox support */
}

/* Code blocks and inline code */
pre,
code,
.highlight {
  font-size: 14px !important; /* Slightly smaller for code */
  line-height: 1.1 !important;
  white-space: pre !important; /* Prevent wrapping */
  overflow-x: auto !important; /* Enable horizontal scrolling */
  overflow-y: hidden !important;
  word-wrap: normal !important; /* Don't break words */
  hyphens: none !important; /* Explicitly disable hyphenation for code */
  -webkit-hyphens: none !important; /* Safari support */
  -moz-hyphens: none !important; /* Firefox support */
}

/* Override code font size within headings to inherit heading size */
h1 code,
h2 code,
h3 code,
h4 code,
h5 code,
h6 code {
  font-size: inherit !important; /* Inherit the heading's font size */
}

/* Headings - adjust these as needed */
h1 {
  font-size: 2.2em !important;
  line-height: 1.1 !important;
}

h2 {
  font-size: 1.8em !important;
  line-height: 1.1 !important;
}

h3 {
  font-size: 1.5em !important;
  line-height: 1.1 !important;
}

h4 {
  font-size: 1.3em !important;
  line-height: 1.1 !important;
}

h5 {
  font-size: 1.1em !important;
  line-height: 1.1 !important;
}

h6 {
  font-size: 1em !important;
  line-height: 1.1 !important;
}

/* Table content */
table,
td,
th {
  font-size: 15px !important;
  line-height: 1.5 !important;
  hyphens: auto !important; /* Enable automatic hyphenation */
  -webkit-hyphens: auto !important; /* Safari support */
  -moz-hyphens: auto !important; /* Firefox support */
}

/* Navigation and sidebar */
.sidebar,
.navigation,
.toctree-wrapper {
  font-size: 14px !important;
  line-height: 1.5 !important;
}

/* Search results */
.search-results {
  font-size: 15px !important;
  line-height: 1.5 !important;
}

/* Admonitions (notes, warnings, etc.) */
.admonition {
  font-size: 15px !important;
  line-height: 1.5 !important;
  hyphens: auto !important; /* Enable automatic hyphenation */
  -webkit-hyphens: auto !important; /* Safari support */
  -moz-hyphens: auto !important; /* Firefox support */
}

/* Override any specific Django doc styles */
.rst-content {
  font-size: 16px !important;
  line-height: 1.6 !important;
}

/* Docstring content */
.descname,
.descclassname,
.sig,
.signature {
  font-size: 15px !important;
  line-height: 1.4 !important;
}

/* Additional code block styling for horizontal scrolling */
.highlight pre,
.codehilite pre,
.literal-block,
.code-block,
div.highlight,
div.code,
.console,
.python-console {
  white-space: pre !important;
  overflow-x: auto !important;
  word-wrap: normal !important;
  max-width: 100% !important;
  hyphens: none !important; /* Explicitly disable hyphenation for code */
  -webkit-hyphens: none !important; /* Safari support */
  -moz-hyphens: none !important; /* Firefox support */
}

/* Inline code should still wrap normally */
code:not(pre code) {
  white-space: normal !important;
  word-wrap: break-word !important;
}

/* Specific styling for Django console/shell examples */
.console .highlight,
.python-console .highlight {
  overflow-x: auto !important;
  white-space: pre !important;
}

/* Code blocks within tables should also scroll */
td pre,
th pre,
td code,
th code {
  white-space: pre !important;
  overflow-x: auto !important;
  max-width: 300px !important; /* Prevent tables from becoming too wide */
  hyphens: none !important; /* Explicitly disable hyphenation for code */
  -webkit-hyphens: none !important; /* Safari support */
  -moz-hyphens: none !important; /* Firefox support */
}

/* Hide Django-specific floating elements by ID and class */
div#version-switcher {
  display: none !important;
  visibility: hidden !important;
}


/* iPad Mini Media Queries - Increase font sizes by 2px */
@media only screen and (max-width: 1133px)  {
  /* Base body font settings */
  body {
    font-size: 17px !important;
  }

  /* Main content area */
  .main-content,
  .document,
  .body,
  .section {
    font-size: 17px !important;
  }

  /* Paragraphs */
  p {
    font-size: 17px !important;
  }

  /* Lists */
  ul,
  ol,
  li {
    font-size: 17px !important;
  }

  /* Code blocks and inline code */
  pre,
  code,
  .highlight {
    font-size: 15px !important;
  }

  /* Override code font size within headings to inherit heading size */
  h1 code,
  h2 code,
  h3 code,
  h4 code,
  h5 code,
  h6 code {
    font-size: inherit !important; /* Inherit the heading's font size */
  }

  /* Headings */
  h1 {
    font-size: 2.4em !important;
  }

  h2 {
    font-size: 2.1em !important;
  }

  h3 {
    font-size: 1.8em !important;
  }

  h4 {
    font-size: 1.6em !important;
  }

  h5 {
    font-size: 1.4em !important;
  }

  h6 {
    font-size: 1.3em !important;
  }

  /* Table content */
  table,
  td,
  th {
    font-size: 17px !important;
  }

  /* Navigation and sidebar */
  .sidebar,
  .navigation,
  .toctree-wrapper {
    font-size: 16px !important;
  }

  /* Search results */
  .search-results {
    font-size: 17px !important;
  }

  /* Admonitions */
  .admonition {
    font-size: 17px !important;
  }

  /* Override any specific Django doc styles */
  .rst-content {
    font-size: 17px !important;
  }

  /* Docstring content */
  .descname,
  .descclassname,
  .sig,
  .signature {
    font-size: 17px !important;
  }
}

/* iPhone Media Queries - Reset to base font sizes */
@media only screen and (max-width: 393px) {
  /* Base body font settings */
  body {
    font-size: 16px !important;
  }

  /* Main content area */
  .main-content,
  .document,
  .body,
  .section {
    font-size: 16px !important;
  }

  /* Paragraphs */
  p {
    font-size: 16px !important;
  }

  /* Lists */
  ul,
  ol,
  li {
    font-size: 16px !important;
  }

  /* Code blocks and inline code */
  pre,
  code,
  .highlight {
    font-size: 14px !important;
  }

  /* Override code font size within headings to inherit heading size */
  h1 code,
  h2 code,
  h3 code,
  h4 code,
  h5 code,
  h6 code {
    font-size: inherit !important; /* Inherit the heading's font size */
  }

  /* Headings */
  h1 {
    font-size: 2.2em !important;
  }

  h2 {
    font-size: 1.8em !important;
  }

  h3 {
    font-size: 1.5em !important;
  }

  h4 {
    font-size: 1.3em !important;
  }

  h5 {
    font-size: 1.1em !important;
  }

  h6 {
    font-size: 1em !important;
  }

  /* Table content */
  table,
  td,
  th {
    font-size: 15px !important;
  }

  /* Navigation and sidebar */
  .sidebar,
  .navigation,
  .toctree-wrapper {
    font-size: 14px !important;
  }

  /* Search results */
  .search-results {
    font-size: 15px !important;
  }

  /* Admonitions */
  .admonition {
    font-size: 15px !important;
  }

  /* Override any specific Django doc styles */
  .rst-content {
    font-size: 16px !important;
  }

  /* Docstring content */
  .descname,
  .descclassname,
  .sig,
  .signature {
    font-size: 15px !important;
  }
}
