/*
Theme Name: Kids Magazines
Theme URI: https://kidsmagazines.co.uk/
Description: News-style child theme for GeneratePress — dark top header, trending strip, three-column hero, category card grids and a dark footer. All content is dynamic (site identity, menus, categories, posts); nothing is hardcoded.
Author: Kids Magazines
Template: generatepress
Version: 1.0.0
Text Domain: kidsmagazines-child
*/

:root {
  --km-ink: #12141a;
  --km-paper: #ffffff;
  --km-bg: #f4f5f7;
  --km-line: #e3e5e9;
  --km-navy: #0b1f4b;
  --km-red: #d21f2c;
  --km-blue: #1553b6;
  --km-grey: #5c6270;
  --km-max: 1200px;
  --km-radius: 6px;
  --km-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Base ---------- */
body {
  font-family: var(--km-font);
  background: var(--km-paper);
  color: var(--km-ink);
}
a { transition: color .15s ease; }

.km-wrap {
  max-width: var(--km-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Hide GeneratePress default header/footer replaced by ours */
.site-header, .main-navigation:not(.km-nav-holder) { }

/* ---------- Top header ---------- */
.km-header {
  background: #0f1115;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.km-header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 54px;
}
/* Keep clear of the WP admin bar for logged-in users */
body.admin-bar .km-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .km-header { top: 46px; } }
.km-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.km-brand img {
  max-height: 38px;
  width: auto;
  display: block;
}
/* Safety net: never show parent-theme headers, navs or footer areas */
#masthead.site-header,
.mobile-header-navigation,
#mobile-header,
#site-navigation,
.main-navigation:not(.km-nav),
.site-footer .footer-widgets,
.site-info { display: none !important; }
.km-brand .km-brand-dot { color: var(--km-red); }
.km-nav { flex: 1 1 auto; }
.km-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.km-nav a {
  display: block;
  padding: 10px 12px;
  color: #e8eaee;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}
.km-nav a:hover { color: #fff; background: rgba(255,255,255,.09); }
.km-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.km-live::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--km-red);
  animation: km-pulse 1.6s infinite;
}
@keyframes km-pulse { 50% { opacity: .35; } }
.km-search-toggle {
  background: none;
  border: 0;
  color: #e8eaee;
  padding: 8px;
  cursor: pointer;
  line-height: 0;
}
.km-search-toggle:hover { color: #fff; }
.km-search-bar { background: #1a1d24; display: none; }
.km-search-bar.open { display: block; }
.km-search-bar form { display: flex; gap: 10px; padding: 12px 0; }
.km-search-bar input[type="search"] {
  flex: 1;
  background: #fff;
  border: 0;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 15px;
}
.km-search-bar button {
  background: var(--km-red);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
}

/* Mobile menu */
.km-menu-toggle {
  display: none;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  line-height: 0;
}

/* ---------- Trending strip ---------- */
.km-trending {
  background: #fff;
  border-bottom: 1px solid var(--km-line);
}
.km-trending-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
  min-height: 44px;
}
.km-trending-inner::-webkit-scrollbar { display: none; }
.km-trending-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--km-red);
  white-space: nowrap;
}
.km-trending a {
  font-size: 14px;
  font-weight: 600;
  color: var(--km-ink);
  text-decoration: none;
  white-space: nowrap;
  padding-right: 18px;
  border-right: 1px solid var(--km-line);
}
.km-trending a:last-child { border-right: 0; }
.km-trending a:hover { color: var(--km-blue); }

/* ---------- Section headings ---------- */
.km-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 34px 0 16px;
  border-bottom: 3px solid var(--km-ink);
  padding-bottom: 8px;
}
.km-sec-head h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin: 0;
}
.km-sec-head a {
  font-size: 13px;
  font-weight: 700;
  color: var(--km-blue);
  text-decoration: none;
  white-space: nowrap;
}
.km-sec-head a:hover { text-decoration: underline; }

/* ---------- Kicker / category label ---------- */
.km-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--km-blue);
  text-decoration: none;
  margin-bottom: 6px;
}
.km-kicker:hover { color: var(--km-red); }

/* ---------- Hero ---------- */
.km-hero {
  display: grid;
  grid-template-columns: 300px 1fr 320px;
  gap: 24px;
  margin-top: 26px;
}
.km-hero-lead { background: var(--km-bg); border-radius: var(--km-radius); padding: 20px; }
.km-hero-lead h1, .km-hero-lead h2 {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -.01em;
}
.km-hero-lead a { color: var(--km-ink); text-decoration: none; }
.km-hero-lead a:hover { color: var(--km-blue); }
.km-hero-lead ul { list-style: none; margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--km-line); }
.km-hero-lead li { margin: 0 0 10px; padding-left: 14px; position: relative; font-size: 14px; line-height: 1.4; }
.km-hero-lead li::before { content: ""; position: absolute; left: 0; top: .5em; width: 6px; height: 6px; background: var(--km-red); border-radius: 50%; }
.km-hero-lead li a { color: var(--km-grey); font-weight: 600; }
.km-hero-main a.km-hero-img { display: block; border-radius: var(--km-radius); overflow: hidden; position: relative; }
.km-hero-main img { width: 100%; height: auto; aspect-ratio: 16/10; object-fit: cover; display: block; }
.km-hero-main .km-hero-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 40px 18px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.78));
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
}
.km-topstories {
  background: var(--km-navy);
  border-radius: var(--km-radius);
  color: #fff;
  padding: 18px;
}
.km-topstories h2 {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.18);
}
.km-topstories ol { list-style: none; margin: 0; padding: 0; counter-reset: ts; }
.km-topstories li {
  counter-increment: ts;
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.km-topstories li:last-child { border-bottom: 0; }
.km-topstories li::before {
  content: counter(ts);
  font-weight: 800;
  color: var(--km-red);
  font-size: 18px;
  line-height: 1.2;
}
.km-topstories a { color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; line-height: 1.4; }
.km-topstories a:hover { text-decoration: underline; }

/* ---------- Card grids ---------- */
.km-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.km-card a.km-card-img { display: block; border-radius: var(--km-radius); overflow: hidden; }
.km-card img {
  width: 100%; height: auto;
  aspect-ratio: 3/2;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}
.km-card:hover img { transform: scale(1.04); }
.km-card h3 { font-size: 16px; line-height: 1.35; font-weight: 700; margin: 10px 0 6px; }
.km-card h3 a { color: var(--km-ink); text-decoration: none; }
.km-card h3 a:hover { color: var(--km-blue); }
.km-card time { font-size: 12px; color: var(--km-grey); }

/* ---------- Footer ---------- */
.km-footer { background: #0f1115; color: #b9bec8; margin-top: 50px; }
.km-footer-inner { padding-top: 40px; padding-bottom: 24px; }
.km-footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr 1fr;
  gap: 34px;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.km-footer .km-brand { font-size: 22px; }
.km-footer-tag {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  color: #e8eaee;
}
.km-footer-about { margin: 10px 0 0; font-size: 13px; line-height: 1.7; color: #9aa1ad; }
.km-footer-social ul { display: flex; gap: 14px; list-style: none; margin: 14px 0 0; padding: 0; }
.km-footer-social a { color: #b9bec8; font-size: 13px; font-weight: 700; text-decoration: none; }
.km-footer-social a:hover { color: #fff; }
.km-footer-col h3 {
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin: 0 0 12px;
}
.km-footer-col ul { list-style: none; margin: 0; padding: 0; }
.km-footer-col li { margin: 0 0 9px; }
.km-footer-col a {
  color: #b9bec8;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.45;
}
.km-footer-col a:hover { color: #fff; }
@media (max-width: 900px) { .km-footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .km-footer-top { grid-template-columns: 1fr; } }
.km-footer-bottom { padding-top: 18px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
.km-footer-bottom a { color: #b9bec8; text-decoration: none; }
.km-footer-bottom a:hover { color: #fff; }

/* ---------- Single post / archive polish ---------- */
/* Comfortable centred reading column */
.single .content-area,
.page .content-area {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  float: none;
}
.single .site-main .inside-article {
  display: flex;
  flex-direction: column;
}
/* News order: kicker + title + meta first, then the image, then content */
.single .inside-article .featured-image.page-header-image-single { order: 2; margin: 18px 0 6px; }
.single .inside-article .entry-header { order: 1; }
.single .inside-article .entry-content { order: 3; }
.single .inside-article .entry-meta,
.single .inside-article footer.entry-meta { order: 4; }
.single .featured-image.page-header-image-single img {
  width: 100%;
  height: auto;
  border-radius: var(--km-radius);
}
.km-post-kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--km-red);
  text-decoration: none;
  margin-bottom: 10px;
}
.km-post-kicker:hover { color: var(--km-blue); }
.single .entry-header .entry-title,
.page .entry-header .entry-title {
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.2;
  font-size: 38px;
  margin-bottom: 8px;
}
.single .entry-header .entry-meta {
  font-size: 13px;
  color: var(--km-grey);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--km-line);
}
@media (max-width: 640px) {
  .single .entry-header .entry-title { font-size: 28px; }
}
.single .entry-content { font-size: 17px; line-height: 1.75; }
.single .entry-content h2 {
  font-weight: 800;
  border-left: 4px solid var(--km-red);
  padding-left: 12px;
  margin-top: 1.6em;
}
.single .entry-content figure.wp-block-image img { border-radius: var(--km-radius); }
.single .entry-content figcaption { color: var(--km-grey); font-size: 13px; }
.single .wp-block-table table { border-collapse: collapse; width: 100%; }
.single .wp-block-table td, .single .wp-block-table th {
  border: 1px solid var(--km-line);
  padding: 10px 12px;
}
.single .wp-block-table tr:nth-child(odd) td { background: var(--km-bg); }
.archive .site-main article, .blog .site-main article { border-bottom: 1px solid var(--km-line); }
.cat-links a, .entry-meta a { color: var(--km-blue); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .km-hero { grid-template-columns: 1fr 1fr; }
  .km-hero-main { order: -1; grid-column: 1 / -1; }
  .km-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .km-hero { grid-template-columns: 1fr; }
  .km-grid { grid-template-columns: 1fr; }
  .km-nav { display: none; }
  .km-nav.open {
    display: block;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: #0f1115;
    padding: 10px 20px 16px;
    border-top: 1px solid rgba(255,255,255,.1);
  }
  .km-nav.open ul { flex-direction: column; }
  .km-menu-toggle { display: block; }
  .km-hero-main .km-hero-cap { font-size: 16px; }
}

/* ---------- Kids Magazines adjustments ---------- */
/* Seven menu items with long names: keep the header on one line. */
@media (min-width: 1025px) {
  .km-nav ul { flex-wrap: nowrap; gap: 2px; }
  .km-nav a { padding: 10px 8px; font-size: 14px; white-space: nowrap; }
}
@media (min-width: 1025px) and (max-width: 1280px) {
  .km-live { display: none; }
}
.km-topstories h2 { color: #fff; }
/* Text logo: dot sits right after the name; smaller on phones so the search icon fits. */
.km-brand .km-brand-dot { margin-left: -10px; }
@media (max-width: 640px) {
  .km-header .km-brand { font-size: 20px; }
}
@media (max-width: 420px) {
  .km-header .km-live { display: none; }
}

/* In-content links: make them clearly stand out from body text. Added 2026-11-01. */
.single .entry-content a:not(.wp-block-button__link):not(.wp-element-button),
.page .entry-content a:not(.wp-block-button__link):not(.wp-element-button) {
  color: var(--km-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: 500;
}
.single .entry-content a:not(.wp-block-button__link):not(.wp-element-button):hover,
.single .entry-content a:not(.wp-block-button__link):not(.wp-element-button):focus,
.page .entry-content a:not(.wp-block-button__link):not(.wp-element-button):hover,
.page .entry-content a:not(.wp-block-button__link):not(.wp-element-button):focus {
  color: var(--km-red);
  text-decoration-thickness: 2px;
}
