/*
Theme Name: Indices Trading Guide
Theme URI: https://example.com/indices-trading-guide
Author: Custom Theme
Author URI: https://example.com
Description: A clean, SEO-optimized WordPress theme designed specifically for Indices Trading Guides. Features semantic markup, Schema.org structured data, Open Graph, and dedicated Google AdSense placement areas (header, sidebar, in-content, footer). Fully responsive and performance-focused.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: indices-trading-guide
Tags: blog, education, finance, trading, seo, custom-menu, featured-images, threaded-comments, translation-ready, two-columns, right-sidebar
*/

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --secondary: #198754;
  --accent: #fd7e14;
  --dark: #1a1a2e;
  --gray-900: #212529;
  --gray-700: #495057;
  --gray-500: #6c757d;
  --gray-300: #dee2e6;
  --gray-100: #f8f9fa;
  --white: #ffffff;
  --success: #198754;
  --warning: #ffc107;
  --danger: #dc3545;
  --font-heading: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --container: 1200px;
  --radius: 8px;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --transition: 0.25s ease;
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--gray-900);
  background: var(--gray-100);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.75em;
  color: var(--dark);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }

p { margin: 0 0 1.25em; }

ul, ol { margin: 0 0 1.25em; padding-left: 1.5em; }

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-content {
  flex: 1;
  padding: 40px 0;
}

.content-area {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 992px) {
  .content-area {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  background: var(--dark);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-top {
  background: #0f0f1a;
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.header-main {
  padding: 16px 0;
}

.header-main .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.site-title a {
  color: var(--white);
}

.site-title a:hover {
  color: var(--accent);
}

.site-description {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  max-width: 280px;
}

/* Navigation */
.main-navigation {
  display: flex;
  align-items: center;
}

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.main-navigation a {
  color: rgba(255,255,255,0.9);
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
  display: block;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  background: rgba(255,255,255,0.1);
  color: var(--white);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .main-navigation ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--dark);
    flex-direction: column;
    padding: 15px;
    box-shadow: var(--shadow-lg);
  }
  .main-navigation.toggled ul { display: flex; }
  .header-main .container { flex-wrap: wrap; }
}

/* ==========================================================================
   AdSense Placeholders
   ========================================================================== */
.ad-container {
  background: var(--gray-100);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius);
  text-align: center;
  color: var(--gray-500);
  font-size: 0.85rem;
  overflow: hidden;
  position: relative;
}

.ad-container::before {
  content: "Advertisement";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-500);
  opacity: 0.7;
}

.ad-header {
  margin: 15px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-sidebar {
  min-height: 250px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-incontent {
  margin: 30px 0;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-footer {
  margin: 20px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Real AdSense will replace the placeholder text */
.ad-container .adsbygoogle {
  display: block;
}

/* ==========================================================================
   Hero / Archive Header
   ========================================================================== */
.page-header {
  background: linear-gradient(135deg, var(--dark) 0%, #16213e 100%);
  color: var(--white);
  padding: 50px 0 40px;
  margin-bottom: 0;
}

.page-header h1 {
  color: var(--white);
  margin-bottom: 10px;
}

.page-header .archive-description {
  color: rgba(255,255,255,0.8);
  max-width: 700px;
  margin: 0;
}

.breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 15px;
  color: rgba(255,255,255,0.7);
}

.breadcrumb a {
  color: rgba(255,255,255,0.85);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span {
  margin: 0 6px;
}

/* ==========================================================================
   Cards & Posts
   ========================================================================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.post-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.post-card .post-thumbnail {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--gray-300);
}

.post-card .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .post-thumbnail img {
  transform: scale(1.05);
}

.post-card .post-content {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card .entry-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.post-card .entry-title a {
  color: var(--dark);
}

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

.post-card .entry-meta {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.post-card .entry-summary {
  color: var(--gray-700);
  font-size: 0.95rem;
  flex: 1;
  margin-bottom: 15px;
}

.post-card .read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
}

/* Single Post */
.single-post .entry-header {
  margin-bottom: 30px;
}

.single-post .entry-title {
  font-size: 2.4rem;
  margin-bottom: 15px;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-bottom: 20px;
}

.entry-meta a {
  color: var(--gray-700);
}

.entry-content {
  background: var(--white);
  padding: 35px 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.entry-content h2 {
  margin-top: 1.8em;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gray-300);
}

.entry-content h3 {
  margin-top: 1.5em;
  color: var(--primary-dark);
}

.entry-content img {
  border-radius: var(--radius);
  margin: 1.5em 0;
}

.entry-content blockquote {
  border-left: 4px solid var(--primary);
  margin: 1.5em 0;
  padding: 15px 25px;
  background: var(--gray-100);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--gray-700);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--gray-300);
  padding: 12px 15px;
  text-align: left;
}

.entry-content th {
  background: var(--dark);
  color: var(--white);
}

.entry-content tr:nth-child(even) {
  background: var(--gray-100);
}

/* Key takeaways box */
.key-takeaways {
  background: linear-gradient(135deg, #e8f4fd 0%, #f0f9ff 100%);
  border: 1px solid #b6d4fe;
  border-radius: var(--radius);
  padding: 25px 30px;
  margin: 30px 0;
}

.key-takeaways h3 {
  margin-top: 0;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.key-takeaways ul {
  margin-bottom: 0;
}

/* Trading tip box */
.trading-tip {
  background: #fff8e6;
  border-left: 4px solid var(--accent);
  padding: 20px 25px;
  margin: 25px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.trading-tip strong {
  color: #b45309;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
  position: sticky;
  top: 90px;
}

.widget {
  background: var(--white);
  border-radius: var(--radius);
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: var(--shadow);
}

.widget-title {
  font-size: 1.1rem;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  color: var(--dark);
}

.widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget li {
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-300);
}

.widget li:last-child {
  border-bottom: none;
}

.widget a {
  color: var(--gray-700);
  font-weight: 500;
}

.widget a:hover {
  color: var(--primary);
}

/* Popular posts widget */
.popular-post {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
}

.popular-post img {
  width: 70px;
  height: 55px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.popular-post .title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

.popular-post .meta {
  font-size: 0.8rem;
  color: var(--gray-500);
}

/* Newsletter */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.newsletter-form input[type="email"] {
  padding: 12px 15px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.95rem;
}

.newsletter-form button {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 12px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.newsletter-form button:hover {
  background: var(--primary-dark);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.8);
  padding: 50px 0 25px;
  margin-top: auto;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 35px;
  margin-bottom: 40px;
}

.footer-widget h3 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 18px;
}

.footer-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-widget li {
  margin-bottom: 8px;
}

.footer-widget a {
  color: rgba(255,255,255,0.7);
}

.footer-widget a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 25px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  font-size: 0.9rem;
}

.footer-bottom a {
  color: rgba(255,255,255,0.7);
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 40px 0 20px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--white);
  color: var(--gray-700);
  font-weight: 500;
  box-shadow: var(--shadow);
}

.pagination .current {
  background: var(--primary);
  color: var(--white);
}

.pagination a:hover {
  background: var(--primary);
  color: var(--white);
}

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

.comment-list {
  list-style: none;
  padding: 0;
}

.comment {
  padding: 20px 0;
  border-bottom: 1px solid var(--gray-300);
}

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

/* ==========================================================================
   Buttons & Forms
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

/* Search form */
.search-form {
  display: flex;
  gap: 0;
}

.search-form input[type="search"] {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--gray-300);
  border-radius: 6px 0 0 6px;
  border-right: none;
  font-size: 0.95rem;
}

.search-form button {
  padding: 12px 18px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.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;
}

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* Risk disclaimer */
.risk-disclaimer {
  background: #fff3cd;
  border: 1px solid #ffecb5;
  color: #664d03;
  padding: 15px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin: 25px 0;
}

.risk-disclaimer strong {
  display: block;
  margin-bottom: 5px;
}

/* ==========================================================================
   Print
   ========================================================================== */
@media print {
  .site-header,
  .sidebar,
  .site-footer,
  .ad-container,
  .menu-toggle {
    display: none !important;
  }
  .content-area {
    grid-template-columns: 1fr;
  }
  .entry-content {
    box-shadow: none;
    padding: 0;
  }
}