/*
Theme Name: WP News Theme
Theme URI: https://example.com
Author: Tuo Nome
Author URI: https://example.com
Description: Tema per sito di notizie con slider, gallery e archivio.
Version: 1.0
Text Domain: wp-news-theme
*/

body {
    font-family: Arial, sans-serif;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.6;
    background-color: #ebebeb;
}

header {
    background: linear-gradient(135deg, #2254a3 0%, #4e7fd0 100%);
    color: #fff;
    text-align: center;
    padding: 20px;
    position: relative;
}

header .logo {
    width: fit-content;
    margin: 0 auto;
}

header .logo img {
    width: 250px;
    height: 250px;
    object-fit: contain;
    border: 1px solid #fff;
}

header h1 {
    margin: 10px 0 0 0;
    font-size: 3rem;
}

.header-actions {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

@media screen and (max-width: 1199px) {
    .header-actions {
        position: relative;
        top: unset;
        right: unset;
        justify-content: right;
        margin-bottom: 30px;
    }
}

@media screen and (max-width: 768px) {
    .header-actions {
        flex-direction: unset !important;
        gap: 15px !important;
    }
}

.search-form-container {
    display: flex;
    align-items: center;
}

.search-form {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}

.search-form label {
    margin: 0;
    flex: 1;
}

.screen-reader-text {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Skip link accessibile */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    z-index: 10000;
    padding: 8px 12px;
    background: #cf2b36;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.skip-link:focus {
    top: 6px;
}

.search-field {
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    width: 200px;
}

.search-submit {
    border: none;
    background: #cf2b36;
    color: #fff;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-submit:hover {
    background: #0a6d3f;
}

.search-icon {
    font-size: 16px;
}

.menu-hamburger {
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    width: 44px;
    height: 44px;
    align-items: center;
}

.menu-hamburger:hover {
    opacity: 0.8;
}

.menu-hamburger:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.hamburger-line {
    width: 30px;
    height: 4px;
    background-color: #fff;
    display: block;
    transition: all 0.3s ease;
}

nav.main-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 60px;
    width: 300px;
    height: calc(100vh - 112px);
    background: #2254a3;
    padding: 10px;
    z-index: 100;
}

nav.main-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav.main-menu li {
    position: relative;
    padding: 20px 10px;
    border-bottom: 1px solid #ddd;
    height: 20px;
    line-height: 60px;
}

nav.main-menu li:first-child {
    border-top: 1px solid #ddd;
}

nav.main-menu li:not(.menu-item-has-children):hover {
    background-color: #cf2b36;
}

nav.main-menu li a {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
    position: absolute;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    display: block;
}

/* Sottomenu */
nav.main-menu .sub-menu {
    display: none;
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
    background-color: rgba(255, 255, 255, .23);
}

nav.main-menu .sub-menu li {
    height: auto;
    line-height: 1.4;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}

nav.main-menu .sub-menu li:hover {
    background-color: #cf2b36;
}

nav.main-menu .sub-menu li a {
    position: static;
    font-size: 16px;
}

/* Stile per voci menu con sottomenu */
nav.main-menu .menu-item-has-children {
    height: auto;
    line-height: 20px;
    padding: 20px 0;
}

nav.main-menu .menu-item-has-children:hover > a:after {
    color: #fff;
}

nav.main-menu .menu-item-has-children > a {
    cursor: pointer;
    position: relative;
}

nav.main-menu .menu-item-has-children > a:after {
    content: '∨';
    position: absolute;
    right: 0;
    top: 0;
    color: #aaa;
}

.container {
    padding-top: 20px;
}
body.home .container {
    background-image: url('../images/bg-home.jpeg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    position: relative;
}

body.home .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 0;
}

.featured-slider-container {
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.featured-slider-container h2 {
    background-color: #0a6d3f;
    color: #fff;
    padding: 5px 10px;
    font-size: 1.5rem;
    margin-top: 0;
}

.featured-slider {
    position: relative;
    overflow: hidden;
}

.featured-slider .slide {
    display: none;
    position: relative;
    height: 50vh;
}

.featured-slider img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* centra l'immagine */
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
}

.featured-info {
    position: absolute;
    bottom: 0;
    left: 0;
    background: rgba(123, 123, 123, 0.75);
    color: #fff;
    width: 100%;
    padding: 10px;
}

@media screen and (max-width: 768px) {
    .featured-info {

    }
}

.featured-info .category {
    margin-bottom: 5px;
}

.featured-info .category a {
    color: #fff;
    background: #2254a3;
    padding: 3px 5px;
    text-decoration: none;
}

.featured-info a.title {
    color: #fff;
    text-decoration: none;
}

.featured-info a.title h3 {
    margin-top: 0;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.featured-info a.title:hover h3 {
    color: #2254a3;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    cursor: pointer;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 15px;
    border-radius: 4px;
    z-index: 10;
    user-select: none;
    transition: background 0.3s ease;
}

@media screen and (max-width: 768px) {
    .slider-arrow {
        top: 40%;
        padding: 0 5px
    }
}

.slider-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
}

.slider-arrow.prev {
    left: 10px;
}

.slider-arrow.next {
    right: 10px;
}

.slider-arrow:focus {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* Indicatori slider */
.slider-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: none;
    gap: 10px;
}

.slider-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid #fff;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.slider-indicator:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.slider-indicator:focus {
    outline: 2px solid #eeef3c;
    outline-offset: 2px;
}

.slider-indicator.active,
.slider-indicator[aria-current="true"] {
    background: #eeef3c;
    transform: scale(1.3);
}

.category-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.category-section .post {
    width: calc(50% - 10px);
}

.category-box {
    margin-bottom: 10px;
    border: 1px solid #cf2b36;
    background: #f9f9f9;
}

.category-title {
    font-size: 1.5rem;
    margin: 0 0 10px 0;
    background-color: #cf2b36;
    color: #fff;
    padding: 0 10px;
}

.category-title a {
    color: #fff;
    text-decoration: none;
}

.category-posts li {
    margin-bottom: 5px;
}

.category-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 10px;
}

@media screen and (max-width: 768px) {
    .category-posts-grid {
        grid-template-columns: 100%;
    }
}

.category-post-item-grid {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.category-post-item-grid .post-thumbnail {
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.category-post-item-grid .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-post-item-grid .post-content {
    padding: 15px;
}

.category-post-item-grid .post-content .date {
    color: #555;
    font-size: 14px;
}

.category-post-item-grid .post-content h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.4;
}

.category-post-item-grid .post-content h3 a {
    text-decoration: none;
    color: #2254a3;
}

.category-post-item-grid .post-content h3 a:hover {
    color: #cf2b36;
}


.gallery-slider {
    display: flex;
    overflow-x: auto;
    gap: 10px;
}

.gallery-slider img {
    max-height: 200px;
    cursor: pointer;
}

/* ============================
   Sidebar
   ============================ */

.sidebar {
    color: #fff;
    min-width: 150px;
}

.box-anno h4 {
    color: #fff;
    background-color: #cf2b36;
    padding-left: 5px;
    cursor: pointer;
}

.box-mesi {
    display: none;
    padding: 0;
    margin: 0;
    list-style: none;
}

.box-mesi a {
    color: #fff;
}

/* ============================
   Page Container Grid Layout
   ============================ */

.page-container {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 5% 49% 38% 5%;
    grid-column-gap: 1%;
    grid-template-areas: "void-left main-content sidebar void-right";
}

/* Assegna grid-area a ogni elemento del container */
.page-container > .void-column:first-child {
    grid-area: void-left;
}

.page-container > .main-container {
    grid-area: main-content;
}

.page-container > .right-column {
    grid-area: sidebar;
}

.page-container > .void-column:last-child {
    grid-area: void-right;
}

/* Responsive: riordina gli elementi su mobile */
@media screen and (max-width: 1199px) {
    body.home .page-container {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "slider"
            "sidebar"
            "articles";
        padding: 0 15px;
        gap: 0;
    }

    /* Nascondi le colonne void su mobile */
    body.home .page-container > .void-column {
        display: none;
    }

    /* Il main-container diventa display: contents per esporre i suoi figli al grid del parent */
    body.home .main-container {
        display: contents;
    }

    /* Assegna grid-area agli elementi dentro main-container */
    body.home .main-container > .slider-wrapper {
        grid-area: slider;
    }

    body.home .main-container > .main-posts {
        grid-area: articles;
    }

    /* Sidebar tra slider e articoli */
    body.home .page-container > .right-column {
        grid-area: sidebar;
        margin: 20px 0;
        padding: 15px;
        background: #f9f9f9;
        border-radius: 4px;
    }
}

/* Layout per pagine non-home */
body:not(.home) .page-container {
    display: grid;
    grid-template-columns: 20% 58% 20%;
    grid-column-gap: 1%;
}

@media screen and (max-width: 1199px) {
    body:not(.home) .page-container {
        grid-template-columns: 2% 96% 2%;
        grid-column-gap: 0;
        /*grid-template-areas: unset;*/
    }
}

/* Nascondi la colonna destra in tutte le pagine tranne la home */
body:not(.home) .right-column {
    display: none;
}

.left-column {
    flex: 1;
}

.main-content {
    flex: 2;
    /*min-width: 1000px;*/
    padding: 0 10px;
}

@media screen and (max-width: 1920px) {
    .main-content {
        /*min-width: unset;*/
        padding: 0;
    }
}

.right-sidebar {
    flex: 1;
}

/* ============================
   Main Posts Section
   ============================ */
.main-posts {
    margin-top: 20px;
    z-index: 10;
    position: relative;
}

.main-posts .main-posts-box {
    display: grid;
    /*grid-template-columns: 49.5% 49.5%;*/
    grid-column-gap: 1%;
}
@media screen and (max-width: 768px) {
    .main-posts .main-posts-box {
        display: grid;
        grid-template-columns: 100%;
    }
}

body.archive .main-posts {
    margin-top: 0;
}

.main-posts h3 {
    background-color: #0a6d3f;
    color: #fff;
    padding: 5px 10px;
    font-size: 1.5rem;
    margin-top: 0;
}

.main-posts article {
    margin-bottom: 30px;
    border: 1px solid #ddd;
    padding: 15px;
    background: #f9f9f9;
}

.main-posts article:last-child {
    border-bottom: none;
}

.main-posts .post-thumbnail {
    background-color: #fff;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.main-posts .post-thumbnail img {
    width: 50%;
    height: auto;
    display: block;
    border-radius: 4px;
    margin: 0 auto;
    object-fit: contain;
}

.main-posts h2 {
    margin: 10px 0;
    font-size: 20px;
}

.main-posts h2 a {
    color: #2254a3;
    text-decoration: none;
}

.main-posts h2 a:hover {
    color: #cf2b36;
}

.main-posts .post-meta {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.main-posts .post-meta .categorie {
    display: block;
    margin-bottom: 5px;
}

.main-posts .post-meta .categorie a {
    background-color: #2254a3;
    color: #fff;
    text-decoration: none;
    padding: 3px 5px;
}

.main-posts .post-meta .categorie a:hover {
    background-color: #999;
}

.main-posts .post-content {
    line-height: 1.6;
}

.main-posts .post-content a {
    color: #2254a3;
    background-color: #f4f4f4;
    text-decoration: none;
    padding: 10px;
    margin: 10px 0;
    display: block;
}

.main-posts .post-content a:hover {
    text-decoration: underline;
}

.main-posts .post-content a.wp-block-file__button.wp-element-button {
    width: fit-content;
    margin: 0 auto;
    padding: 10px 15px;
    border-radius: 15px;
    background-color: #1a4082;
    color: #fff;
}

.main-posts .post-content a[class^="a2a"] {
    display: none;
}

/* ============================
   Category Page Styles
   ============================ */
.category-header {
    margin-bottom: 30px;
}

.category-header .category-title {
    font-size: 1.5rem;
    color: #fff;
    margin: 0 0 10px 0;
    padding: 5px 10px;
}

.category-header .category-description {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
}

.category-posts {
    margin-bottom: 40px;
}

.category-post-item {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    box-sizing: border-box;
}

.category-post-item:last-child {
    border-bottom: none;
}

.category-post-item .post-thumbnail {
    flex: 0 0 200px;
}

.category-post-item .post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.category-post-item .post-content {
    border-left: 1px solid #e0e0e0;
}

.category-post-item .post-content-wrapper {
    flex: 1;
}

.category-post-item .post-title {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
}

.category-post-item .post-title a {
    color: #2254a3;
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-post-item .post-title a:hover {
    color: #cf2b36;
}

.category-post-item .post-meta {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.category-post-item .post-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.category-post-item .read-more {
    display: inline-block;
    color: #2254a3;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.category-post-item .read-more:hover {
    color: #1a4082;
}

.no-posts-found {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.no-posts-found p {
    font-size: 1.2rem;
    color: #666;
}

/* Pagination Styles */
.pagination-wrapper {
    margin: 40px 0;
    padding: 20px 0;
    border-top: 2px solid #e0e0e0;
}

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

.pagination-wrapper .page-numbers {
    display: inline-block;
    padding: 8px 15px;
    background: #f4f4f4;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination-wrapper .page-numbers:hover {
    background: #2254a3;
    color: #fff;
}

.pagination-wrapper .page-numbers.current {
    background: #2254a3;
    color: #fff;
    font-weight: bold;
}

.pagination-wrapper .page-numbers.dots {
    background: transparent;
    padding: 8px 5px;
}

.pagination-wrapper .prev,
.pagination-wrapper .next {
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    .category-post-item {
        flex-direction: column;
    }

    .category-post-item .post-thumbnail {
        flex: 0 0 auto;
        width: 100%;
    }

    .category-post-item .post-content-wrapper {
        padding: 5px;
    }

    .category-post-item .post-title {
        font-size: 1.3rem;
    }

    .category-header .category-title {
        font-size: 2rem;
    }

    .pagination-wrapper .page-numbers {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}

/* ============================
   Single Post Styles
   ============================ */
.single-post {
    background: #fff;
    padding: 0 30px;
    margin-bottom: 40px;
}

.single-post-header {
    margin-bottom: 30px;
    padding: 0 0 20px 0;
    background: #fff;
    color: #2254a3;
}

.single-post-header .post-date {
    display: block;
    text-align: left;
    font-size: 0.9rem;
    color: #555;
}

.single-post-title {
    font-size: 1.5rem;
    margin: 10px 0 20px 0;
    line-height: 1.3;
    color: #fff;
    background-color: #0a6d3f;
    padding: 10px 0;
}

.single-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #999;
    font-size: 0.95rem;
}

.single-post-meta span {
    display: inline-block;
    margin-bottom: 5px;
}

.single-post-meta span.post-categories a {
    background-color: #2254a3;
    color: #fff;
    padding: 3px 5px;
    text-decoration: none;
}

.single-post-meta span.post-categories a:hover {
    background-color: #999;
}

.single-post-meta strong {
    color: #333;
}

.single-post-meta a {
    color: #eeef3c;
    text-decoration: none;
}

.single-post-meta a:hover {
    text-decoration: underline;
}

.single-post-thumbnail {
    margin-bottom: 30px;
    text-align: center;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.single-post-thumbnail img {
    width: 50%;
    max-width: 50%;
    height: auto;
}
@media (max-width: 640px) {
    .single-post-thumbnail img {
        width: 100%;
        max-width: 100%;
    }
}

.single-post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

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

.single-post-content h2,
.single-post-content h3,
.single-post-content h4 {
    color: #2254a3;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.single-post-content h2 {
    font-size: 1.8rem;
}

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

.single-post-content h4 {
    font-size: 1.2rem;
}

.single-post-content .wp-block-file {
    margin-bottom: 6.5em;
}

.single-post-content .wp-block-file a {
    color: #2254a3;
    background-color: #f4f4f4;
    text-decoration: none;
    text-align: center;
    padding: 10px;
    margin: 10px 0;
    display: block;
}

.single-post-content .wp-block-file a:hover {
    color: #1a4082;
}

.single-post-content .wp-block-file a.wp-block-file__button.wp-element-button {
    width: fit-content;
    margin: 0 auto;
    padding: 10px 15px;
    border-radius: 15px;
    background-color: #1a4082;
    color: #fff;
}

.single-post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 4px;
}

.single-post-content iframe {
    max-width: 100%;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.single-post-content ul,
.single-post-content ol {
    margin-bottom: 1.5em;
    padding-left: 30px;
}

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

.single-post-content blockquote {
    border-left: 4px solid #2254a3;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #666;
}

.single-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.single-post-content table th,
.single-post-content table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.single-post-content table th {
    background-color: #2254a3;
    color: #fff;
}

.single-post-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.single-post-tags strong {
    color: #333;
    margin-right: 10px;
}

.single-post-tags a {
    display: inline-block;
    padding: 5px 12px;
    background: #f4f4f4;
    color: #2254a3;
    text-decoration: none;
    border-radius: 3px;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.single-post-tags a:hover {
    background: #2254a3;
    color: #fff;
}

.page-links {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    font-weight: bold;
}

.page-links a {
    display: inline-block;
    padding: 5px 10px;
    background: #f4f4f4;
    color: #2254a3;
    text-decoration: none;
    margin-right: 5px;
    border-radius: 3px;
}

.page-links a:hover {
    background: #2254a3;
    color: #fff;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 40px;
    padding: 20px 0;
    border-top: 2px solid #e0e0e0;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation a {
    display: inline-block;
    padding: 10px 15px;
    background: #f4f4f4;
    color: #2254a3;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.post-navigation a:hover {
    background: #2254a3;
    color: #fff;
}

.no-post-found {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.no-post-found h1 {
    color: #2254a3;
    margin-bottom: 15px;
}

.no-post-found p {
    color: #666;
    font-size: 1.1rem;
}

/* Responsive per single post */
@media (max-width: 768px) {
    .single-post {
        padding: 0;
    }

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

    .single-post-meta {
        /*flex-direction: column;*/
        /*gap: 10px;*/
    }

    .single-post-content {
        font-size: 1rem;
    }

    .post-navigation {
        flex-direction: column;
    }

    .post-navigation .nav-next {
        text-align: left;
    }
}

/* ============================
   Search Page Styles
   ============================ */
.search-header {
    margin-bottom: 30px;
}

.search-title {
    font-size: 1.5rem;
    color: #fff;
    background-color: #2254a3;
    padding: 5px 10px;
    margin: 0 0 10px 0;
}

.search-title span {
    color: #eeef3c;
}

.search-count {
    color: #666;
    font-size: 1rem;
    margin-bottom: 20px;
}

.search-results {
    margin-bottom: 40px;
}

.search-result-item {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    padding: 15px;
}

.search-result-item:last-child {
    margin-bottom: 0;
}

.search-result-item .post-thumbnail {
    flex: 0 0 200px;
}

.search-result-item .post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.search-result-item .post-content-wrapper {
    flex: 1;
}

.search-result-item .post-title {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
}

.search-result-item .post-title a {
    color: #2254a3;
    text-decoration: none;
    transition: color 0.3s ease;
}

.search-result-item .post-title a:hover {
    color: #cf2b36;
}

.search-result-item .post-meta {
    color: #2254a3;
    font-size: 0.9rem;
    margin-top: 0;
    margin-bottom: 10px;
}

.search-result-item .post-meta .post-categories {
    display: block;
    margin-bottom: 5px;
}

.search-result-item .post-meta .post-categories a {
    background-color: #2254a3;
    color: #fff;
    padding: 3px 5px;
    text-decoration: none;
}

.search-result-item .post-meta .post-categories a:hover {
    background-color: #999;
}

.search-result-item .post-excerpt {
    color: #999;
    line-height: 1.6;
    margin-bottom: 15px;
}

.search-result-item .post-excerpt a {
    color: #2254a3;
}

.search-result-item .read-more {
    display: inline-block;
    color: #2254a3;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.search-result-item .read-more:hover {
    color: #cf2b36;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.no-results p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
}

.search-form-retry {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.search-form-retry .search-form {
    width: 100%;
    max-width: 500px;
}

.search-form-retry .search-field {
    width: 100%;
}

/* Responsive per search */
@media (max-width: 768px) {
    .search-result-item {
        flex-direction: column;
    }

    .search-result-item .post-thumbnail {
        flex: 0 0 auto;
        width: 100%;
    }

    .search-title {
        font-size: 1.3rem;
    }

    .header-actions {
        flex-direction: column;
        gap: 10px;
    }

    .search-field {
        width: 150px;
    }
}

/* ============================
   Footer Styles
   ============================ */
.site-footer {
    background: linear-gradient(135deg, #2254a3 0%, #4e7fd0 100%);
    color: #fff;
    padding: 40px 20px 20px;
    position: relative;
    z-index: 10;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.footer-info {
    text-align: center;
}

.footer-info p {
    margin: 0;
    line-height: 1.8;
}

.footer-info a {
    color: #eeef3c;
}

.footer-social {
    display: flex;
    justify-content: center;
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: #cf2b36;
    transform: translateY(-3px);
}

.social-link svg {
    width: 24px;
    height: 24px;
}

.footer-copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-copyright p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Responsive footer */
@media (max-width: 768px) {
    .site-footer {
        padding: 30px 15px 15px;
    }

    .footer-content {
        gap: 20px;
    }

    .social-links {
        gap: 15px;
    }

    .social-link {
        width: 40px;
        height: 40px;
    }

    .footer-info {
        font-size: 0.9rem;
    }
}

/* ============================
   Single Page Styles (non articoli)
   ============================ */
.single-page {
    background: #fff;
    padding: 30px;
    margin-bottom: 40px;
}

.page-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    background: #0a6d3f;
}

.page-title {
    font-size: 1.5rem;
    color: #fff;
    margin: 0;
    line-height: 1.3;
}

.page-thumbnail {
    margin-bottom: 30px;
    text-align: center;
}

.page-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

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

.page-content p.contratti br {
    display: none;
}

.page-content p.contratti a {
    background-color: #f4f4f4;
    text-decoration: none;
    padding: 10px;
    margin: 10px 0;
    display: block;
}

.page-content h2,
.page-content h3,
.page-content h4 {
    color: #2254a3;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.page-content h2 {
    font-size: 1.8rem;
}

.page-content h3 {
    font-size: 1.5rem;
}

.page-content h4 {
    font-size: 1.2rem;
}

.page-content a {
    color: #2254a3;
    text-decoration: underline;
}

.page-content a:hover {
    color: #cf2b36;
}

.page-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 4px;
}

.page-content iframe {
    max-width: 100%;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.page-content ul,
.page-content ol {
    margin-bottom: 1.5em;
    padding-left: 30px;
}

.page-content li {
    margin-bottom: 0.5em;
}

.page-content blockquote {
    border-left: 4px solid #2254a3;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #666;
}

.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.page-content table th,
.page-content table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.page-content table th {
    background-color: #2254a3;
    color: #fff;
}

.no-page-found {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.no-page-found h1 {
    color: #2254a3;
    margin-bottom: 15px;
}

.no-page-found p {
    color: #666;
    font-size: 1.1rem;
}

/* Responsive per pagine */
@media (max-width: 768px) {
    .single-page {
        padding: 20px;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .page-content {
        font-size: 1rem;
    }
}

/* ============================
   Archivio Page Styles
   ============================ */
.archivio-page {
    background: #fff;
    padding: 30px;
    margin-bottom: 40px;
}

.archivio-page .page-title {
    font-size: 1.5rem;
    margin: 0 0 30px 0;
    background-color: #0a6d3f;
    padding: 20px;
    color: #fff;
    text-align: center;
}

.archivio-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    justify-content: center;
    max-width: 100%;
}

.archivio-anno-box {
    background: #f9f9f9;
    border: 1px solid #ddd;
    overflow: hidden;
}

.archivio-anno-title {
    background-color: #2254a3;
    color: #fff;
    padding: 5px 10px;
    margin: 0;
    font-size: 1.5rem;
    text-align: center;
}

.archivio-mesi-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

.archivio-mesi-list li {
    border-bottom: 1px solid #ddd;
}

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

.archivio-mesi-list li a {
    display: block;
    padding: 15px 20px;
    color: #2254a3;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.archivio-mesi-list li a:hover {
    background-color: #ddd;
    padding-left: 30px;
}

.archivio-mesi-list .post-count {
    color: #999;
    font-size: 0.9rem;
    font-weight: normal;
}

.archivio-mesi-list li a:hover .post-count {
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .archivio-page {
        padding: 20px 10px;
    }

    .archivio-content {
        grid-template-columns: 1fr;
    }

    .archivio-anno-title {
        font-size: 1.5rem;
    }

    .archivio-mesi-list li a {
        font-size: 1rem;
        padding: 12px 15px;
    }
}

figure.wp-block-image.size-full {
    text-align: center;
    border: 1px solid #ddd;
    width: 300px;
    margin: 30px auto;
}
figure.wp-block-image.size-full a {
    background: #2254a3;
    width: 300px;
}

figure.wp-block-image.size-full .wp-element-caption {
    color: #2254a3;
    font-weight: 600;
}

/* ============================
   Global Focus Styles (WCAG 2.4.7)
   ============================ */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #2254a3;
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #2254a3;
    outline-offset: 2px;
}

/* COOKIE NOTICE */
@media (max-width: 768px) {
    #cookie-notice {
        font-size: 10px;
    }

    #cookie-notice .cn-button:not(.cn-button-custom) {
        font-size: 10px;
    }

}
