/* ==== OddsPapi Blog – Header, Footer, Global Styles (with dark theme) ==== */

/* CSS variables */
:root {
  /* Page + text */
  --op-bg: #fdfcfc;
  --op-text-main: #111827;
  --op-text-main-soft: #4b5563;

  /* Header / footer */
  --op-text: #ffffff;
  --op-muted: #5A6277;
  --op-border: rgba(255, 255, 255, 0.20);

  /* Brand */
  --op-blue: #2563eb;
}

/* Dark theme overrides – activated when <html> has class="dark" */
html.dark {
  --op-bg: #141414;
  --op-text-main: #e5e7eb;
  --op-text-main-soft: #9ca3af;

  --op-text: #f9fafb;
  --op-muted: #9ca3af;
  --op-border: rgba(75, 85, 99, 0.7);
}

/* Generic content links inside the blog area */
html.dark .op-blog-main a {
  color: #60a5fa;              /* lighter blue */
}

/* Post lists / cards */
html.dark .op-post-title a,
html.dark .op-post-card-title a,
html.dark .op-post-card-readmore {
  color: #60a5fa;
}

/* Single post body links */
html.dark .op-post-single-content a,
html.dark .op-post-content a {
  color: #60a5fa;
}

/* Hover state */
html.dark .op-blog-main a:hover,
html.dark .op-post-title a:hover,
html.dark .op-post-card-title a:hover,
html.dark .op-post-card-readmore:hover,
html.dark .op-post-single-content a:hover,
html.dark .op-post-content a:hover {
  color: #93c5fd;              /* even lighter on hover */
  text-decoration: underline;
}

/* ===================== LAYOUT HELPERS ===================== */

.op-container{
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (min-width: 640px){ .op-container{ padding: 0 2rem; } }
@media (min-width: 768px){ .op-container{ padding: 0 3rem; } }

.op-header,
.op-footer {
  flex-shrink: 0;
}

/* ===================== HEADER ===================== */

.op-header{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1100;
  background: #1E2746;
  border-bottom: 1px solid transparent;
  backdrop-filter: saturate(180%) blur(8px);
  transition: box-shadow .3s ease, border-color .3s ease, background-color .3s ease;
}
.op-header.scrolled{
  border-bottom-color: var(--op-border);
  box-shadow: 0 10px 25px rgba(0,0,0,.35);
}
html.dark .op-header {
  background: #141414;
}
html.dark .op-header.scrolled {
  box-shadow: 0 10px 25px rgba(0,0,0,.7);
}

/* BACKDROP FOR MOBILE MENU */
@media (max-width: 900px) {
  .op-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;  /* lower than header now */
    display: none;
  }

  .op-nav {
    /* this can stay absolute, but give it a high z-index for safety */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1101; /* above backdrop (and within header's 1100 context) */
  }
}

body.admin-bar .op-header{ top: 32px; }
@media (max-width: 782px){ body.admin-bar .op-header{ top: 46px; } }

.op-header-bar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 0;
  color: var(--op-text);
  gap: 1.25rem;
}

/* Logo */
.op-logo img{
  display: block;
  width: 100px;
  height: 50px;
}

/* Right side: nav + actions (like React header) */
.op-header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* NAVIGATION */

.op-nav {
  display: flex;
}

.op-nav-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 600;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
.op-nav-link{
  position: relative;
  display: inline-block;
  padding: .75rem 1rem;
  color: var(--op-text);
  text-decoration: none;
  transition: color .2s ease, opacity .2s ease;
  font-weight: 600;
}
.op-nav-link:hover{
  color: #d1d5db;
}
.op-nav-link::after{
  content: "";
  position: absolute;
  left: 1rem;
  bottom: .375rem;
  height: 2px;
  width: 0;
  background: #fff;
  transition: width .3s ease;
}
.op-nav-link:hover::after{
  width: 60%;
}
.op-nav-ext{
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.op-ext-ico{
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}
/* ---------- Coverage dropdown (desktop) ---------- */
.op-nav-item {
  position: relative;
}

.op-dropdown-toggle {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Little caret, matches theme */
.op-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(255, 255, 255, 0.85);
  transition: transform 0.2s ease;
}

/* Dropdown panel */
.op-dropdown {
  position: absolute;
  top: calc(100% - 6px);
  left: 16px;
  width: 190px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  background: #10162A;
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
  display: none;
  z-index: 60;
}

html.dark .op-dropdown {
  background: #0F1115;
}

/* Links inside dropdown */
.op-dropdown-link {
  display: block;
  padding: 12px 14px;
  font-size: 14px;
  color: #fff;
  text-decoration: none;
}

.op-dropdown-link:hover {
  background: rgba(255,255,255,0.10);
}

/* Desktop hover opens dropdown */
@media (min-width: 768px) {
  .op-has-dropdown:hover .op-dropdown {
    display: block;
  }
  .op-has-dropdown:hover .op-caret {
    transform: rotate(180deg);
  }
}

/* ---------- Mobile: dropdown becomes expandable ---------- */
/* When nav is open (mobile), turn dropdown into inline section */
@media (max-width: 767px) {
  .op-dropdown {
    position: static;
    width: 100%;
    margin-top: 10px;
    border-radius: 10px;
    display: none; /* toggled via JS */
  }

  .op-dropdown-link {
    padding-left: 18px;
  }

  /* Rotate caret when expanded */
  .op-has-dropdown.is-open .op-caret {
    transform: rotate(180deg);
  }

  .op-has-dropdown.is-open .op-dropdown {
    display: block;
  }
}


/* HEADER ACTIONS: theme toggle + burger */
.op-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme toggle button */
.op-theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  outline: none;
  color: #ffffff;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    opacity 0.2s ease;
}
.op-theme-toggle:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

/* SVG icons (sun/moon) */
.op-theme-icon {
  display: block;
  width: 18px;
  height: 18px;
}
.op-theme-icon-sun {
  display: none;
}

html.dark .op-theme-toggle {
  color: #f5f5f5;
  border-color: rgba(255, 255, 255, 0.2);
}
html.dark .op-theme-toggle:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
}
html.dark .op-theme-icon-moon {
  display: none;
}
html.dark .op-theme-icon-sun {
  display: block;
}

/* BURGER BUTTON (mobile) */
.op-burger {
  display: none;
  flex-direction: column;
  width: 30px;
  gap: 6px;
  cursor: pointer;
  background: transparent !important;
  border: none !important;
  padding: 0;
}
.op-burger div {
  width: 100%;
  height: 3px;
  background: #ffffff !important;
  border-radius: 3px;
}

/* BACKDROP FOR MOBILE MENU */
.op-backdrop {
  display: none;
}

/* Mobile nav behaviour */
@media (max-width: 900px) {
  .op-burger {
    display: flex;
  }

  .op-nav {
    display: none;
    position: absolute;
    top: 100%; /* just below header bar */
    left: 0;
    right: 0;
    background: #1E2746;
    padding: 1rem 0 1.2rem;
    z-index: 1002;
  }

  .op-nav.open {
    display: block;
  }

  html.dark .op-nav {
    background: #141414;
  }

  .op-nav-list {
    flex-direction: column;
    gap: 1rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .op-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 900;
    display: none;
  }

  .op-backdrop.visible {
    display: block;
  }

  body.menu-open {
    overflow: hidden;
  }

  .op-header-right {
    gap: 0.75rem;
  }
}

/* Small screens extra */
@media (max-width: 480px){
  .op-nav-link{
    padding: .5rem .75rem;
  }
}

/* ===================== FOOTER ===================== */

.op-footer{
  background: #1E2746 !important;
  color: #fff !important;
  border-top: 1px solid rgba(37,99,235,.2);
}
html.dark .op-footer {
  background: #020617 !important;
  border-top-color: rgba(31, 41, 55, .9);
}

.op-footer-top{
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding: 4rem 0 8rem;
}
@media (min-width: 768px){
  .op-footer-top{
    grid-template-columns: 1fr 2fr;
    align-items: flex-start;
  }
}

.op-social-col{
  display: flex;
  flex-direction: column;
}
.op-h4{
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}
.op-social-row{
  display: flex;
  gap: 1.5rem;
}
.op-social{
  color: #fff;
  text-decoration: none;
  opacity: 1;
  transition: opacity .2s ease;
}
.op-social:hover{
  opacity: .8;
}

.op-cta{
  display: block;
  margin-top: 3rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(90deg,#2563eb,#4f46e5);
  color: #fff;
  text-align: center;
  border-radius: .75rem;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.op-cta span{
  display: block;
  margin-top: .25rem;
  font-size: .875rem;
  color: #c7d2fe;
}
.op-cta:hover{
  transform: scale(1.02);
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}

/* Footer link grid */
.op-links-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 640px){
  .op-links-grid{
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}
@media (min-width: 768px){
  .op-links-grid{
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}
@media (min-width: 1024px){
  .op-links-grid{
    grid-template-columns: repeat(4,minmax(0,1fr));
  }
}
.op-col-title{
  margin: 0 0 1.5rem;
  font-weight: 600;
  color: var(--op-muted);
  border-bottom: 2px solid #fff;
  padding-bottom: .5rem;
}
.op-col-list{
  list-style: none;
  margin: 0;
  padding: 0;
}
.op-col-list a{
  display: inline-block;
  margin: .6rem 0;
  font-size: .95rem;
  color: #fff;
  text-decoration: none;
  transition: color .2s ease;
}
.op-col-list a:hover{
  color: #d1d5db;
}

/* ===================== BLOG INTRO (INDEX HEADER) ===================== */

.op-blog-intro {
  margin-bottom: 2.5rem;
  text-align: center;
}

.op-blog-title {
  font-size: 2.4rem;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  font-weight: 700;
  color: var(--op-text-main);
}

.op-blog-subtitle {
  font-size: 1.05rem;
  line-height: 1.6;
  font-weight: 400;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  color: var(--op-text-main-soft);
}

/* Dark theme – blog intro titles */
html.dark .op-blog-title {
  color: #f9fafb; /* near-white, strong contrast */
}

html.dark .op-blog-subtitle {
  color: #9ca3af; /* muted gray, readable but secondary */
}

/* ===================== BLOG MAIN LAYOUT ===================== */

.op-blog-main{
  flex: 1 !important;
  margin: 0 !important;
  padding: 3rem 0 4rem !important; /* top space */
  background-color: var(--op-bg);
}

.op-blog-container {
  max-width: 1280px;
  margin: 100px auto;
  padding-top: 3rem !important;
}

.op-post{
  margin-bottom: 3rem;
}
.op-post-title{
  font-size: 1.75rem;
  margin: 0 0 .5rem;
}
.op-post-title a{
  color: #155dfc !important;
  text-decoration: none;
}
.op-post-title a:hover{
  text-decoration: underline;
}
.op-post-meta{
  font-size: .875rem;
  color: var(--op-text-main-soft) !important;
  margin-bottom: 1rem;
}
.op-post-content{
  color: var(--op-text-main) !important;
}

/* ===================== GLOBAL RESET + Poppins ===================== */

/* Remove default browser margin/padding/border */
html,
body {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  height: 100%;
}

/* WordPress wrappers – remove padding/margin and white backgrounds */
#page,
.site,
.site-main,
.wp-site-blocks,
#primary,
.hfeed,
.content-area,
.wrap {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

/* Main page background */
html,
body {
  background-color: var(--op-bg) !important;
}

/* Apply Poppins globally and override WP defaults */
body,
body * {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

/* Layout: header + content + footer */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===================== BLOG GRID & CARDS ===================== */

.op-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

/* Card */
.op-post-card {
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.op-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}
html.dark .op-post-card {
  background-color: #020617;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
}

/* Image / category badge */
.op-post-card-media {
  position: relative;
  display: block;
  overflow: hidden;
}
.op-post-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 200ms ease;
}
.op-post-card:hover .op-post-card-image {
  transform: scale(1.03);
}
.op-post-card-image--placeholder {
  background: linear-gradient(135deg, #1f2937, #111827);
}

/* Category pill on image */
.op-post-card-category {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 9999px;
  background-color: #000000;
  color: #ffffff;
}

/* Card body */
.op-post-card-body {
  padding: 1.1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Meta */
.op-post-card-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}
html.dark .op-post-card-meta {
  color: #9ca3af;
}
.op-post-card-author a {
  color: inherit;
  text-decoration: none;
}
.op-post-card-separator {
  margin: 0 0.35rem;
}

/* Title */
.op-post-card-title {
  font-size: 1.25rem;
  line-height: 1.35;
  margin: 0;
}
.op-post-card-title a {
  color: #111827;
  text-decoration: none;
  transition: color 150ms ease;
}
.op-post-card:hover .op-post-card-title a {
  color: var(--op-blue);
}
html.dark .op-post-card-title a {
  color: #e5e7eb;
}

/* Excerpt */
.op-post-card-excerpt {
  font-size: 0.9rem;
  color: #4b5563;
}
html.dark .op-post-card-excerpt {
  color: #9ca3af;
}
.op-post-card-excerpt p {
  margin: 0 0 0.35rem;
}

/* Read more link */
.op-post-card-readmore {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--op-blue);
}
.op-post-card-readmore:hover {
  text-decoration: underline;
}

/* ===================== SINGLE POST BASIC STYLES ===================== */

.op-post-single-title {
  font-size: 2.1rem;
  line-height: 1.2;
  margin-bottom: 0.6rem;
  color: var(--op-text-main);
}
html.dark .op-post-single-title {
  color: #f9fafb;
}

/* Featured image on single post */
.op-post-single-featured {
  margin: 1.25rem 0 1.25rem;
  border-radius: 0.9rem;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.10);
}

.op-post-single-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

html.dark .op-post-single-featured {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
}

.op-post-single-meta {
  font-size: 0.8rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.4rem;
}
html.dark .op-post-single-meta {
  color: #9ca3af;
}

.op-post-single-category {
  font-weight: 600;
  margin-right: 0.5rem;
}

.op-post-single-content {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--op-text-main);
}
html.dark .op-post-single-content {
  color: #d1d5db;
}
.op-post-single-content p {
  margin-bottom: 1rem;
}

/* ===================== TABLES & CODE BLOCKS ===================== */

/* Base table styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

th,
td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e7eb;
  font-size: 0.9rem;
}

th {
  background-color: #f9fafb;
  color: #111827;
  text-align: left;
  font-weight: 600;
}

td {
  background-color: #ffffff;
  color: #111827;
}

/* Dark mode tables */
html.dark table {
  border-color: #27272a;
}

html.dark th,
html.dark td {
  border-color: #27272a;
}

html.dark th {
  background-color: #111827;
  color: #e5e7eb;
}

html.dark td {
  background-color: #020617;
  color: #e5e7eb;
}

/* Inline code */
code {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875em;
  background-color: #f3f4f6;
  color: #111827;
  padding: 0.15em 0.35em;
  border-radius: 0.25rem;
}

/* Code blocks */
pre,
.wp-block-code {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background-color: #111827;
  color: #e5e7eb;
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code,
.wp-block-code code {
  background: transparent;
  padding: 0;
}

/* Dark mode code */
html.dark code {
  background-color: #1f2937;
  color: #e5e7eb;
}

html.dark pre,
html.dark .wp-block-code {
  background-color: #020617;
  color: #e5e7eb;
}

html.dark pre code,
html.dark .wp-block-code code {
  background: transparent;
  color: inherit;
}
