/*
Theme Name:        DefinedFi
Theme URI:         https://www.definedfi.com/
Author:            DefinedFi
Author URI:        https://www.definedfi.com/
Description:       A sharp, editorial-grade WordPress theme for DefinedFi — built for DeFi, markets, trading, research, and financial news blogging. Features a dynamic homepage grid, topic explorer, newsletter section, full plugin compatibility (Yoast SEO, Contact Form 7, WooCommerce-ready), and a Customizer-driven design system.
Version:           1.0.0
Requires at least: 6.0
Tested up to:      6.5
Requires PHP:      8.0
License:           Private Label
License URI:       https://www.definedfi.com/
Text Domain:       definedfi
Tags:              blog, finance, custom-logo, custom-menu, featured-images, full-site-editing, theme-options, two-columns, right-sidebar, custom-colors, editor-style, responsive-layout, translation-ready, accessibility-ready

This theme, like WordPress, is licensed under the GPL.
*/

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Brand Colors */
  --df-navy:        #0f172a;
  --df-navy-mid:    #1e293b;
  --df-navy-light:  #334155;
  --df-blue:        #2563eb;
  --df-blue-hover:  #1d4ed8;
  --df-sky:         #0ea5e9;
  --df-sky-light:   #e0f2fe;
  --df-white:       #ffffff;
  --df-off-white:   #f8fafc;
  --df-muted:       #64748b;
  --df-border:      #e2e8f0;
  --df-border-dark: #cbd5e1;

  /* Category Colors */
  --cat-defi:       #eff6ff;
  --cat-defi-hover: #bfdbfe;
  --cat-markets:    #f0fdf4;
  --cat-markets-hover: #bbf7d0;
  --cat-trading:    #fff0f3;
  --cat-trading-hover: #fecdd3;
  --cat-research:   #f8f5ff;
  --cat-research-hover: #ddd6fe;
  --cat-news:       #fefce8;
  --cat-news-hover: #fde68a;

  /* Typography */
  --font-display:   'Sora', sans-serif;
  --font-body:      'DM Sans', sans-serif;
  --font-mono:      'JetBrains Mono', monospace;

  /* Spacing */
  --container-max:  1280px;
  --content-max:    768px;
  --section-py:     80px;

  /* Shadows */
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
  --shadow-md:      0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.12);
  --shadow-card:    0 2px 8px rgba(15,23,42,.08);

  /* Radius */
  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      20px;
  --radius-full:    9999px;

  /* Transitions */
  --ease:           cubic-bezier(.4,0,.2,1);
  --duration:       .25s;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--df-navy-mid);
  background: var(--df-white);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--df-blue);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
a:hover { color: var(--df-blue-hover); }
a:focus-visible {
  outline: 2px solid var(--df-blue);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--df-navy);
  letter-spacing: -.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
li { margin-bottom: .4rem; }

blockquote {
  border-left: 4px solid var(--df-blue);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--df-sky-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--df-navy-light);
}

code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--df-off-white);
  border: 1px solid var(--df-border);
  border-radius: 4px;
  padding: .15em .4em;
}

pre {
  background: var(--df-navy);
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
pre code { background: none; border: none; color: inherit; padding: 0; }

hr {
  border: none;
  border-top: 1px solid var(--df-border);
  margin: 2.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: .9rem;
}
th, td { padding: .75rem 1rem; border: 1px solid var(--df-border); text-align: left; }
th { background: var(--df-off-white); font-family: var(--font-display); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.df-container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 4vw, 2rem);
  padding-right: clamp(1rem, 4vw, 2rem);
}

.df-section {
  padding-top: var(--section-py);
  padding-bottom: var(--section-py);
}

.df-section--sm {
  padding-top: calc(var(--section-py) * .6);
  padding-bottom: calc(var(--section-py) * .6);
}

.screen-reader-text {
  clip: rect(1px,1px,1px,1px);
  position: absolute !important;
  white-space: nowrap;
  height: 1px; width: 1px;
  overflow: hidden;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.df-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .01em;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}

.df-btn--primary {
  background: var(--df-blue);
  color: var(--df-white);
  border-color: var(--df-blue);
}
.df-btn--primary:hover {
  background: var(--df-blue-hover);
  border-color: var(--df-blue-hover);
  color: var(--df-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
}

.df-btn--outline {
  background: transparent;
  color: var(--df-blue);
  border-color: var(--df-blue);
}
.df-btn--outline:hover {
  background: var(--df-blue);
  color: var(--df-white);
}

.df-btn--ghost {
  background: transparent;
  color: var(--df-navy);
  border-color: var(--df-border);
}
.df-btn--ghost:hover {
  background: var(--df-off-white);
  color: var(--df-navy);
}

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.df-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3rem .75rem;
  border-radius: var(--radius-full);
  background: var(--df-sky-light);
  color: var(--df-blue);
}

.df-badge--defi     { background: var(--cat-defi);     color: #1e40af; }
.df-badge--markets  { background: var(--cat-markets);   color: #166534; }
.df-badge--trading  { background: var(--cat-trading);   color: #9f1239; }
.df-badge--research { background: var(--cat-research);  color: #5b21b6; }
.df-badge--news     { background: var(--cat-news);      color: #854d0e; }

/* ============================================================
   SECTION TITLES
   ============================================================ */
.df-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--df-navy);
  margin-bottom: .5rem;
}
.df-section-subtitle {
  font-size: .95rem;
  color: var(--df-muted);
  margin-bottom: 2.5rem;
}
.df-title-accent {
  display: block;
  width: 48px;
  height: 4px;
  background: var(--df-blue);
  border-radius: var(--radius-full);
  margin: .75rem 0 1.25rem;
}

/* ============================================================
   HEADER / NAVBAR
   ============================================================ */
#df-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--df-border);
  transition: box-shadow var(--duration) var(--ease);
}
#df-header.scrolled {
  box-shadow: var(--shadow-md);
}
#df-header.scrolled {
  box-shadow: var(--shadow-md);
}

.df-header-inner {
  display: flex;
  align-items: center;
  height: 90px;
  gap: 1rem;
  padding: 0;        /* logo sits at the very edge */
}

/* Logo */
.df-logo {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  flex-shrink: 0;
  margin-left: 3rem !important;  /* hug the left edge */
  margin-right: auto; /* push everything else right — only used on mobile */
}
.df-logo img {
  height: 36px;
  width: auto;
}
.df-logo-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: #0a1628;       /* deep navy — darker than --df-navy */
  letter-spacing: -.03em;
}
.df-logo-text span { color: #0a1628; } /* whole word same dark navy */
/* Main Nav */
.df-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
}
/* ── HEADER AD BANNER ── */
.df-header-ad {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  max-height: 90px;
}
.df-header-ad img,
.df-header-ad iframe,
.df-header-ad ins {
  display: block;
  max-width: 728px;
  width: 100%;
  height: auto;
}
/* Placeholder shown until a real ad is wired up */
.df-header-ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 728px;
  max-width: 100%;
  height: 60px;
  border: 2px dashed var(--df-border);
  border-radius: var(--radius-sm);
  color: var(--df-muted);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
}
.df-header-ad-placeholder:hover {
  border-color: var(--df-blue);
  color: var(--df-blue);
}

/* Hide header ad on tablet/mobile — not enough room */
@media (max-width: 1024px) {
  .df-header-ad { display: none; }
}
.df-nav a {
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 600;
  color: var(--df-navy-light);
  padding: .5rem .85rem;
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease);
  letter-spacing: .01em;
}
.df-nav a:hover,
.df-nav a.current-menu-item,
.df-nav a.current_page_item {
  color: var(--df-blue);
  background: var(--cat-defi);
}

/* Dropdown menus */
.df-nav .menu-item-has-children {
  position: relative;
}
.df-nav .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: var(--df-white);
  border: 1px solid var(--df-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: .5rem;
  list-style: none;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all var(--duration) var(--ease);
  z-index: 100;
}
.df-nav .sub-menu li { margin: 0; }
.df-nav .sub-menu a {
  display: block;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
}

.df-nav .menu-item-has-children:hover > .sub-menu,
.df-nav .menu-item-has-children:focus-within > .sub-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.df-search-toggle:hover {
  background: var(--df-off-white);
  color: var(--df-blue);
  border-color: var(--df-blue);
}

/* Mobile toggle */
.df-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
}

.df-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--df-navy);
  border-radius: 2px;
  transition: all .3s var(--ease);
}

/* Search overlay */
.df-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}
.df-search-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.df-search-overlay-inner {
  width: 100%;
  max-width: 640px;
  padding: 0 1.5rem;
}
.df-search-overlay form {
  display: flex;
  background: var(--df-white);
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.df-search-overlay input[type="search"] {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 1.05rem;
  background: transparent;
}
.df-search-overlay button {
  padding: 0 1.5rem;
  background: var(--df-blue);
  border: none;
  color: var(--df-white);
  cursor: pointer;
  font-size: 1.1rem;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.df-hero {
  background: var(--df-navy);
  color: var(--df-white);
  padding: clamp(60px,10vw,120px) 0;
  position: relative;
  overflow: hidden;
}
.df-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 60% 40%, rgba(37,99,235,.25), transparent),
              radial-gradient(ellipse 60% 60% at 10% 80%, rgba(14,165,233,.12), transparent);
  pointer-events: none;
}
.df-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='g' width='60' height='60' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='30' cy='30' r='1' fill='%23ffffff' opacity='.04'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='60' height='60' fill='url(%23g)'/%3E%3C/svg%3E");
  pointer-events: none;
}
.df-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 700px;
}
.df-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--df-sky);
  margin-bottom: 1.25rem;
}
.df-hero-kicker::before {
  content: '';
  display: block;
  width: 24px; height: 2px;
  background: var(--df-sky);
  border-radius: 2px;
}
.df-hero h1 {
  color: var(--df-white);
  margin-bottom: 1.25rem;
  line-height: 1.1;
}
.df-hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,.72);
  max-width: 520px;
  margin-bottom: 2rem;
}
.df-hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================================
   POST GRID
   ============================================================ */
.df-post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}
.df-post-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}
.df-post-grid--featured {
  grid-template-columns: repeat(2, 1fr);
}
.df-post-grid--featured .df-card:first-child {
  grid-row: span 2;
}

/* Post Card */
.df-card {
  background: var(--df-white);
  border: 1px solid var(--df-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--duration) var(--ease);
  position: relative;
}
.df-card:hover {
  border-color: var(--df-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.df-card-thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--df-off-white);
}
.df-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.df-card:hover .df-card-thumb img {
  transform: scale(1.05);
}
.df-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.df-card-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.df-card-date {
  font-size: .75rem;
  color: var(--df-muted);
}
.df-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--df-navy);
  line-height: 1.35;
  margin-bottom: .6rem;
  letter-spacing: -.01em;
}
.df-card-title a {
  color: inherit;
}
.df-card-title a:hover { color: var(--df-blue); }
.df-card-excerpt {
  font-size: .875rem;
  color: var(--df-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}
.df-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .75rem;
  border-top: 1px solid var(--df-border);
  margin-top: auto;
}
.df-card-author {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  color: var(--df-muted);
}
.df-card-author img {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.df-card-readtime {
  font-size: .72rem;
  color: var(--df-muted);
}

/* Featured post card (tall) */
.df-card--featured {
  position: relative;
  min-height: 420px;
}
.df-card--featured .df-card-thumb {
  position: absolute;
  inset: 0;
  aspect-ratio: unset;
  border-radius: 0;
}
.df-card--featured .df-card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,23,42,.92) 0%, rgba(15,23,42,.4) 60%, transparent 100%);
}
.df-card--featured .df-card-body {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1.5rem;
  justify-content: flex-end;
}
.df-card--featured .df-card-title { font-size: 1.25rem; color: var(--df-white); }
.df-card--featured .df-card-excerpt { color: rgba(255,255,255,.7); }
.df-card--featured .df-card-date { color: rgba(255,255,255,.55); }
.df-card--featured .df-card-footer { border-color: rgba(255,255,255,.15); }
.df-card--featured .df-card-author { color: rgba(255,255,255,.7); }
.df-card--featured .df-card-readtime { color: rgba(255,255,255,.5); }

/* ============================================================
   EXPLORE TOPICS
   ============================================================ */
.df-topics-section {
  background: var(--df-navy);
  padding: var(--section-py) 0;
}
.df-topics-section .df-section-title { color: var(--df-white); }
.df-topics-section .df-section-subtitle { color: rgba(255,255,255,.55); }

.df-topics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}
.df-topic-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.05);
  text-decoration: none;
  transition: all var(--duration) var(--ease);
  text-align: center;
  cursor: pointer;
}
.df-topic-card:hover {
  background: rgba(37,99,235,.2);
  border-color: var(--df-blue);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(37,99,235,.25);
}
.df-topic-icon {
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--df-sky);
}
.df-topic-icon svg {
  width: 100%; height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}
.df-topic-name {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--df-white);
  margin-bottom: .3rem;
}
.df-topic-count {
  font-size: .75rem;
  color: rgba(255,255,255,.45);
}

/* ============================================================
   NEWSLETTER / SUBSCRIPTION SECTION
   ============================================================ */
.df-newsletter {
  background: linear-gradient(135deg, var(--df-blue) 0%, #1e40af 100%);
  padding: var(--section-py) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.df-newsletter::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='p' width='80' height='80' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='40' cy='40' r='1.5' fill='%23ffffff' opacity='.06'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='80' height='80' fill='url(%23p)'/%3E%3C/svg%3E");
  pointer-events: none;
}
.df-newsletter .df-container { position: relative; z-index: 1; }
.df-newsletter h2 {
  color: var(--df-white);
  margin-bottom: .75rem;
}
.df-newsletter p {
  color: rgba(255,255,255,.75);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto 2rem;
}
.df-newsletter-form {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  background: var(--df-white);
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(15,23,42,.2);
}
.df-newsletter-form input[type="email"] {
  flex: 1;
  padding: .9rem 1.4rem;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: .95rem;
  background: transparent;
}
.df-newsletter-form button {
  padding: .9rem 1.5rem;
  background: var(--df-navy);
  border: none;
  color: var(--df-white);
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration) var(--ease);
}
.df-newsletter-form button:hover { background: var(--df-navy-mid); }

/* ============================================================
   TICKER / MARQUEE
   ============================================================ */
.df-ticker {
  background: var(--df-navy-mid);
  padding: .6rem 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.df-ticker-inner {
  display: flex;
  align-items: center;
  gap: 3rem;
  animation: ticker-scroll 30s linear infinite;
  white-space: nowrap;
}
.df-ticker-inner:hover { animation-play-state: paused; }
.df-ticker-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-size: .75rem;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  letter-spacing: .04em;
}
.df-ticker-item .up   { color: #4ade80; }
.df-ticker-item .down { color: #f87171; }
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   MAIN CONTENT LAYOUT
   ============================================================ */
.df-content-area {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  align-items: start;
}
.df-content-area.no-sidebar {
  grid-template-columns: 1fr;
  max-width: var(--content-max);
  margin: 0 auto;
}
.df-main { min-width: 0; }

/* ============================================================
   SIDEBAR
   ============================================================ */
#df-sidebar {
  position: sticky;
  top: 88px;
}
.df-widget {
  background: var(--df-white);
  border: 1px solid var(--df-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.df-widget-title {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--df-navy);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--df-border);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.df-widget-title::before {
  content: '';
  display: block;
  width: 3px; height: 14px;
  background: var(--df-blue);
  border-radius: 2px;
}

/* Sidebar post list */
.df-sidebar-posts { list-style: none; padding: 0; margin: 0; }
.df-sidebar-post {
  display: flex;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--df-border);
  margin: 0;
}
.df-sidebar-post:last-child { border-bottom: none; padding-bottom: 0; }
.df-sidebar-post-thumb {
  flex-shrink: 0;
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--df-off-white);
}
.df-sidebar-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.df-sidebar-post-info { flex: 1; min-width: 0; }
.df-sidebar-post-title {
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--df-navy);
  margin-bottom: .25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.df-sidebar-post-title a { color: inherit; }
.df-sidebar-post-title a:hover { color: var(--df-blue); }
.df-sidebar-post-date { font-size: .7rem; color: var(--df-muted); }

/* Tags cloud */
.df-tags-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }
.df-tags-cloud a {
  font-size: .75rem;
  font-weight: 600;
  padding: .3rem .8rem;
  border-radius: var(--radius-full);
  background: var(--df-off-white);
  border: 1px solid var(--df-border);
  color: var(--df-navy-light);
  transition: all var(--duration) var(--ease);
}
.df-tags-cloud a:hover {
  background: var(--df-blue);
  border-color: var(--df-blue);
  color: var(--df-white);
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.df-post-header { margin-bottom: 2rem; }
.df-post-header .df-card-meta { margin-bottom: 1rem; }
.df-post-title {
  font-size: clamp(1.8rem,4vw,2.75rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}
.df-post-meta-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--df-border);
  border-bottom: 1px solid var(--df-border);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.df-post-meta-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--df-muted);
}
.df-post-meta-item svg { width: 14px; height: 14px; }

.df-post-featured-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
  aspect-ratio: 16/7;
}
.df-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.df-post-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--df-navy-mid);
}
.df-post-content h2,
.df-post-content h3,
.df-post-content h4 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.df-post-content img {
  border-radius: var(--radius-md);
  margin: 2rem auto;
}
.df-post-content .wp-caption {
  max-width: 100%;
  margin: 2rem auto;
}
.df-post-content .wp-caption-text {
  text-align: center;
  font-size: .8rem;
  color: var(--df-muted);
  margin-top: .5rem;
}

/* Post footer: tags & share */
.df-post-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--df-border);
}
.df-post-tags-label {
  font-family: var(--font-display);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--df-muted);
  margin-bottom: .75rem;
}
.df-share-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.df-share-bar-label {
  font-family: var(--font-display);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--df-muted);
  margin-right: .25rem;
}
.df-share-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .9rem;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--duration) var(--ease);
}
.df-share-btn--twitter  { background: #000; color: #fff; }
.df-share-btn--linkedin { background: #0077b5; color: #fff; }
.df-share-btn--copy     { background: var(--df-off-white); color: var(--df-navy); border: 1px solid var(--df-border); }
.df-share-btn:hover { opacity: .85; color: inherit; }

/* Post navigation */
.df-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
}
.df-post-nav-item {
  background: var(--df-off-white);
  border: 1px solid var(--df-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all var(--duration) var(--ease);
}
.df-post-nav-item:hover {
  border-color: var(--df-blue);
  background: var(--cat-defi);
}
.df-post-nav-item.prev { text-align: left; }
.df-post-nav-item.next { text-align: right; }
.df-post-nav-direction {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  color: var(--df-muted);
  margin-bottom: .4rem;
}
.df-post-nav-title {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 700;
  color: var(--df-navy);
  line-height: 1.3;
}
.df-post-nav-item a { text-decoration: none; }
.df-post-nav-item a:hover .df-post-nav-title { color: var(--df-blue); }

/* Author box */
.df-author-box {
  display: flex;
  gap: 1.5rem;
  background: var(--df-off-white);
  border: 1px solid var(--df-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 3rem;
}
.df-author-avatar {
  flex-shrink: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--df-white);
  box-shadow: var(--shadow-sm);
}
.df-author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.df-author-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--df-navy);
  margin-bottom: .25rem;
}
.df-author-bio { font-size: .88rem; color: var(--df-muted); margin: 0; }

/* Rating widget */
.df-rating-widget {
  background: var(--df-off-white);
  border: 1px solid var(--df-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin: 2.5rem 0;
}
.df-rating-label {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--df-muted);
  margin-bottom: .75rem;
}
.df-stars { display: flex; flex-direction: row-reverse; justify-content: center; gap: 4px; }
.df-stars input { display: none; }
.df-stars label {
  font-size: 1.75rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: color .15s, transform .1s;
}
.df-stars label:hover,
.df-stars label:hover ~ label,
.df-stars input:checked ~ label { color: #f59e0b; }
.df-stars label:hover { transform: scale(1.2); }
.df-rating-summary { font-size: .82rem; color: var(--df-muted); margin-top: .5rem; }
.df-rating-avg { color: #f59e0b; font-weight: 700; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.df-breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--df-muted);
  padding: .75rem 0;
  margin-bottom: 1.5rem;
}
.df-breadcrumb a { color: var(--df-muted); }
.df-breadcrumb a:hover { color: var(--df-blue); }
.df-breadcrumb-sep { opacity: .4; }
.df-breadcrumb-current { color: var(--df-navy); font-weight: 600; }

/* ============================================================
   PAGINATION
   ============================================================ */
.df-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.df-pagination a,
.df-pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid var(--df-border);
  color: var(--df-navy-light);
  transition: all var(--duration) var(--ease);
  padding: 0 .5rem;
}
.df-pagination a:hover {
  background: var(--df-blue);
  color: var(--df-white);
  border-color: var(--df-blue);
}
.df-pagination .current {
  background: var(--df-blue);
  color: var(--df-white);
  border-color: var(--df-blue);
}
.df-pagination .dots {
  border: none;
  background: none;
  color: var(--df-muted);
}

/* ============================================================
   COMMENTS
   ============================================================ */
.df-comments-section { margin-top: 3.5rem; }
.df-comments-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--df-border);
}
.df-comment-list { list-style: none; padding: 0; }
.df-comment {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--df-border);
}
.df-comment:last-child { border-bottom: none; }
.df-comment-inner {
  display: flex;
  gap: 1rem;
}
.df-comment-avatar { flex-shrink: 0; }
.df-comment-avatar img { border-radius: 50%; }
.df-comment-author-name {
  font-family: var(--font-display);
  font-size: .88rem;
  font-weight: 700;
  color: var(--df-navy);
}
.df-comment-date {
  font-size: .72rem;
  color: var(--df-muted);
  margin-bottom: .5rem;
}
.df-comment-text { font-size: .9rem; }
.df-comment-reply-link {
  font-size: .75rem;
  font-weight: 600;
  color: var(--df-blue);
  margin-top: .5rem;
  display: inline-block;
}

.df-comment-form-wrap { margin-top: 2.5rem; }
.df-comment-form-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.comment-form label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: .35rem;
  color: var(--df-navy-light);
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: .7rem 1rem;
  border: 1px solid var(--df-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .9rem;
  outline: none;
  transition: border-color var(--duration) var(--ease);
  background: var(--df-white);
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--df-blue); }
.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form p { margin-bottom: 1rem; }
.comment-form .form-submit input[type="submit"] {
  background: var(--df-blue);
  color: var(--df-white);
  border: none;
  padding: .7rem 1.75rem;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}
.comment-form .form-submit input[type="submit"]:hover {
  background: var(--df-blue-hover);
}

/* ============================================================
   ARCHIVE / CATEGORY HEADER
   ============================================================ */
.df-archive-header {
  background: var(--df-off-white);
  border-bottom: 1px solid var(--df-border);
  padding: 2.5rem 0;
  margin-bottom: 2.5rem;
}
.df-archive-label {
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--df-blue);
  margin-bottom: .5rem;
}
.df-archive-title {
  font-size: clamp(1.5rem,3vw,2rem);
  font-weight: 800;
  margin-bottom: .5rem;
}
.df-archive-desc { font-size: .95rem; color: var(--df-muted); margin: 0; }

/* ============================================================
   SEARCH RESULTS
   ============================================================ */
.df-search-header {
  background: var(--df-off-white);
  border-bottom: 1px solid var(--df-border);
  padding: 2rem 0;
  margin-bottom: 2.5rem;
}
.df-search-query {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}
.df-search-query em { color: var(--df-blue); font-style: normal; }
.df-search-bar-form {
  margin-top: 1rem;
  display: flex;
  max-width: 480px;
}
.df-search-bar-form input[type="search"] {
  flex: 1;
  padding: .7rem 1.25rem;
  border: 2px solid var(--df-border);
  border-right: none;
  border-radius: var(--radius-full) 0 0 var(--radius-full);
  outline: none;
  font-family: var(--font-body);
  font-size: .9rem;
}
.df-search-bar-form input:focus { border-color: var(--df-blue); }
.df-search-bar-form button {
  padding: .7rem 1.25rem;
  background: var(--df-blue);
  border: 2px solid var(--df-blue);
  color: var(--df-white);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  font-weight: 700;
  cursor: pointer;
}

/* ============================================================
   FOOTER
   ============================================================ */
#df-footer {
  background: var(--df-navy);
  color: rgba(255,255,255,.7);
  padding: 64px 0 0;
}
.df-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.df-footer-brand .df-logo-text { color: var(--df-white); }
.df-footer-brand p {
  font-size: .85rem;
  margin: 1rem 0 1.5rem;
  color: rgba(255,255,255,.5);
  line-height: 1.7;
}
.df-footer-col-title {
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin-bottom: 1.25rem;
}
.df-footer-links {
  list-style: none; padding: 0; margin: 0;
}
.df-footer-links li { margin-bottom: .6rem; }
.df-footer-links a {
  font-size: .85rem;
  color: rgba(255,255,255,.6);
  transition: color var(--duration) var(--ease);
}
.df-footer-links a:hover { color: var(--df-white); }

.df-footer-social {
  display: flex;
  gap: .5rem;
  margin-top: .5rem;
}
.df-footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.6);
  font-size: .9rem;
  transition: all var(--duration) var(--ease);
}
.df-footer-social a:hover {
  background: var(--df-blue);
  color: var(--df-white);
}

.df-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  font-size: .78rem;
  color: rgba(255,255,255,.35);
  flex-wrap: wrap;
  gap: .75rem;
}
.df-footer-bottom a { color: rgba(255,255,255,.45); }
.df-footer-bottom a:hover { color: var(--df-white); }
.df-footer-bottom-links { display: flex; gap: 1.5rem; }

/* ============================================================
   WORDPRESS CORE CLASSES
   ============================================================ */
.alignleft  { float: left; margin: 0 2rem 1.5rem 0; }
.alignright { float: right; margin: 0 0 1.5rem 2rem; }
.aligncenter { display: block; margin: 1.5rem auto; }
.alignwide   { margin-left: calc(-1 * clamp(1rem,4vw,2rem)); margin-right: calc(-1 * clamp(1rem,4vw,2rem)); }
.alignfull   { width: 100vw; position: relative; left: 50%; transform: translateX(-50%); max-width: 100vw; }

.wp-block-image { margin-bottom: 1.5rem; }
.wp-block-image img { border-radius: var(--radius-md); }

.wp-caption { max-width: 100%; }
.wp-caption-text { text-align: center; font-size: .8rem; color: var(--df-muted); }

/* Gallery */
.gallery {
  display: grid;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.gallery-item img { border-radius: var(--radius-sm); width: 100%; object-fit: cover; }

/* Blocks */
.wp-block-pullquote {
  border-top: 4px solid var(--df-blue);
  border-bottom: 4px solid var(--df-blue);
  padding: 2rem;
  text-align: center;
  font-size: 1.3rem;
  font-style: italic;
}
.wp-block-code {
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
}
.wp-block-table { overflow-x: auto; }

/* WooCommerce compatibility */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}
.woocommerce-message { background: var(--cat-markets); border-left: 4px solid #22c55e; }
.woocommerce-info    { background: var(--cat-defi);    border-left: 4px solid var(--df-blue); }
.woocommerce-error   { background: var(--cat-trading); border-left: 4px solid #ef4444; }

/* Yoast breadcrumb */
.yoast-breadcrumb { font-size: .78rem; color: var(--df-muted); margin-bottom: 1.5rem; }
.yoast-breadcrumb a { color: var(--df-muted); }
.yoast-breadcrumb a:hover { color: var(--df-blue); }

/* Contact Form 7 */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea,
.wpcf7-form select {
  width: 100%;
  padding: .7rem 1rem;
  border: 1px solid var(--df-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .9rem;
  outline: none;
  margin-bottom: 1rem;
  transition: border-color var(--duration) var(--ease);
}
.wpcf7-form input:focus,
.wpcf7-form textarea:focus { border-color: var(--df-blue); }
.wpcf7-form input[type="submit"] {
  background: var(--df-blue);
  color: var(--df-white);
  border: none;
  padding: .75rem 2rem;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
}
.wpcf7-not-valid-tip { color: #ef4444; font-size: .78rem; }
.wpcf7-response-output { padding: .75rem 1rem; border-radius: var(--radius-sm); margin-top: 1rem; }

/* ============================================================
   404 PAGE
   ============================================================ */
.df-404 {
  text-align: center;
  padding: 6rem 1.5rem;
}
.df-404-code {
  font-family: var(--font-display);
  font-size: clamp(6rem,15vw,10rem);
  font-weight: 900;
  color: var(--df-blue);
  line-height: 1;
  opacity: .12;
  display: block;
}
.df-404-title { font-size: 2rem; margin-bottom: 1rem; }
.df-404-text { color: var(--df-muted); margin-bottom: 2rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .df-post-grid--4 { grid-template-columns: repeat(3, 1fr); }
  .df-topics-grid  { grid-template-columns: repeat(4, 1fr); }
  .df-footer-grid  { grid-template-columns: 2fr 1fr 1fr; }
}
@media (max-width: 1024px) {
  .df-post-grid     { grid-template-columns: repeat(2, 1fr); }
  .df-post-grid--featured { grid-template-columns: 1fr; }
  .df-post-grid--featured .df-card:first-child { grid-row: unset; }
  .df-content-area  { grid-template-columns: 1fr; }
  #df-sidebar       { position: static; }
  .df-topics-grid   { grid-template-columns: repeat(3, 1fr); }
  .df-footer-grid   { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 768px) {
  :root { --section-py: 48px; }
  .df-nav          { display: none; }
  .df-nav.open     { display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0; background: var(--df-white); border-bottom: 1px solid var(--df-border); padding: 1rem; box-shadow: var(--shadow-md); z-index: 999; }
  .df-nav.open a   { padding: .75rem 1rem; border-radius: var(--radius-sm); }
  .df-nav .sub-menu { position: static; opacity: 1; pointer-events: all; transform: none; box-shadow: none; border: none; background: var(--df-off-white); }
  .df-menu-toggle  { display: flex; }
  .df-post-grid    { grid-template-columns: 1fr; }
  .df-topics-grid  { grid-template-columns: repeat(2, 1fr); }
  .df-footer-grid  { grid-template-columns: 1fr; }
  .df-post-nav     { grid-template-columns: 1fr; }
  .df-author-box   { flex-direction: column; align-items: center; text-align: center; }
  .df-hero-actions { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .df-topics-grid { grid-template-columns: 1fr 1fr; }
  .df-footer-bottom { flex-direction: column; text-align: center; }
  .df-footer-bottom-links { justify-content: center; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  #df-header, #df-sidebar, #df-footer, .df-post-nav,
  .df-share-bar, .df-author-box, .df-comments-section,
  .df-newsletter, .df-ticker { display: none !important; }
  .df-content-area { grid-template-columns: 1fr !important; }
  body { font-size: 12pt; color: #000; }
  a { color: #000; }
}
