/*
Theme Name: Daily18 Theme
Theme URI: https://example.com/daily18
Author: dharmendra singh
Description: High-performance AI, technology, and magazine blog websites.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.4
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: daily18
Tags: blog, magazine, news, responsive-layout, dark-mode, editor-style, fast, ai, auto-loading, custom-colors, post-formats, theme-options, translation-ready
*/

:root {
  --primary-color: #0d6efd;
  --bg-color: #f8f9fa;
  --text-color: #2b2b2b;
  --text-muted: #6c757d;
  --surface-color: #ffffff;
  --border-color: #e9ecef;
  --nav-bg: #ffffff;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --font-base: 'Inter', system-ui, sans-serif;
  --header-height: 80px;
  --transition: all 0.3s ease;
}

[data-theme="dark"] {
  --primary-color: #3b82f6;
  --bg-color: #0f1115;
  --text-color: #e2e8f0;
  --text-muted: #94a3b8;
  --surface-color: #1e2128;
  --border-color: #2d3139;
  --nav-bg: #1e2128;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.5);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.6);
}

/* Base Styles */
* { box-sizing: border-box; }
body {
    font-family: var(--font-base);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    transition: var(--transition);
}
a { color: var(--primary-color); text-decoration: none; transition: var(--transition); }
a:hover { color: inherit; opacity: 0.8; }
h1, h2, h3, h4, h5, h6 { color: var(--text-color); font-weight: 700; margin-top: 0; line-height: 1.2; }
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-flex { display: flex; align-items: center; justify-content: space-between; }

/* Buttons */
.btn, button, input[type="submit"] {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}
.btn:hover, button:hover, input[type="submit"]:hover { filter: brightness(0.9); }

/* Header */
.site-header { background: var(--nav-bg); border-bottom: 1px solid var(--border-color); }
.top-bar { background: var(--primary-color); color: #fff; padding: 5px 0; font-size: 0.85rem; }
.top-bar a { color: rgba(255,255,255,0.8); margin-left: 15px; text-decoration: none; }
.top-bar a:hover { color: #fff; }
.mid-header { padding: 25px 20px; }
.site-branding h1 { margin: 0; font-size: 2.2rem; font-weight: 800; letter-spacing: -1px; }
.site-branding a { color: var(--text-color); }
.site-description { margin: 5px 0 0; color: var(--text-muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }
.header-ad { margin-left: auto; max-width: 728px; }
.ad-placeholder { background: var(--surface-color); border: 1px dashed var(--border-color); text-align: center; padding: 30px; color: var(--text-muted); }

/* Navigation */
.nav-wrapper { background: var(--nav-bg); border-top: 1px solid var(--border-color); position: relative; z-index: 100; transition: var(--transition); }
.nav-wrapper.sticky { position: fixed; top: 0; left: 0; width: 100%; box-shadow: var(--shadow-md); animation: slideDown 0.3s ease-out forwards; }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; }
.main-navigation li { position: relative; }
.main-navigation a { display: block; padding: 15px 20px; font-weight: 600; color: var(--text-color); font-size: 1.05rem; }
.main-navigation a:hover { color: var(--primary-color); }
.header-tools { display: flex; align-items: center; }
.dark-mode-btn { background: var(--surface-color); color: var(--text-color); border: 1px solid var(--border-color); border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; transition: transform 0.3s; }
.dark-mode-btn:hover { transform: scale(1.1); }

/* Progress Bar */
.reading-progress { position: fixed; top: 0; left: 0; width: 0%; height: 4px; background: var(--primary-color); z-index: 9999; }

/* Layout */
.layout-sidebar { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; margin-top: 40px; margin-bottom: 40px; }
@media(max-width: 900px) { .layout-sidebar { grid-template-columns: 1fr; } }
.main-content { min-width: 0; }

/* Cards & Grids */
.card { background: var(--surface-color); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; border: 1px solid var(--border-color); transition: transform 0.3s, box-shadow 0.3s; margin-bottom: 30px; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.post-list .list-item { display: flex; flex-direction: row; }
@media(max-width: 600px) { .post-list .list-item { flex-direction: column; } }
.post-list .half-width { flex: 1; }
.post-thumbnail img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16/10; transition: transform 0.5s; }
.card:hover .post-thumbnail img { transform: scale(1.05); }
.post-thumbnail { overflow: hidden; height: 100%; }
.post-info { padding: 25px; display: flex; flex-direction: column; justify-content: center; }
.post-cat a { background: rgba(13, 110, 253, 0.1); color: var(--primary-color); padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; margin-bottom: 15px; display: inline-block; letter-spacing: 1px; }
.entry-title { font-size: 1.4rem; margin: 10px 0; }
.entry-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 15px; font-weight: 500; }
.entry-excerpt { font-size: 1rem; color: var(--text-muted); line-height: 1.6; }

/* Slider Wrapper */
.homepage-slider { margin-top: 30px; }
.slider-wrapper { display: flex; gap: 20px; flex-wrap: wrap; height: 450px; }
.slider-wrapper .slide-item { flex: 1; border-radius: var(--border-radius-lg); background-size: cover; background-position: center; position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 30px; min-width: 300px; color: #fff; transition: flex 0.5s; }
.slider-wrapper .slide-item:hover { flex: 1.2; }
.slider-wrapper .slide-item a { color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.5); font-size: 1.8rem; font-weight: 800; }
.slider-wrapper .slide-item .post-cat a { background: var(--primary-color); color:#fff; }
.slider-wrapper .post-meta { color: rgba(255,255,255,0.8); font-size: 0.85rem; margin-top: 10px; }

/* Single Post */
.single-post-view .entry-header { margin-bottom: 30px; }
.breadcrumbs { font-size: 0.9rem; margin-bottom: 15px; color: var(--text-muted); font-weight: 500; }
.breadcrumbs a { color: var(--text-color); }
.single-title { font-size: 2.8rem; line-height: 1.2; margin-bottom: 25px; letter-spacing: -1px; }
.single-meta { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 25px; }
.meta-author { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.meta-author img { border-radius: 50%; width: 45px; height: 45px; }
.single-thumbnail { margin-bottom: 40px; border-radius: var(--border-radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.ai-summary-block { background: rgba(13, 110, 253, 0.05); border: 1px solid var(--primary-color); border-radius: var(--border-radius-lg); padding: 25px; margin-bottom: 40px; position: relative; }
.ai-summary-block::before { content: 'AI'; position: absolute; right: 20px; top: -15px; background: var(--primary-color); color: #fff; padding: 5px 15px; border-radius: 20px; font-size: 0.8rem; font-weight: 800; }
.ai-summary-block h4 { margin: 0 0 10px; color: var(--primary-color); display: flex; align-items: center; gap: 8px; }
.entry-content { font-size: 1.15rem; line-height: 1.8; color: var(--text-color); font-weight: 400; }
.entry-content p { margin-bottom: 25px; }
.entry-content h2, .entry-content h3 { margin-top: 50px; margin-bottom: 25px; font-weight: 800; }
.entry-content blockquote { border-left: 5px solid var(--primary-color); margin: 40px 0; padding: 20px 30px; font-style: italic; font-size: 1.3rem; color: var(--text-color); background: rgba(0,0,0,0.02); border-radius: 0 var(--border-radius) var(--border-radius) 0; }
[data-theme="dark"] .entry-content blockquote { background: rgba(255,255,255,0.02); }

/* Social Share */
.social-share { margin: 50px 0; display: flex; gap: 15px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); padding: 30px 0; }
.share-label { font-weight: 700; font-size: 1.1rem; }
.share-btn { padding: 10px 20px; border-radius: 25px; color: #fff !important; font-size: 0.95rem; font-weight: 600; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.facebook { background: #1877F2; }
.share-btn.linkedin { background: #0A66C2; }

/* Author Box */
.author-box { display: flex; gap: 30px; background: var(--surface-color); padding: 40px; border-radius: var(--border-radius-lg); border: 1px solid var(--border-color); margin: 50px 0; align-items: center; }
.author-avatar img { border-radius: 50%; width: 100px; height: 100px; }
.author-info h3 { margin: 0 0 10px; font-size: 1.5rem; }
.author-info p { margin: 0 0 15px; color: var(--text-muted); font-size: 1.05rem; line-height: 1.6; }
.author-link { font-weight: 700; color: var(--primary-color); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; }

/* Related Posts */
.related-posts { margin: 50px 0 0; }
.related-posts h3 { font-size: 1.8rem; margin-bottom: 30px; }
.related-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }

/* Comments */
.comments-area { margin-top: 50px; padding-top: 50px; border-top: 1px solid var(--border-color); }

/* Sidebar */
.sidebar-sticky { position: sticky; top: 120px; }
.widget { background: var(--surface-color); padding: 30px; border-radius: var(--border-radius-lg); border: 1px solid var(--border-color); margin-bottom: 30px; }
.widget-title { font-size: 1.3rem; font-weight: 800; border-bottom: 3px solid var(--primary-color); padding-bottom: 15px; margin-bottom: 25px; display: inline-block; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 12px 0; border-bottom: 1px dashed var(--border-color); display: flex; align-items: center; gap: 15px; }
.widget li::before { content: '›'; color: var(--primary-color); font-weight: 700; font-size: 1.5rem; }
.widget li:last-child { border-bottom: none; }
.widget select, .widget input[type="text"] { width: 100%; padding: 12px; border-radius: var(--border-radius); border: 1px solid var(--border-color); background: var(--bg-color); color: var(--text-color); margin-bottom: 15px; }

/* Footer */
.site-footer { background: #0f1115; color: #cbd5e1; padding: 80px 0 30px; margin-top: 80px; }
.footer-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; margin-bottom: 60px; }
.site-footer .widget { background: transparent; border: none; padding: 0; }
.site-footer .widget-title { border-bottom-color: #334155; color: #fff; }
.site-footer .widget li { border-bottom-color: #1e293b; }
.site-footer .widget li::before { display: none; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.newsletter-form { display: flex; flex-direction: column; gap: 15px; }
.newsletter-form input { padding: 15px; border: 1px solid #334155; background: #1e293b; color: #fff; border-radius: var(--border-radius); outline: none; transition: border-color 0.3s; }
.newsletter-form input:focus { border-color: var(--primary-color); }
.newsletter-form button { padding: 15px; font-size: 1.05rem; }
.site-info { border-top: 1px solid #1e293b; padding-top: 30px; display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; }
.footer-nav ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 20px; font-weight: 500; }

/* Forms */
#commentform { display: flex; flex-direction: column; gap: 20px; }
#commentform input[type="text"], #commentform input[type="email"], #commentform textarea { width: 100%; padding: 15px; border: 1px solid var(--border-color); border-radius: var(--border-radius); background: var(--bg-color); color: var(--text-color); font-family: var(--font-base); }
#commentform textarea { min-height: 150px; resize: vertical; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 40px; }
.page-numbers { padding: 10px 18px; background: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--border-radius); font-weight: 600; color: var(--text-color); }
.page-numbers.current, .page-numbers:hover { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* Responsive */
@media(max-width: 992px) {
    .single-title { font-size: 2.2rem; }
}
@media(max-width: 768px) {
    .site-branding h1 { font-size: 1.8rem; }
    .site-info { flex-direction: column; gap: 20px; text-align: center; }
    .slider-wrapper { height: auto; flex-direction: column; }
    .slider-wrapper .slide-item { height: 350px; }
    .main-navigation { display: none; }
    .main-navigation.toggled { display: block; position: absolute; top: 100%; left: 0; width: 100%; background: var(--nav-bg); padding: 20px; box-shadow: var(--shadow-lg); border-top: 1px solid var(--border-color); }
    .main-navigation.toggled ul { flex-direction: column; }
    .main-navigation.toggled a { padding: 10px 0; border-bottom: 1px solid var(--border-color); }
    .menu-toggle { display: block !important; background: transparent; color: var(--text-color); border: 1px solid var(--border-color); padding: 8px 15px; border-radius: var(--border-radius); font-weight: 600; cursor: pointer; }
    .author-box { flex-direction: column; text-align: center; }
    .related-grid { grid-template-columns: 1fr; }
}
.menu-toggle { display: none; }
.category-block { margin-bottom: 40px; }
.section-title { position: relative; padding-left: 15px; margin-bottom: 30px; font-size: 1.8rem; clear: both; }
.section-title::before { content: ''; position: absolute; left: 0; top: 0; width: 5px; height: 100%; background: var(--primary-color); border-radius: 5px; }

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
