/*
Theme Name: Starter Theme
Theme URI: https://starter-theme.com
Author: Pro Developer
Author URI: https://starter-theme.com
Description: A professional, clean and responsive WordPress theme inspired by modern blog designs. Features a minimalist aesthetic with excellent typography and SEO optimization.
Version: 1.0.0
Requires at least: 5.0
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: starter-theme
Tags: blog, two-columns, right-sidebar, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ============================================
   CSS VARIABLES
============================================ */
:root {
    --primary-color: #3bb2cf;
    --secondary-color: #22272d;
    --text-color: #22272d;
    --text-light: #9ca8af;
    --background: #fafafa;
    --white: #ffffff;
    --red: #d1354f;
    --border-color: #e8e8e8;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
    --font-primary: 'Raleway', sans-serif;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol {
    list-style: none;
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--secondary-color);
}

/* ============================================
   CONTAINER
============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.wrapper {
    display: flex;
    gap: 30px;
    padding: 30px 0;
}

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

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-logo svg {
    width: 32px;
    height: 32px;
}

.site-logo .logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--secondary-color);
    letter-spacing: -0.5px;
}

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

.nav-menu {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    transition: var(--transition);
}

.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a {
    background: var(--background);
    color: var(--primary-color);
}

/* Dropdown */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--white);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

.nav-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu li a {
    display: block;
    padding: 10px 20px;
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 500;
}

.nav-menu .sub-menu li a:hover {
    background: var(--background);
    color: var(--primary-color);
}

/* Nested Dropdown */
.nav-menu .sub-menu .sub-menu {
    left: 100%;
    top: 0;
}

/* Header Icons */
.header-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    color: var(--secondary-color);
    cursor: pointer;
    transition: var(--transition);
}

.header-icon:hover {
    background: var(--background);
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
}

/* ============================================
   MAIN CONTENT
============================================ */
.main-content {
    flex: 1;
    min-width: 0;
}

/* Post Card */
.post-card {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.post-card:hover {
    box-shadow: 0 5px 25px rgba(0,0,0,0.12);
}

.post-card-inner {
    display: flex;
    gap: 20px;
}

.post-thumbnail {
    flex-shrink: 0;
    width: 180px;
    height: 135px;
    border-radius: 8px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.post-content {
    flex: 1;
    min-width: 0;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

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

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.post-meta .author {
    color: var(--primary-color);
    font-weight: 500;
}

.post-meta .separator {
    color: var(--text-light);
}

.post-excerpt {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* Load More Button */
.load-more-wrapper {
    text-align: center;
    padding: 20px 0;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    background: var(--primary-color);
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.load-more-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* ============================================
   SIDEBAR
============================================ */
.sidebar {
    width: 320px;
    flex-shrink: 0;
}

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

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--secondary-color);
    position: relative;
    padding-bottom: 12px;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Social Links Widget */
.social-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 8px;
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

.social-link:hover {
    transform: translateY(-2px);
    color: var(--white);
}

.social-link.facebook { background: #1877f2; }
.social-link.twitter { background: var(--secondary-color); }
.social-link.youtube { background: var(--red); }
.social-link.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

.social-link i {
    font-size: 1rem;
}

/* Popular Posts Widget */
.popular-post {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.popular-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.popular-post:first-child {
    padding-top: 0;
}

.popular-post-thumb {
    width: 70px;
    height: 55px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.popular-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-post-content {
    flex: 1;
    min-width: 0;
}

.popular-post-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-post-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Comments Widget */
.recent-comment {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.recent-comment:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--background);
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-author {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.comment-text {
    font-size: 0.85rem;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Categories Widget */
.category-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.category-list li a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

.category-list li a:hover {
    color: var(--primary-color);
}

.category-list li .count {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Tags Widget */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud a {
    display: inline-block;
    padding: 8px 16px;
    background: var(--background);
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.tag-cloud a:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* ============================================
   FOOTER
============================================ */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.footer-main {
    padding: 40px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 1;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-logo svg {
    width: 28px;
    height: 28px;
}

.footer-logo .logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary-color);
}

.footer-description {
    font-size: 0.9rem;
    color: var(--text-light);
    max-width: 400px;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    color: var(--text-color);
    border-radius: 50%;
    transition: var(--transition);
}

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

.footer-bottom {
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    font-size: 0.875rem;
    color: var(--text-light);
}

.copyright a {
    color: var(--primary-color);
    font-weight: 600;
}

.footer-menu {
    display: flex;
    gap: 25px;
}

.footer-menu a {
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 500;
}

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

/* ============================================
   BACK TO TOP
============================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 4px 15px rgba(59, 178, 207, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

/* ============================================
   FLOATING BUTTONS
============================================ */
.floating-buttons {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
}

.floating-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    padding: 12px 8px;
    background: var(--white);
    color: var(--text-color);
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    border: 1px solid var(--border-color);
    border-right: none;
    cursor: pointer;
    transition: var(--transition);
}

.floating-btn:first-child {
    border-radius: 8px 0 0 0;
}

.floating-btn:last-child {
    border-radius: 0 0 0 8px;
}

.floating-btn i {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

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

/* ============================================
   SINGLE POST
============================================ */
.single-post-header {
    margin-bottom: 30px;
}

.single-post-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.single-post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.single-post-content {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.single-post-content p {
    margin-bottom: 1.5em;
}

.single-post-content h2,
.single-post-content h3,
.single-post-content h4 {
    margin: 1.5em 0 0.75em;
}

.single-post-content img {
    border-radius: 8px;
    margin: 1.5em 0;
}

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

.comments-title {
    font-size: 1.25rem;
    margin-bottom: 25px;
}

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

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

.comment:last-child {
    border-bottom: none;
}

.comment-body {
    display: flex;
    gap: 15px;
}

.comment-author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
}

.comment-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-main {
    flex: 1;
}

.comment-author-name {
    font-weight: 700;
    margin-bottom: 5px;
}

.comment-date {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.comment-text {
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Comment Form */
.comment-form {
    margin-top: 30px;
}

.comment-form .form-group {
    margin-bottom: 20px;
}

.comment-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.comment-form button {
    padding: 12px 30px;
    background: var(--primary-color);
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.comment-form button:hover {
    background: var(--secondary-color);
}

/* ============================================
   PAGE TEMPLATES
============================================ */
.page-header {
    padding: 40px 0;
    text-align: center;
    background: var(--white);
    margin-bottom: 30px;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 10px;
}

.page-description {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   PAGINATION
============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 30px 0;
}

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

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

/* ============================================
   SEARCH
============================================ */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-form-overlay {
    width: 90%;
    max-width: 600px;
}

.search-form-overlay input {
    width: 100%;
    padding: 20px;
    font-size: 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--white);
    color: var(--white);
    outline: none;
}

.search-form-overlay input::placeholder {
    color: rgba(255,255,255,0.5);
}

.search-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
}

/* ============================================
   COOKIE NOTICE
============================================ */
.cookie-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--secondary-color);
    color: var(--white);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 9998;
    transform: translateY(100%);
    transition: var(--transition);
}

.cookie-notice.visible {
    transform: translateY(0);
}

.cookie-notice p {
    font-size: 0.9rem;
}

.cookie-notice a {
    color: var(--primary-color);
}

.cookie-accept {
    padding: 8px 20px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.cookie-accept:hover {
    background: var(--white);
    color: var(--secondary-color);
}

/* ============================================
   MOBILE MENU
============================================ */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    background: var(--white);
    z-index: 10000;
    transform: translateX(-100%);
    transition: var(--transition);
    overflow-y: auto;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-close {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.mobile-nav {
    padding: 20px;
}

.mobile-nav li {
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav li a {
    display: block;
    padding: 12px 0;
    font-weight: 500;
}

.mobile-nav .sub-menu {
    padding-left: 20px;
}

.mobile-nav .sub-menu li:last-child {
    border-bottom: none;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 1024px) {
    .wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .nav-menu {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .post-card-inner {
        flex-direction: column;
    }

    .post-thumbnail {
        width: 100%;
        height: 200px;
    }

    .post-title {
        font-size: 1.25rem;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-brand {
        flex-direction: column;
    }

    .footer-bottom-inner {
        flex-direction: column;
        gap: 15px;
    }

    .social-links {
        grid-template-columns: 1fr;
    }

    .floating-buttons {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 10px 0;
    }

    .site-logo .logo-text {
        font-size: 1.5rem;
    }

    .post-card {
        padding: 20px;
    }

    .widget {
        padding: 20px;
    }

    .single-post-title {
        font-size: 1.5rem;
    }
}

/* ============================================
   WORDPRESS SPECIFIC
============================================ */
.alignleft {
    float: left;
    margin: 0 1.5em 1.5em 0;
}

.alignright {
    float: right;
    margin: 0 0 1.5em 1.5em;
}

.aligncenter {
    display: block;
    margin: 1.5em auto;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.875rem;
    color: var(--text-light);
    text-align: center;
    padding: 10px 0;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin: 1.5em 0;
}

.gallery-item {
    margin: 0;
}

.gallery-item img {
    width: 100%;
    height: auto;
}

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

/* WordPress Block Editor Styles */
.wp-block-image {
    margin: 1.5em 0;
}

.wp-block-quote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 1.5em 0;
    font-style: italic;
}

.wp-block-quote cite {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 10px;
}

.has-text-align-center {
    text-align: center;
}

.has-text-align-right {
    text-align: right;
}
