body {
    font-family: 'Josefin Sans', sans-serif;
    line-height: 1.6;
    margin: 0;
    color: #333;
    background-color: #f4f4f4;
    overflow-x: hidden;
    transition: background-color 0.8s ease, color 0.6s ease;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.main-header {
    background: rgba(214, 187, 81, 0.6) !important;
    backdrop-filter: blur(5px); 
    -webkit-backdrop-filter: blur(5px);
    color: #1c1c1c;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px;
    visibility: visible !important;
    z-index: 1000;
    overflow: visible;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: height 0.4s ease-in-out, background-color 0.4s ease-in-out !important;
    will-change: height;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    left: 0;
    right: 0;
    margin: 0 auto;
    will-change: height; 
    -webkit-font-smoothing: antialiased;
}

.main-header.exit-active {
    opacity: 1 !important; 
    height: 120px !important; 
}

.main-header.exit-active h1 {
    font-size: 2.5rem !important;
}

.container.exit-active, 
.full-article.exit-active, 
.article-body-wrapper.exit-active,
footer.exit-active {
    opacity: 0 !important;
    transform: translateY(30px) !important;
    transition: opacity 0.5s ease, transform 0.5s ease !important;
}

.main-header.shrink {
    height: 70px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.main-header.expand-exit {
    height: 120px !important;
}

.header-content-brand {
    width: 100%;
    max-width: 1100px;
    padding: 0 20px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    contain: layout;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.main-header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    transition: font-size 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin: 0;
    transition: font-size 0.5s ease, margin 0.5s ease, transform 0.5s ease !important;
    will-change: font-size;
}

.main-header.shrink h1 {
    font-size: 1.8rem;
}

.subtitle {
    margin: 0;
    font-size: 1rem;
    font-style: italic;
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
    max-height: 50px;
    opacity: 1;
    padding-left: 50px;
}

@media (max-width: 768px) {
.subtitle {
    margin: 0;
    font-size: 1rem;
    font-style: italic;
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
    max-height: 50px;
    opacity: 1;
    padding-left: 0px;
}
}

.main-header.shrink .subtitle {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-5px);
}

.header-controls {
    position: fixed;
    top: 0;
    right: 0;
    height: 120px;
    display: flex;
    align-items: center;
    padding-right: 20px; 
    gap: 20px;
    z-index: 3000 !important; 
    transition: height 0.5s ease, top 0.5s ease, transform 0.5s ease !important;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative; 
    z-index: 3000; 
}

@media (max-width: 768px) {
.logo-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    transition: top 0.3s ease, transform 0.2s ease;
    padding-left: 0px !important;
}
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    transition: top 0.3s ease, transform 0.2s ease;
    padding-left: 50px;
}

.logo-link:hover h1 {
    opacity: 0.8;
    transform: scale(1.01);
    transition: opacity 0.3s ease;
}

.sticky-title-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) translateY(20px); 
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    max-width: 50%;
    text-align: center;
    z-index: 9999; 
    pointer-events: none;
}

.sticky-title-container.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) translateY(0);
}

.sticky-title-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #1c1c1c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.main-header.show-title .subtitle {
    opacity: 0 !important;
    transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
    .sticky-title-container { display: none !important; }
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 7px;
    cursor: pointer;
    z-index: 3001;
    padding: 5px;
    transition: transform 0.3s ease;
}

.hamburger:hover {
    transform: scale(1.1);  
}

.hamburger span {
    display: block;
    width: 28px;
    height: 2px;
    background-color: #1c1c1c;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center; 
}

.hamburger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: translateX(-15px); }
.hamburger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.instagram-link-header {
    font-size: 1.6rem;
    color: #1c1c1c;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.3s ease, transform 0.3s ease;
}

.instagram-link-header:hover {
    transform: scale(1.1);
}

.side-menu {
    position: fixed;
    top: 0;
    right: -35%; 
    width: 35%;
    height: 100%;
    background-color: #af9168;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding-top: 120px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}

.side-menu.active { 
    right: 0; 
}

.side-menu.exit-active {
    transform: translateX(100%) !important;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.side-menu a {
    padding: 15px 40px;
    text-decoration: none;
    font-size: 1.3rem;
    color: #1c1c1c;
    transition: 0.3s;
}

.side-menu a.active {
    color: #000000 !important; 
    font-weight: 700;
    transform: translateX(15px);    position: relative;
    background: rgba(175, 145, 104, 0.1); 
}

.side-menu a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #af9168;
}

.side-menu a:hover {
    background-color: rgba(255,255,255,0.1);
    padding-left: 50px;
}

.tags-container {
    display: flex;
    flex-wrap: nowrap; 
    gap: 8px;         
    margin-top: 15px; 
    position: relative;
    z-index: 10 !important;
    overflow: visible;  
}

.tag {
    white-space: nowrap; 
    font-size: 0.8rem;
    padding: 5px 10px;
}

.container {
    max-width: 88%;
    opacity: 1;
    margin: 160px auto 40px auto; 
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out !important;
    will-change: opacity, transform;
    transform: translateY(0);
}

#search-input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    font-size: 1rem;
    font-family: 'Josefin Sans', sans-serif;
    border: 1px solid #eee;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
    color: #1c1c1c;
}

#search-input::placeholder {
    color: #aaaaaa;
    font-style: italic;
    opacity: 1; 
}

#search-input:focus {
    border-color: #af9168;
    box-shadow: 0 0 10px rgba(175, 145, 104, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: #af9168;
    pointer-events: none;
}

.tags-container {
    display: flex;
    gap: 8px;
    margin: 0;
    flex-wrap: wrap;
    align-items: center;
    display: inline-flex;
    vertical-align: middle;
    position: relative;
    z-index: 10 !important;
    
}

.tag {
    background: #fdfaf3;
    color: #af9168;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 4px;
    border: 1px solid #eee;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    position: relative;
    z-index: 11;
    cursor: pointer;
    display: inline-block;
}

.tag:hover {
    background-color: #af9168 !important; 
    color: white !important;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
    margin-top: 30px;
    margin-right: 50px;
    margin-left: 50px;
}

.card-container, .post-card {
    will-change: transform, opacity;
}

.post-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
                border-color 0.4s ease;
} 

.post-card:hover {
    transform: scale(1.025);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border-color: #af9168;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-image img {
    display: flex;
    flex-direction: column;
    width: 350px;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}


.post-content {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}

.post-content h3 { 
    font-size: 1.3rem; 
    margin: 0 0 10px 0; 
}

.post-content .preview {
    flex-grow: 1;
    margin-bottom: 15px;
}

.post-content .read-more {
    align-self: flex-end;
    color: #af9168; 
    text-decoration: none; 
    font-weight: 700;
}

footer { text-align: center; padding: 40px; color: #666; }

@media (max-width: 992px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .side-menu { width: 50%; right: -50%; }
}

@media (max-width: 768px) {
    .side-menu { width: 80%; right: -80%; }
    .posts-grid { grid-template-columns: 1fr; }
    .container { padding: 20px; margin: 20px; }
    .post-item { height: auto; flex-direction: column; }
    .item-image { flex: 0 0 200px; }
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.post-item {
    display: flex;
    background: #fff;
    border: 1px solid #c5c5c5 !important;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    height: 300px;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
                border-color 0.4s ease;
    will-change: transform;
}

.post-item:hover {
    transform: scale(1.02); 
    box-shadow: 0 12px 30px rgba(0,0,0,0.12); 
    border-color: #af9168;
    z-index: 10; 
}

.post-item:hover .item-image img {
    transform: scale(1.05) !important;
}

.item-image {
    flex: 0 0 220px;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.item-content {
    padding: 15px 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0px;
}

.item-content .preview {
    margin-top: 0;
    margin-bottom: 10px;
    flex-grow: 0.5; 
}
.item-content .read-more {
    align-self: flex-end; 
    margin-top: auto;
    color: #af9168;
    text-decoration: none;
    font-weight: 700;
}

.read-more::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
}

.full-article {
    max-width: 777px;
    margin: 160px auto 40px auto;
    background: #ffffff; 
    padding: 50px;         
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

header.article-header {
    background: transparent !important;
    background-color: transparent !important;
    height: auto !important;
    position: relative !important;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 30px;
    display: block !important;
    opacity: 1 !important;
    animation: none !important;
    box-shadow: none !important;
}

.article-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

#main-title {
    font-size: 2.5rem;
    margin: 0;
    color: #1a1a1a;
    line-height: 1.2;
    background: none !important;
    flex: 1;
}

#main-date {
    font-size: 1rem;
    color: #888;
    white-space: nowrap;;
    display: block !important;
}

#main-subtitle {
    font-size: 1.15rem;
    font-style: italic;
    color: #555;
    margin-top: 10px;
    line-height: 1.5;
}

.featured-image {
    width: 90%;
    margin-bottom: 40px;
    overflow: hidden;
    border-radius: 8px;
    margin-left: auto;
    margin-right: auto;
}

#main-image {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.article-body {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #333;
}

.article-body blockquote {
    margin: 40px 0;
    padding: 25px 35px;
    border-left: 4px solid #af9168;
    background-color: #fdfaf3;
    font-family: 'Josefin Sans', sans-serif;
    font-style: normal;
    font-size: 1.25rem;
    line-height: 1.7;
    color: #333;
    border-radius: 0 8px 8px 0;
}

.article-body blockquote::before {
    color: #1c1c1c;
    font-weight: 400;
}

.article-body blockquote::after {
    color: #1c1c1c;
    font-weight: 400;
}

.article-tags-section {
    padding-top: 35px;
    margin-top: 5px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.tags-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin: 0;
    padding: 0;
    margin-top: 0; 
}

.tags-label:hover {
    color:#285AEB;
}

.clickable-tag {
    background: #fdfaf3;
    color: #af9168;
    font-size: 0.8rem;
    padding: 7px 15px; 
    border-radius: 4px;
    border: 1px solid #eee;
    text-transform: uppercase;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: 32px; 
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.clickable-tag:hover {
    background-color: #af9168;
    color: rgb(255, 255, 255);
    border-color: #af9168;
    transform: translateY(-5%);
}

.article-footer {
    margin-top: 50px;
    padding-bottom: 20px;
}

.back-link {
    display: inline-block;
    text-decoration: none;
    color: #af9168;
    font-weight: 700;
    transition: transform 0.3s ease;
}

.back-link:hover {
    transform: translateX(-5px);
}

.reveal {
    opacity: 0 !important;
    transform: translateY(25px) !important;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: transform, opacity;
}

.reveal.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.footer-social {
    margin-bottom: 15px;
}

.footer-social a {
    text-decoration: none;
    color: #666;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: color 0.3s ease;
}

.instagram-icon-footer {
    font-size: 1.2rem;
    background: -webkit-linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.footer-social a:hover .instagram-icon-footer {
    filter: grayscale(0%); 
}

.footer-social a:hover {
    color: #333;
}

.article-meta-info {
    display: flex;
    justify-content: space-between;
    align-items: center;       
    padding: 15px 0;
    margin: 20px 0 30px 0;
    border-top: 1px solid #eee;  
    border-bottom: 1px solid #eee;
}

.reading-time-container {
    border-top: none !important; 
    margin: 0 !important;
    padding: 0 !important;
    color: #888;
    font-size: 0.9rem;
    font-style: italic;
}

.reading-mode-toggle {
    margin: 0 !important;
    padding: 0 !important;
}

#toggleReadingMode {
    background: none;
    border: 1px solid #af9168;
    color: #af9168;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

#toggleReadingMode:hover {
    background: #af9168;
    color: white;
}

.progress-container {
    position: absolute;
    bottom: 0; 
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 10;
}

.progress-bar {
    height: 4px;
    background: #af9168; 
    width: 0%; 
}

.main-header.shrink + .progress-container,
.main-header.shrink ~ .progress-container {
    top: 70px;
}

#backToTop {
    display: flex; 
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1999;
    background-color: #af9168;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: 
        opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.3s ease, 
        color 0.3s ease !important;
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#backToTop:hover {
    background-color: #1c1c1c !important;
    color: #af9168 !important;
    border-color: #af9168 !important;
    transform: translateY(-5px) !important;
    transform: scale(1.1) !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(15px); }
}

#toggleReadingMode {
    background: none;
    border: 1px solid #af9168;
    color: #af9168;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Josefin Sans', sans-serif;
    transition: all 0.3s ease;
}

#toggleReadingMode:hover {
    background: #af9168;
    color: white;
    transform: scale(1.1) !important;

}

body.reading-dark-mode {
    background-color: #1a1a1a !important; 
    color: #e0e0e0 !important;
}

body.reading-dark-mode .full-article {
    max-width: 777px;
    margin: 160px auto 40px auto !important;
    padding: 30px 50px 50px 50px !important;
    background-color: #242424 !important; 
    color: #e0e0e0 !important;
    padding: 50px !important;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: all 0.5s ease;
}

body.reading-dark-mode .article-body, 
body.reading-dark-mode #main-title,
body.reading-dark-mode .article-subtitle {
    color: #e0e0e0 !important;
}

body.reading-dark-mode blockquote {
    border-left-color: #af9168;
    background: #2d2d2d;
    color: #af9168;
}

body.reading-dark-mode .clickable-tag {
    background: #2a2a2a !important; 
    color: #af9168 !important;  
    border: 1px solid #444 !important;
    transform: none !important; 
}

body.reading-dark-mode .post-card.related-mini {
    background-color: #2a2a2a !important;
    border: 1px solid #333 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
}

body.reading-dark-mode .related-title-mini {
    color: #e0e0e0 !important;
}

body.reading-dark-mode .article-footer {
    border-top: none !important;
}

body.reading-dark-mode .related-img-mini img {
    filter: brightness(0.8);
    transition: filter 0.3s ease;
}

body.reading-dark-mode .post-card.related-mini:hover .related-img-mini img {
    filter: brightness(1);
}

body.reading-dark-mode .post-card.related-mini {
    background-color: #242424 !important; 
    border: 1px solid #333 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
}

body.reading-dark-mode .related-title-mini {
    color: #e0e0e0 !important;
}

body.reading-dark-mode .post-card.related-mini .date {
    color: #888 !important;
}

body.reading-dark-mode .post-card.related-mini .preview {
    color: #bbb !important;
}

body.reading-dark-mode .article-tags-section {
    border-top: 1px solid #333 !important;
}

body.reading-dark-mode .tags-label {
    color: #888 !important;
}

body.reading-dark-mode .tag,
body.reading-dark-mode .clickable-tag {
    background: #2a2a2a !important; 
    color: #af9168 !important;  
    border: 1px solid #444 !important;
    transform: none !important;  
}

body.reading-dark-mode .tag:hover,
body.reading-dark-mode .clickable-tag:hover {
    background-color: #af9168 !important;
    color: #1a1a1a !important; 
    border-color: #af9168 !important;
    transform: translateY(-5%) !important;
}

body.reading-dark-mode .post-card.related-mini img {
    filter: brightness(0.8);
    transition: filter 0.3s ease;
}

body.reading-dark-mode .post-card.related-mini:hover img {
    filter: brightness(1);
}

body.reading-dark-mode .related-articles .post-card,
body.reading-dark-mode #related-posts-container .post-card {
    background-color: #242424 !important;
    border: 1px solid #3d3d3d !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
                border-color 0.4s ease,
                background-color 0.4s ease !important;
    
    will-change: transform, box-shadow;
}

body.reading-dark-mode .related-articles .post-card:hover,
body.reading-dark-mode #related-posts-container .post-card:hover {
    transform: scale(1.025) !important; 
    border-color: #af9168 !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6) !important;
    background-color: #2a2a2a !important; 
}

body.reading-dark-mode .related-articles .post-card img,
body.reading-dark-mode #related-posts-container .post-card img {
    filter: brightness(0.7) contrast(1.1);
    transition: transform 0.4s ease, filter 0.4s ease !important;
}

body.reading-dark-mode .related-articles .post-card:hover img,
body.reading-dark-mode #related-posts-container .post-card:hover img {
    transform: scale(1.05) !important;
    filter: brightness(0.8) !important;
}

body.reading-dark-mode .related-articles h3,
body.reading-dark-mode .related-articles .preview,
body.reading-dark-mode .related-articles .date {
    color: #e0e0e0 !important;
    transition: color 0.4s ease;
}

body.reading-dark-mode .tag, 
body.reading-dark-mode .clickable-tag {
    background-color: #1a1a1a !important;
    border-color: #af9168 !important;
    color: #af9168 !important;
}

.tag, .clickable-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    line-height: 1;
    padding: 0 12px;
    transition: all 0.3s ease !important;
}

#readingFloat {
    position: fixed;
    right: 30px;
    bottom: 95px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #1c1c1c;
    color: #af9168;
    border: 1px solid #af9168;
    cursor: pointer;
    z-index: 1999;
    display: flex !important;
    align-items: center;   
    justify-content: center;
    padding: 0;   
    line-height: 0;     
    font-size: 1.2rem;   
    transition: all 0.3s ease;
}

#readingFloat i {
    margin: 0;
    padding: 0;
    display: inline-block;
}

#readingFloat:hover {
    background-color: #af9168;
    color: white;
    transform: scale(1.1) !important;
}

.show-reading-float {
    display: block !important;
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.hide-reading-float {
    animation: bounceOut 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

body.reading-dark-mode .main-header {
    background-color: rgba(26, 26, 26, 0.8) !important;
    backdrop-filter: blur(5px); 
    border-bottom: 1px solid #333;
    box-shadow: none;
}

body.reading-dark-mode .main-header h1, 
body.reading-dark-mode .main-header .subtitle {
    color: #888 !important;
    transition: color 0.3s ease;
}

body.reading-dark-mode .hamburger span {
    background-color: #666 !important;
}

body.reading-dark-mode .header-controls i:not(.fa-instagram) {
    color: #666 !important; 
}

body.reading-dark-mode .instagram-link-header i,
body.reading-dark-mode .instagram-icon-footer {
    background: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    -webkit-text-fill-color: #666 !important; 
    color: #666 !important;
    filter: none !important; 
    opacity: 0.8;
}

body.reading-dark-mode .header-controls a:hover i,
body.reading-dark-mode .hamburger:hover span {
    color: #af9168 !important;
    opacity: 1;
}

body.reading-dark-mode .hamburger.open span:nth-child(2) {
    opacity: 0 !important;
    background-color: transparent !important;
}

body.reading-dark-mode blockquote {
    border-left: 4px solid #af9168;
    color: #af9168 !important;
    background: #222;
}

.share-wrapper {
    position: fixed;
    right: 30px;
    bottom: 160px;
    z-index: 1999;
    display: flex;
    flex-direction: column; 
    align-items: center;
    gap: 12px;
}

.share-main-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #1c1c1c;
    color: #af9168;
    border: 1px solid #af9168;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    order: 2;
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    order: 1; 
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.share-options.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    font-size: 1.1rem;
    transition: transform 0.2s ease, filter 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.share-main-btn:hover,
.share-main-btn.active {
    background-color: #af9168 !important; 
    color: white !important;    
    border: 1px solid transparent !important; 
    transform: scale(1.1) !important;
}

.wa { background-color: #25D366; }
.tg { background-color: #0088cc; }
.copy { background-color: #666; }
.share-btn.fb { background-color: #1877F2 !important;}
.wa:hover { transform: scale(1.1); }
.tg:hover { transform: scale(1.1); }
.copy:hover { transform: scale(1.1); }
.share-btn.fb:hover { transform: scale(1.1); }

.copy-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px); 
    background-color: #1c1c1c;
    color: #af9168;
    padding: 12px 25px;
    border-radius: 30px;
    border: 1px solid #af9168;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.9rem;
    z-index: 10000;
    opacity: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

#copy-notification.show {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateX(-50%) translateY(-10px) !important; 
}

#readingFloat, 
.share-wrapper {
    z-index: 1999 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.reading-dark-mode {
    background-color: #1c1c1c !important;
    color: #f4f4f4 !important;
}

body {
    opacity: 1;
    transition: opacity 0.5s ease;
}

body.fade-out {
    opacity: 0;
}

.page-loading {
    opacity: 0;
}

.related-articles {
    margin-top: 0px;
    padding: 15px 20px;
}

#related-posts-container
#related-posts-container .post-card img 
 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

#related-posts-container .post-card {
    scale: 0.9;
}

#related-posts-container .post-content h3 {
    font-size: 1.3rem;
    margin: 10px 0;
}

#related-posts-container .post-content p {
    font-size: 1rem;
}

.main-footer {
    transition: transform 0.5s ease, opacity 0.5s ease !important;
    will-change: transform, opacity;
}

footer {
    transition: opacity 0.4s ease, transform 0.4s ease !important;
}

.article-body-wrapper {
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.article-exit-wrapper {
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.article-body-wrapper, 
.article-exit-wrapper,
main, 
footer {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out !important;
    will-change: opacity, transform;
}

body .article-body-wrapper {
    opacity: 1;
}

footer {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out !important;
}

.article-body-wrapper,
footer {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease-in-out;
}

.full-article, 
.article-body-wrapper, 
.container,
footer {
    opacity: 1;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out !important;
    will-change: opacity, transform; 
}

.container, 
.article-body-wrapper, 
.full-article, 
footer{
    opacity: 0;
    transform: translateY(20);
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out !important;
}

.fade-in-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.fade-out-now {
    opacity: 0 !important;
    transform: translateY(20px) !important;
    pointer-events: none;
}

#related-posts-container {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out !important;
}

#related-posts-container.exit-active {
    opacity: 0;
    transform: translateY(-20px);
}

.related-title, 
.related-posts-section {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out !important;
}

.related-title.exit-active,
.related-posts-section.exit-active {
    opacity: 0;
    transform: translateY(-20px);
}

.skeleton {
    position: relative;
    overflow: hidden;
    background-color: #e2e2e2;
}

.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.5) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.img-loaded {
    filter: blur(0);
    animation: blurIn 0.8s ease;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

@keyframes blurIn {
    from { filter: blur(10px); opacity: 0; }
    to { filter: blur(0); opacity: 1; }
}

.post-image img, .item-image img {
    opacity: 0;
}

.view-all-container {
    display: flex;
    justify-content: center;
    margin-top: 50px; 
    margin-bottom: 20px;
}

.btn-view-all {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 12px 30px;
    border: 2px solid #af9168; 
    color: #af9168;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 50px; 
    background: transparent;
}

.btn-view-all i {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.btn-view-all:hover {
    background-color: #af9168;
    color: #fff !important;
    transform: translateY(-5px); 
    box-shadow: 0 10px 20px rgba(175, 145, 104, 0.2);
}

.btn-view-all:hover i {
    transform: translateX(3px);
}

body.reading-dark-mode .btn-view-all {
    border-color: #af9168;
    color: #af9168;
}

body.loaded footer {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    padding-top: 10px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #888;
}

.breadcrumbs a {
    color: #888;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: #af9168;
}

.breadcrumbs i {
    font-size: 0.6rem;
    color: #ccc;
    margin: 0 4px;
}

.breadcrumbs .current {
    color: #af9168;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

body.reading-dark-mode .breadcrumbs a { color: #666; }
body.reading-dark-mode .breadcrumbs .current { color: #af9168; }

@media (max-width: 768px) {
    main.container, .full-article {
    margin-top: 140px !important;
    background-color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05); 
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    padding-top: 10px !important;
    padding-left: 25px !important;
    padding-right: 25px !important;
    }
}

.menu-trigger {
    display: none; 
}

@media (max-width: 768px) {
    .header-controls {
        display: none !important;
    }

    .trigger {
        display: flex;
        position: fixed;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        background-color: #af9168;
        color: white;
        width: 45px;
        height: 65px;
        align-items: center;
        justify-content: center;
        border-radius: 20px 0 0 20px;
        z-index: 2000 !important;
        box-shadow: -2px 0 10px rgba(0,0,0,0.2);
        transition: right 0.4s ease;
    }

    .side-menu {
        left: auto;
        right: -100%;
        width: 280px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .side-menu.active {
        right: 0;
        left: auto;
    }
}

@media (max-width: 768px) {
    #backToTop, 
    #readingFloat, 
    #shareMain {
        width: 40px !important;
        height: 40px !important;
        right: 15px !important; 
        left: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        position: fixed !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
        z-index: 1999 !important;
    }

    #shareMain {
        bottom: 120px !important;
    }
    
    #readingFloat {
        bottom: 70px !important; 
    }

    #backToTop {
        bottom: 20px !important; 
    }

    #backToTop i, 
    #readingFloat i, 
    #shareMain i {
        font-size: 1rem !important;
        margin: 0 !important;
    }

    .share-options {
        right: 15px !important;
        left: auto !important;
        bottom: 65px !important; 
        width: 40px !important;
        margin: 0 !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px !important;
    }

    .share-options a {
        width: 35px !important;
        height: 35px !important;
        font-size: 0.9rem !important;
        margin: 0 !important;
    }

    #copy-notification {
    position: fixed !important; 
    bottom: 40px !important;   
    left: 50% !important;  
    transform: translateX(-50%) !important; 
    background-color: rgba(0, 0, 0, 0.85) !important;
    color: #ffffff !important;
    padding: 12px 24px !important;
    border-radius: 50px !important;
    font-size: 14px !important;
    z-index: 999999 !important;
    display: block !important;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    white-space: nowrap !important;
    text-align: center !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}
}

@media (max-width: 768px) {
    #backToTop, 
    #readingFloat, 
    #shareMain,
    .trigger {
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s !important;
        will-change: transform, opacity;
    }

    .trigger {
        overflow: visible !important;
    }
}

@media (max-width: 768px) {
    .trigger {
        position: fixed !important;
        top: 50% !important; 
        right: 0 !important;
        bottom: auto !important;
        transform: translateY(-50%) translateX(0);
        margin: 0 !important;
        padding: 0 !important;
        transition: transform 0.4s ease, opacity 0.4s;
        z-index: 10001;
        opacity: 1 !important; 
    }
}

@media (max-width: 768px) {
    #side-menu {
        width: 250px !important;
        right: -250px !important;
        background-color: #af9168;
        backdrop-filter: blur(10px); 
    }

    #side-menu.active {
        right: 0 !important;
    }
}

@media (max-width: 768px) {
    .date-bottom {
        display: block !important;
        text-align: right !important;
        margin: 10px auto 1px !important;
        padding-top: 20px !important;
        width: 90% !important;
        font-style: italic !important;
        color: #666 !important;
    }

    .brand .date:not(.date-bottom) {
        display: none !important;
    }
}

#shareMain, #readingFloat {
    opacity: 0; 
    transform: translateX(0);
    transition: transform 0.4s ease, opacity 0.4s ease; 
    pointer-events: auto;
}

#shareMain, #readingFloat, .trigger {
    opacity: 0; 
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease !important;
    pointer-events: auto;
}

.fade-in-visible {
    opacity: 1 !important;
}

.exit-active-float {
    opacity: 0 !important;
    transform: translateY(40px) !important; 
    transition: all 0.5s ease-in-out !important;
}

@media (max-width: 768px) {
    .main-header.header-hidden ~ #shareMain,
    .main-header.header-hidden ~ #readingFloat,
    .main-header.header-hidden ~ #backToTop {
        opacity: 0 !important;
        transform: translateX(100px) !important;
        pointer-events: none !important;
    }
}

.exit-active-float {
    opacity: 0 !important;
    transform: translateY(20px) !important; 
    transition: all 0.4s ease !important;
    pointer-events: none !important;
}

@media (max-width: 768px) {
    main.container, .full-article {
    margin-top: 140px !important;
    background-color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05); 
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    padding-top: 10px !important;
    padding-left: 25px !important;
    padding-right: 25px !important;
    }
}

@media (max-width: 768px) {
    .full-article, 
    body.reading-dark-mode .full-article {
        padding: 20px !important;  
        margin: 140px 15px 30px 15px !important; 
        width: auto !important;
        max-width: none !important;
        font-size: 1.2rem !important;
        line-height: 1.8 !important;
    }

    #main-title, 
    body.reading-dark-mode #main-title {
        padding-left: 0 !important;
        padding-right: 0 !important;
        font-size: 1.7rem !important;
        line-height: 1.4 !important;
    }

    .article-body,
    body.reading-dark-mode .article-body {
        padding-left: 0 !important;
        padding-right: 0 !important;
        font-size: 1.25rem !important; 
        line-height: 1.9 !important;
        text-align: justify;
        hyphens: auto;
    }
}

* {
    -webkit-tap-highlight-color: transparent;
}

*:focus {
    outline: none !important;
    box-shadow: none !important;
}

@media (max-width: 768px) {
    .share-options {
        left: auto !important;
        right: 80px !important; 
        gap: 10px;
        order: 1;
        width: 60px !important; 
        position: fixed !important;
        display: flex !important;
        align-items: center !important;
        z-index: 99999 !important;
    }

    .share-options.active {
        transform: scale(1) translateY(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

.share-options a#shareIG {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%) !important;
    color: #ffffff !important;
    border: none !important; 
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    transition: transform 0.3s ease !important; 
}

#shareIG i {
    color: #ffffff !important;
    font-size: 1.2rem !important;
}

#shareIG:hover {
    transform: scale(1.08) !important;
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%) !important;
}

@media (max-width: 768px) {
    .share-options a#shareIG {
        width: 35px !important; 
        height: 35px !important;
    }
}

@media (max-width: 768px) {

#copy-notification {
    bottom: 50% !important;    
    left: 50% !important;     
    transform: translateX(-50%) !important; 
    background-color: rgba(0, 0, 0, 0.85) !important;
    color: #ffffff !important;
    padding: 12px 24px !important;
    border-radius: 50px !important;
    font-size: 14px !important;
    z-index: 999999 !important; 
    display: block !important;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    white-space: nowrap !important;
    text-align: center !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}
}

.cookie-banner {
    position: fixed !important;
    bottom: -200px; 
    left: 0;
    width: 100%;
    background: #1c1c1c;
    color: #d6bb51;
    padding: 20px 0;
    z-index: 9999999 !important;
    transition: bottom 0.5s cubic-bezier(0.25, 1, 0.5, 1) !important;
    visibility: visible; 
    display: block !important;
}

.cookie-banner.show {
    bottom: 0 !important;
}

.cookie-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.cookie-content p { margin: 0; font-size: 0.9rem; }
.cookie-content a { color: #fff; text-decoration: underline; }

.cookie-btn {
    background: #d6bb51;
    color: #1c1c1c;
    border: none;
    padding: 8px 40px;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Josefin Sans', sans-serif !important; 
    font-weight: 700; transition: transform 0.2s;
}

.cookie-btn:hover { transform: scale(1.05); }

@media (max-width: 768px) {
    .cookie-content { text-align: center; justify-content: center; }
}

@media (max-width: 768px) {
    .cookie-banner {
        padding: 12px 0;
    }

    .cookie-content {
        flex-direction: column;
        gap: 8px;
        padding: 0 15px;
    }

    .cookie-content p {
        font-size: 11px; 
        line-height: 1.3;
        margin: 0;
        text-align: center;
    }

    .cookie-content p i {
        font-size: 10px; 
    }

    .cookie-btn.accept {
        width: auto; 
        padding: 6px 20px; 
        font-size: 12px; 
        margin-top: 5px;
    }
}

.nota-link a {
    color: #d6bb51;
    text-decoration: none;
    font-weight: bold;
    padding: 0 2px;
    font-size: 0.8em;
}

.nota-link a:hover {
    background-color: rgba(214, 187, 81, 0.2);
    border-radius: 3px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 120px; 
}

.footnotes a {
    color: #d6bb51 !important;
    text-decoration: none;
    font-weight: bold;
    margin-left: 5px;
    font-size: 1.1rem;
}
.footnotes ol {
    padding-left: 20px;
}

.footnotes li:target {
    animation: flash-highlight 2s ease-out;
}

.nota-tooltip {
    position: absolute;
    background: #1c1c1c;
    color: #fff;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    max-width: 280px;
    z-index: 1000;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    border: 1px solid #d6bb51;
    line-height: 1.4;
    pointer-events: auto; 
    transition: opacity 0.3s ease;
}


@keyframes flash-highlight {
    0% { background-color: rgba(214, 187, 81, 0.7); }
    100% { background-color: transparent; }  
}

.nota-link:target {
    animation: flash-highlight 2s ease-out;
    border-radius: 3px;
    scroll-margin-top: 120px; 
}

.footnotes li {
    scroll-margin-top: 200px; 
    transition: background-color 0.5s ease;
    border-radius: 5px;
    padding: 5px;
}

.nota-link {
    scroll-margin-top: 200px;
}

@media (max-width: 768px) {
    
    .footnotes li {
        font-size: 0.8rem;
        line-height: 1.4;  
    }

    .nota-link a {
        font-size: 0.9rem;
    }

    .footnotes a {
    color: #d6bb51 !important;
    text-decoration: none;
    font-weight: bold;
    margin-left: 5px;
    font-size: 1.4rem;
}
}

.article-body sup {
    vertical-align: baseline; 
    position: relative;
    top: -0.5em;
    line-height: 0;  
    font-size: 0.75em;
    margin-left: 2px;
}

.article-body p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
    display: block;
    text-align: justify;
    hyphens: auto;
}

.bibliography-section {
    margin-top: 20px;
    margin-bottom: 20px;
    padding-top: 20px;
}

.biblio-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 12px 30px;
    border: 2px solid #af9168;
    color: #af9168;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 50px;
    background: transparent;
    
    cursor: pointer;
    margin: 40px auto;
    width: fit-content;
}

body.reading-dark-mode .biblio-toggle {
    border-color: #af9168;
    color: #af9168;
}

.biblio-toggle:hover {
    background-color: #af9168;
    color: #fff !important;
    transform: translateY(-5px); 
    box-shadow: 0 10px 20px rgba(175, 145, 104, 0.2);
}

.biblio-toggle i {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.biblio-toggle.active i {
    transform: rotate(180deg);
}

.biblio-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.4s ease, 
                transform 0.4s ease,
                margin-top 0.5s ease; 
    opacity: 0;
    transform: translateY(-10px);
}

.biblio-content.show {
    opacity: 1;
    transform: translateY(0);
    margin-top: 20px;
}

.biblio-content ul {
    list-style: none;
    padding: 0;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.8;
}

.biblio-content li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.biblio-content li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: #d6bb51;
}

.footnotes {
    border-top: 1px solid #eee;
    margin-top: 50px; 
    font-family: 'Josefin Sans', sans-serif;
    color: #333;
    font-size: 0.9rem;
}

.sticky-title-container {
    pointer-events: auto !important; 
    cursor: pointer !important;
    z-index: 9999; 
}

.sticky-title-text {
    pointer-events: none;
}

.sticky-title-container:hover {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

body.reading-dark-mode .footnotes {
    color: #f4f4f4;
    border-top: 1px solid #333 !important;
}

body.reading-dark-mode .footnotes li,
body.reading-dark-mode .footnotes p {
    color: #f4f4f4;
}
body.reading-dark-mode .footnotes a {
    color: #d6bb51 !important;
    text-decoration: none;
}

body.reading-dark-mode .sticky-title-text {
    color: #888 !important;
}

#quote-sharer {
    position: absolute;
    display: none; 
    background-color: #1c1c1c;
    color: #af9168;    
    border: 1px solid #af9168;
    padding: 10px 20px;
    border-radius: 6px;    
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;      
    text-transform: none;   
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
    min-width: 160px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    border: 1px solid #d6bb51;
    padding: 0 15px; 
}

#quote-sharer.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

#quote-sharer.success {
    background-color: #1c1c1c; 
    color: #d6bb51;     
}

#quote-sharer:hover {
    background-color: #2a2a2a;
    color: #d6bb51;
}

html.dark-mode #quote-sharer {
    background-color: #000;
    color: #af9168;
    box-shadow: 0 4px 15px rgba(0,0,0,0.8);
}

.sharer-text {
    display: inline-block;
    width: 100%;
    text-align: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
    flex-shrink: 0; 
}

.text-fade {
    opacity: 0;
    transform: translateY(-5px);
}

.term {
    border-bottom: 1px dotted #d6bb51;
    cursor: help;
    position: relative;
    color: inherit;
    font-weight: 500;
}

#glossary-tooltip {
    position: absolute;
    display: none;
    background-color: #1c1c1c;
    color: #f4f4f4;
    border: 1px solid #d6bb51;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    z-index: 10001;
    width: 250px;
    max-width: 60vw;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    pointer-events: none; 
    opacity: 0;
    transition: opacity 0.3s ease;
}

#glossary-tooltip strong {
    display: block;
    color: #d6bb51;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    #glossary-tooltip {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 80% !important;
        max-width: 300px !important;
        height: auto !important;
        opacity: 1 !important;
    }

}

.share-btn.x-twitter {
    background-color: #000 !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fa-x-twitter {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400;
}

.share-btn.x-twitter:hover {
    background-color: #222222;
    transform: scale(1.1);
}

/* ============================================================
   PROSSIMO ARTICOLO - DESKTOP (Trigger Verticale a Sinistra)
   ============================================================ */
.next-article-container {
    position: fixed;
    top: 90%;
    left: 0;
    right: auto;
    width: auto;
    min-width: 280px;
    background: #1c1c1c;
    border: 1px solid #af9168;
    border-radius: 0 0 12px 12px; 
    padding: 10px 25px;
    box-shadow: 2px 5px 15px rgba(0,0,0,0.4);
    z-index: 10000;
    transform: translateY(-50%) rotate(-90deg) translateY(-100%);
    transform-origin: top left;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
    opacity: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.next-article-container.show {
    /* Torna in posizione 0 */
    transform: translateY(-50%) rotate(-90deg) translateY(0);
    opacity: 1;
}

.next-article-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

#next-article-title {
    font-size: 0.95rem;
    margin: 0;
    color: #fff;
    white-space: nowrap;
}

#next-article-excerpt {
    display: none; /* Sempre nascosto su PC per snellire */
}

.next-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #af9168;
    margin: 0 !important;
    white-space: nowrap;
}

#close-next {
    /* Raddrizziamo la X (rotazione opposta al contenitore) */
    transform: rotate(90deg) !important;
    margin-left: 15px;
    background: none;
    border: none;
    color: #1c1c1c;
    cursor: pointer;
    font-size: 20px;
}

/* ============================================================
   PROSSIMO ARTICOLO - MOBILE (Banner in alto da destra)
   ============================================================ */
@media (max-width: 768px) {
    .next-article-container {
        top: 85px; 
        bottom: auto;
        left: auto !important; 
        right: -110% !important;
        width: 50% !important;             
        transform: rotate(0deg) !important; 
        transform-origin: center;
        border-radius: 12px 0 0 12px; 
        padding: 12px 15px;
        flex-direction: row;
        justify-content: flex-start;
        box-shadow: -5px 5px 15px rgba(0,0,0,0.3);
        opacity: 0;
        transition: right 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    }

    .next-article-container.show {
        right: 0 !important;
        opacity: 1;
    }

    .next-article-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding-right: 20px;
    }

    #next-article-title {
        font-size: 0.9rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Sistemazione pulsante chiusura su mobile */
    #close-next {
        transform: rotate(0deg) !important;
        position: absolute;
        top: 5px;
        right: 8px;
        font-size: 18px;
    }
}
/* Container della card in Home */
.post-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    height: 400px; /* Altezza fissa per la griglia */
    color: #ffffff;
}

/* La tua nuova classe specifica */
.post-image-home {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.post-image-home img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7); /* Scurisce l'immagine per far leggere il testo */
    transition: transform 0.5s ease;
}

/* Effetto hover stile professionale */
.post-card:hover .post-image-home img {
    transform: scale(1.05);
}

/* Il contenuto sopra l'immagine */
.post-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
}

.post-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    line-height: 1.2;
    min-height: 3.2rem; 
}

.post-content .date {
    margin-bottom: auto; 
    padding-bottom: 40px; 
    margin-top: -10px; 
}

/* Stile base per i tag nelle card della Home */
.post-card .tag {
    background-color: #af9168; /* Panna/Bianco sporco */
    color: #fdfaf5;            /* Oro/Marrone */
    padding: 2px 8px;
    font-size: 0.6rem;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 4px;
    transition: all 0.3s ease; /* Transizione fluida */
    cursor: pointer;
    border: 1px solid transparent;
}

/* EFFETTO HOVER SPECIFICO PER LA HOME */
.post-card .tag:hover {
    background-color: #fdfaf5 !important; /* Diventa trasparente */
    color: #af9168 !important;               /* Il testo diventa bianco/panna */
    transform: translateY(-1px);   /* Piccola spinta verso l'alto */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Container principale Archivio */
.post-item {
    display: flex;
    height: 160px; 
    background: #fff;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    overflow: hidden;
    margin-bottom: 15px;
}

.post-image-archive {
    flex: 0 0 320px;
    height: 100%;
}


.post-image-archive img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease; 
}

.post-item:hover .post-image-archive img {
    transform: scale(1.05);
}

.item-content {
    display: flex;
    justify-content: center;
    flex: 1;
    padding: 1px 50px; 
    flex-direction: column;
    justify-content: flex-start; 
}

.item-content .date {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #cdcdcd;
    margin-bottom: 17px;
}

.item-content h3 {
    font-size: 1.15rem;
    margin: 5px 0 2px 0;
    color: #1a1a1a;
    line-height: 1.2;
}

.item-content .preview {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-content .tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 0px;
    margin-top: 0;
    line-height: 1;   
}

.item-content .tag {
    display: inline-flex;  
    align-items: center;
    justify-content: center;
    background: #fdfaf5;
    color: #af9168;
    border: 1px solid #f2eade;
    border-radius: 3px;
    height: auto;     
    min-height: 0;    
    font-size: 0.6rem; 
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 2;  
    transition: all 0.2s ease;
    cursor: pointer;
}

.item-content .tag:hover {
    background-color: #af9168;
    color: #ffffff;
    border-color: #af9168;
    transform: translateY(-1px);   /* Piccola spinta verso l'alto */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);

}

/* Media Query per smartphone (sotto i 768px) */
@media (max-width: 768px) {
    
    .posts-grid {
        grid-template-columns: 1fr; 
        gap: 20px;
        padding: 0 15px;
        width: 85%;
        margin-left: auto;
        margin-right: auto;
    }

    /* 2. Card: riduciamo l'altezza per vederne di più */
    .post-card {
        height: 250px;
}

    /* 3. CONTENUTO: Nascondiamo i tag come richiesto */
    .post-card .tags-container {
        display: none; 
    }

    .post-content {
        padding: 20px;
    }

    .post-content .date {
        margin-top: 1px;
        font-size: 0.8rem;
    }

    .post-content h3 {
        font-size: 1.3rem;
        margin-bottom: 5px;
        padding-top: 0;
        min-height: 2.8rem;
    }

    .post-content .preview {
        font-size: 0.95rem;
    }

    #related-posts-container .post-card {
    scale: 1;
    }

    #related-posts-container .post-content h3 {
    font-size: 1.3rem;
    margin-top: 0;
    }

    #related-posts-container .post-content p {
    font-size: 1rem;
    }

    #related-posts-container .date {
    margin-bottom: 0;
    padding-bottom: 20px;
    color:#cdcdcd;
    }
}

@media (max-width: 768px) {
    .post-item {
        flex-direction: column; 
        height: auto; 
        min-height: 350px;
        width: 90% !important; 
        margin: 0 auto 20px !important;
    }

    .post-image-archive {
        flex: 0 0 150px;
    }

    .item-content {
        padding: 15px;
        justify-content: flex-start;
    }

    .item-content .date {
        margin-bottom: 8px;
        font-size: 0.7rem;
    }

    .item-content h3 {
        font-size: 1.1rem;
        min-height: auto; 
        margin-bottom: 8px;
    }

    .item-content .preview {
        font-size: 0.85rem;
        line-clamp: 2; 
        display: -webkit-box;
        -webkit-line-clamp: 2; 
        -webkit-box-orient: vertical;  
        overflow: hidden;
        margin-bottom: 15px;
    }

    .item-content .tags-container {
        display: flex; 
        margin-top: 5px;
        gap: 8px;
    }
    
    .item-content .tag {
        padding: 4px 10px; 
        font-size: 0.65rem;
    }
    
    .item-content .tags-container {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap; 
    padding-bottom: 5px; 
    -ms-overflow-style: none; 
    scrollbar-width: none;     /* Per Firefox */
}

    .item-content .tags-container::-webkit-scrollbar {
    display: none;
    }
}

/* --- IMMAGINI E BOX NEL TESTO --- */

/* Classi base per le immagini */
.img-inline {
    width: 100%;
    height: auto;
    margin: 20px 0;
    display: block;
    border-radius: 8px;
}

/* Box curiosità stile libro di testo */
.box-curiosita {
    background: rgba(214, 187, 81, 0.1); /* Richiama il colore dell'header */
    border-left: 5px solid #d6bb51;
    padding: 20px;
    margin: 20px 0;
    font-size: 0.95rem;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.box-curiosita h4 {
    margin-top: 0;
    color: #1c1c1c;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

/* Allineamento Destra/Sinistra (Desktop) */
@media (min-width: 769px) {
    .align-right {
        float: right;
        width: 40%;
        margin-left: 30px;
        margin-bottom: 20px;
    }

    .align-left {
        float: left;
        width: 40%;
        margin-right: 30px;
        margin-bottom: 20px;
    }
    
    .align-center {
        width: 80%;
        margin: 40px auto;
        float: none;
        clear: both;
    }
}

/* Reset per Mobile: tutto centrale e a larghezza intera */
@media (max-width: 768px) {
    .align-right, .align-left, .align-center {
        float: none;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    .box-curiosita {
        padding: 15px;
    }
}

/* Pulizia per evitare sovrapposizioni post-float */
.article-body::after {
    content: "";
    display: table;
    clear: both;
}

/* Contenitore principale per immagine + didascalia */
.article-figure {
    margin: 20px 0;
    display: block;
}

/* L'immagine dentro la figura occupa tutto lo spazio del contenitore */
.article-figure img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px 8px 0 0; /* Arrotonda solo gli angoli superiori */
}

/* Stile della didascalia */
.article-figcaption {
    background: #eee; /* Grigio chiaro per staccare dal fondo */
    padding: 10px 15px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #555;
    border-radius: 0 0 8px 8px; /* Arrotonda angoli inferiori */
    border-top: 1px solid #ddd;
    font-style: italic;
}

/* Gestione Dark Mode per le didascalie */
.dark-mode .article-figcaption {
    background: #2a2a2a;
    color: #bbb;
    border-top-color: #444;
}

/* Allineamenti Desktop (sopra i 768px) */
@media (min-width: 769px) {
    .align-right {
        float: right;
        width: 40%;
        margin-left: 30px;
        margin-bottom: 20px;
    }

    .align-left {
        float: left;
        width: 40%;
        margin-right: 30px;
        margin-bottom: 20px;
    }

    .align-center {
        width: 80%;
        margin: 40px auto;
        clear: both;
    }
}

/* Reset Mobile */
@media (max-width: 768px) {
    .align-right, .align-left, .align-center {
        float: none;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

/* Box curiosità */
.box-curiosita {
    background: rgba(214, 187, 81, 0.1);
    border-left: 5px solid #d6bb51;
    padding: 20px;
    font-size: 0.95rem;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    box-sizing: border-box;
    /* Rimuove eventuali clear che bloccano il testo */
    clear: none !important; 
}

@media (min-width: 769px) {
    .align-left {
        float: left;
        width: 35%;
        margin: 5px 25px 15px 0; /* Margine a destra per il testo */
    }

    .align-right {
        float: right;
        width: 35%;
        margin: 5px 0 15px 25px; /* Margine a sinistra per il testo */
    }
}

/* IMPORTANTE: Questo assicura che il testo non "salti" sotto */
.article-body p {
    display: block; /* Non usare flex o altro sui paragrafi */
    overflow: visible; 
}

/* Usiamo aside per semantica, ma puoi usare anche div */
.box-curiosita {
    background: rgba(214, 187, 81, 0.1);
    border-left: 5px solid #d6bb51;
    padding: 15px;
    font-size: 0.95rem;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    box-sizing: border-box;
    line-height: 1.4;
    margin-bottom: 10px;
}

.box-curiosita h4 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #1c1c1c;
}

body.reading-dark-mode .box-curiosita h4 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #c7c7c7;
}

/* Questa è la parte magica per il wrapping fluido */
@media (min-width: 769px) {
    .align-right {
        float: right;
        width: 35%;
        margin: 10px 0 15px 25px; /* Crea lo spazio per il testo intorno */
    }

    .align-left {
        float: left;
        width: 35%;
        margin: 10px 25px 15px 0;
    }
}

/* Reset per evitare che il testo successivo "sotto" l'articolo si rompa */
.article-body::after {
    content: "";
    display: table;
    clear: both;
}

/* Rimuovi eventuali reveal o animazioni che bloccano il testo */
.box-curiosita.reveal { 
    display: inline-block; /* Aiuta a mantenere il testo vicino */
}

/* Impedisci ai titoli di rompere il float dei box/immagini */
.article-body h2, 
.article-body h3, 
.article-body blockquote {
    clear: none !important; /* Forza il titolo a stare di fianco al box se c'è spazio */
    display: block; 
    overflow: visible;
}

/* Se vuoi che il testo sia davvero fluido, il box deve stare DENTRO il paragrafo */
.box-curiosita {
    display: block; /* Mantiene la sua natura di scatola */
    /* ... resto del codice ... */
}

@media (max-width: 768px) {
    .poesia {
    margin: 30px auto;
    padding-left: 20px;
    line-height: 1.5 !important; /* Interlinea più compatta per i versi */
    color: #333;
    border-left: 1px solid #d6bb51; /* Un tocco di stile che richiama il sito */
    display: block;
    font-size: 1.1rem;
}

.poesia br {
    margin-bottom: 10px !important;
}

.article-body h2 {
    font-size: 1.5rem;
}

.article-body p {
    font-size: 1.1rem;
}

.article-body blockquote {
    font-size: 1.18rem;
}

.box-curiosita p {
    font-size: 0.95rem;
}

.box-curiosita h4 {
    font-size: 0.95rem;
}
}

/* Stile per le poesie o testi in versi */
.poesia {
    margin: 30px auto;
    padding-left: 20px;
    line-height: 1.7; /* Interlinea più compatta per i versi */
    color: #333;
    border-left: 1px solid #d6bb51; /* Un tocco di stile che richiama il sito */
    display: block;
}

/* Rimuove lo spazio tra le linee della poesia */
.poesia br {
    content: "";
    margin: 0;
    display: block;
}

body.reading-dark-mode .poesia {
    color: #b1b1b1;
    border-left-color: #d6bb51;
}
