/*
 * Main Stylesheet – 4D King Results
 *
 * Global resets, design tokens, typography, utilities,
 * layout systems for all page templates, and responsive rules.
 * (Sidebar styles moved to toc.css and sidebar-lottery.css)
 */

/* -------------------------------------------------------------------------- */
/*  1. CSS Reset                                                               */
/* -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               Helvetica, Arial, sans-serif;
  font-size: var(--base-font-size, 1rem);
  line-height: 1.6;
  background-color: var(--white, #ffffff);
  color: var(--dark, #111111);
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* -------------------------------------------------------------------------- */
/*  2. Design Tokens                                                          */
/* -------------------------------------------------------------------------- */
:root {
  --primary-red:  #cc0000;
  --primary-hover:#a00000;
  --primary-red-light: #f5cccc;
  --primary-red-pale:  #fff5f5;
  --white:        #ffffff;
  --dark:         #111111;
  --grey:         #666666;
  --light-grey:   #f5f5f5;
  --border-color: #e0e0e0;

  --base-font-size: 1rem;
  --heading-font-weight: 700;

  --section-padding: 60px;

  --card-shadow: 0 2px 8px rgba(0,0,0,0.06);
  --card-shadow-hover: 0 6px 16px rgba(0,0,0,0.1);
  --transition-fast: 0.18s ease;
}

/* -------------------------------------------------------------------------- */
/*  3. Layout Helpers                                                         */
/* -------------------------------------------------------------------------- */
.container {
  width: 90%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}

.site-main {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}

/* -------------------------------------------------------------------------- */
/*  4. Accessibility                                                          */
/* -------------------------------------------------------------------------- */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 1000;
  background: var(--primary-red);
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* =====================================================================
   LAYOUT SYSTEMS (grid definitions – no sidebar styling)
   ===================================================================== */

/* ---------- Standard 3‑column (page.php, single.php) ---------- */
.standard-layout {
  display: grid;
  grid-template-columns: 250px 1fr 250px;
  gap: 30px;
  margin-top: 30px;
  padding: 0 20px;
}

/* ---------- Full‑width 3‑column (single.php) ---------- */
.full-width-layout {
  display: grid;
  grid-template-columns: 250px 1fr 250px;
  gap: 30px;
  margin-top: 30px;
  padding: 0 20px;
}

.full-width-layout .standard-content {
  max-width: 720px;
  width: 100%;
  justify-self: center;
}

/* ---------- Pillar layout (template-pillar-lottery.php) ---------- */
.pillar-layout {
  display: grid;
  grid-template-columns: 250px 1fr 250px;
  gap: 30px;
  margin-top: 30px;
  padding: 0 20px;
}

.pillar-layout .pillar-content {
  max-width: 720px;
  width: 100%;
  justify-self: center;
}

/* ---------- Single result layout (old) ---------- */
.single-result-layout {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 30px;
  margin-top: 30px;
  padding: 0 20px;
}

.result-main-center {
  max-width: 700px;
  margin: 0 auto;
}

/* ---------- New CPT result template (sidebar 250px) ---------- */
.result-sidebar-layout {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 40px;
  margin-top: 30px;
  padding: 0 20px;
  align-items: start;
}

/* =====================================================================
   TYPOGRAPHY & SHARED ELEMENTS
   ===================================================================== */

/* Breadcrumbs */
.result-breadcrumbs,
.pillar-breadcrumbs,
.post-breadcrumbs {
  margin-bottom: 20px;
  font-size: 0.95rem;
  color: var(--grey);
}

.result-breadcrumbs ol,
.pillar-breadcrumbs ol,
.post-breadcrumbs {
  list-style: none;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 0;
}

.result-breadcrumbs a,
.pillar-breadcrumbs a,
.post-breadcrumbs a {
  color: var(--primary-red);
  text-decoration: none;
}

.result-breadcrumbs a:hover,
.pillar-breadcrumbs a:hover,
.post-breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumb-separator,
.breadcrumb-sep {
  margin: 0 5px;
  color: var(--grey);
}

/* Titles */
.post-title,
.pillar-title,
.result-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 20px;
}

/* Excerpts / descriptions */
.pillar-description,
.post-excerpt,
.result-excerpt {
  color: var(--grey);
  line-height: 1.6;
  margin-bottom: 30px;
  text-align: center;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Red dividers */
.pillar-divider {
  border: 0;
  border-top: 2px solid var(--primary-red);
  margin: 30px 0;
}

/* Author meta block */
.pillar-author-meta,
.post-author-meta,
.result-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;          /* force single line on desktop */
  gap: 15px;
  margin-bottom: 20px;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 1;             /* allow shrinking if needed */
  min-width: 0;               /* prevent overflow issues */
}

.author-text {
  display: flex;
  flex-direction: column;
  min-width: 0;               /* allow text truncation if absolutely necessary */
}

.author-text span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.author-avatar {
  border-radius: 50%;
}

.author-name {
  font-weight: 600;
}

.publish-date,
.result-date {
  color: var(--grey);
  font-size: 0.9rem;
}

/* Keep social icons together, never shrink */
.social-share {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* Calendar icon button */
.calendar-icon-btn {
  background: var(--white);
  border: 2px solid var(--primary-red);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary-red);
  padding: 0;
  transition: background 0.2s, color 0.2s;
}

.calendar-icon-btn:hover {
  background: var(--primary-red);
  color: var(--white);
}

.calendar-icon-btn svg {
  width: 22px;
  height: 22px;
  pointer-events: none;
}

/* Jackpot card */
.jackpot-card {
  margin-top: 20px;
  padding: 16px;
  border: 2px solid var(--primary-red);
  border-radius: 8px;
}

.jackpot-card h3 {
  color: var(--primary-red);
  margin-bottom: 12px;
}

.prize-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.prize-label {
  font-weight: 500;
}

.prize-value {
  font-weight: 700;
  color: var(--dark);
}

.view-full-draw-btn:hover {
  text-decoration: underline;
}

/* Home page: centre the "View All Results" button */
.home .text-center {
    text-align: center;
}

.home .text-center .view-full-draw-btn {
    display: block;
    margin: 0 auto;
    width: 200px;
    float: none;
}

/* 404 page */
.error-404 .container {
  max-width: 600px;
}

.error-404 h1 {
  font-size: 6rem;
  color: var(--primary-red);
  margin: 0;
}

.error-404 h2 {
  margin: 0 0 20px;
}

.error-404 p {
  color: var(--grey);
  margin-bottom: 30px;
}

/* =====================================================================
   SMOOTH SCROLL OFFSET for anchored headings
   ===================================================================== */
[id] {
  scroll-margin-top: 100px;
}

/* =====================================================================
   RESPONSIVE BREAKPOINTS (layout adjustments only)
   ===================================================================== */

/* Small desktops / tablets landscape */
@media (max-width: 1024px) {
  .standard-layout,
  .full-width-layout,
  .pillar-layout,
  .single-result-layout,
  .result-sidebar-layout {
    grid-template-columns: 1fr;
    /* NOTE: .pillar-layout gap is also set in pillar-page.css at this
       breakpoint with a DIFFERENT value (24px vs. this file's unchanged
       30px). See chat notes — needs consolidation into one file. */
  }

  .post-title,
  .pillar-title,
  .result-title {
    font-size: 2rem;
  }
}

/* Tablets portrait */
@media (max-width: 768px) {
  .site-main {
    padding-top: 30px;
    padding-bottom: 30px;
  }

  .pillar-author-meta,
  .post-author-meta,
  .result-meta {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;          /* wrap allowed on small screens */
  }

    .author-info {
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }

  .social-share {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
    padding-top: 8px;
  }

    /* Add “Share” text before the icons (purely via CSS) */
  .social-share::before {
    content: "Share";
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark);
    margin-right: 8px;
    align-self: center;
  }

    /* Larger touch‑friendly icons */
  .social-share a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .social-share a svg {
    width: 24px;
    height: 24px;
  }
}

    .author-text {
    align-items: center;
  }

  .post-title,
  .pillar-title,
  .result-title {
    font-size: 1.8rem;
  }

  .standard-layout,
  .full-width-layout,
  .pillar-layout,
  .single-result-layout,
  .result-sidebar-layout {
    padding: 0 10px;
    gap: 20px;
    /* NOTE: pillar-page.css sets gap:18px for .pillar-layout at this same
       breakpoint — conflicting value, see chat notes. */
  }

  .container {
    width: 95%;
    padding-left: 10px;
    padding-right: 10px;
  }

  .pillar-description,
  .post-excerpt,
  .result-excerpt {
    font-size: 0.95rem;
  }

/* Large phones */
@media (max-width: 480px) {
  .post-title,
  .pillar-title,
  .result-title {
    font-size: 1.6rem;
  }

  .error-404 h1 {
    font-size: 2.75rem;
  }

  .error-404 h2 {
    font-size: 1.3rem;
  }

  .breadcrumb-separator,
  .breadcrumb-sep {
    margin: 0 2px;
  }

  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .jackpot-card {
    padding: 12px;
  }

  .pillar-description,
  .post-excerpt,
  .result-excerpt {
    margin-bottom: 22px;
  }
}