/* 
Theme Name: Bare Bones Blog Theme
Theme URI: http://example.com/
Author: Whoever
Author URI: http://example.com/
Description: A minimalist blogging theme
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bare-bones-blog-theme
*/

/* CSS Reset and Box Sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Custom Properties */
:root {
    --color-bg: #ffffff;
    --color-text: #333333;
    --color-primary: #0066cc;
    --color-secondary: #f8f8f8;
    --color-accent: #ff6600;
    --color-muted: #6c757d;
    --color-border: #e7ebf0;
    --max-width: 1200px;
    --spacing-unit: 1rem;
}

/* Dark theme */
:root.dark-theme {
    --color-bg: #1a1a1a;
    --color-text: #f0f0f0;
    --color-secondary: #333333;
    --color-border: #4a4a4a;
}

html {
    height: 100%;
}

/* Base styles */
body {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    transition: background-color 0.3s ease, color 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Roboto', sans-serif;
    margin-bottom: 0.5em;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

p,
ul,
ol {
    margin-bottom: 1rem;
}

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

a:hover {
    text-decoration: underline;
}

/* Header styles */
body>header {
    background-color: var(--color-secondary);
    padding: var(--spacing-unit) 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    -ms-word-wrap: break-word;
    word-wrap: break-word;
}

.header-inner {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    word-wrap: break-word;
    padding: 0 calc(var(--spacing-unit) + 20px);
}

.site-title {
    margin: 0;
    font-size: 2rem;
}

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

.header-controls {
    display: flex;
    gap: var(--spacing-unit);
}

.header-controls>#theme-switcher {
    max-width: 40px;
    margin-left: auto;
}

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

.search-field {
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-right: none;
    border-radius: 4px 0 0 4px;
}

.search-submit {
    padding: 0.5rem 1rem;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-submit:hover {
    background-color: #0052a3;
}

/* Sorting filter styles */
#sorting-filter {
    padding: 0.5rem 1rem;
    background-color: var(--color-secondary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    color: var(--color-text);
}

#sorting-filter:hover {
    background-color: #e6e6e6;
}

/* Dark theme specific styles for sorting filter */
:root.dark-theme #sorting-filter {
    background-color: var(--color-secondary);
    color: var(--color-text);
    border-color: var(--color-text);
}

:root.dark-theme #sorting-filter:hover {
    background-color: #4a4a4a;
}

/* Theme switcher styles */
#theme-switcher {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    transition: color 0.3s ease;
}

#theme-switcher:hover {
    color: var(--color-primary);
}

#theme-switcher svg {
    width: 24px;
    height: 24px;
}

/* Dark theme specific styles for theme switcher */
:root.dark-theme #theme-switcher {
    color: var(--color-text);
}

:root.dark-theme #theme-switcher:hover {
    color: var(--color-accent);
}

/* Main content styles */
body>main {
    padding: var(--spacing-unit) 0;
    flex: 1 0 auto;
}

/* Post styles */
.home .post,
.blog .post {
    background-color: var(--color-secondary);
    border-radius: 8px;
    margin-bottom: var(--spacing-unit);
    padding: var(--spacing-unit);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    gap: var(--spacing-unit);
}

.home .post .entry-header,
.blog .post .entry-header {
    padding: 20px;
}

.home .post:hover,
.blog .post:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
}

.entry-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

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

.entry-meta {
    font-size: 0.9rem;
    color: var(--color-muted);
    margin-bottom: 1rem;
}

.home .entry-content,
.blog .entry-content {
    margin-bottom: 1rem;
    padding: 20px;
    flex-grow: 1;
}

.post-thumbnail {
    width: 100%;
    max-height: 400px;
    margin-bottom: 1rem;
}

.home .post-thumbnail,
.blog .post-thumbnail {
    max-width: 300px;
    width: auto;
    height: 300px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Single post styles */
.single .post {
    display: block;
    background-color: var(--color-bg);
    box-shadow: none;
    padding: 0;
    margin: 40px calc(var(--spacing-unit) + 20px);
}

/* create list indentation and styling for single posts */
.single .post ul {
    padding-left: 1.5rem;
    list-style-type: disc;
}

.single .post ol {
    padding-left: 1.5rem;
    list-style-type: decimal;
}

.single .post li {
    margin-bottom: 0.5rem;
}

.single .post:hover {
    transform: none;
    box-shadow: none;
}

.single .post-thumbnail {
    max-height: 500px;
    margin-bottom: 2rem;
}

.single .entry-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.single .entry-meta {
    margin-bottom: 2rem;
}

.single .entry-content {
    font-size: 1.2rem;
    line-height: 1.9;
}

/* Content Styles */
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.entry-content figure {
    margin-bottom: 1rem;
}

.entry-content figcaption {
    font-size: 0.9rem;
    color: var(--color-muted);
    text-align: center;
}

.entry-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: 1rem;
    margin-left: 0;
    font-style: italic;
    color: var(--color-muted);
}

.entry-content pre {
    background-color: var(--color-secondary);
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.entry-content code {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9em;
    background-color: var(--color-secondary);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.entry-content th,
.entry-content td {
    border: 1px solid var(--color-border);
    padding: 0.5rem;
}

.entry-content th {
    background-color: var(--color-secondary);
    font-weight: bold;
}

/* Footer styles */
body>footer {
    background-color: var(--color-secondary);
    color: var(--color-text);
    padding: var(--spacing-unit) 0;
    margin-top: var(--spacing-unit);
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-unit) calc(var(--spacing-unit) + 20px);
}

.footer-info {
    margin: 0;
}

.footer-info p {
    margin: 0;
}

.footer-links ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links ul li {
    margin: 0;
    line-height: 1;
}

.footer-links a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.footer-links svg {
    width: 20px;
    height: 20px;
}

.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;
}

/* Responsive footer adjustments */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: var(--spacing-unit) 1rem;
    }

    .footer-links ul {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 576px) {
    .footer-links ul {
        gap: 1rem;
    }
}

/* Loader */
#loader {
    text-align: center;
    padding: var(--spacing-unit);
    display: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.post {
    animation: fadeIn 0.5s ease;
}

/* Responsive Breakpoints */

/* Extra large devices (large desktops, 1201px and up) */
/* These are the base styles, no media query needed */

/* Large devices (desktops, 1200px and down) */
@media (max-width: 1200px) {
    .container {
        padding: 0 2rem;
    }

    .home .post-thumbnail,
    .blog .post-thumbnail {
        max-width: 250px;
        width: auto;
        height: 250px;
    }
}

/* Medium devices (tablets, 992px and down) */
@media (max-width: 992px) {
    .container {
        padding: 0 1.5rem;
    }

    .home .post-thumbnail,
    .blog .post-thumbnail {
        max-width: 200px;
        width: auto;
        height: 200px;
    }
}

/* Small devices (landscape phones, 768px and down) */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .container {
        padding: 0 1rem;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .home.site-title {
        margin-bottom: 15px;
    }

    .single.site-title {
        margin-bottom: 0;
    }

    .header-controls {
        width: 100%;
        gap: 0.5rem;
    }

    .home .post,
    .blog .post {
        flex-direction: column;
    }

    .home .post-thumbnail,
    .blog .post-thumbnail {
        max-width: 100%;
        width: 100%;
        height: auto;
        margin-bottom: var(--spacing-unit);
    }

    #theme-switcher {
        position: absolute;
        top: 20px;
        right: 36px;
    }

    #sorting-filter {
        width: 100%;
    }
}

/* Extra small devices (phones, 576px and down) */
@media (max-width: 576px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 0 0.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    h4 {
        font-size: 1.25rem;
    }

    h5 {
        font-size: 1.1rem;
    }

    h6 {
        font-size: 1rem;
    }

    .single .entry-title {
        font-size: 2rem;
    }

    .single .entry-content {
        font-size: 1.1rem;
        line-height: 1.8;
    }
}

/* Revert to stacked layout for single posts at all breakpoints */
.single .post {
    display: block;
}

.single .post-thumbnail {
    width: 100%;
    height: auto;
    max-height: 500px;
}