:root {
    --navy: #0A192F;
    --navy-light: #112240;
    --navy-mid: #0D1F3C;
    --gold: #D4AF37;
    --gold-light: #F3E5AB;
    --gold-dim: rgba(212, 175, 55, 0.15);
    --gold-border: rgba(212, 175, 55, 0.25);
    --text-primary: #CCD6F6;
    --text-secondary: #8892B0;
    --text-white: #E6F1FF;
    --danger: #E74C3C;
    --success: #2ECC71;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.4);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--navy);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

/* ========== HEADER ========== */
.site-header {
    background: linear-gradient(180deg, var(--navy-light) 0%, var(--navy) 100%);
    border-bottom: 1px solid var(--gold-border);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: -0.3px;
}

.site-logo .logo-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav a {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
}

.header-nav a:hover { color: var(--gold); }

.rss-link {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========== HERO SECTION ========== */
.hero {
    text-align: center;
    padding: 64px 24px 40px;
    background: radial-gradient(ellipse at center top, rgba(212, 175, 55, 0.06) 0%, transparent 70%);
}

.hero h1 {
    color: var(--text-white);
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 32px;
}

/* ========== SEARCH BAR ========== */
.search-container {
    max-width: 640px;
    margin: 0 auto 24px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background: var(--navy-light);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    color: var(--text-white);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input::placeholder { color: var(--text-secondary); }
.search-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
    pointer-events: none;
}

/* ========== TAG FILTERS ========== */
.tag-filters {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tag-pill {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--gold-border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.tag-pill:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-dim);
}

.tag-pill.active {
    border-color: var(--gold);
    background: var(--gold);
    color: var(--navy);
    font-weight: 600;
}

/* ========== POST GRID ========== */
.posts-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
}

.post-card {
    background: var(--navy-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gold-border);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--gold);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform var(--transition);
}

.post-card:hover .card-image {
    transform: scale(1.03);
}

.card-image-wrapper {
    overflow: hidden;
    position: relative;
}

.card-reading-time {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(8px);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title {
    color: var(--text-white);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 10px;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.card-tag {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    background: var(--gold-dim);
    color: var(--gold);
    font-weight: 500;
}

/* ========== STAR RATINGS ========== */
.stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.stars .star {
    color: var(--gold-border);
    font-size: 1rem;
    transition: color var(--transition);
}

.stars .star.filled { color: var(--gold); }
.stars .star.half { color: var(--gold); opacity: 0.6; }

.rating-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 6px;
}

/* Interactive stars on post page */
.star-rating-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px;
    background: var(--navy-light);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    margin: 32px 0;
}

.star-rating-widget h3 {
    color: var(--text-white);
    font-size: 1.1rem;
    font-weight: 600;
}

.interactive-stars {
    display: flex;
    gap: 6px;
}

.interactive-stars .star-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2rem;
    color: var(--gold-border);
    transition: color var(--transition), transform var(--transition);
    padding: 2px;
}

.interactive-stars .star-btn:hover { transform: scale(1.15); }
.interactive-stars .star-btn.filled { color: var(--gold); }
.interactive-stars .star-btn.hovered { color: var(--gold-light); }

.rating-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.rating-info .avg {
    color: var(--gold);
    font-weight: 600;
    font-size: 1.1rem;
}

.rating-feedback {
    font-size: 0.85rem;
    color: var(--success);
    opacity: 0;
    transition: opacity var(--transition);
}

.rating-feedback.show { opacity: 1; }

/* ========== SOCIAL SHARING ========== */
.share-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
    flex-wrap: wrap;
}

.share-bar .share-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid var(--gold-border);
    background: var(--navy-light);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
}

.share-btn:hover {
    border-color: var(--gold);
    background: var(--gold-dim);
    color: var(--gold);
}

.share-btn.copied {
    border-color: var(--success);
    color: var(--success);
}

/* ========== POST VIEWER ========== */
.post-viewer {
    max-width: 880px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.post-viewer-header {
    margin-bottom: 32px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    transition: color var(--transition);
}

.back-link:hover { color: var(--gold); }

.post-viewer-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.post-viewer-title {
    color: var(--gold);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.3px;
}

.post-content-frame {
    border: none;
    width: 100%;
    min-height: 600px;
    background: transparent;
}

.blog-content-embed {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gold-border);
    margin-bottom: 24px;
}

/* Inline embedded blog content styling */
.blog-content-inner {
    padding: 0;
    overflow: hidden;
}

/* Constrain ALL images inside embedded blog content */
.blog-content-inner img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

/* Hero images specifically */
.blog-content-inner .hero-image,
.blog-content-inner img:first-of-type {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

/* Ensure embedded blog styles do not bleed out */
.blog-content-inner header {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.blog-content-inner footer {
    display: none; /* Hide the embedded blog's own footer */
}

/* ========== RELATED POSTS ========== */
.related-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--gold-border);
}

.related-section h3 {
    color: var(--text-white);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.related-card {
    background: var(--navy-light);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--gold-border);
    transition: border-color var(--transition), transform var(--transition);
    cursor: pointer;
}

.related-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.related-card .related-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.related-card .related-title {
    color: var(--text-white);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

/* ========== LOADING ========== */
.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gold-border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.load-more-container {
    text-align: center;
    padding: 40px 0;
}

.load-more-btn {
    padding: 12px 32px;
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: var(--radius-md);
    color: var(--gold);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

.load-more-btn:hover {
    background: var(--gold);
    color: var(--navy);
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 80px 24px;
}

.empty-state h3 {
    color: var(--text-white);
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ========== SUBSCRIBE SECTION ========== */
.subscribe-section {
    max-width: 680px;
    margin: 0 auto 20px;
    padding: 0 24px;
}

.subscribe-inner {
    background: var(--navy-light);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
}

.subscribe-inner h2 {
    color: var(--gold);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.subscribe-inner p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.subscribe-form {
    display: flex;
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
}

.subscribe-input {
    flex: 1;
    padding: 13px 18px;
    background: var(--navy);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-md);
    color: var(--text-white);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.subscribe-input::placeholder {
    color: var(--text-secondary);
}

.subscribe-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.subscribe-btn {
    white-space: nowrap;
    padding: 13px 24px;
    font-size: 0.95rem;
    font-weight: 600;
}

.subscribe-feedback {
    margin-top: 16px;
    font-size: 0.9rem;
    min-height: 1.4em;
    transition: opacity 0.3s ease;
}

.subscribe-feedback.success {
    color: var(--success);
}

.subscribe-feedback.error {
    color: var(--danger);
}

@media (max-width: 480px) {
    .subscribe-form {
        flex-direction: column;
    }
    .subscribe-inner {
        padding: 28px 20px;
    }
}

/* ========== FOOTER ========== */
.site-footer {
    text-align: center;
    padding: 40px 24px;
    border-top: 1px solid var(--gold-border);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.site-footer a { color: var(--gold); }

/* ========== ADMIN STYLES ========== */
.admin-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.admin-header h1 {
    color: var(--text-white);
    font-size: 1.75rem;
}

.admin-section {
    background: var(--navy-light);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.admin-section h2 {
    color: var(--gold);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gold-border);
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.08);
    font-size: 0.9rem;
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: rgba(212, 175, 55, 0.03);
}

.btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
}

.btn-primary:hover { background: var(--gold-light); }

.btn-outline {
    background: transparent;
    border-color: var(--gold-border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.btn-danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
}

.admin-input {
    padding: 10px 14px;
    background: var(--navy);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-sm);
    color: var(--text-white);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
}

.admin-input:focus { border-color: var(--gold); }

.inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tag-manager-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.managed-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 500;
}

.managed-tag.assigned {
    background: var(--gold);
    color: var(--navy);
    cursor: pointer;
}

.managed-tag.unassigned {
    background: var(--gold-dim);
    color: var(--gold);
    border: 1px dashed var(--gold-border);
    cursor: pointer;
}

.managed-tag:hover { opacity: 0.8; }

/* Login page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-box {
    background: var(--navy-light);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 {
    color: var(--text-white);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.login-box p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.login-box .admin-input {
    width: 100%;
    margin-bottom: 16px;
}

.login-box .btn { width: 100%; }

.login-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 12px;
    display: none;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--navy-light);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h3 {
    color: var(--text-white);
    margin-bottom: 20px;
}

.modal-close {
    float: right;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover { color: var(--text-white); }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero { padding: 40px 16px 24px; }
    .posts-grid { grid-template-columns: 1fr; }
    .post-viewer-title { font-size: 1.6rem; }
    .header-inner { height: 60px; }
    .site-logo { font-size: 1.05rem; }
    .site-logo span { display: none; }
    .share-bar { gap: 8px; }
    .share-btn { padding: 8px 12px; font-size: 0.8rem; }
    .admin-table { font-size: 0.8rem; }
    .admin-table th, .admin-table td { padding: 8px 6px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.6rem; }
    .posts-grid { gap: 16px; }
    .card-title { font-size: 1.05rem; }
    .search-input { font-size: 0.9rem; padding: 12px 16px 12px 42px; }
}
