/*
 Theme Name: Astra Azure Child
 Theme URI: https://example.com
 Description: Child theme for Astra with Azure / Terraform / DevOps styling and interactive reading enhancements.
 Author: Codex
 Template: astra
 Version: 1.0.26
*/

:root {
  --color-azure-900: #0b254f;
  --color-azure-800: #0e3a7c;
  --color-azure-700: #0f66c2;
  --color-azure-100: #e6f1ff;
  --color-teal-500: #00b5e2;
  --color-slate-900: #0b1a34;
  --color-slate-600: #4a566b;
  --color-slate-100: #f1f5f9;
  --color-terra-500: #5c4ee5;
  --content-width: 840px;
  --radius-lg: 18px;
  --radius-sm: 10px;
  --shadow-soft: 0 18px 45px rgba(11, 26, 52, 0.12);
}

body {
  background: #f5f7fb;
  color: var(--color-slate-900);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  line-height: 1.65;
  letter-spacing: -0.005em;
}

#page,
.site,
.site-content,
.ast-separate-container .ast-article-post,
.ast-separate-container .ast-article-single {
  background: #f5f7fb;
  border: none;
}

/* Global page width + sidebar proportions */
.site-content > .ast-container,
.site-content .ast-container {
  max-width: 1100px !important;
  padding-left: 18px;
  padding-right: 18px;
}

.single-post .site-content > .ast-container,
.single-post .site-content .ast-container {
  max-width: 100% !important;
  padding-left: 24px;
  padding-right: 24px;
}

@media (min-width: 1024px) {
  .ast-right-sidebar .site-content .ast-container .ast-row,
  .ast-left-sidebar .site-content .ast-container .ast-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 20px;
    align-items: start;
  }

  .ast-right-sidebar #primary,
  .ast-left-sidebar #primary,
  .ast-right-sidebar #secondary,
  .ast-left-sidebar #secondary {
    width: auto !important;
    float: none !important;
  }

  #primary {
    min-width: 0;
    width: 100%;
  }

  #secondary {
    max-width: 240px;
    width: 240px;
    position: sticky;
    top: 96px;
    align-self: start;
    flex-shrink: 0;
  }
}

h1,
h2,
h3,
h4 {
  font-family: "Space Grotesk", "DM Sans", "Segoe UI", sans-serif !important;
  color: var(--color-azure-900);
  letter-spacing: -0.02em;
}

h1 {
  font-weight: 700;
  line-height: 1.15;
}

h2,
h3 {
  font-weight: 600;
  margin-top: 1.75em;
}

a {
  color: var(--color-azure-700);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--color-teal-500);
  text-decoration: underline;
}

.site-content {
  padding-top: 2rem;
}

.single-post .site-content .ast-container {
  max-width: 1240px;
}

.single-post .entry-header {
  margin-bottom: 1.25rem;
  padding: 1.75rem 1.5rem;
  background: linear-gradient(135deg, rgba(15, 102, 194, 0.16), rgba(0, 181, 226, 0.18));
  border: 1px solid rgba(15, 102, 194, 0.22);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(11, 26, 52, 0.16);
  position: relative;
  overflow: hidden;
}

.single-post .entry-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.3), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.28), transparent 40%);
  opacity: 0.8;
  pointer-events: none;
}

.single-post .entry-header * {
  position: relative;
  z-index: 1;
}

.single-post .entry-meta {
  display: inline-flex;
  gap: 0.6rem;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  font-size: 0.95rem;
  color: var(--color-slate-900);
}

.single-post .entry-content {
  max-width: 1100px;
  width: 100%;
  margin: 0 0 3rem;
  padding: 0 18px 3.5rem;
  background: #ffffff;
  border-radius: var(--radius-lg);
  position: relative;
  z-index: 2;
  display: flow-root;
  box-sizing: border-box;
}

.single-post article {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(11, 26, 52, 0.08);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.2rem, 2vw, 1.8rem) clamp(1.3rem, 2.2vw, 2.1rem) clamp(1.8rem, 3vw, 2.8rem);
  position: relative;
  z-index: 1;
}

.entry-content p {
  margin-bottom: 1.15em;
  color: var(--color-slate-900);
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.25rem;
  margin: 1rem 0 1.5rem;
  color: var(--color-slate-900);
}

.entry-content li {
  margin: 0.35em 0;
}

.entry-content blockquote {
  border-left: 4px solid var(--color-azure-700);
  padding: 1rem 1.25rem;
  background: rgba(15, 102, 194, 0.05);
  border-radius: var(--radius-sm);
  font-size: 1.02rem;
  color: var(--color-slate-900);
}

.entry-content hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(15, 102, 194, 0.35), rgba(0, 181, 226, 0.15));
  margin: 2rem 0;
}

.wp-block-image img {
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(11, 26, 52, 0.08);
}

.wp-block-image figcaption {
  text-align: center;
  color: var(--color-slate-600);
  font-size: 0.95rem;
}

.wp-block-code,
pre,
code {
  font-family: "JetBrains Mono", "SFMono-Regular", "Menlo", "Consolas", monospace;
}

.entry-content pre {
  position: relative;
  background: #0c1224;
  color: #f8fafc;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
  overflow: auto;
  border: 1px solid rgba(0, 181, 226, 0.2);
}

.entry-content code {
  background: rgba(15, 102, 194, 0.08);
  color: var(--color-azure-900);
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}

.entry-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.ast-button,
.button,
button,
input[type="submit"],
input[type="button"] {
  background: linear-gradient(135deg, var(--color-azure-700), var(--color-teal-500));
  border: none;
  color: #fff;
  border-radius: 12px;
  padding: 0.65rem 1.15rem;
  font-weight: 600;
  box-shadow: 0 12px 26px rgba(15, 102, 194, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.ast-button:hover,
.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(15, 102, 194, 0.36);
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, var(--color-azure-700), var(--color-teal-500));
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0.92;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.copy-btn:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 102, 194, 0.35);
}

#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, var(--color-azure-700), var(--color-teal-500));
  z-index: 9999;
  box-shadow: 0 6px 14px rgba(15, 102, 194, 0.35);
}

.toc-card {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(11, 26, 52, 0.08);
  box-shadow: var(--shadow-soft);
}

.toc-card summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--color-azure-900);
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.toc-card ol {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.3rem;
}

.toc-card a {
  color: var(--color-slate-900);
}

.toc-card a:hover {
  color: var(--color-azure-700);
}

.entry-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.25rem 0;
  background: #fff;
  border: 1px solid rgba(11, 26, 52, 0.08);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.05);
}

.entry-content th,
.entry-content td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(11, 26, 52, 0.06);
}

.entry-content th {
  background: rgba(15, 102, 194, 0.08);
  color: var(--color-azure-900);
}

/* Home layout (static front page) */
.home .site-content > .ast-container,
.home .site-content .ast-container {
  max-width: 940px !important;
  padding-left: 12px;
  padding-right: 12px;
}

@media (min-width: 1024px) {
  .home .site-content .ast-container .ast-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 18px;
    align-items: start;
  }

  .home.ast-right-sidebar #primary,
  .home.ast-right-sidebar #secondary,
  .home.ast-left-sidebar #primary,
  .home.ast-left-sidebar #secondary {
    width: auto !important;
    float: none !important;
  }

  .home #primary {
    min-width: 0;
    width: 100%;
  }

  .home #secondary {
    max-width: 280px;
    width: 100%;
  }
}

.home .wp-block-latest-posts__list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.home .wp-block-latest-posts__list li {
  background: #ffffff;
  border: 1px solid rgba(11, 26, 52, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px rgba(11, 26, 52, 0.1);
  padding: 1rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.home .wp-block-latest-posts__featured-image {
  margin: -1rem -1rem 0.65rem;
}

.home .wp-block-latest-posts__featured-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.home .wp-block-latest-posts__post-title {
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-weight: 700;
  color: var(--color-azure-900);
}

.home .wp-block-latest-posts__post-title:hover {
  color: var(--color-azure-700);
}

.home .wp-block-latest-posts__post-date,
.home .wp-block-latest-posts__post-author {
  font-size: 0.95rem;
  color: var(--color-slate-600);
}

.home .wp-block-latest-posts__post-excerpt {
  color: var(--color-slate-900);
  margin-top: 0.15rem;
}

.home .widget-area {
  max-width: 230px;
}

.home .widget-area .widget {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(11, 26, 52, 0.08);
  box-shadow: 0 12px 28px rgba(11, 26, 52, 0.1);
  padding: 1rem 1.1rem;
  margin-bottom: 1.2rem;
  width: 100%;
  box-sizing: border-box;
}

.home .widget-area .widget-title {
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  color: var(--color-azure-900);
  font-weight: 700;
  margin-bottom: 0.8rem;
}

/* Home/archive layout */
.blog .site-content .ast-container,
.archive .site-content .ast-container {
  max-width: 940px !important;
  padding-left: 12px;
  padding-right: 12px;
}

@media (min-width: 1024px) {
  .blog .site-content .ast-container .ast-row,
  .archive .site-content .ast-container .ast-row,
  .single-post .site-content .ast-container .ast-row,
  .page .site-content .ast-container .ast-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 18px;
    align-items: start;
  }
}

.blog .ast-article-post,
.archive .ast-article-post {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(11, 26, 52, 0.08);
  box-shadow: 0 12px 30px rgba(11, 26, 52, 0.12);
  padding: 1.1rem 1.15rem 1.5rem;
  margin-bottom: 1.6rem;
  position: relative;
  overflow: hidden;
  width: 100% !important;
  max-width: none !important;
  float: none !important;
}

.blog .ast-article-post .post-thumb-img-content,
.archive .ast-article-post .post-thumb-img-content {
  margin: -1.25rem -1.25rem 1rem;
}

.blog .ast-article-post .post-thumb-img-content img,
.archive .ast-article-post .post-thumb-img-content img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.blog .entry-title a,
.archive .entry-title a {
  color: var(--color-azure-900);
}

.blog .entry-title a:hover,
.archive .entry-title a:hover {
  color: var(--color-azure-700);
}

.blog .ast-article-post .entry-meta,
.archive .ast-article-post .entry-meta {
  font-size: 0.95rem;
  color: var(--color-slate-600);
  margin-bottom: 0.6rem;
}

.blog .ast-article-post .entry-content p,
.archive .ast-article-post .entry-content p {
  color: var(--color-slate-900);
}

.blog .ast-article-post .read-more,
.archive .ast-article-post .read-more {
  margin-top: 0.4rem;
}

/* Archive/category: single-column posts + sidebar */
.archive .site-content .ast-container .ast-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  align-items: start;
}

.archive #primary {
  width: 100% !important;
}

.archive #secondary {
  display: block !important;
  width: 240px;
  max-width: 240px;
}

.archive #primary .ast-row {
  display: block !important;
}

.archive #primary .ast-row > article,
.archive #primary .ast-row > .ast-article-post {
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  margin-bottom: 1.6rem;
}

.archive .entry-header {
  padding: 1.1rem 0;
  margin-bottom: 1rem;
}

@media (min-width: 1024px) {
  .archive.ast-right-sidebar .site-content .ast-container .ast-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 20px;
    align-items: start;
  }

  .archive.ast-right-sidebar #primary {
    width: 100% !important;
  }

  .archive.ast-right-sidebar #secondary {
    display: block !important;
    width: 240px;
    max-width: 240px;
    float: none;
    margin-left: 0;
  }
}

.blog #primary,
.archive #primary {
  width: 100% !important;
}

.blog #secondary,
.archive #secondary {
  display: none !important;
}

.blog .widget-area .widget,
.archive .widget-area .widget,
.single-post .widget-area .widget,
.page .widget-area .widget {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(11, 26, 52, 0.08);
  box-shadow: 0 12px 28px rgba(11, 26, 52, 0.1);
  padding: 1rem 1.1rem;
  margin-bottom: 1.2rem;
}

.blog .widget-area .widget-title,
.archive .widget-area .widget-title,
.single-post .widget-area .widget-title,
.page .widget-area .widget-title {
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  color: var(--color-azure-900);
  font-weight: 700;
  margin-bottom: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Category widget styling + stickiness */
.widget_categories ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.widget_categories ul li {
  background: #f7f9fc;
  border: 1px solid rgba(11, 26, 52, 0.08);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--color-slate-900);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
  white-space: normal;
  word-break: normal;
  hyphens: none;
}

.widget_categories ul li:hover {
  border-color: rgba(15, 102, 194, 0.25);
  box-shadow: 0 10px 24px rgba(11, 26, 52, 0.12);
  transform: translateY(-1px);
}

.widget_categories ul li a {
  color: inherit;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  flex: 1 1 auto;
}

.widget_categories ul li .count {
  color: var(--color-azure-700);
  font-weight: 700;
}

@media (min-width: 1024px) {
#secondary {
  position: sticky;
  top: 96px;
  align-self: start;
  z-index: 3;
  word-break: normal;
  hyphens: none;
}
}

.post-navigation {
  max-width: var(--content-width);
  margin: 0 auto 3rem;
  padding: 0 1.25rem;
}

.wp-block-separator.has-alpha-channel-opacity {
  opacity: 1;
}

@media (min-width: 1024px) {
  .entry-content {
    padding: 0 0 3rem;
  }

}

@media (max-width: 720px) {
  :root {
    --content-width: 94vw;
  }

  body {
    background: #f8fafc;
  }

  .entry-header {
    padding: 1.1rem 1rem;
  }

  .entry-content {
    padding: 0 1rem 2.5rem;
  }

  .toc-card {
    margin: 1rem 0 1.5rem;
  }

  .copy-btn {
    top: 8px;
    right: 8px;
  }
}
.inline-categories-panel {
  background: #ffffff;
  border: 1px solid rgba(11, 26, 52, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 26px rgba(11, 26, 52, 0.12);
  padding: 0.85rem 0.95rem;
  margin: 0 0 1.25rem;
}

.inline-cat-title {
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-weight: 700;
  color: var(--color-azure-900);
  margin-bottom: 0.6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-cat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.inline-cat-list li {
  background: #f7f9fc;
  border: 1px solid rgba(11, 26, 52, 0.08);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.inline-cat-list li:hover {
  border-color: rgba(15, 102, 194, 0.25);
  box-shadow: 0 10px 24px rgba(11, 26, 52, 0.12);
  transform: translateY(-1px);
}

.inline-cat-list li a {
  color: var(--color-slate-900);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}

.inline-cat-list li .count {
  color: var(--color-azure-700);
  font-weight: 700;
}

@media (min-width: 1024px) {
  .single-post .inline-categories-panel {
    float: right;
    width: 230px;
    max-width: 230px;
    margin-left: 1.2rem;
    position: sticky;
    top: 96px;
    z-index: 3;
  }
}

@media (max-width: 1023px) {
  .inline-categories-panel {
    width: 100%;
    max-width: none;
    margin-left: 0;
    position: static;
    float: none;
  }

  .single-post .entry-content {
    padding-right: 1.5rem;
  }
}

/* Prevent categories widget/panel from appearing inside post content */
.single-post .entry-content .widget_categories,
.single-post .entry-content .inline-categories-panel {
  display: none !important;
}

#secondary .widget_categories {
  display: block;
}

/* Hide TOC card on single posts */
.single-post .toc-card {
  display: none !important;
}
