@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

html, body {
    width: 100%;
    overflow-x: hidden;
    font-family: "Inter", sans-serif;
    background-color: #E3E3E3;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body {
    position: relative;
}

.custom-blog-container {
    width: 100%;
    max-width: 100%;
    margin: 40px 0 80px 0;
    padding: 0 40px;
    flex: 1;
    box-sizing: border-box;
}

.blog-hero-wrapper {
    width: 100vw;
    height: 100vh;
    margin-left: calc(50% - 50vw);
    position: relative;
    background-color: #333;
    margin-top: -120px;
    animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both 0.1s;
    transform: translateZ(0);
    backface-visibility: hidden;
    left: 0;
    right: 0;
}

.blog-hero-banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.blog-hero-overlay-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #D7DAD1;
    z-index: 1;
    box-sizing: border-box;
    padding: 80px 20px 20px 20px;
}

.blog-hero-overlay-content .overlay-top-text {
    font-family: 'clearfacestd', 'Times New Roman', serif;
    font-weight: 400;
    font-size: 22px;
    margin-bottom: 80px;
    text-transform: none;
}

.blog-hero-overlay-content .overlay-title {
    font-family: 'moulin', 'Times New Roman', serif;
    font-weight: 400;
    font-size: 60px;
    color: #D7DAD1;
    line-height: 1;
    text-transform: uppercase;
    margin: 0 0 20px 0;
    padding: 0 200px;
    max-width: 80%;
}

.blog-hero-overlay-content .overlay-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 0;
    padding: 0 150px;
    max-width: 60%;
}

.custom-blog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-top: 40px;
    animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both 0.2s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.category-toggle { 
    display: none; 
}

.custom-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 25px;
    box-shadow: none !important;
    flex: 1;
    max-width: 70%;
}

.custom-category-tabs .ajax-category-btn {
    text-decoration: none;
    color: #000;
    font-weight: 500;
    padding: 4px 0;
    border: none;
    border-bottom: 2px solid transparent;
    text-transform: uppercase;
    background: none;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    box-shadow: none !important;
    transition: color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.custom-category-tabs .ajax-category-btn:hover {
    border-color: transparent;
    text-decoration: none;
    color: #3A4237;
}

.custom-category-tabs .ajax-category-btn.active {
    font-weight: 700;
    border-color: #000;
    color: #000;
    text-decoration: none;
}

.custom-category-tabs .ajax-category-btn.active:hover {
    color: #000;
}

.custom-search .search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.custom-search .search-form .screen-reader-text { 
    display: none; 
}

.custom-search .search-field {
    border: none;
    border-bottom: 1px solid #68764B;
    border-radius: 0;
    padding: 6px 30px 6px 2px;
    width: 250px;
    transition: all 0.3s ease;
    background-color: #E3E3E3 !important;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #68764B;
}

.custom-search .search-field:focus {
    outline: none;
    width: 300px;
    background-color: #f8f8f8 !important;
    border-bottom-color: #3A4237;
}

.custom-search .search-field::placeholder {
    color: #68764B;
    font-weight: 400;
    opacity: 1;
}

.custom-search .search-submit {
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    outline: none !important;
    box-shadow: none !important;
    transition: transform 0.2s ease;
}

.custom-search .search-submit:hover {
    transform: translateY(-50%) scale(1.1);
}

.custom-search .search-submit:focus,
.custom-search .search-submit:active {
    outline: none !important;
    box-shadow: none !important;
}

.custom-search .search-submit svg {
    width: 16px;
    height: 16px;
    fill: #68764B;
}

.blog-loading {
    display: none;
    text-align: center;
    padding: 40px;
    font-family: 'Inter', sans-serif;
    color: #747965;
    font-size: 14px;
}

.blog-loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #747965;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

.custom-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    transition: opacity 0.3s ease;
    animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both 0.3s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.custom-blog-grid.is-loading,
.custom-pagination.is-loading {
    opacity: 0.4;
    pointer-events: none;
}

.custom-blog-grid.is-loading:after {
    content: "Loading...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #747965;
    font-family: 'Inter', sans-serif;
}

.custom-blog-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #747965;
    padding: 15px;
    box-sizing: border-box;
    background: #E3E3E3;
    animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform: translateZ(0);
    backface-visibility: hidden;
    position: relative;
    min-height: 450px;
    width: 100%;
}

.custom-blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(58, 66, 55, 0.15);
}

.custom-blog-card:nth-child(1) { animation-delay: 0.1s; }
.custom-blog-card:nth-child(2) { animation-delay: 0.2s; }
.custom-blog-card:nth-child(3) { animation-delay: 0.3s; }
.custom-blog-card:nth-child(4) { animation-delay: 0.2s; }
.custom-blog-card:nth-child(5) { animation-delay: 0.3s; }
.custom-blog-card:nth-child(6) { animation-delay: 0.4s; }
.custom-blog-card:nth-child(7) { animation-delay: 0.3s; }
.custom-blog-card:nth-child(8) { animation-delay: 0.4s; }
.custom-blog-card:nth-child(9) { animation-delay: 0.5s; }

.custom-blog-image {
    display: block;
    margin-bottom: 15px;
    margin-left: -15px;
    margin-right: -15px;
    margin-top: -15px;
    position: relative;
    overflow: hidden;
    width: calc(100% + 30px);
}

.custom-blog-image img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    background: #f0f0f0;
    border-radius: 0;
    transition: transform 0.5s ease;
}

.custom-blog-card:hover .custom-blog-image img {
    transform: scale(1.05);
}

.custom-blog-date {
    color: #747965;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
}

.custom-blog-title {
    margin: 0;
    margin-bottom: 12px;
}

.custom-blog-title a {
    color: #3A4237;
    text-decoration: none;
    line-height: 1.3;
    font-family: 'moulin', 'Times New Roman', serif;
    font-weight: 400;
    font-size: 1.7rem;
    text-transform: uppercase;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.6em;
}

.custom-blog-title a:hover {
    text-decoration: none;
}

.custom-blog-desc {
    color: #414040;
    margin: 0 0 20px 0;
    line-height: 1.6;
    flex-grow: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    min-height: 4.8em;
}

.custom-blog-read {
    color: #3A4237;
    align-self: flex-start;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.3s ease, padding-right 0.3s ease;
    position: relative;
    margin-top: auto;
}

.custom-blog-read .read-more-text {
    border-bottom: 1px solid #3A4237;
    padding-bottom: 2px;
    transition: border-color 0.3s ease;
}

.custom-blog-read span:last-child {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.custom-blog-read:hover {
    color: #000;
    padding-right: 12px;
}

.custom-blog-read:hover .read-more-text {
    border-bottom-color: #000;
}

.custom-blog-read:hover span:last-child {
    transform: translateX(5px);
}

.custom-pagination {
    margin-top: 50px;
    transition: opacity 0.3s ease;
    animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both 0.4s;
    width: 100%;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
}

.custom-pagination-input {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #3A4237;
}

.ajax-page-btn {
    background: #E3E3E3;
    border: 1px solid #3A4237;
    border-radius: 5px;
    color: #3A4237;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 40px;
    height: 40px;
    line-height: 40px;
    padding: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ajax-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ddd;
}

.ajax-page-btn:not(:disabled):hover {
    background-color: #3A4237;
    color: #E3E3E3;
}

.ajax-page-btn:focus,
.ajax-page-btn:active {
    outline: none;
    box-shadow: none;
}

.ajax-page-input {
    width: 35px;
    height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    -moz-appearance: textfield;
    background: #E3E3E3 !important;
    border-radius: 5px;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.ajax-page-input:focus,
.ajax-page-input:active {
    outline: none;
    box-shadow: none;
    border-color: #3A4237;
    background-color: #f8f8f8 !important;
}

.ajax-page-input::-webkit-outer-spin-button,
.ajax-page-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.custom-pagination .nav-links,
.custom-pagination .page-numbers {
    display: none;
}

@media (max-width: 1440px) {
    .custom-blog-container {
        padding: 0 40px;
    }
}

@media (max-width: 1200px) {
    .custom-blog-container {
        padding: 0 40px;
    }
    
    .custom-blog-grid {
        gap: 20px;
    }
    
    .custom-blog-card {
        min-height: 420px;
        padding: 12px;
    }
    
    .custom-blog-image {
        margin-left: -12px;
        margin-right: -12px;
        margin-top: -12px;
    }
    
    .custom-blog-image img {
        height: 250px;
    }
    
    .custom-blog-title a {
        font-size: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .blog-hero-overlay-content .overlay-title {
        font-size: 48px;
        padding: 0 100px;
    }
    
    .blog-hero-overlay-content .overlay-subtitle {
        font-size: 16px;
        padding: 0 50px;
    }

    .custom-blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .custom-blog-desc {
        -webkit-line-clamp: 3;
    }
    
    .custom-blog-card {
        min-height: 400px;
    }
    
    .custom-category-tabs {
        max-width: 60%;
    }
}

@media (max-width: 900px) {
    .custom-blog-container {
        padding: 0 40px;
    }
    
    .custom-blog-controls {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .custom-category-tabs {
        max-width: 100%;
        order: 2;
        justify-content: center;
    }
    
    .custom-search {
        order: 1;
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .custom-blog-container {
        padding: 0 20px;
        margin: 20px 0 60px 0;
    }
    
    .blog-hero-wrapper {
        height: 100vh;
        margin-top: -100px;
    }
    
    .blog-hero-overlay-content {
        padding-top: 80px;
    }
    
    .blog-hero-overlay-content .overlay-top-text {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .blog-hero-overlay-content .overlay-title {
        font-size: 32px;
        margin-bottom: 20px;
        padding: 0;
        max-width: 95%;
        line-height: 1.1;
    }
    
    .blog-hero-overlay-content .overlay-subtitle {
        font-size: 14px;
        padding: 0;
        max-width: 95%;
        line-height: 1.4;
    }
    
    .custom-blog-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        margin-bottom: 25px;
        padding-top: 30px;
    }
    
    .category-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 12px 0;
        border: none;
        border-bottom: 1px solid #68764B;
        background: #E3E3E3 !important;
        font-family: 'Inter', sans-serif;
        font-size: 14px;
        font-weight: 400;
        color: #68764B;
        cursor: pointer;
        text-transform: none;
        transition: all 0.3s ease;
        border-radius: 0;
    }
    
    .category-toggle:hover {
        background: #E3E3E3 !important;
        border-bottom-color: #3A4237;
    }
    
    .toggle-text {
        color: #68764B;
        font-weight: 400;
        padding: 0;
    }
    
    .toggle-arrow {
        border: solid #68764B;
        border-width: 0 2px 2px 0;
        display: inline-block;
        padding: 3px;
        transform: rotate(45deg);
        transition: transform 0.3s ease;
        margin-right: 8px;
    }
    
    .category-toggle[aria-expanded="true"] .toggle-arrow {
        transform: rotate(-135deg);
    }
    
    .custom-category-tabs {
        display: none;
        flex-direction: column;
        width: 100%;
        border: none;
        border-bottom: 1px solid #68764B;
        gap: 0;
        background: #E3E3E3;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }
    
    .custom-category-tabs.is-open {
        display: flex;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .custom-category-tabs .ajax-category-btn {
        padding: 12px 0;
        border: none;
        border-bottom: 1px solid #e0e0e0;
        text-align: left;
        background: #E3E3E3;
        color: #68764B;
        font-weight: 400;
        font-size: 14px;
        transition: all 0.2s ease;
        text-transform: none;
        white-space: normal;
    }
    
    .custom-category-tabs .ajax-category-btn:hover {
        background: #f5f5f5;
        color: #3A4237;
    }
    
    .custom-category-tabs .ajax-category-btn.active {
        background: #E3E3E3;
        color: #3A4237;
        font-weight: 600;
        border-bottom: 1px solid #3A4237;
    }
    
    .custom-category-tabs .ajax-category-btn:last-child {
        border-bottom: none;
    }
    
    .custom-search {
        width: 100%;
        order: 2;
    }
    
    .custom-search .search-form {
        width: 100%;
        border-bottom: 1px solid #68764B;
    }
    
    .custom-search .search-field {
        width: 100%;
        border: none !important;
        background: #E3E3E3 !important;
        padding: 12px 30px 12px 0;
        font-size: 14px;
        font-weight: 400;
        color: #68764B;
    }
    
    .custom-search .search-field:focus {
        width: 100%;
        outline: none;
        background: #f8f8f8 !important;
    }
    
    .custom-blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .custom-blog-grid .custom-blog-card:nth-child(n+9) {
        display: none;
    }
    
    .custom-blog-card {
        padding: 10px;
        min-height: 320px;
        border: 1px solid #747965;
    }
    
    .custom-blog-image {
        margin-left: -10px;
        margin-right: -10px;
        margin-top: -10px;
        margin-bottom: 10px;
        width: calc(100% + 20px);
        position: relative;
        overflow: hidden;
    }
    
    .custom-blog-image img {
        width: 100%;
        height: 180px;
        object-fit: cover;
        display: block;
        background: #f0f0f0;
        border-radius: 0;
        transition: transform 0.5s ease;
    }
    
    .custom-blog-card:hover .custom-blog-image img {
        transform: scale(1.05);
    }
    
    .custom-blog-date {
        color: #747965;
        margin-bottom: 6px;
        font-family: 'Inter', sans-serif;
        font-weight: 600;
        font-size: 11px;
        text-transform: uppercase;
    }
    
    .custom-blog-title {
        margin: 0;
        margin-bottom: 8px;
        flex-grow: 1;
    }
    
    .custom-blog-title a {
        font-size: 1rem;
        line-height: 1.2;
        min-height: 2.4em;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .custom-blog-desc {
        font-size: 11px;
        line-height: 1.4;
        margin-bottom: 12px;
        -webkit-line-clamp: 2;
        min-height: 2.8em;
    }
    
    .custom-blog-read {
        font-size: 11px;
        margin-top: auto;
    }
    
    .custom-pagination {
        margin-top: 40px;
        padding: 0;
        width: 100%;
    }
    
    .custom-pagination-input {
        gap: 8px;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        font-size: 12px;
        font-weight: 600;
        color: #3A4237;
        width: auto;
        max-width: 100%;
        padding: 0 10px;
    }
    
    .page-count {
        font-size: 12px;
        display: flex;
        align-items: center;
        gap: 6px;
        color: #3A4237;
        font-weight: 600;
        margin: 0 4px;
        white-space: nowrap;
    }
    
    .ajax-page-input {
        width: 30px;
        height: 30px;
        font-size: 11px;
        border: 1px solid #3A4237;
        background: #E3E3E3 !important;
        font-weight: 600;
        padding: 0;
    }
    
    .ajax-page-btn {
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 14px;
        border: 1px solid #3A4237;
        background: #E3E3E3;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        padding: 0;
    }
    
    .ajax-page-btn:disabled {
        opacity: 0.3;
        border-color: #ccc;
        color: #ccc;
    }
    
    .ajax-page-btn:not(:disabled):hover {
        background-color: #3A4237;
        color: #E3E3E3;
    }
    
    .ajax-page-btn.prev-page-btn {
        order: -1;
    }
    
    .ajax-page-btn.next-page-btn {
        order: 1;
    }
}

@media (max-width: 480px) {
    .custom-blog-container {
        padding: 0 15px;
    }
    
    .custom-blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .custom-blog-card {
        min-height: 300px;
        padding: 8px;
    }
    
    .custom-blog-image {
        margin-left: -8px;
        margin-right: -8px;
        margin-top: -8px;
        width: calc(100% + 16px);
    }
    
    .custom-blog-image img {
        height: 160px;
    }
    
    .custom-blog-title a {
        font-size: 0.9rem;
    }
    
    .custom-blog-desc {
        font-size: 10px;
    }
    
    .custom-pagination-input {
        gap: 6px;
    }
    
    .page-count {
        font-size: 11px;
        gap: 4px;
    }
    
    .ajax-page-input {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
    
    .ajax-page-btn {
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .custom-blog-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .custom-blog-card {
        min-height: 280px;
    }
    
    .custom-blog-image img {
        height: 200px;
    }
    
    .custom-pagination-input {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .page-count {
        order: 0;
        width: 100%;
        justify-content: center;
        margin-bottom: 5px;
        font-size: 11px;
    }
    
    .ajax-page-btn.prev-page-btn {
        order: -1;
        margin-right: auto;
    }
    
    .ajax-page-btn.next-page-btn {
        order: 1;
        margin-left: auto;
    }
    
    .ajax-page-input {
        order: 0;
    }
}

@media (max-width: 320px) {
    .custom-blog-container {
        padding: 0 10px;
    }
    
    .custom-pagination-input {
        gap: 4px;
    }
    
    .page-count {
        font-size: 10px;
        gap: 3px;
    }
    
    .ajax-page-input {
        width: 25px;
        height: 25px;
        font-size: 9px;
    }
    
    .ajax-page-btn {
        width: 25px;
        height: 25px;
        line-height: 25px;
        font-size: 11px;
    }
}

.site-footer {
    margin-top: auto;
    position: relative;
    z-index: 10;
    width: 100%;
}

@media print {
    .custom-blog-container {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .blog-hero-wrapper {
        height: auto;
        margin-top: 0;
    }
    
    .custom-blog-controls,
    .custom-pagination {
        display: none;
    }
    
    .custom-blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .custom-blog-card {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
    
    .custom-blog-read {
        color: #000;
        text-decoration: underline;
    }
}