/* Dangit UI - reading comfort and mobile layout layer */

:root {
  --dangit-ink: #1f2328;
  --dangit-ink-soft: #444c56;
  --dangit-link: #8a1c2b;
  --dangit-link-underline: #c4737d;
  --dangit-measure: 40rem;
  --dangit-read-size: 1.0625rem;
}

/* ---------- 1. Mobile horizontal overflow ----------
   An auto-placed ad renders wider than small viewports and
   drags the whole document sideways. Clip it at the source. */
@media (max-width: 1024px) {
  .google-auto-placed,
  .google-auto-placed ins,
  .google-auto-placed iframe,
  #aswift_0_host, #aswift_1_host, #aswift_2_host,
  #aswift_3_host, #aswift_4_host,
  ins.adsbygoogle {
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden;
  }
  .google-auto-placed ins {
    display: block;
  }
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }
}

/* ---------- 2. Article typography ----------
   14px Verdana is small for sustained reading. Aim at a
   17px base on a ~40rem measure. */
.td-post-content,
.entry-content,
.td-post-content .td-post-content-main {
  font-size: var(--dangit-read-size) !important;
  line-height: 1.75 !important;
  color: var(--dangit-ink) !important;
  max-width: var(--dangit-measure);
}

.td-post-content p,
.td-post-content li,
.entry-content p,
.entry-content li {
  font-size: var(--dangit-read-size) !important;
  line-height: 1.75 !important;
  color: var(--dangit-ink) !important;
  margin-bottom: 1.4em;
}

/* Comfortable reading: a little more space between blocks. */
.td-post-content p {
  text-wrap: pretty;
}

/* ---------- 3. Measure ---------- */
@media (max-width: 1200px) {
  .td-post-content {
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---------- 4. Headings ---------- */
.td-post-content h2,
.td-post-content h3 {
  color: #10141a;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-top: 2em;
  margin-bottom: 0.6em;
}

.td-post-content h2 {
  font-size: 1.6rem !important;
}

.td-post-content h3 {
  font-size: 1.24rem !important;
}

/* ---------- 5. Links ----------
   Theme set links to red with no underline. Restore a
   recognisable link treatment: underlined, higher contrast. */
.td-post-content a,
.entry-content a {
  color: var(--dangit-link) !important;
  text-decoration: underline !important;
  text-decoration-color: var(--dangit-link-underline);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 120ms ease;
}

.td-post-content a:hover,
.entry-content a:hover {
  text-decoration-color: currentColor !important;
}

/* ---------- 6. Lists ---------- */
.td-post-content ul,
.td-post-content ol {
  padding-left: 1.4em;
}

.td-post-content li {
  margin-bottom: 0.5em;
}

/* ---------- 7. Tables ----------
   Tables are a real part of these articles and must not
   force horizontal scroll on a phone. */
.td-post-content table {
  width: 100% !important;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 0.95rem !important;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.td-post-content table th,
.td-post-content table td {
  padding: 0.6em 0.8em;
  border: 1px solid #d7dbe0;
  text-align: left;
  vertical-align: top;
}

.td-post-content table thead th {
  background: #f2f4f7;
  font-weight: 600;
}

/* ---------- 8. Images ---------- */
.td-post-content img {
  max-width: 100% !important;
  height: auto;
  border-radius: 4px;
}

.td-post-content figure figcaption,
.td-post-content .wp-caption-text {
  color: #5a6472;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-top: 0.6em;
}

/* ---------- 9. Source and disclaimer blocks ---------- */
.td-post-content h2#sources {
  margin-top: 2.4em;
  padding-top: 0.4em;
  border-top: 2px solid #e4e7eb;
}

.td-post-content em:only-child,
.td-post-content p > em:last-child {
  color: #5a6472;
}

/* ---------- 10. Focus visibility ---------- */
.td-post-content a:focus-visible,
.site a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #1f6feb;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- 11. Tap targets ---------- */
@media (max-width: 768px) {
  .td-post-sharing-classic a,
  .td-social-sharing-wrap a,
  .td-post-sharing-classic .td-social-sharing-butic-share,
  .td-social-sharing-butic-share a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }
}

/* ---------- 12. Homepage and site body ---------- */
body {
  color: var(--dangit-ink-soft);
  -webkit-text-size-adjust: 100%;
}

/* ---------- 13. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}