/* ============================================
   CryptoPulse - crypto.news Inspired Design
   Modern Cryptocurrency News Site
   ============================================ */

/* CSS Variables - crypto.news Style Dark Theme */
:root {
  --bg-primary: #0f1419;
  --bg-secondary: #1a1f26;
  --bg-tertiary: #24272c;
  --bg-ticker: #161b22;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #3c61e2;
  --accent-hover: #5b7cf5;
  --accent-teal: #42e8e0;
  --accent-orange: #ff9e5c;
  --positive: #3fb950;
  --negative: #f85149;
  --border-color: #30363d;
  --card-shadow: 0 4px 16px rgba(0,0,0,.25);
  --transition: all .25s ease;
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f6f8fa;
  --bg-tertiary: #eaeef2;
  --bg-ticker: #f0f3f6;
  --text-primary: #1f2328;
  --text-secondary: #656d76;
  --text-muted: #8c959f;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --accent-teal: #1a7f7a;
  --accent-orange: #d97008;
  --positive: #1a7f37;
  --negative: #cf222e;
  --border-color: #d0d7de;
  --card-shadow: 0 4px 16px rgba(0,0,0,.06);
}

/* Reset & Base */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:var(--bg-primary);color:var(--text-primary);line-height:1.6;overflow-x:hidden}
img{max-width:100%;height:auto;display:block}
a{color:inherit;text-decoration:none;transition:var(--transition)}
ul,ol{list-style:none}
button{cursor:pointer;border:none;background:none;font-family:inherit}

/* Typography */
h1,h2,h3,h4,h5,h6{font-weight:700;line-height:1.2}
h1{font-size:clamp(1.75rem,4vw,2.5rem)}
h2{font-size:clamp(1.5rem,3vw,2rem);margin-bottom:1rem}
h3{font-size:clamp(1.25rem,2.5vw,1.5rem)}
p{margin-bottom:1rem;color:var(--text-secondary)}

/* Container */
.container{width:100%;max-width:1280px;margin:0 auto;padding:0 1.25rem}
@media(min-width:768px){.container{padding:0 2rem}}

/* ========== HEADER ========== */
.header{position:sticky;top:0;z-index:1000;background:var(--bg-secondary);border-bottom:1px solid var(--border-color);box-shadow:var(--card-shadow)}
.header-inner{display:flex;align-items:center;justify-content:space-between;padding:1rem 0;gap:1rem;flex-wrap:wrap}
.logo{font-size:1.5rem;font-weight:800;color:var(--accent);letter-spacing:-.5px}
.logo span{color:var(--text-primary)}

/* Navigation */
.nav{display:none}
@media(min-width:992px){.nav{display:flex;align-items:center;gap:.5rem}}
.nav a{padding:.5rem .75rem;border-radius:6px;font-weight:500;font-size:.9rem}
.nav a:hover{background:var(--bg-tertiary);color:var(--accent)}

/* Header Actions */
.header-actions{display:flex;align-items:center;gap:.75rem}
.search-wrapper{position:relative;display:none}
@media(min-width:768px){.search-wrapper{display:block}}
.search-wrapper input{width:200px;padding:.5rem 1rem .5rem 2.5rem;border:1px solid var(--border-color);border-radius:8px;background:var(--bg-tertiary);color:var(--text-primary);font-size:.9rem}
.search-wrapper input::placeholder{color:var(--text-muted)}
.search-wrapper input:focus{outline:none;border-color:var(--accent)}
.search-icon{position:absolute;left:.75rem;top:50%;transform:translateY(-50%);color:var(--text-muted);pointer-events:none}

/* Theme Toggle */
.theme-toggle{width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;background:var(--bg-tertiary);color:var(--text-primary);transition:var(--transition)}
.theme-toggle:hover{background:var(--accent);color:var(--bg-primary)}
.theme-toggle svg{width:20px;height:20px}

/* Mobile Menu */
.mobile-menu-btn{display:flex;width:44px;height:44px;align-items:center;justify-content:center;background:var(--bg-tertiary);border-radius:10px;color:var(--text-primary)}
@media(min-width:992px){.mobile-menu-btn{display:none}}

/* ========== PRICE TICKER (crypto.news style) ========== */
.price-ticker{background:var(--bg-ticker);border-bottom:1px solid var(--border-color);padding:.6rem 0;overflow:hidden}
.price-ticker-inner{display:flex;gap:2rem;align-items:center;width:max-content;animation:ticker-scroll 50s linear infinite}
.price-ticker-inner:hover{animation-play-state:paused}
@keyframes ticker-scroll{0%{transform:translateX(0)}100%{transform:translateX(-50%)}}
.ticker-item{display:flex;align-items:center;gap:.5rem;white-space:nowrap;flex-shrink:0}
.ticker-item a{color:var(--text-secondary);font-size:.85rem;font-weight:500}
.ticker-item a:hover{color:var(--accent)}
.ticker-name{color:var(--text-primary);font-weight:600}
.ticker-price{color:var(--text-primary)}
.ticker-change{font-size:.8rem;font-weight:600;margin-left:.25rem}
.ticker-change.positive{color:var(--positive)}
.ticker-change.negative{color:var(--negative)}

/* ========== PAGE TITLE (crypto.news style) ========== */
.page-title-section{padding:2rem 0 1rem;text-align:center}
.page-title-section h1{font-size:clamp(1.5rem,3vw,2rem);font-weight:700;color:var(--text-primary);margin-bottom:.25rem}
.page-title-section .subtitle{font-size:.95rem;color:var(--text-muted)}

/* ========== LATEST LIST (crypto.news style) ========== */
.latest-section{margin-bottom:2rem}
.section-title--compact{font-size:1.1rem!important;font-weight:800!important;text-transform:uppercase;letter-spacing:.05em}
.section-title--compact::after{display:none}
.latest-section .section-header,.top-stories-section .section-header,.deep-dives-section .section-header{margin-bottom:1rem}
.latest-list{display:flex;flex-direction:column;gap:0}
.latest-list a{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:.85rem 0;border-bottom:1px solid var(--border-color);color:var(--text-primary);font-size:.95rem;font-weight:500}
.latest-list a:hover{color:var(--accent)}
.latest-list a:last-child{border-bottom:none}
.latest-list .time{font-size:.8rem;color:var(--text-muted);flex-shrink:0}

/* ========== TOP STORIES (crypto.news style) ========== */
.top-stories-section{margin-bottom:2.5rem}
.top-stories-grid{display:grid;gap:1.25rem;grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
.top-story-card{background:var(--bg-secondary);border-radius:8px;overflow:hidden;border:1px solid var(--border-color);transition:var(--transition)}
.top-story-card:hover{border-color:var(--accent);box-shadow:var(--card-shadow)}
.top-story-card .img-wrap{position:relative;aspect-ratio:16/10;overflow:hidden}
.top-story-card .img-wrap img{width:100%;height:100%;object-fit:cover;transition:var(--transition)}
.top-story-card:hover .img-wrap img{transform:scale(1.03)}
.top-story-card .content{padding:1rem}
.top-story-card h3{font-size:1rem;font-weight:700;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* ========== DEEP DIVES (crypto.news style) ========== */
.deep-dives-section{margin-bottom:2.5rem}
.deep-dive-card{display:flex;gap:1rem;padding:1rem;border-bottom:1px solid var(--border-color);transition:var(--transition);border-radius:6px}
.deep-dive-card:hover{background:var(--bg-tertiary)}
.deep-dive-card:last-child{border-bottom:none}
.deep-dive-card .type{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--accent);margin-bottom:.25rem}
.deep-dive-card h3{font-size:1rem;font-weight:600;line-height:1.4}
.deep-dive-card .time{font-size:.8rem;color:var(--text-muted);margin-top:.35rem}
.deep-dive-card a{color:var(--text-primary)}
.deep-dive-card a:hover{color:var(--accent)}

/* ========== HERO SECTION ========== */
.hero{padding:2rem 0 3rem}
.hero-grid{display:grid;gap:1.5rem}
@media(min-width:768px){.hero-grid{grid-template-columns:2fr 1fr;grid-template-rows:auto auto}}
@media(min-width:992px){.hero-grid{grid-template-columns:2fr 1fr;grid-template-rows:1fr 1fr}}
.hero-featured{position:relative;border-radius:12px;overflow:hidden;min-height:300px;background:var(--bg-secondary)}
@media(min-width:768px){.hero-featured{grid-row:span 2;min-height:400px}}
.hero-featured img{width:100%;height:100%;object-fit:cover}
.hero-featured .overlay{position:absolute;bottom:0;left:0;right:0;padding:2rem;background:linear-gradient(transparent,rgba(0,0,0,.9));color:#fff}
.hero-featured .category-tag{display:inline-block;padding:.25rem .75rem;background:var(--accent);color:var(--bg-primary);border-radius:6px;font-size:.75rem;font-weight:600;margin-bottom:.5rem;text-transform:uppercase}
.hero-featured h2{font-size:clamp(1.25rem,2.5vw,1.75rem);margin-bottom:.5rem}
.hero-featured p{font-size:.9rem;color:rgba(255,255,255,.9);margin:0}

/* Hero Trending Cards */
.hero-trending{display:flex;flex-direction:column;gap:1rem}
@media(min-width:768px){.hero-trending{flex-direction:row}}
@media(min-width:992px){.hero-trending{flex-direction:column}}
.trending-card{display:flex;gap:1rem;padding:1rem;background:var(--bg-secondary);border-radius:12px;border:1px solid var(--border-color);transition:var(--transition)}
.trending-card:hover{border-color:var(--accent);transform:translateY(-2px)}
.trending-card img{width:100px;min-width:100px;height:80px;object-fit:cover;border-radius:8px}
.trending-card .content h3{font-size:1rem;margin-bottom:.25rem;line-height:1.3}
.trending-card .content .meta{font-size:.75rem;color:var(--text-muted)}

/* ========== MAIN LAYOUT ========== */
.main-section{padding:2rem 0}
.main-grid{display:grid;gap:2rem}
@media(min-width:992px){.main-grid{grid-template-columns:1fr 320px}}
.main-content{min-width:0}

/* Section Headers */
.section-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;flex-wrap:wrap;gap:1rem}
.section-title{font-size:1.5rem;font-weight:700;color:var(--text-primary)}
.section-title::after{content:'';display:block;width:40px;height:3px;background:var(--accent);margin-top:.5rem;border-radius:2px}
.view-all{font-weight:600;color:var(--accent);font-size:.9rem}
.view-all:hover{color:var(--accent-hover);text-decoration:underline}

/* Article Cards Grid */
.articles-grid{display:grid;gap:1.5rem;grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
.article-card{background:var(--bg-secondary);border-radius:12px;overflow:hidden;border:1px solid var(--border-color);transition:var(--transition);display:flex;flex-direction:column}
.article-card:hover{border-color:var(--accent);box-shadow:var(--card-shadow);transform:translateY(-4px)}
.article-card .img-wrap{position:relative;aspect-ratio:16/10;overflow:hidden}
.article-card .img-wrap img{width:100%;height:100%;object-fit:cover;transition:var(--transition)}
.article-card:hover .img-wrap img{transform:scale(1.05)}
.article-card .category-tag{position:absolute;top:.75rem;left:.75rem;padding:.2rem .6rem;background:var(--accent);color:var(--bg-primary);border-radius:4px;font-size:.7rem;font-weight:600;text-transform:uppercase}
.article-card .content{padding:1.25rem;flex:1;display:flex;flex-direction:column}
.article-card h3{font-size:1.1rem;margin-bottom:.5rem;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.article-card .excerpt{font-size:.875rem;color:var(--text-secondary);margin-bottom:1rem;flex:1;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.article-card .read-more{display:inline-flex;align-items:center;gap:.5rem;font-weight:600;color:var(--accent);font-size:.9rem}
.article-card .read-more:hover{color:var(--accent-hover)}
.article-card .meta{font-size:.8rem;color:var(--text-muted);margin-bottom:.5rem}

/* Guides Section */
.guides-grid{display:grid;gap:1rem;grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}
.guide-card{display:flex;align-items:center;gap:1rem;padding:1.25rem;background:var(--bg-secondary);border-radius:12px;border:1px solid var(--border-color);transition:var(--transition)}
.guide-card:hover{border-color:var(--accent);background:var(--bg-tertiary)}
.guide-card .icon{width:48px;height:48px;min-width:48px;background:linear-gradient(135deg,var(--accent),#00a884);border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:1.5rem}
.guide-card h3{font-size:1rem;margin:0}

/* Price Prediction Section */
.prediction-grid{display:grid;gap:1rem;grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}
.prediction-card{background:var(--bg-secondary);border-radius:12px;padding:1.5rem;border:1px solid var(--border-color);transition:var(--transition)}
.prediction-card:hover{border-color:var(--accent-orange);box-shadow:var(--card-shadow)}
.prediction-card .crypto-icon{font-size:2rem;margin-bottom:.5rem}
.prediction-card h3{font-size:1.1rem;margin-bottom:.5rem}
.prediction-card p{font-size:.875rem;margin:0}

/* ========== SIDEBAR ========== */
.sidebar{display:flex;flex-direction:column;gap:2rem}
.sidebar-widget{background:var(--bg-secondary);border-radius:12px;padding:1.5rem;border:1px solid var(--border-color)}
.sidebar-widget h3{font-size:1.1rem;margin-bottom:1rem;padding-bottom:.75rem;border-bottom:2px solid var(--accent);display:inline-block}
.sidebar-search input{width:100%;padding:.75rem 1rem;border:1px solid var(--border-color);border-radius:8px;background:var(--bg-tertiary);color:var(--text-primary);font-size:.9rem;margin-bottom:.5rem}
.sidebar-search input:focus{outline:none;border-color:var(--accent)}
.sidebar-search button{width:100%;padding:.75rem;background:var(--accent);color:var(--bg-primary);border-radius:8px;font-weight:600;font-size:.9rem}
.sidebar-search button:hover{background:var(--accent-hover)}
.categories-list a{display:flex;justify-content:space-between;padding:.5rem 0;border-bottom:1px solid var(--border-color);color:var(--text-secondary);font-size:.9rem}
.categories-list a:hover{color:var(--accent)}
.categories-list a:last-child{border-bottom:none}
.recent-posts .post-item{display:flex;gap:.75rem;padding:.75rem 0;border-bottom:1px solid var(--border-color)}
.recent-posts .post-item:last-child{border-bottom:none}
.recent-posts .post-item img{width:60px;height:45px;object-fit:cover;border-radius:6px}
.recent-posts .post-item h4{font-size:.9rem;font-weight:600;line-height:1.3}
.newsletter-form input{width:100%;padding:.75rem;border:1px solid var(--border-color);border-radius:8px;background:var(--bg-tertiary);color:var(--text-primary);margin-bottom:.5rem;font-size:.9rem}
.newsletter-form input:focus{outline:none;border-color:var(--accent)}
.newsletter-form button{width:100%;padding:.75rem;background:var(--accent-orange);color:#fff;border-radius:8px;font-weight:600;font-size:.9rem}
.newsletter-form button:hover{opacity:.9}
.newsletter-form p{font-size:.8rem;color:var(--text-muted);margin-top:.5rem}

/* ========== FOOTER ========== */
.footer{background:var(--bg-secondary);border-top:1px solid var(--border-color);padding:3rem 0 2rem;margin-top:3rem}
.footer-grid{display:grid;gap:2rem;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));margin-bottom:2rem}
.footer-col h4{font-size:1rem;margin-bottom:1rem;color:var(--text-primary)}
.footer-col ul li{margin-bottom:.5rem}
.footer-col a{color:var(--text-secondary);font-size:.9rem}
.footer-col a:hover{color:var(--accent)}
.footer-bottom{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:1rem;padding-top:2rem;border-top:1px solid var(--border-color)}
.footer-bottom p{font-size:.85rem;color:var(--text-muted);margin:0}
.social-links{display:flex;gap:.75rem}
.social-links a{width:40px;height:40px;display:flex;align-items:center;justify-content:center;background:var(--bg-tertiary);border-radius:10px;color:var(--text-secondary);transition:var(--transition)}
.social-links a:hover{background:var(--accent);color:var(--bg-primary)}

/* ========== BLOG POST (Single) ========== */
.article-header{text-align:center;padding:2rem 0 3rem;max-width:800px;margin:0 auto}
.article-header .breadcrumb{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center;margin-bottom:1rem;font-size:.85rem;color:var(--text-muted)}
.article-header .breadcrumb a:hover{color:var(--accent)}
.article-header .category-tag{display:inline-block;padding:.25rem .75rem;background:var(--accent);color:var(--bg-primary);border-radius:6px;font-size:.75rem;font-weight:600;margin-bottom:1rem;text-transform:uppercase}
.article-header h1{font-size:clamp(1.75rem,4vw,2.5rem);margin-bottom:1rem;line-height:1.3}
.article-header .meta{display:flex;flex-wrap:wrap;gap:1rem;justify-content:center;font-size:.9rem;color:var(--text-muted)}
.article-featured-img{margin-bottom:2rem;border-radius:12px;overflow:hidden}
.article-featured-img img{width:100%;aspect-ratio:21/9;object-fit:cover}
.article-body{max-width:800px;margin:0 auto;padding:0 1rem 3rem}
.article-body h2{margin-top:2rem;margin-bottom:1rem;padding-bottom:.5rem;border-bottom:1px solid var(--border-color)}
.article-body h3{margin-top:1.5rem;margin-bottom:.75rem}
.article-content a{color:var(--accent);text-decoration:underline}
.article-content a:hover{color:var(--accent-hover);text-decoration:underline}
.article-body ul, .article-body ol{margin:1rem 0;padding-left:1.5rem}
.article-body figure{margin:2rem 0;border-radius:12px;overflow:hidden;border:1px solid var(--border-color)}
.article-body figure img{width:100%;height:auto}
.article-body figcaption{padding:1rem;font-size:.9rem;color:var(--text-muted);background:var(--bg-secondary)}
.article-body li{margin-bottom:.5rem;color:var(--text-secondary)}
.table-of-contents{background:var(--bg-secondary);border-radius:12px;padding:1.5rem;margin:2rem 0;border:1px solid var(--border-color)}
.table-of-contents h3{font-size:1.1rem;margin-bottom:1rem}
.table-of-contents ul{padding-left:0;list-style:none}
.table-of-contents li{margin-bottom:.5rem}
.table-of-contents a{color:var(--text-secondary);font-size:.95rem}
.table-of-contents a:hover{color:var(--accent)}
.related-posts{margin-top:3rem;padding-top:2rem;border-top:1px solid var(--border-color)}
.related-posts h2{margin-bottom:1.5rem}
.comment-form{background:var(--bg-secondary);border-radius:12px;padding:2rem;margin-top:2rem;border:1px solid var(--border-color)}
.comment-form h3{margin-bottom:1rem}
.comment-form input,.comment-form textarea{width:100%;padding:.75rem;border:1px solid var(--border-color);border-radius:8px;background:var(--bg-tertiary);color:var(--text-primary);margin-bottom:1rem;font-size:.9rem}
.comment-form input:focus,.comment-form textarea:focus{outline:none;border-color:var(--accent)}
.comment-form textarea{min-height:120px;resize:vertical}
.comment-form button{padding:.75rem 1.5rem;background:var(--accent);color:var(--bg-primary);border-radius:8px;font-weight:600}
.comment-form button:hover{background:var(--accent-hover)}

/* ========== CONTACT PAGE ========== */
.contact-hero{text-align:center;padding:2rem 0}
.contact-hero h1{margin-bottom:.5rem}
.contact-hero p{max-width:600px;margin:0 auto}
.contact-grid{display:grid;gap:2rem;padding:2rem 0;grid-template-columns:1fr}
@media(min-width:768px){.contact-grid{grid-template-columns:1fr 1fr}}
.contact-form input,.contact-form textarea{width:100%;padding:.75rem;border:1px solid var(--border-color);border-radius:8px;background:var(--bg-secondary);color:var(--text-primary);margin-bottom:1rem;font-size:1rem}
.contact-form textarea{min-height:150px;resize:vertical}
.contact-form button{padding:.75rem 2rem;background:var(--accent);color:var(--bg-primary);border-radius:8px;font-weight:600;font-size:1rem}
.contact-form button:hover{background:var(--accent-hover)}
.legal-content{max-width:800px;margin:0 auto;padding:2rem 1rem 3rem}
.legal-content h1{margin-bottom:1rem}
.legal-content h2{font-size:1.25rem;margin-top:2rem;margin-bottom:.75rem}
.legal-content p,.legal-content ul{margin-bottom:1rem;color:var(--text-secondary)}
.legal-content ul{padding-left:1.5rem}

/* ========== PAGINATION ========== */
.pagination{display:flex;justify-content:center;gap:.5rem;margin:2rem 0;flex-wrap:wrap}
.pagination a,.pagination span{display:flex;align-items:center;justify-content:center;min-width:40px;height:40px;padding:0 .75rem;border-radius:8px;font-weight:600;font-size:.9rem;background:var(--bg-secondary);border:1px solid var(--border-color);color:var(--text-primary)}
.pagination a:hover{background:var(--accent);border-color:var(--accent);color:var(--bg-primary)}
.pagination .current{background:var(--accent);border-color:var(--accent);color:var(--bg-primary)}

/* ========== BACK TO TOP ========== */
.back-to-top{position:fixed;bottom:2rem;right:2rem;width:50px;height:50px;background:var(--accent);color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;opacity:0;visibility:hidden;transition:var(--transition);z-index:999;box-shadow:0 4px 15px rgba(60,97,226,.4)}
.back-to-top.visible{opacity:1;visibility:visible}
.back-to-top:hover{background:var(--accent-hover);color:var(--bg-primary);transform:translateY(-3px)}

/* ========== MOBILE MENU ========== */
.mobile-nav{position:fixed;top:0;right:-100%;width:300px;max-width:85vw;height:100vh;background:var(--bg-secondary);z-index:9999;padding:2rem;transition:right .3s ease;box-shadow:-5px 0 20px rgba(0,0,0,.3);overflow-y:auto}
.mobile-nav.active{right:0}
.mobile-nav-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:9998;opacity:0;visibility:hidden;transition:var(--transition)}
.mobile-nav-overlay.active{opacity:1;visibility:visible}
.mobile-nav a{display:block;padding:1rem;border-bottom:1px solid var(--border-color);font-weight:500}
.mobile-nav a:hover{color:var(--accent)}
.mobile-nav-close{position:absolute;top:1rem;right:1rem;width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:var(--bg-tertiary);border-radius:10px}

/* ========== LAZY LOAD ========== */
img[data-src]{opacity:0;transition:opacity .3s}
img.loaded{opacity:1}

/* ========== UTILITIES ========== */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
