/*
Theme Name: Mobile Reader Pro
Theme URI: https://example.com/mobile-reader-pro
Author: Custom WP Dev
Description: A fast, lightweight, mobile-first English WordPress theme designed for comfortable story reading and crisp full-width image viewing. Fully compatible with WordPress 6.x and PHP 8.x.
Version: 2.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: mobile-reader-theme
*/

:root {
    --bg-color: #f4f5f7;
    --card-bg: #ffffff;
    --text-primary: #1a1c1e;
    --text-secondary: #5f6368;
    --accent-color: #1877f2;
    --accent-hover: #145dbf;
    --border-color: #e4e6eb;
    --radius: 12px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
    word-wrap: break-word;
}

/* Header */
.site-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.header-inner {
    max-width: 680px;
    margin: 0 auto;
    padding: 14px 16px;
    text-align: center;
}

.site-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

.site-title a {
    color: var(--accent-color);
    text-decoration: none;
}

.site-description {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.primary-nav {
    margin-top: 10px;
}

.primary-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.primary-nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.primary-nav a:hover {
    background-color: var(--bg-color);
    color: var(--accent-color);
}

/* Main container */
.site-main {
    max-width: 680px;
    margin: 0 auto;
    padding: 16px 12px 32px;
}

/* Cards / Articles */
.post-card {
    background: var(--card-bg);
    padding: 18px;
    margin-bottom: 18px;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.entry-title {
    margin: 0 0 8px 0;
    font-size: 21px;
    line-height: 1.35;
    font-weight: 700;
}

.entry-title a {
    color: var(--text-primary);
    text-decoration: none;
}

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

.entry-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

/* Images & Media */
.post-thumbnail {
    margin: 0 0 14px 0;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: cover;
}

.entry-content img,
.wp-block-image img,
figure img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 14px auto;
    border-radius: 8px;
}

figure {
    margin: 16px 0;
    max-width: 100%;
}

figcaption {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 6px;
}

iframe, video, embed {
    max-width: 100%;
}

/* Content Typography */
.entry-content {
    font-size: 17px;
    line-height: 1.75;
    color: var(--text-primary);
}

.entry-content p {
    margin: 0 0 16px 0;
}

.entry-content h2,
.entry-content h3 {
    margin: 24px 0 12px 0;
    line-height: 1.35;
}

.entry-content blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 4px solid var(--accent-color);
    background-color: var(--bg-color);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

/* Buttons */
.read-more-btn,
.back-home-btn {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 14px;
    padding: 12px 16px;
    background-color: var(--accent-color);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: background-color 0.15s ease;
}

.read-more-btn:hover,
.back-home-btn:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
}

.back-home-link {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

/* Pagination & Post Navigation */
.navigation.pagination,
.post-navigation {
    margin-top: 20px;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-links a,
.nav-links .page-numbers {
    display: inline-block;
    padding: 10px 14px;
    background: var(--card-bg);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.nav-links .page-numbers.current {
    background: var(--accent-color);
    color: #ffffff;
}

.nav-links a:hover {
    background: var(--accent-color);
    color: #ffffff;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 24px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

.site-footer p {
    margin: 0;
}

/* WordPress Accessibility */
.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;
}
