/*
Theme Name: IT Star Services
Theme URI: https://itstarservices.co.uk
Author: IT Star Services
Author URI: https://itstarservices.co.uk
Description: Professional IT consultation theme for IT Star Services — featuring a dark navy hero, sticky header, two-column layout, and full Customiser control.
Version: 1.0.2
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: itstar
Tags: two-columns, custom-menu, featured-images, footer-widgets, sticky-post, theme-options
*/

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --navy:        #0a1628;
  --navy-mid:    #0d1f3c;
  --navy-light:  #12295a;
  --blue:        #1a5dab;
  --blue-bright: #2979d8;
  --accent:      #4fa3e0;
  --accent-glow: #60c3ff;
  --white:       #ffffff;
  --off-white:   #f4f7fb;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --border:      #e2e8f0;
  --green:       #22c55e;
  --header-h:    68px;
  --topbar-h:    36px;
  --radius:      8px;
  --radius-lg:   14px;
  --shadow:      0 2px 16px rgba(10,22,40,.10);
  --shadow-lg:   0 8px 40px rgba(10,22,40,.18);
  --font-sans:   'Inter', 'Segoe UI', Arial, sans-serif;
  --transition:  .22s cubic-bezier(.4,0,.2,1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--off-white);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--blue-bright); }
ul { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.25; color: var(--text); }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px);
  clip-path: inset(50%); height: 1px; margin: -1px;
  overflow: hidden; padding: 0; position: absolute; width: 1px;
  word-wrap: normal !important;
}

/* ============================================================
   TOP BAR
   ============================================================ */
#itstar-topbar {
  background: var(--navy);
  color: rgba(255,255,255,.82);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .02em;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.07);
  overflow: hidden;
}
#itstar-topbar .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
#itstar-topbar .topbar-star { color: #fbbf24; font-size: .9rem; }

/* ============================================================
   STICKY HEADER
   ============================================================ */
#masthead {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  height: var(--header-h);
  box-shadow: 0 2px 12px rgba(10,22,40,.10);
  transition: box-shadow var(--transition);
}
#masthead.scrolled { box-shadow: 0 4px 24px rgba(10,22,40,.16); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.site-branding { display: flex; align-items: center; gap: 12px; }
.site-logo-img { height: 44px; width: auto; }
.site-logo-text { display: flex; flex-direction: column; }
.site-name { font-size: 1.15rem; font-weight: 800; color: var(--navy); line-height: 1.1; letter-spacing: -.01em; }
.site-name span { color: var(--blue); }
.site-tagline-small { font-size: .7rem; color: var(--text-muted); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }

/* Primary Nav */
#primary-nav { display: flex; align-items: center; gap: 4px; }
#primary-nav .nav-menu { display: flex; align-items: center; gap: 2px; }
#primary-nav .nav-menu li { position: relative; }
#primary-nav .nav-menu a {
  display: block;
  padding: 8px 16px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
#primary-nav .nav-menu a:hover,
#primary-nav .nav-menu .current-menu-item > a,
#primary-nav .nav-menu .current_page_item > a {
  background: var(--off-white);
  color: var(--blue);
}

/* Dropdown */
#primary-nav .nav-menu .sub-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all var(--transition);
  z-index: 100;
}
#primary-nav .nav-menu li:hover > .sub-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
#primary-nav .nav-menu .sub-menu a { border-radius: 0; padding: 10px 18px; font-weight: 500; }
#primary-nav .nav-menu .sub-menu a:hover { background: var(--off-white); }

/* Hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--navy); border-radius: 2px; transition: all var(--transition); }
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================================
   HERO BANNER
   ============================================================ */
#hero-banner {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, var(--navy-light) 100%);
  position: relative;
  overflow: hidden;
  padding: 80px 0 90px;
}
#hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(41,121,216,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41,121,216,.07) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
#hero-banner::after {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(41,121,216,.22) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(41,121,216,.18);
  border: 1px solid rgba(79,163,224,.35);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 28px;
}
.hero-badge .badge-star { color: var(--accent-glow); }
.hero-heading {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.12;
  letter-spacing: -.03em;
  margin-bottom: 20px;
}
.hero-heading .highlight {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,.72);
  line-height: 1.6;
  max-width: 560px;
  margin-bottom: 36px;
  font-weight: 400;
}
.hero-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-pill {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.85);
  font-size: .8rem;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 100px;
  letter-spacing: .03em;
  transition: all var(--transition);
}
.hero-pill:hover {
  background: rgba(41,121,216,.3);
  border-color: rgba(79,163,224,.5);
  color: var(--white);
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
#primary-content { padding: 52px 0 60px; }
.content-area-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.entry-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}
.entry-title { font-size: 1.75rem; margin-bottom: 20px; color: var(--navy); }
.entry-content h2 { font-size: 1.4rem; color: var(--navy); margin: 1.6rem 0 .8rem; }
.entry-content h3 { font-size: 1.2rem; color: var(--navy-light); margin: 1.4rem 0 .6rem; }
.entry-content ul, .entry-content ol { margin: 0 0 1rem 1.5rem; }
.entry-content li { margin-bottom: .4rem; }
.entry-content blockquote {
  border-left: 4px solid var(--blue);
  padding: 12px 20px;
  background: var(--off-white);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-muted);
}

/* ============================================================
   HOMEPAGE CARD GRID
   ============================================================ */
.homepage-pages-section { margin-top: 40px; }
.homepage-pages-section h2 {
  font-size: 1.3rem;
  color: var(--navy);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pages-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.page-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: 0 1px 6px rgba(10,22,40,.06);
}
.page-card:hover {
  border-color: var(--blue);
  box-shadow: 0 6px 24px rgba(26,93,171,.15);
  transform: translateY(-2px);
  color: inherit;
}
.page-card-icon { font-size: 2.2rem; margin-bottom: 12px; display: block; line-height: 1; }
.page-card-title { font-size: .9rem; font-weight: 700; color: var(--navy); line-height: 1.3; }
.page-card-excerpt { font-size: .78rem; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }

/* ============================================================
   SIDEBAR
   ============================================================ */
#secondary { position: sticky; top: calc(var(--header-h) + 20px); }
.widget-area { display: flex; flex-direction: column; gap: 20px; }
.widget {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}
.widget-title {
  font-size: .85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Quick Links */
.quick-links-menu { display: flex; flex-direction: column; gap: 2px; }
.quick-links-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  transition: all var(--transition);
}
.quick-links-menu a::before { content: '→'; color: var(--blue); font-size: .75rem; transition: transform var(--transition); }
.quick-links-menu a:hover { background: var(--off-white); color: var(--blue); }
.quick-links-menu a:hover::before { transform: translateX(3px); }
.quick-links-menu .current-menu-item > a,
.quick-links-menu .current_page_item > a { background: rgba(26,93,171,.08); color: var(--blue); }

/* System Status */
.system-status-list { display: flex; flex-direction: column; gap: 10px; }
.status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--off-white);
  border-radius: var(--radius);
  font-size: .84rem;
}
.status-name { font-weight: 600; color: var(--text); }
.status-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.status-dot { width: 9px; height: 9px; background: var(--green); border-radius: 50%; position: relative; }
.status-dot::before {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid var(--green);
  border-radius: 50%;
  opacity: 0;
  animation: pulse-ring 2.4s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { opacity: .7; transform: scale(.8); }
  70%  { opacity: 0;  transform: scale(1.6); }
  100% { opacity: 0;  transform: scale(1.6); }
}
.status-item:nth-child(2) .status-dot::before { animation-delay: .4s; }
.status-item:nth-child(3) .status-dot::before { animation-delay: .8s; }
.status-item:nth-child(4) .status-dot::before { animation-delay: 1.2s; }
.status-item:nth-child(5) .status-dot::before { animation-delay: 1.6s; }

/* Search Widget */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--off-white);
  transition: border-color var(--transition);
  outline: none;
}
.search-form input[type="search"]:focus { border-color: var(--blue); background: var(--white); }
.search-form button {
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: 9px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 700;
  transition: background var(--transition);
}
.search-form button:hover { background: var(--blue-bright); }

/* ============================================================
   FOOTER
   ============================================================ */
#colophon { background: var(--navy); color: rgba(255,255,255,.75); border-top: 3px solid var(--blue); }
.footer-top {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 48px;
  padding: 56px 0 48px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-brand .footer-logo-text { font-size: 1.3rem; font-weight: 800; color: var(--white); margin-bottom: 8px; }
.footer-brand .footer-logo-text span { color: var(--accent); }
.footer-tagline { font-size: .875rem; color: rgba(255,255,255,.6); line-height: 1.6; margin-bottom: 20px; max-width: 300px; }
.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(41,121,216,.2);
  border: 1px solid rgba(79,163,224,.25);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 5px 12px;
  border-radius: 100px;
}
.footer-col-title {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-menu { display: flex; flex-direction: column; gap: 6px; }
.footer-menu a {
  font-size: .875rem;
  color: rgba(255,255,255,.65);
  transition: color var(--transition);
  padding: 2px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-menu a::before { content: '›'; color: var(--accent); font-size: .9rem; }
.footer-menu a:hover { color: var(--white); }
.footer-bottom {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
  color: rgba(255,255,255,.38);
}
.footer-bottom a { color: rgba(255,255,255,.5); }
.footer-bottom a:hover { color: var(--white); }

/* ============================================================
   ARCHIVE / BLOG
   ============================================================ */
.posts-list { display: flex; flex-direction: column; gap: 28px; }
.post-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.post-card:hover { box-shadow: var(--shadow-lg); }
.post-card .entry-title { font-size: 1.3rem; margin-bottom: 8px; }
.post-card .entry-title a { color: var(--navy); }
.post-card .entry-title a:hover { color: var(--blue); }
.entry-meta { font-size: .8rem; color: var(--text-muted); margin-bottom: 14px; display: flex; gap: 16px; flex-wrap: wrap; }

/* ============================================================
   PAGE HEADER STRIP
   ============================================================ */
.page-header-strip {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 40px 0;
  border-bottom: 3px solid var(--blue);
}
.page-header-strip .page-title { font-size: 1.8rem; color: var(--white); font-weight: 800; }
.page-header-strip .breadcrumbs { font-size: .8rem; color: rgba(255,255,255,.55); margin-top: 6px; }
.page-header-strip .breadcrumbs a { color: rgba(255,255,255,.65); }
.page-header-strip .breadcrumbs a:hover { color: var(--white); }

/* ============================================================
   404
   ============================================================ */
.not-found-wrap { text-align: center; padding: 60px 20px; }
.not-found-wrap .big-icon { font-size: 4rem; margin-bottom: 20px; }
.not-found-wrap h1 { font-size: 2rem; color: var(--navy); margin-bottom: 12px; }
.not-found-wrap p { color: var(--text-muted); margin-bottom: 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue);
  color: var(--white);
  padding: 12px 26px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: .9rem;
  transition: background var(--transition), transform var(--transition);
  border: none;
  cursor: pointer;
}
.btn:hover { background: var(--blue-bright); color: var(--white); transform: translateY(-1px); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; gap: 6px; justify-content: center; padding: 32px 0 0; flex-wrap: wrap; }
.pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--text);
  transition: all var(--transition);
  background: var(--white);
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover { background: var(--blue); color: var(--white); border-color: var(--blue); }

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-area {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
  margin-top: 28px;
}

/* ============================================================
   ADMIN NOTICE
   ============================================================ */
.itstar-admin-notice { border-left: 4px solid #1a5dab !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .content-area-grid { grid-template-columns: 1fr; }
  #secondary { position: static; }
}
@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .menu-toggle { display: flex; }
  #primary-nav .nav-menu {
    display: none;
    position: fixed;
    top: calc(var(--topbar-h) + var(--header-h));
    left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    box-shadow: 0 12px 40px rgba(10,22,40,.18);
    gap: 2px;
  }
  #primary-nav .nav-menu.is-open { display: flex; }
  #primary-nav .nav-menu .sub-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; background: var(--off-white);
    border-radius: var(--radius); margin-top: 4px;
  }
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  #hero-banner { padding: 52px 0 60px; }
  .hero-heading { font-size: 1.8rem; }
  .entry-content { padding: 24px; }
  .pages-card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .pages-card-grid { grid-template-columns: 1fr; }
  .hero-pills { gap: 8px; }
}

/* ============================================================
   HEADER ICON PANEL
   Rendered by ITStar_Header_Icon_Widget into the sidebar
   'header-icon-panel'. Sits between .site-branding and
   #primary-nav inside the existing .header-inner flex row.
   CSS custom properties (--hip-color, --hip-opacity,
   --hip-tag-color) are set as inline style on the wrapper.
   ============================================================ */

.header-icon-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-left:  1px solid var(--border);
  border-right: 1px solid var(--border);
  height: 44px;
  flex-shrink: 0;
}

.hip-icon {
  display: flex;
  align-items: center;
  color: var(--hip-color, #4fa3e0);
  opacity: var(--hip-opacity, 0.8);
  flex-shrink: 0;
}

.hip-icon svg {
  width: 34px;
  height: 34px;
  display: block;
}

.hip-tagline {
  font-size: .8rem;
  font-weight: 700;
  color: var(--hip-tag-color, #1e293b);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* Hide on smaller screens to keep header tidy */
@media (max-width: 960px) {
  .header-icon-panel { display: none; }
}

/* ============================================================
   CUSTOM LOGO — uploaded via Appearance > Customise > Site Identity
   ============================================================ */
.custom-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}
.custom-logo {
  height: 48px;
  width: auto;
  max-width: 220px;
  display: block;
  object-fit: contain;
}
@media (max-width: 480px) {
  .custom-logo { height: 36px; max-width: 160px; }
}
