/* =========================
   FUENTES
========================= */
@font-face {
    font-family: Dudu_Calligraphy;
    src: url('/assets/fonts/Dudu_Calligraphy.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* =========================
   RESET BÁSICO
========================= */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

a, li {
    margin: 0;
    padding: 0;
}

/* =========================
   PRELOAD
========================= */

body::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    z-index: -1;
    background-image:
        url('/assets/img/home1.png'),
        url('/assets/img/home2.png'),
        url('/assets/img/blog1.png'),
        url('/assets/img/blog2.png'),
        url('/assets/img/gallery1.png'),
        url('/assets/img/gallery2.png'),
        url('/assets/img/like1.png'),
        url('/assets/img/like2.png');
}

@view-transition {
    navigation: auto;
}

/* =========================
   ESTILOS GENERALES
========================= */
body {
    font-family: Dudu_Calligraphy, sans-serif !important;
    font-size: 1.25em;
    margin: 0;
    padding: 0;
    background: repeating-linear-gradient(
        90deg,
        #deb887,
        #deb887 10px,
        #d2a679 10px,
        #d2a679 20px
  );
}

/* =========================
    SELECCIÓN FLUORESCENTE
========================= */

::selection {
     background-color: rgba(255, 255, 0, 0.5);
}

/* =========================
   HEADER
========================= */

header img {
    width: 200px;
    height: auto;
    margin: 20px;
}

/* =========================
   NAVEGACIÓN
========================= */

nav {
    display: flex;
    gap: 16px;
    padding: 16px;
    justify-content: center;
}

nav a {
    text-decoration: none;
    font-weight: bold;
    color: black;
}

nav .nav-image {
    width: 64px;
    height: 64px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

nav .nav-image.home {
    background-image: url('/assets/img/home1.png');
}

nav .nav-image.home:hover {
    background-image: url('/assets/img/home2.png');
}

nav .nav-image.blog {
    background-image: url('/assets/img/blog1.png');
}

nav .nav-image.blog:hover {
    background-image: url('/assets/img/blog2.png');
}

nav .nav-image.gallery {
    background-image: url('/assets/img/gallery1.png');
}

nav .nav-image.gallery:hover {
    background-image: url('/assets/img/gallery2.png');
}

nav .nav-image span {
    opacity: 0;
    transition: 0.1s;
    position: absolute;
    font-size: 0.7em;
}

nav .nav-image:hover span {
    opacity: 1;
    text-align: center;
    color: #333;
    transform: translateY(28px);
    font-size: 1em;
}

/* =========================
   LAYOUT PRINCIPAL
========================= */

div.main-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

main {
    width: 100%;
    max-width: 100%;
    text-align: left;
    min-height: 100vh; /* ocupa toda la altura de la pantalla */
    display: flex;
    flex-direction: column;
    background-color: #fbfbfb;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.03) 0,
        rgba(0, 0, 0, 0.03) 1px,
        transparent 1px,
        transparent 32px
    );
    background-size: 100% 32px;
    background-repeat: repeat;
    background-attachment: fixed;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

main .content {
    margin: 16px;
    margin-top: 0;
}

main .content .header {
    margin: 0;
    padding: 0;
}

main .content .header h1 {
    margin: 0;
}

main .content .header h4 {
    margin-top: 4px;
    margin-bottom: 4px;
    color: rgba(0, 0, 0, 0.5);
}

main .content .header h5 {
    margin-top: 0;
    padding-top: 0;
    color: rgba(0, 0, 0, 0.5);
}

main .content .header h5 img {
    margin: 0;
    padding: 0;
    vertical-align: middle;
    border: 0;
    width: 1em;
    height: 1em;
    opacity: 0.7;
}

main .content .header h5 span {
    display: flex;
    align-items: center;
    gap: 4px;
}

main .content > h2 {
    margin-top: 64px;
    margin-bottom: 0;
}

.posts h3 {
    margin-bottom: 0;
}

.posts h3 a {
    color: black;
    text-decoration-color: black;
}

.posts .post-date {
    font-size: 0.9em;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.posts .post-date img {
    width: 16px;
    height: 16px;
}

a {
    text-decoration: dotted underline;
}

a:hover {
    text-decoration: dashed underline;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

.post-meta button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 0;
    margin: 0 0;
    border-radius: 8px;
    transition: background-color 0.2s;
    color: red;
    font-family: Dudu_Calligraphy, sans-serif !important;
}

.post-meta h5 {
    margin: 0;
    padding: 0;
}

.post-meta {
    margin-bottom: 16px;
}

.post-meta img {
    margin: 0 !important;
    padding: 0 !important;
    width: 16px;
    height: 16px;
    border: none !important;
}

.post-meta button.like-btn img {
    content: url("/assets/img/like1.png");
    transition: opacity 0.2s;
}

.post-meta button.like-btn:hover img {
    content: url("/assets/img/like2.png");
}

.post-meta button.like-btn.liked img {
    content: url("/assets/img/like2.png");
}

.post-meta button.like-btn.liked:hover img {
    content: url("/assets/img/like2.png");
}

.likes {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.likes.loading {
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
}


/* =========================
   TABLE OF CONTENTS
========================= */

.table-of-contents {
    margin: 24px 0;
    padding: .5em .4em;
    border: 2px dashed rgba(0, 0, 0, 0.2);
    background: rgba(222, 184, 135, 0.15);
    max-width: 100%;
}

.table-of-contents::before {
    content: "📑 Cositas en este post:";
    display: block;
    font-weight: bold;
    font-size: 1.1em;
    opacity: 0.85;
}

.table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-of-contents li {
    margin: 6px 0;
    padding-left: 14px;
    position: relative;
}

.table-of-contents li::before {
    content: "⤳";
    position: absolute;
    left: 0;
    top: 0;
    color: rgba(0, 0, 0, 0.6);
}

.table-of-contents a {
    text-decoration: none;
    font-weight: bold;
    color: black;
    padding: 2px 6px;
}

.table-of-contents a:hover {
    background: rgba(255, 255, 0, 0.35);
}

.table-of-contents ul ul li::before {
    content: "⇝";
}

.table-of-contents ul ul a {
    font-weight: normal;
    font-size: 0.95em;
    color: rgba(0, 0, 0, 0.8);   
}

.content.blog img, .content.blog video, .content.blog audio {
    display: block;
    margin: 16px auto;
    border: 4px dashed rgba(0, 0, 0, 0.1);
    max-width: 100%;
    max-height: 750px;
}

.content.blog p > img {
    margin-bottom: 0;
}

.content.blog p > img + em, .content.blog p > video + em, .content.blog p > audio + em {
    display: block;
    margin: 0 auto;
    text-align: center;
    font-size: 0.90em;
}

.content.blog audio {
    border: none;
}

.content.blog pre {
    background: #0f0f0f !important;
    color: #e6e6e6 !important;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.4) !important;
    overflow-x: auto !important;
    line-height: 1.5 !important;
    font-size: 0.8em !important;
}

.content.blog hr {
    border: none;
    border-top: 1px dashed rgba(0, 0, 0, 0.9);
    max-width: 50%;
}

.content.blog .footnotes-sep {
    display: none;
}

.content.blog .footnotes {
    border: 1px dashed;
}

/* =========================
        GALLERY
========================= */

.gallery-images {
    column-count: 2;
    column-gap: 0;
    margin-top: 32px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 32px;
    border: 4px solid white;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-item:hover {
    transform: rotate(0) !important;
    cursor: pointer;
}

/* =========================
   AUDIO SIMPLE (BLOG)
========================= */

.content.blog figure.audio-block {
    max-width: 100%;
    margin: 16px 0;
    padding: 0;
    border: none;
    background: none;
}

.content.blog figure.audio-block figcaption {
    font-size: 0.85em;
    opacity: 0.6;
    margin-bottom: 4px;
    text-align: center;
}

.content.blog figure.audio-block audio {
    width: 100%;
    display: block;
    margin: 0 auto;
    border: none;
}
