/* ============================================
   FourPoets - Main Stylesheet
   Professional literary blog theme
   ============================================ */

/* ===== CSS Variables ===== */
:root,
.theme-dark {
    --bg-color: #1a1714;
    --bg-surface: #252019;
    --bg-surface-alt: #2e2820;
    --bg-elevated: #332c24;
    --text-color: #e8e0d4;
    --text-muted: #a09689;
    --text-faint: #6b6258;
    --border-color: #3d362e;
    --accent: #8C2628;
    --accent-light: #a8383a;
    --accent-hover: #c04548;
    --link-color: #c89a6a;
    --link-hover: #e0b07a;
    --shadow: rgba(0, 0, 0, 0.4);
    --header-text: #f4efe6;
    --topbar-bg: #1E1A17;
    --topbar-text: #e8e0d4;
    --topbar-border: #3d362e;
    --footer-bg: #1E1A17;
    --footer-text: #a09689;
    --input-bg: #2a2520;
    --input-border: #4a4038;
    --input-text: #e8e0d4;
    --btn-bg: #8C2628;
    --btn-text: #fff;
    --btn-hover-bg: #a8383a;
    --card-bg: #252019;
    --card-border: #3d362e;
}

.theme-light {
    --bg-color: #EDE5D6;
    --bg-surface: #FBF8F2;
    --bg-surface-alt: #F5EFE4;
    --bg-elevated: #FEFCF7;
    --text-color: #1E1A17;
    --text-muted: #5a5249;
    --text-faint: #8a8175;
    --border-color: #d9d0c4;
    --accent: #8C2628;
    --accent-light: #a8383a;
    --accent-hover: #6e1c1e;
    --link-color: #6e1c1e;
    --link-hover: #4a1213;
    --shadow: rgba(0, 0, 0, 0.1);
    --header-text: #f4efe6;
    --topbar-bg: #1E1A17;
    --topbar-text: #e8e0d4;
    --topbar-border: #3d362e;
    --footer-bg: #1E1A17;
    --footer-text: #a09689;
    --input-bg: #ffffff;
    --input-border: #d9d0c4;
    --input-text: #1E1A17;
    --btn-bg: #8C2628;
    --btn-text: #fff;
    --btn-hover-bg: #6e1c1e;
    --card-bg: #ffffff;
    --card-border: #e0d7ca;
}

/* ===== Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    font-weight: 400;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Slightly heavier text in light mode for better contrast */
.theme-light body {
    font-weight: 500;
}

.theme-light .blog-entry-content,
.theme-light .post-detail-content,
.theme-light .page-content,
.theme-light .sidebar-list-item,
.theme-light .sidebar-list-item a,
.theme-light .sidebar-title,
.theme-light .sidebar-search-input,
.theme-light .list-item,
.theme-light .list-item-title,
.theme-light .list-item-title a,
.theme-light .list-item-meta,
.theme-light .login-card,
.theme-light .login-subtitle,
.theme-light .form-group label,
.theme-light .form-control,
.theme-light .admin-table th,
.theme-light .admin-table td,
.theme-light .admin-stat-card .stat-label,
.theme-light .admin-user-info span,
.theme-light .footer-nav a,
.theme-light .footer-brand,
.theme-light .footer-credit {
    font-weight: 500;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Top Navigation Bar ===== */
.topbar {
    background: var(--topbar-bg);
    color: var(--topbar-text);
    border-bottom: 1px solid var(--topbar-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px var(--shadow);
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 1rem;
}

.topbar-brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--topbar-text);
}

.topbar-brand a:hover {
    color: var(--topbar-text);
    opacity: 0.85;
}

.topbar-logo {
    height: 40px;
    width: auto;
    border-radius: 4px;
}

.topbar-brand-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.85rem;
    color: var(--topbar-text);
    font-size: 0.875rem;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
    border-radius: 4px;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--topbar-text);
    background: rgba(255, 255, 255, 0.08);
}

.nav-login {
    background: var(--accent);
    color: #fff !important;
    margin-left: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
}

.nav-login:hover {
    background: var(--accent-hover) !important;
}

.caret {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    margin-left: 0.25rem;
    transition: transform 0.2s ease;
}

/* ===== Nav Dropdowns ===== */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle[aria-expanded="true"] .caret {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--topbar-bg);
    border: 1px solid var(--topbar-border);
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    padding: 0.5rem 0;
    display: none;
    z-index: 1001;
}

.nav-dropdown-menu.open {
    display: block;
    animation: fadeInDown 0.2s ease;
}

.nav-dropdown-wide {
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--topbar-text);
    font-size: 0.875rem;
    text-decoration: none;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--topbar-text);
}

.dropdown-item-post {
    display: flex;
    flex-direction: column;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-post-title {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
}

.dropdown-post-meta {
    font-size: 0.75rem;
    color: var(--text-faint);
    margin-top: 0.2rem;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== Topbar Actions ===== */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid var(--topbar-border);
    border-radius: 50%;
    color: var(--topbar-text);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

.theme-dark .icon-sun { display: none; }
.theme-dark .icon-moon { display: block; }
.theme-light .icon-sun { display: block; }
.theme-light .icon-moon { display: none; }

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid var(--topbar-border);
    border-radius: 6px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--topbar-text);
    border-radius: 2px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

/* ===== Page Header (full width image, faded at bottom) ===== */
.page-header {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 0 1.5rem;
}

.page-header-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.page-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        rgba(26, 23, 20, 0.1) 0%,
        rgba(26, 23, 20, 0.3) 40%,
        rgba(26, 23, 20, 0.7) 75%,
        var(--bg-color) 100%
    );
    transition: background 0.3s ease;
}

.theme-light .page-header-overlay {
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.25) 40%,
        rgba(0, 0, 0, 0.6) 75%,
        var(--bg-color) 100%
    );
}

.page-header-logo-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% - 0.5cm));
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.page-header-logo {
    width: clamp(98px, 15vw, 162px);
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.55));
    opacity: 0.92;
}

.page-header-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 0 3rem 0;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 3rem;
}

.page-header-title,
.page-header-subtitle {
    grid-column: 1;
}

.page-header-title {
    color: #f4efe6;
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.7);
}

.page-header-subtitle {
    color: rgba(244, 239, 230, 0.9);
    font-size: 1.2rem;
    margin-top: 0.5rem;
    text-shadow: 0 1px 15px rgba(0, 0, 0, 0.6);
}

/* ===== Main Content (two-column layout) ===== */
.main-content {
    flex: 1;
    width: 100%;
    padding: 2.5rem 1.5rem;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 3rem;
    align-items: start;
}

.content-main {
    min-width: 0;
}

/* ===== Sidebar ===== */
.content-sidebar {
    position: sticky;
    top: 80px;
}

.sidebar-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.sidebar-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-search-form {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.sidebar-search-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 0;
    padding: 0.6rem 0.85rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--input-text);
    font-size: 0.9rem;
    font-family: inherit;
}

.sidebar-search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.sidebar-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.sidebar-search-btn:hover {
    background: var(--accent-hover);
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-list-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.sidebar-list-item:last-child {
    border-bottom: none;
}

.sidebar-list-item a {
    color: var(--text-color);
    text-decoration: none;
    line-height: 1.4;
    display: block;
    transition: color 0.2s ease;
}

.sidebar-list-item a:hover {
    color: var(--accent);
}

/* ===== Blog Feed (full entries) ===== */
.blog-feed {
    max-width: 800px;
    margin: 0;
}

.blog-entry {
    margin-bottom: 3.5rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
}

.blog-entry:last-child {
    border-bottom: none;
}

.blog-entry-header {
    margin-bottom: 1.5rem;
}

.blog-entry-category {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.blog-entry-title {
    font-size: 2rem;
    line-height: 1.25;
    margin-bottom: 0.6rem;
}

.blog-entry-title a {
    color: var(--text-color);
}

.blog-entry-title a:hover {
    color: var(--link-hover);
}

.blog-entry-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-faint);
}

.blog-entry-meta .meta-sep {
    color: var(--text-faint);
}

.blog-entry-featured {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    max-height: 500px;
    object-fit: cover;
}

.blog-entry-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-color);
}

.blog-entry-content p {
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
}

.blog-entry-content h2,
.blog-entry-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-entry-content img {
    display: block;
    margin: 1.5rem 0;
    max-width: 100%;
    border-radius: 8px;
}

.blog-entry-content img[style*="float: left"] {
    margin: 0.5rem 1.5rem 1rem 0;
}

.blog-entry-content img[style*="float: right"] {
    margin: 0.5rem 0 1rem 1.5rem;
}

.blog-entry-content video {
    width: 100%;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.blog-entry-content audio {
    width: 100%;
    margin: 1.5rem 0;
}

.blog-entry-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-muted);
}

.blog-entry-content a {
    color: var(--link-color);
    text-decoration: underline;
}

.blog-entry-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.blog-entry-link {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-entry-link:hover {
    color: var(--accent-hover);
}

/* ===== Post List / Cards (deprecated, kept for reference) ===== */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.post-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px var(--shadow);
}

.post-card-featured {
    height: 180px;
    background-size: cover;
    background-position: center;
}

.post-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.post-card-title {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.post-card-title a {
    color: var(--text-color);
}

.post-card-title a:hover {
    color: var(--link-hover);
}

.post-card-excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-faint);
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.post-card-meta .meta-sep {
    color: var(--text-faint);
}

/* ===== Post Detail ===== */
.post-detail {
    max-width: 760px;
    margin: 0;
}

.post-detail-header {
    margin-bottom: 2rem;
}

.post-detail-category {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.post-detail-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.post-detail-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.post-detail-meta .meta-sep {
    color: var(--text-faint);
}

.post-detail-featured {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 2rem;
    max-height: 500px;
    object-fit: cover;
}

.post-detail-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-color);
}

.post-detail-content p {
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
}

.post-detail-content h2,
.post-detail-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-detail-content img {
    display: block;
    border-radius: 8px;
    margin: 1.5rem 0;
    max-width: 100%;
}

.post-detail-content img[style*="float: left"] {
    margin: 0.5rem 1.5rem 1rem 0;
}

.post-detail-content img[style*="float: right"] {
    margin: 0.5rem 0 1rem 1.5rem;
}

.post-detail-content video {
    width: 100%;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.post-detail-content audio {
    width: 100%;
    margin: 1.5rem 0;
}

.post-detail-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-muted);
}

.post-detail-content pre {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.9rem;
}

.post-detail-content a {
    color: var(--link-color);
    text-decoration: underline;
}

/* ===== Author/Category Lists ===== */
.list-page {
    max-width: 760px;
    margin: 0;
}

.list-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.list-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.list-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.list-item {
    display: block;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: padding-left 0.2s ease;
}

.list-item:hover {
    padding-left: 0.75rem;
}

.list-item-title {
    font-size: 1.3rem;
    margin-bottom: 0.4rem;
}

.list-item-title a {
    color: var(--text-color);
}

.list-item-title a:hover {
    color: var(--link-hover);
}

.list-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-faint);
}

.list-item-meta .meta-sep {
    color: var(--text-faint);
}

/* ===== Forms ===== */
.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--input-text);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(140, 38, 40, 0.15);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a7d75' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

.form-textarea {
    min-height: 200px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--btn-bg);
    color: var(--btn-text);
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn:hover {
    background: var(--btn-hover-bg);
    color: var(--btn-text);
}

.btn:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: var(--bg-surface-alt);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    color: var(--text-color);
}

.btn-danger {
    background: #a02828;
}

.btn-danger:hover {
    background: #8a2020;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.825rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.5rem;
}

/* ===== Alerts ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(34, 139, 34, 0.15);
    border: 1px solid rgba(34, 139, 34, 0.3);
    color: #6abf6a;
}

.alert-error {
    background: rgba(180, 30, 30, 0.15);
    border: 1px solid rgba(180, 30, 30, 0.3);
    color: #e07070;
}

/* ===== Login Page ===== */
.login-container {
    max-width: 420px;
    margin: 2rem 0;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 8px 30px var(--shadow);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* ===== Static Page Content ===== */
.page-content {
    max-width: 760px;
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.85;
}

.page-content h2 {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.page-content h3 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.page-content p {
    margin-bottom: 1.25rem;
}

.page-content ul, .page-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

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

/* ===== Footer ===== */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--footer-text);
    font-size: 0.9rem;
}

.footer-logo {
    height: 32px;
    width: auto;
    border-radius: 3px;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--footer-text);
    font-size: 0.85rem;
}

.footer-nav a:hover {
    color: #e8e0d4;
}

.footer-credit {
    font-size: 0.85rem;
}

.footer-credit a {
    color: var(--accent-light);
    font-weight: 500;
}

.footer-credit a:hover {
    color: var(--accent-hover);
}

/* ===== Cookie Banner ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--topbar-bg);
    border-top: 1px solid var(--topbar-border);
    padding: 1rem 1.5rem;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-banner-text {
    color: var(--footer-text);
    font-size: 0.85rem;
    line-height: 1.5;
}

.cookie-banner-text a {
    color: var(--accent-light);
    text-decoration: underline;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}

.cookie-btn-accept {
    background: var(--accent);
    color: #fff;
}

.cookie-btn-accept:hover {
    background: var(--accent-hover);
}

.cookie-btn-decline {
    background: transparent;
    color: var(--footer-text);
    border: 1px solid var(--topbar-border);
}

.cookie-btn-decline:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.2s ease;
}

.pagination a:hover {
    background: var(--bg-elevated);
}

.pagination .current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ===== Admin Panel ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: var(--topbar-bg);
    color: var(--topbar-text);
    padding: 1.5rem 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 100;
}

.admin-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--topbar-border);
}

.admin-sidebar-brand img {
    height: 32px;
    border-radius: 4px;
}

.admin-sidebar-brand span {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--topbar-text);
}

.admin-nav {
    list-style: none;
    padding: 1rem 0;
}

.admin-nav li {
    margin: 0;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.5rem;
    color: var(--footer-text);
    font-size: 0.875rem;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255, 255, 255, 0.06);
    color: var(--topbar-text);
}

.admin-nav a.active {
    border-left: 3px solid var(--accent);
}

.admin-main {
    flex: 1;
    margin-left: 240px;
    padding: 2rem 2.5rem;
    background: var(--bg-color);
    min-height: 100vh;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header h1 {
    font-size: 1.8rem;
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-user-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Admin Tables ===== */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow);
}

.admin-table th,
.admin-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--bg-surface-alt);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background: var(--bg-surface-alt);
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-published {
    background: rgba(34, 139, 34, 0.15);
    color: #6abf6a;
}

.status-draft {
    background: rgba(200, 160, 50, 0.15);
    color: #d4a83a;
}

/* ===== Admin Cards ===== */
.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
}

.admin-stat-card .stat-number {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
}

.admin-stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ===== Media Grid (Admin) ===== */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.media-item {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.media-item:hover .media-item-overlay {
    opacity: 1;
}

.media-item-overlay a {
    color: #fff;
    font-size: 0.8rem;
    margin: 0 0.25rem;
}

/* ===== Toolbar ===== */
.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-search {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

/* ===== Editor ===== */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.5rem;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.editor-toolbar button {
    padding: 0.35rem 0.6rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
}

.editor-toolbar button:hover {
    background: var(--bg-elevated);
}

.editor-textarea {
    border-radius: 0 0 6px 6px;
    border-top: none;
    min-height: 600px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

/* ===== Wider editor page ===== */
.admin-main.editor-page {
    padding: 1rem 1.5rem;
}

.admin-main.editor-page .editor-form {
    max-width: 100%;
}

.admin-main.editor-page .form-control {
    max-width: 100%;
}

/* ===== Author link ===== */
.post-author-link {
    color: inherit;
    text-decoration: none;
}
.post-author-link:hover {
    text-decoration: underline;
}

/* ===== TinyMCE custom styles ===== */
.tox-tinymce {
    border-radius: 0 0 6px 6px !important;
    border: 1px solid var(--border-color) !important;
}

/* ===== Responsive ===== */
@media (max-width: 968px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .topbar-nav {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--topbar-bg);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 0;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .topbar-nav.open {
        transform: translateX(0);
    }

    .nav-link {
        padding: 0.85rem 1rem;
        width: 100%;
        text-align: left;
        border-radius: 0;
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .nav-dropdown-menu.open {
        display: block;
    }

    .nav-dropdown-wide {
        max-height: 300px;
    }

    .nav-toggle {
        display: flex;
    }

    .page-header {
        height: 250px;
        padding: 0 1rem;
    }

    .page-header-logo-wrap {
        display: none;
    }

    .page-header-logo {
        width: clamp(45px, 14vw, 68px);
    }

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

    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .page-header-content {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .content-sidebar {
        position: static;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

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

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .cookie-banner-inner {
        flex-direction: column;
        text-align: center;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .topbar-brand-text {
        display: none;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .page-header {
        height: 200px;
    }

    .page-header-title {
        font-size: 1.6rem;
    }
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 1rem; }
.w-100 { width: 100%; }

/* ===== Post Navigation (Entrada anterior/siguiente) ===== */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 3rem;
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border-color, #333);
}

.post-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    background: var(--card-bg, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color, #333);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s, border-color 0.2s;
}

.post-nav-link:hover {
    background: var(--card-bg-hover, rgba(255,255,255,0.06));
    border-color: var(--accent-color, #c9a84c);
    text-decoration: none;
}

.post-nav-link.post-nav-disabled {
    opacity: 0.35;
    pointer-events: none;
}

.post-nav-prev {
    text-align: left;
}

.post-nav-next {
    text-align: right;
    margin-left: auto;
}

@media (max-width: 640px) {
    .post-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    .post-nav-next {
        margin-left: 0;
    }
}

/* ===== Mini share buttons (Facebook / Instagram) ===== */
.fp-share {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.fp-share-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
}

.fp-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.fp-share-btn svg {
    width: 15px;
    height: 15px;
    display: block;
}

.fp-share-btn:hover {
    color: #fff;
}

.fp-share-fb:hover {
    background: #1877F2;
    border-color: #1877F2;
}

.fp-share-ig:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-color: transparent;
}

.fp-share-copied {
    border-color: var(--accent);
    color: var(--accent);
}

.footer-share {
    display: flex;
    align-items: center;
}

.footer-share .fp-share-label {
    color: var(--footer-text);
}

@media (max-width: 640px) {
    .blog-entry-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}
