:root {
  --apl-red: #d71920;
  --apl-red-light: #ff3645;
  --apl-navy: #07162f;
  --apl-navy-2: #0b284f;
  --apl-blue: #149ee4;
  --apl-cyan: #56c8ff;
  --apl-gold: #e6b800;
  --apl-green: #178b55;
  --apl-text: #172033;
  --apl-muted: #68758a;
  --apl-line: #e4e9f0;
  --apl-soft: #f5f8fb;
  --apl-accent: var(--apl-red);
  --apl-accent-2: var(--apl-red-light);
}

body.apl-accent-blue { --apl-accent: #148fd3; --apl-accent-2: #55c8ff; }
body.apl-accent-green { --apl-accent: #16884e; --apl-accent-2: #54b77e; }
body.apl-accent-gold { --apl-accent: #bf9200; --apl-accent-2: #f1c93a; }
body.apl-accent-cyan { --apl-accent: #087db8; --apl-accent-2: #58c7ee; }
body.apl-accent-poland { --apl-accent: #d71920; --apl-accent-2: #f05a62; }
body.apl-accent-dark { --apl-accent: #202937; --apl-accent-2: #d71920; }

/* Common theme duplicate prevention. Can be disabled in settings. */
body.single-post.apl-hide-theme-title main article > header .entry-title,
body.single-post.apl-hide-theme-title main article > .entry-header .entry-title,
body.single-post.apl-hide-theme-title .site-main article > header h1.entry-title,
body.single-post.apl-hide-theme-title .site-main .wp-block-post-title:first-child {
  display: none !important;
}

body.single-post.apl-hide-theme-featured main article > .post-thumbnail,
body.single-post.apl-hide-theme-featured main article > figure.post-thumbnail,
body.single-post.apl-hide-theme-featured .site-main article > .wp-post-image:first-child,
body.single-post.apl-hide-theme-featured .site-main article > header + .post-thumbnail {
  display: none !important;
}

.apl-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 99999;
  pointer-events: none;
  background: rgba(7, 22, 47, .08);
}

.apl-reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--apl-accent), var(--apl-accent-2));
  box-shadow: 0 0 14px rgba(215, 25, 32, .25);
  transition: width .08s linear;
}

.apl-article-shell,
.apl-article-shell * {
  box-sizing: border-box;
}

.apl-article-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto 60px;
  color: var(--apl-text);
  font-family: "Inter", Arial, sans-serif;
}

.apl-article-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: clamp(32px, 5vw, 62px);
  color: #fff;
  background:
    radial-gradient(circle at 88% 18%, color-mix(in srgb, var(--apl-accent) 38%, transparent), transparent 33%),
    linear-gradient(135deg, #06142d 0%, #0a2856 60%, #0b3c6d 100%);
  box-shadow: 0 20px 55px rgba(7, 22, 47, .16);
}

.apl-article-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, var(--apl-accent), var(--apl-accent-2));
}

.apl-article-hero::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 45px solid rgba(255, 255, 255, .035);
  pointer-events: none;
}

.apl-hero-kicker {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  font-family: "Oswald", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.apl-hero-kicker span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--apl-accent-2);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--apl-accent) 18%, transparent);
}

.apl-hero-title {
  position: relative;
  z-index: 2;
  max-width: 920px;
  margin: 0 0 18px !important;
  color: #fff !important;
  font-family: "Oswald", Arial, sans-serif !important;
  font-size: clamp(42px, 6.2vw, 76px) !important;
  font-weight: 700 !important;
  line-height: 1.02 !important;
  letter-spacing: -.025em !important;
  text-transform: uppercase;
}

.apl-hero-lead {
  position: relative;
  z-index: 2;
  max-width: 880px;
  margin: 0 0 22px !important;
  color: rgba(255,255,255,.92) !important;
  font-size: clamp(17px, 2vw, 20px) !important;
  font-weight: 500;
  line-height: 1.62 !important;
}

.apl-hero-meta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: rgba(255,255,255,.72);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
}

.apl-meta-sep { opacity: .45; }

.apl-featured-wrap {
  margin: 22px 0 0 !important;
  border-radius: 20px;
  overflow: hidden;
  background: #07162f;
  box-shadow: 0 16px 42px rgba(7,22,47,.13);
}

.apl-featured-wrap img,
.apl-hero-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 680px;
  object-fit: cover;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.apl-featured-wrap figcaption {
  padding: 10px 14px;
  margin: 0;
  color: rgba(255,255,255,.68);
  background: #07162f;
  font-size: 12px;
}

.apl-article-grid {
  display: grid;
  grid-template-columns: 64px minmax(0, 820px);
  justify-content: center;
  gap: 24px;
  margin-top: 34px;
}

.apl-article-content {
  min-width: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--apl-text);
  font-size: 18px;
  line-height: 1.8;
}

.apl-article-content > p,
.apl-article-content .wp-block-paragraph {
  margin: 0 0 22px;
}

.apl-article-content > p:first-child {
  font-size: 19px;
}

.apl-article-content h2,
.apl-article-content .wp-block-heading:is(h2) {
  position: relative;
  margin: 48px 0 20px !important;
  padding-left: 17px;
  color: var(--apl-navy) !important;
  font-family: "Oswald", Arial, sans-serif !important;
  font-size: clamp(30px, 4vw, 38px) !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  letter-spacing: -.012em;
}

.apl-article-content h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: .13em;
  bottom: .13em;
  width: 5px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--apl-accent), var(--apl-accent-2));
}

.apl-article-content h3 {
  margin: 34px 0 14px;
  color: var(--apl-navy);
  font-family: "Oswald", sans-serif;
  font-size: 26px;
  font-weight: 700;
}

.apl-article-content a {
  color: color-mix(in srgb, var(--apl-accent) 78%, #003b68);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.apl-article-content strong { font-weight: 800; }

.apl-article-content ul,
.apl-article-content ol {
  margin: 10px 0 26px;
  padding-left: 1.35em;
}

.apl-article-content li { margin-bottom: 8px; }

.apl-article-content blockquote,
.apl-article-content .wp-block-quote {
  margin: 32px 0;
  padding: 26px 28px;
  border: 1px solid color-mix(in srgb, var(--apl-accent) 25%, #dbe7ef);
  border-left: 5px solid var(--apl-accent);
  border-radius: 14px;
  background: #f5f9fc;
  color: #0a3559;
  font-family: "Oswald", sans-serif;
  font-size: 23px;
  line-height: 1.45;
}

.apl-article-content blockquote p:last-child { margin-bottom: 0; }

.apl-article-content figure img,
.apl-article-content > img,
.apl-article-content .wp-block-image img {
  border-radius: 15px;
}

.apl-article-content figcaption {
  color: var(--apl-muted);
  font-size: 12px;
}

.apl-article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 26px 0;
  overflow: hidden;
  border: 1px solid var(--apl-line);
  border-radius: 12px;
}

.apl-article-content th,
.apl-article-content td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--apl-line);
  text-align: left;
}

.apl-article-content th {
  background: var(--apl-navy);
  color: #fff;
  font-family: "Oswald", sans-serif;
}

/* Gutenberg custom styles */
.apl-article-content .is-style-apl-important {
  margin: 30px 0;
  padding: 25px 28px;
  border: 1px solid color-mix(in srgb, var(--apl-accent) 22%, #d9e4ec);
  border-left: 5px solid var(--apl-accent);
  border-radius: 15px;
  background: linear-gradient(135deg, #f6fbff, #eef7fd);
}

.apl-article-content .is-style-apl-important h3 {
  margin: 0 0 8px;
  color: var(--apl-accent);
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: .035em;
}

.apl-article-content .is-style-apl-important p:last-child { margin-bottom: 0; }

.apl-article-content .is-style-apl-dark-box {
  margin: 32px 0;
  padding: 28px 30px;
  border-radius: 17px;
  background: linear-gradient(135deg, #07162f, #0b3565);
  color: #fff;
}

.apl-article-content .is-style-apl-dark-box h2,
.apl-article-content .is-style-apl-dark-box h3,
.apl-article-content .is-style-apl-dark-box p { color: #fff !important; }

.apl-article-content .is-style-apl-big-number {
  margin: 0 !important;
  color: var(--apl-accent) !important;
  font-family: "Oswald", sans-serif;
  font-size: clamp(44px, 7vw, 70px) !important;
  font-weight: 700;
  line-height: 1 !important;
}

.apl-article-content .is-style-apl-comparison {
  gap: 14px;
  margin: 28px 0;
}

.apl-article-content .is-style-apl-comparison > .wp-block-column {
  padding: 24px 18px;
  border: 1px solid var(--apl-line);
  border-radius: 15px;
  background: var(--apl-soft);
}

.apl-article-content .is-style-apl-quote {
  background: linear-gradient(135deg, #f7fbff, #eef7fd);
}

.apl-sources-box {
  margin: 38px 0;
  padding: 24px 27px;
  border: 1px solid var(--apl-line);
  border-radius: 15px;
  background: #fafbfd;
}

.apl-sources-box h3 { margin-top: 0 !important; }
.apl-sources-box li { margin-bottom: 5px; }

.apl-share {
  font-family: "Inter", Arial, sans-serif;
}

.apl-share-desktop {
  position: sticky;
  top: 100px;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.apl-share-label {
  margin-bottom: 2px;
  color: var(--apl-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.apl-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--apl-line);
  border-radius: 50%;
  background: #fff;
  color: var(--apl-navy) !important;
  box-shadow: 0 5px 16px rgba(7,22,47,.06);
  font: 800 16px/1 "Inter", sans-serif;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, color .18s ease;
}

.apl-share-btn:hover {
  transform: translateY(-2px);
  border-color: var(--apl-accent);
  color: var(--apl-accent) !important;
}

.apl-share-mobile { display: none; }

.apl-related {
  grid-column: 2;
  margin-top: 54px;
  padding-top: 28px;
  border-top: 1px solid var(--apl-line);
}

.apl-section-label {
  margin-bottom: 16px;
  color: var(--apl-navy);
  font-family: "Oswald", sans-serif;
  font-size: 26px;
  font-weight: 700;
  text-transform: uppercase;
}

.apl-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.apl-related-card {
  overflow: hidden;
  border: 1px solid var(--apl-line);
  border-radius: 14px;
  background: #fff;
  color: var(--apl-text) !important;
  text-decoration: none !important;
  box-shadow: 0 8px 22px rgba(7,22,47,.05);
  transition: transform .2s ease, box-shadow .2s ease;
}

.apl-related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(7,22,47,.1);
}

.apl-related-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #e9eef3;
}

.apl-related-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.apl-related-body { padding: 14px; }
.apl-related-date { color: var(--apl-muted); font-size: 11px; font-weight: 700; }
.apl-related-card h3 {
  margin: 5px 0 0;
  color: var(--apl-navy);
  font-family: "Oswald", sans-serif;
  font-size: 19px;
  line-height: 1.2;
}

@media (max-width: 900px) {
  .apl-article-grid {
    grid-template-columns: minmax(0, 820px);
    gap: 0;
  }
  .apl-share-desktop { display: none; }
  .apl-share-mobile {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 34px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--apl-line);
  }
  .apl-share-mobile .apl-share-label {
    margin-right: 4px;
    writing-mode: initial;
    transform: none;
  }
  .apl-related { grid-column: 1; }
}

@media (max-width: 700px) {
  .apl-article-shell {
    width: min(100% - 18px, 1120px);
    margin-top: 10px;
  }
  .apl-article-hero {
    padding: 30px 22px;
    border-radius: 16px;
  }
  .apl-hero-title {
    font-size: clamp(37px, 11vw, 52px) !important;
  }
  .apl-hero-lead { font-size: 16.5px !important; }
  .apl-featured-wrap { margin-top: 12px !important; border-radius: 14px; }
  .apl-article-grid { margin-top: 24px; }
  .apl-article-content { font-size: 16.5px; line-height: 1.72; }
  .apl-article-content > p:first-child { font-size: 17px; }
  .apl-article-content h2,
  .apl-article-content .wp-block-heading:is(h2) { margin-top: 39px !important; }
  .apl-related-grid { grid-template-columns: 1fr; }
  .apl-article-content .is-style-apl-comparison { gap: 10px; }
}
