/*
Theme Name: UK Digital Life News
Theme URI: https://ukdigitallife.com/
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: UK Digital Life
Template: generatepress
Version: 1.0.0
Text Domain: udl-news-child
*/

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

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

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

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

/* ---------- Top header ---------- */
.udl-header {
  background: #0f1115;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.udl-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 .udl-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .udl-header { top: 46px; } }
.udl-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;
}
.udl-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(.udl-nav),
.site-footer .footer-widgets,
.site-info { display: none !important; }
.udl-brand .udl-brand-dot { color: var(--udl-red); }
.udl-nav { flex: 1 1 auto; }
.udl-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.udl-nav a {
  display: block;
  padding: 10px 12px;
  color: #e8eaee;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}
.udl-nav a:hover { color: #fff; background: rgba(255,255,255,.09); }
.udl-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.udl-live::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--udl-red);
  animation: udl-pulse 1.6s infinite;
}
@keyframes udl-pulse { 50% { opacity: .35; } }
.udl-search-toggle {
  background: none;
  border: 0;
  color: #e8eaee;
  padding: 8px;
  cursor: pointer;
  line-height: 0;
}
.udl-search-toggle:hover { color: #fff; }
.udl-search-bar { background: #1a1d24; display: none; }
.udl-search-bar.open { display: block; }
.udl-search-bar form { display: flex; gap: 10px; padding: 12px 0; }
.udl-search-bar input[type="search"] {
  flex: 1;
  background: #fff;
  border: 0;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 15px;
}
.udl-search-bar button {
  background: var(--udl-red);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
}

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

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

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

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

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

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

/* ---------- Footer ---------- */
.udl-footer { background: #0f1115; color: #b9bec8; margin-top: 50px; }
.udl-footer-inner { padding-top: 40px; padding-bottom: 24px; }
.udl-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);
}
.udl-footer .udl-brand { font-size: 22px; }
.udl-footer-tag {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  color: #e8eaee;
}
.udl-footer-about { margin: 10px 0 0; font-size: 13px; line-height: 1.7; color: #9aa1ad; }
.udl-footer-social ul { display: flex; gap: 14px; list-style: none; margin: 14px 0 0; padding: 0; }
.udl-footer-social a { color: #b9bec8; font-size: 13px; font-weight: 700; text-decoration: none; }
.udl-footer-social a:hover { color: #fff; }
.udl-footer-col h3 {
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin: 0 0 12px;
}
.udl-footer-col ul { list-style: none; margin: 0; padding: 0; }
.udl-footer-col li { margin: 0 0 9px; }
.udl-footer-col a {
  color: #b9bec8;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.45;
}
.udl-footer-col a:hover { color: #fff; }
@media (max-width: 900px) { .udl-footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .udl-footer-top { grid-template-columns: 1fr; } }
.udl-footer-bottom { padding-top: 18px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
.udl-footer-bottom a { color: #b9bec8; text-decoration: none; }
.udl-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(--udl-radius);
}
.udl-post-kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--udl-red);
  text-decoration: none;
  margin-bottom: 10px;
}
.udl-post-kicker:hover { color: var(--udl-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(--udl-grey);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--udl-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(--udl-red);
  padding-left: 12px;
  margin-top: 1.6em;
}
.single .entry-content figure.wp-block-image img { border-radius: var(--udl-radius); }
.single .entry-content figcaption { color: var(--udl-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(--udl-line);
  padding: 10px 12px;
}
.single .wp-block-table tr:nth-child(odd) td { background: var(--udl-bg); }
.archive .site-main article, .blog .site-main article { border-bottom: 1px solid var(--udl-line); }
.cat-links a, .entry-meta a { color: var(--udl-blue); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .udl-hero { grid-template-columns: 1fr 1fr; }
  .udl-hero-main { order: -1; grid-column: 1 / -1; }
  .udl-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .udl-hero { grid-template-columns: 1fr; }
  .udl-grid { grid-template-columns: 1fr; }
  .udl-nav { display: none; }
  .udl-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);
  }
  .udl-nav.open ul { flex-direction: column; }
  .udl-menu-toggle { display: block; }
  .udl-hero-main .udl-hero-cap { font-size: 16px; }
}
