/*
Theme Name: Bute
Theme URI: https://wordpress.com/theme/bute/
Author: Automattic
Author URI: https://automattic.com/
Description: Bute is a blog theme that has a full-screen front page
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 5.7
Version: 1.0.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bute
Tags: blog, holiday, one-column, wide-blocks, block-styles, featured-images, full-site-editing, rtl-language-support, threaded-comments, translation-ready
*/

/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
  text-decoration-thickness: 0.5px !important;
  text-underline-offset: 2px;
}

/*
 * Button Block
 * Control the hover stylings of outline block style.
 * Unnecessary once block styles are configurable via theme.json
 * https://github.com/WordPress/gutenberg/issues/42794
 */
.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background):hover {
  background-color: var(--wp--preset--color--primary);
  border-color: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--base);
}

/*
 * Pull quote Block
 * Reset the browser default margins for blockquote element
 * https://github.com/WordPress/gutenberg/issues/44129
 */
.wp-block-pullquote blockquote,
.wp-block-pullquote p {
  margin: 0;
}

/*
 * Footer template part
 * There is no option to remove the top margin.
 * https://github.com/WordPress/gutenberg/issues/47637
 */
.footer-container {
  margin-top: auto;
}

/* --- Recent Posts Block --- */
.recent-posts-block {
    background: #403D38; /* Simple solid color */
    border-radius: 17px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
}

.recent-posts-header {
    background: rgba(255,255,255,0.1); /* Just a subtle overlay */
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.recent-posts-header::before {
    content: '//';
    color: rgba(255,255,255,0.7);
    font-weight: bold;
    margin-right: 8px;
}

.recent-posts-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: inline;
}

.recent-posts-block .posts-list {
    padding: 0;
    margin: 0;
}

.recent-posts-block .post-item {
    display: block;
    color: rgba(255,255,255,0.95) !important;
    text-decoration: none !important;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    font-size: 14px;
    line-height: 1.4;
}

.recent-posts-block .post-item:last-child {
    border-bottom: none;
}

.recent-posts-block .post-item:hover {
    background: rgba(255,255,255,0.1);
    color: white !important;
    transform: translateX(5px);
}

/* --- Featured Post Block --- */
.featured-post-block {
    background: #ab6e2c;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
}

.featured-post-block .post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.featured-post-block .post-content {
    padding: 20px;
}

.featured-post-block .post-date {
    background: rgba(255,255,255,0.1);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-post-block .post-title {
    color: white;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.featured-post-block .post-meta {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.featured-post-block .post-category {
    background: rgba(255,255,255,0.15);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
}

.featured-post-block .post-excerpt {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.featured-post-block .read-more {
    color: rgba(255,255,255,0.8) !important;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 15px;
    display: inline-block;
    text-decoration: none !important;
}

.featured-post-block .read-more:hover {
    color: white !important;
}

/* --- Offset Post List Block --- */
.post-list-offset-block {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.post-item-offset {
    background: #1d591f !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: stretch;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none !important;
}

.post-item-offset:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-decoration: none !important;
}

.post-image-offset {
    width: 120px;
    height: auto;
    object-fit: cover;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.post-content-offset {
    padding: 15px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-header-offset {
    margin-bottom: 10px;
}

.post-date-offset {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-title-offset {
    color: white !important;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.post-excerpt-offset {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

@media (max-width: 480px) {
    .post-item-offset {
        flex-direction: column;
    }
    
    .post-image-offset {
        width: 100%;
        height: 150px;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
}

/* --- New Two-Column Grid Container --- */
.all-posts-2col-grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .all-posts-2col-grid-container {
        grid-template-columns: 1fr;
    }
}

/* --- Post List Block (Grid) Styles --- */
.post-list-container {
    width: 100%;
    margin: 0;
}

.post-list-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.post-list-block .post-item {
    background: #1D591F;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: stretch;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.post-list-block .post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-decoration: none;
}

.post-list-block .post-item:focus {
    outline: 2px solid #1D591F;
    outline-offset: 2px;
}

.post-list-block .post-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.post-list-block .post-content {
    padding: 15px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.post-list-block .post-header {
    margin-bottom: 10px;
}

.post-list-block .post-date {
    background: rgba(255,255,255,0.1);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-list-block .post-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.post-list-block .post-meta {
    color: rgba(255,255,255,0.6);
    font-size: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-list-block .post-category {
    background: rgba(255,255,255,0.15);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 600;
}

.post-list-block .post-excerpt {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

.no-posts-message {
    grid-column: 1 / -1;
    padding: 40px 20px;
    color: #666;
    text-align: center;
    background: #f8f8f8;
    border-radius: 8px;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .post-list-block { grid-template-columns: 1fr; }
    .post-list-block .post-image { width: 100px; height: 100px; }
    .post-list-block .post-content { padding: 12px 15px; }
    .post-list-block .post-title { font-size: 14px; }
    .post-list-block .post-excerpt { font-size: 12px; }
}

@media (max-width: 480px) {
    .post-list-block .post-item { flex-direction: column; }
    .post-list-block .post-image { width: 100%; height: 80px; }
    .post-list-block .post-content { padding: 12px; }
    .post-list-block .post-title { font-size: 14px; }
    .post-list-block .post-meta { flex-direction: column; align-items: flex-start; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    .post-list-block .post-item { transition: none; }
}

@media (prefers-contrast: high) {
    .post-list-block .post-item { border: 2px solid #000; }
    .post-list-block .post-date, .post-list-block .post-category { background: #000; color: #fff; }
}

/* --- Combined Page List and Store Button Styles --- */
.simple-page-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style-type: none;
    padding: 0;
    margin: 20px 0;
    justify-content: flex-end; /* Align right */
    align-items: center; /* Center vertically */
}

.simple-page-list li {
    flex: 1; /* Make all buttons equal width */
    min-width: 0; /* Allow flex shrinking */
}

.simple-page-list li a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s;
    min-height: 24px;
    text-align: center;
    box-sizing: border-box;
    line-height: 1;
    white-space: nowrap;
    border: none;
    margin: 0;
    outline: none;
    width: 100%; /* Fill the flex container */
}

.simple-page-list li a:hover {
    background-color: #0073aa;
    color: #ffffff;
}

/* Store button specific styling */
.simple-page-list li a.store-button-link {
    background-color: #1D591F;
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.simple-page-list li a.store-button-link:hover {
    background-color: #0073aa;
    color: #ffffff;
}