/*
Theme Name: Titan Protect
Theme URI: https://titanprotect.trade
Author: Titan Protect
Author URI: https://titanprotect.trade
Description: Premium trading intelligence theme. Dark, institutional, minimal.
Version: 1.0.0
License: Proprietary
Text Domain: titan-protect
*/

/* === CSS Variables === */
:root {
  --bg-deep: #050709;
  --bg-card: #0a0e14;
  --bg-card-hover: #141920;
  --gold: #D8AF44;
  --green: #2ECC71;
  --text-body: #d4d8e0;
  --text-bright: #eef0f4;
  --text-dim: #7a8494;
  --border: #1c2230;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 1200px;
  --nav-height: 64px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-body);
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
}

/* Grain texture overlay */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-bright);
  line-height: 1.2;
  margin-bottom: 0.5em;
}

h1 { font-size: 2.75rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1em; }

a {
  color: var(--text-body);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--gold);
}

strong { color: var(--text-bright); }

code, pre, .mono {
  font-family: var(--font-mono);
}

code {
  background: var(--bg-card);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--gold);
}

pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25em;
  overflow-x: auto;
  margin-bottom: 1.5em;
}

pre code {
  background: none;
  padding: 0;
  color: var(--text-body);
}

blockquote {
  border-left: 3px solid var(--gold);
  padding: 0.75em 1.25em;
  margin: 1.5em 0;
  background: var(--bg-card);
  border-radius: 0 8px 8px 0;
  color: var(--text-dim);
  font-style: italic;
}

/* === Section Header Gold Accent === */
.section-header,
.wp-block-heading {
  border-left: 3px solid var(--gold);
  padding-left: 0.75em;
}

/* === Images === */
img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* === Navigation === */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(5, 7, 9, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.nav-mark {
  width: 30px;
  height: 30px;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--bg-deep);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.nav-brand-text {
  font-family: var(--font-body);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-brand-text .titan {
  color: #fff;
  font-weight: 300;
}

.nav-brand-text .protect {
  color: var(--gold);
  font-weight: 700;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-menu ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.nav-menu li a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item a,
.nav-menu li.current_page_item a {
  color: var(--gold);
}

.nav-cta {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: var(--gold);
  color: var(--bg-deep);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity 0.2s ease;
  margin-left: 1rem;
}

.nav-cta:hover {
  opacity: 0.85;
  color: var(--bg-deep);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-body);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* === Buttons === */
.btn, button, input[type="submit"], .button {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  background: var(--gold);
  color: var(--bg-deep);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.btn:hover, button:hover, input[type="submit"]:hover, .button:hover {
  opacity: 0.85;
  color: var(--bg-deep);
}

.btn-green {
  background: var(--green);
}

/* === Forms / Inputs === */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
textarea,
select {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text-body);
  padding: 0.65rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  width: 100%;
  transition: border-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* === Tables === */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: 0.95rem;
}

thead th {
  background: var(--gold);
  color: var(--bg-deep);
  font-weight: 600;
  text-align: left;
  padding: 0.6rem 0.9rem;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

tbody td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

tbody tr:hover td {
  background: var(--bg-card-hover);
}

/* === Cards === */
.card {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--gold);
}

/* === Layout === */
.site-content {
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.content-narrow {
  max-width: 760px;
  margin: 0 auto;
}

/* === Post / Page Content === */
.entry-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 2em;
}

.entry-content ul,
.entry-content ol {
  margin: 1em 0;
  padding-left: 1.5em;
}

.entry-content li {
  margin-bottom: 0.4em;
}

.entry-content img {
  margin: 1.5em 0;
}

/* === Post Cards (Blog / Archive) === */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.post-card {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.post-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.post-card-thumb img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0;
}

.post-card-body {
  padding: 1.25rem;
}

.post-card-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

.post-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.post-card-title a {
  color: inherit;
}

.post-card-title a:hover {
  color: var(--gold);
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* === Single Post === */
.single-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.single-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.single-title {
  font-size: 2.5rem;
  color: var(--text-bright);
}

/* === Footer === */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 1rem;
}

.footer-col p,
.footer-col li {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.7;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.4rem;
}

.footer-col a {
  color: var(--text-dim);
}

.footer-col a:hover {
  color: var(--gold);
}

.footer-disclaimer {
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
  max-width: 800px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-mark {
  width: 24px;
  height: 24px;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.55rem;
  color: var(--bg-deep);
}

/* === 404 === */
.error-404 {
  text-align: center;
  padding: 6rem 1.5rem;
}

.error-404 h1 {
  font-size: 6rem;
  color: var(--gold);
  margin-bottom: 0.25em;
}

.error-404 p {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 3rem 0;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.9rem;
}

.pagination a:hover,
.pagination .current {
  border-color: var(--gold);
  color: var(--gold);
}

/* === WooCommerce Compatibility === */
.woocommerce .products,
.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.woocommerce ul.products li.product {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.woocommerce ul.products li.product .price {
  color: var(--gold);
  font-weight: 600;
}

.woocommerce ul.products li.product a.button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce .cart .button,
.woocommerce .checkout .button {
  background: var(--gold) !important;
  color: var(--bg-deep) !important;
  border: none;
  font-family: var(--font-body);
}

.woocommerce table.shop_table {
  background: var(--bg-card);
  border-color: var(--border);
}

.woocommerce table.shop_table th {
  background: var(--gold);
  color: var(--bg-deep);
}

.woocommerce table.shop_table td {
  border-color: var(--border);
  background: var(--bg-card);
  color: var(--text-body);
}

.woocommerce-cart .cart-collaterals,
.woocommerce-cart .cart_totals {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text-body);
}

.woocommerce form .form-row input.input-text:focus {
  border-color: var(--gold);
}

.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error {
  background: var(--bg-card);
  border-top-color: var(--gold);
  color: var(--text-body);
}

.woocommerce .woocommerce-error {
  border-top-color: #e74c3c;
}

/* === PMPro Compatibility === */
#pmpro_levels,
.pmpro_checkout,
.pmpro_account {
  background: var(--bg-deep);
  color: var(--text-body);
}

#pmpro_levels .pmpro_level {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  color: var(--text-body);
}

#pmpro_levels .pmpro_level h2 {
  color: var(--gold);
}

#pmpro_levels .pmpro_level .pmpro_price {
  color: var(--text-bright);
  font-family: var(--font-mono);
}

.pmpro_checkout .pmpro_checkout-fields {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

.pmpro_checkout input[type="text"],
.pmpro_checkout input[type="email"],
.pmpro_checkout input[type="password"],
.pmpro_checkout select {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text-body);
}

.pmpro_checkout input:focus {
  border-color: var(--gold);
}

.pmpro_btn,
.pmpro_btn:link {
  background: var(--gold) !important;
  color: var(--bg-deep) !important;
  border: none !important;
}

.pmpro_account-membership .pmpro_card,
.pmpro_account-profile .pmpro_card,
.pmpro_account-invoices .pmpro_card {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* === WordPress Defaults === */
.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 0.5em;
}

.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin: 1em auto; }

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

/* === Responsive === */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  .nav-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-deep);
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    overflow-y: auto;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-menu ul {
    flex-direction: column;
    gap: 0;
  }

  .nav-menu li a {
    padding: 0.75rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-cta {
    margin: 1rem 0 0;
    text-align: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .single-title {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .entry-content {
    font-size: 1rem;
  }
}
