/* =====================================================================
   Estepona Imágenes 2026 - Frontend público
   Estilo tipo Instagram, responsive mobile-first
   ===================================================================== */

:root {
    --bg:            #fafafa;
    --surface:       #ffffff;
    --text:          #262626;
    --text-muted:    #8e8e8e;
    --border:        #dbdbdb;
    --border-light:  #efefef;
    --primary:       #0095f6;
    --primary-hover: #1877f2;
    --danger:        #ed4956;
    --like:          #ed4956;
    --radius:        8px;
    --header-h:      60px;
    --max-width:     600px;
    --shadow:        0 0 1px rgba(0,0,0,.12), 0 0 0 rgba(0,0,0,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg) url('../background.jpg') no-repeat center center fixed;
    background-size: cover;
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;

}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* =====================================================================
   Header sticky
   ===================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,.95);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border-light);
}
.site-header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: var(--header-h);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand__icon { font-size: 24px; }
.brand__name {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 20px;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.site-nav__tag {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Menu hamburguesa de categorias */
.site-nav { position: relative; }
.cat-menu-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: border-color .15s;
}
.cat-menu-toggle:hover { border-color: var(--text-muted); }
.cat-menu-toggle__label { white-space: nowrap; }
.cat-menu-toggle__icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 16px;
}
.cat-menu-toggle__icon span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform .25s, opacity .25s;
}
.cat-menu-toggle[aria-expanded="true"] .cat-menu-toggle__icon span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}
.cat-menu-toggle[aria-expanded="true"] .cat-menu-toggle__icon span:nth-child(2) {
    opacity: 0;
}
.cat-menu-toggle[aria-expanded="true"] .cat-menu-toggle__icon span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

.cat-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    min-width: 180px;
    padding: 6px 0;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s, transform .2s, visibility .2s;
}
.cat-menu--open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.cat-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    transition: background .12s;
}
.cat-menu__item:hover {
    background: var(--border-light);
    text-decoration: none;
}
.cat-menu__item.active {
    font-weight: 600;
    color: var(--primary);
}
.cat-menu__dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* =====================================================================
   Feed
   ===================================================================== */
.feed {
    
    margin: 0 auto;
    padding: 12px 0 0;
	max-width: var(--max-width);
	background-color: white;
	box-shadow: rgba(0, 0, 0, 0.3) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;

}

/* =====================================================================
   Tarjeta de post
   ===================================================================== */
.post {
    background: var(--surface);
    _border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
	background-color: white;
}

/* Header de la tarjeta */
.post__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}
.post__avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433, #dc2743, #bc1888);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}
.post__avatar-img { font-size: 18px; line-height: 1; }
.post__author { display: flex; flex-direction: column; line-height: 1.2; }
.post__username { font-weight: 600; font-size: 14px; }
.post__location { font-size: 12px; color: var(--text-muted); }
.post__category {
    display: inline-block;
    padding: 1px 7px;
    margin-left: 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    vertical-align: middle;
    line-height: 1.5;
}
.post__time {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}
.post__time-mobile { display: none; }

/* Media */
.post__media {
    width: 100%;
    background: #000;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;          /* centra el contenido */
    align-items: center;
    justify-content: center;
}
.post__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #f0f0f0;
}

/* Vídeo YouTube: ocupa todo el recuadro cuadrado y se centra */
.post__media .post__video {
    width: 100%;
    height: 100%;
    background: #000;
    position: relative;
}
.post__media .post__video.ratio-16x9 { aspect-ratio: auto; } /* anula el 16:9 heredado */
.post__media .post__video iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    transform: translate(-50%, -50%);
}

/* Acciones */
.post__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px 4px;
}
.post__btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .12s ease, opacity .12s ease;
}
.post__btn:hover { opacity: .55; }
.post__btn:active { transform: scale(.88); }
.post__btn svg { width: 26px; height: 26px; fill: none; stroke: var(--text); stroke-width: 2; }
.post__btn--like svg { fill: none; stroke: var(--text); }
.post__btn--like.is-liked svg { fill: var(--like); stroke: var(--like); }
.post__btn--like.animating svg { animation: pop .35s ease; }
.post__btn--comment { position: relative; }
@keyframes pop {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.35); }
    60%  { transform: scale(.9); }
    100% { transform: scale(1); }
}
.post__btn--comment svg { fill: none; stroke: var(--text); }
.post__spacer { flex: 1; }

.post__share { position: relative; }
.post__btn--share svg { width: 24px; height: 24px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.post__share-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    min-width: 150px;
    padding: 6px 0;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .2s, transform .2s, visibility .2s;
}
.post__share-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.post__share-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: background .12s;
}
.post__share-item:hover {
    background: var(--border-light);
    text-decoration: none;
}
.post__share-item svg {
    width: 18px; height: 18px;
    fill: var(--text);
    stroke: none;
    flex-shrink: 0;
}
.post__share-item[data-share="email"] svg {
    fill: none;
    stroke: var(--text);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.post__share-item[data-share="x"] svg {
    fill: var(--text);
}
.post__comment-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    pointer-events: none;
}

/* Likes */
.post__likes { padding: 2px 14px; font-size: 14px; }
.post__likes-count { font-weight: 600; }

/* Caption */
.post__caption {
    padding: 2px 14px;
    font-size: 14px;
    word-break: break-word;
}
.post__caption-user { font-weight: 600; margin-right: 6px; }
.post__caption-text { 
    font-family: 'Poppins', sans-serif;
    font-weight: 300;
    font-size: 16px;

}

/* Sección de comentarios (colapsable, estilo Instagram) */
.post__comments-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    background: var(--bg);
    border-top: 1px solid transparent;
}
.post__comments-section.is-open {
    max-height: 2000px;
    border-top-color: var(--border);
    padding-bottom: 4px;
}
.post__comments-list { padding: 10px 14px 4px; }
.post__view-comments {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 13px; padding: 2px 0;
    display: block; margin-bottom: 8px;
}
.post__view-comments:hover { color: var(--text); text-decoration: underline; }
.post__comment {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 10px;
    word-break: break-word;
}
.post__comment-body { flex: 1; min-width: 0; }
.post__comment-author {
    font-weight: 600;
    font-size: 13px;
    display: block;
    margin-bottom: 1px;
}
.post__comment-text {
    font-size: 13px;
    display: block;
    line-height: 1.4;
}
.post__comment-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    display: inline-block;
}
.post__comment-like {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 0 0 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    color: var(--text-muted);
    transition: transform .12s ease;
}
.post__comment-like:active { transform: scale(.85); }
.post__comment-like svg {
    width: 14px; height: 14px;
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 2;
}
.post__comment-like.is-liked svg {
    fill: var(--like);
    stroke: var(--like);
}
.post__comment-like.is-liked { color: var(--like); }
.post__comment-like-count {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

/* Form comentario */
.post__comment-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 10px;
    border-top: 1px solid var(--border-light);
    margin-top: 4px;
    flex-wrap: wrap;
    background: var(--surface);
}
.post__comment-name {
    flex: 0 0 100px;
}
.post__comment-input { flex: 1; }
.post__comment-name,
.post__comment-input,
.post__captcha-input {
    border: none;
    background: transparent;
    font-size: 13px;
    padding: 6px 0;
    color: var(--text);
    border-bottom: 1px solid transparent;
}
.post__comment-name:focus,
.post__comment-input:focus,
.post__captcha-input:focus {
    outline: none;
    border-bottom-color: var(--border);
}
.post__captcha-question {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}
.post__captcha-input {
    width: 48px;
    text-align: center;
    font-weight: 600;
}
.post__comment-send {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 0;
    opacity: 1;
}
.post__comment-send:disabled { opacity: .4; cursor: default; }

/* =====================================================================
   Loader / final
   ===================================================================== */
.sentinel {  }
.loader {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}
.loader[hidden] { display: none; }
.loader__spinner {
    width: 28px; height: 28px;
    margin: 0 auto 10px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.feed-end {
    text-align: center;
	margin: 0 auto;
    padding: 28px 16px 12px;
    color: var(--text-muted);
    font-size: 13px;
	max-width: var(--max-width);
	background-color: white;
	box-shadow: rgba(0, 0, 0, 0.3) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;
}
.feed-end[hidden] { display: none; }

/* Empty state */
.feed-empty {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}
.feed-empty__icon { font-size: 56px; margin-bottom: 16px; }
.feed-empty h2 { font-family: 'Poppins', sans-serif; color: var(--text); margin-bottom: 8px; }

/* =====================================================================
   Error 404
   ===================================================================== */
.error-page {
    text-align: center;
    padding: 60px 24px 80px;
    max-width: 440px;
    margin: 0 auto;
}
.error-page__code {
    font-family: 'Poppins', sans-serif;
    font-size: 96px;
    font-weight: 700;
    color: var(--border);
    line-height: 1;
    margin-bottom: 12px;
}
.error-page__title {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    color: var(--text);
    margin-bottom: 8px;
}
.error-page__text {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 28px;
}
.error-page__btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 28px;
    border-radius: var(--radius);
    transition: background .15s;
}
.error-page__btn:hover { background: var(--primary-hover); }
.error-page__cats { margin-top: 36px; }
.error-page__cats-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.error-page__cat-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text);
    margin: 0 4px 8px 0;
    transition: border-color .15s;
}
.error-page__cat-link:hover { border-color: var(--border); }

/* =====================================================================
   Footer
   ===================================================================== */
.site-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 12px;
	max-width: var(--max-width);
    background-color: white;
	margin: 0 auto;
	box-shadow: rgba(0, 0, 0, 0.3) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;
}
.site-footer a {
    color: var(--text-muted);
}
.site-footer a:hover {
    color: #6EA4C6;
}

/* =====================================================================
   Toast (mensajes temporales)
   ===================================================================== */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    background: rgba(38,38,38,.95);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    animation: toast-in .25s ease;
}
@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 600px) {
    .post {
        border-radius: 0;
        border-left: none;
        border-right: none;
        
    }
    .site-header__inner { padding: 0 12px; }
    .brand__name { font-size: 18px; }
    .post__time { display: none; }
    .post__time-mobile {
        display: inline;
        font-size: 12px;
        color: var(--text-muted);
    }
    .feed { padding-top: 0; }
    .cat-menu-toggle { padding: 5px 10px; font-size: 12px; }
    .cat-menu { min-width: 160px; right: -8px; }
}

@media (min-width: 601px) {
    .feed { padding: 20px 0px 0; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
