/* Reset and Variables */
:root {
    --bg-color: #f2f7fb;
    --text-main: #333333;
    --text-muted: #777777;
    --white: #ffffff;
    --accent-red: #ef8d8d;
    --tag-bg: rgba(239, 141, 141, 0.9);
    --border-color: #eaeaea;
    --ticker-bg: #f9f9f9;
    --ticker-label: #888888;
    --font-main: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-red);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Sprite Icons */
.sprite-icon {
    background-image: url('ui-icons.webp');
    background-size: 400% 100%;
    display: inline-block;
}
.icon-menu { width: 24px; height: 24px; background-position: 0 0; }
.icon-chevron-up { width: 16px; height: 16px; background-position: -33.33% 0; }
.icon-pause { width: 16px; height: 16px; background-position: -66.66% 0; }
.icon-chevron-down { width: 16px; height: 16px; background-position: -100% 0; }

/* Header */
.site-header {
    background-color: var(--white);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 40px;
}

.main-nav .nav-list {
    list-style: none;
    display: flex;
    gap: 25px;
}

.main-nav .nav-list a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

/* Ticker Bar */
.ticker-bar {
    background-color: var(--ticker-bg);
    padding: 15px 0;
    margin-bottom: 30px;
}

.ticker-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ticker-label {
    background-color: var(--ticker-label);
    color: var(--white);
    padding: 5px 15px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.ticker-content {
    flex-grow: 1;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticker-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 10px;
}

.ticker-controls {
    display: flex;
    gap: 5px;
}

.ticker-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

/* Common Grid & Post Styles */
.image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 10px;
}

.image-wrapper img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.grid-item:hover .image-wrapper img, 
.featured-card:hover .image-wrapper img {
    transform: scale(1.05);
}

.category-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--tag-bg);
    color: var(--white);
    font-size: 0.7rem;
    padding: 3px 8px;
    font-weight: 600;
    z-index: 1;
    border-radius: 2px;
}

.post-title {
    font-size: 1rem;
    margin-bottom: 5px;
    line-height: 1.3;
    color: var(--text-main);
}

.post-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Top Grid (5 items) */
.top-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* Featured Split */
.featured-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 50px;
}

.featured-card .image-wrapper.large img {
    aspect-ratio: 16/9;
}

.featured-card .post-title.large {
    font-size: 1.8rem;
    margin: 15px 0 10px;
}

.featured-card .post-excerpt {
    color: var(--text-muted);
    font-size: 1rem;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.list-item {
    display: flex;
    gap: 15px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

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

.list-item img {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

.list-info {
    flex-grow: 1;
}

.post-title.small {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

/* Latest Posts */
.latest-posts-section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-red);
}

.latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.card {
    background-color: var(--white);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
}

.card-header {
    text-align: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
}

.card-body {
    padding: 25px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.card-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 15px;
}

.card-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
    flex-grow: 1;
}

/* Welcome Section */
.welcome-section {
    background-color: var(--white);
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.welcome-section h2 {
    margin-bottom: 15px;
    color: var(--text-main);
}

.welcome-section p {
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto;
}

/* Footer */
.site-footer {
    background-color: var(--accent-red);
    color: var(--white);
    text-align: center;
    padding: 30px 0;
    margin-top: auto;
}

.site-footer .copyright {
    font-weight: 600;
    margin-bottom: 10px;
}

.site-footer .disclaimer {
    font-size: 0.8rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

/* Cookie Modal */
.cookie-modal {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 300px;
    background-color: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 1000;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 4px solid var(--accent-red);
}

.cookie-modal.show {
    transform: translateX(0);
}

.cookie-modal h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.cookie-modal p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.4;
}

.btn-accept {
    background-color: var(--accent-red);
    color: var(--white);
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: background-color 0.3s;
}

.btn-accept:hover {
    background-color: #d87070;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .top-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .top-grid .grid-item:nth-child(4), 
    .top-grid .grid-item:nth-child(5) {
        display: none; /* Hide last two on medium screens for symmetry if desired, or let wrap */
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
    }
    .main-nav .nav-list {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 10px;
        padding-top: 15px;
        text-align: center;
    }
    .main-nav .nav-list.active {
        display: flex;
    }
    .mobile-menu-toggle {
        display: block;
    }
    .ticker-container {
        flex-direction: column;
        text-align: center;
    }
    .top-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .top-grid .grid-item:nth-child(4), 
    .top-grid .grid-item:nth-child(5) {
        display: block; /* Show them back on wrap */
    }
    .featured-split {
        grid-template-columns: 1fr;
    }
    .cookie-modal {
        bottom: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        border-left: none;
        border-top: 4px solid var(--accent-red);
    }
}

@media (max-width: 480px) {
    .top-grid {
        grid-template-columns: 1fr;
    }
    .latest-grid {
        grid-template-columns: 1fr;
    }
}
/* Inner page styles */

/* === NEW STYLES FOR INTERNAL PAGE === */

/* Article Layout */
.article-container {
    max-width: 900px;
    margin: 0 auto 50px;
    padding: 0 20px;
}

.post-header {
    text-align: center;
    margin-bottom: 30px;
}

.inline-tag {
    position: static;
    display: inline-block;
    margin-bottom: 15px;
}

.post-header h1 {
    font-size: 2.8rem;
    color: var(--text-main);
    margin-bottom: 15px;
    line-height: 1.2;
    font-weight: 700;
}

.post-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Image Styling */
.main-image-wrapper {
    margin-bottom: 40px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.main-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 16/9;
}

.content-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 40px 0;
    display: block;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

/* Typography within Content */
.post-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-main);
    margin-bottom: 60px;
}

.post-content p {
    margin-bottom: 25px;
}

.post-content span {
    color: var(--accent-red);
    font-weight: 600;
    background-color: rgba(239, 141, 141, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.post-content h2 {
    font-size: 2rem;
    margin: 50px 0 25px;
    color: var(--text-main);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.post-content h3 {
    font-size: 1.6rem;
    margin: 40px 0 20px;
    color: var(--text-main);
}

.post-content h4, 
.post-content h5, 
.post-content h6 {
    font-size: 1.3rem;
    margin: 30px 0 15px;
    color: var(--text-main);
    font-weight: 600;
}

/* Table of Contents */
.toc {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    border-left: 5px solid var(--accent-red);
}

.toc-title {
    font-size: 1.3rem !important;
    font-weight: 700;
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    border: none !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toc ul {
    list-style-type: none !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
}

.toc ul li {
    margin-bottom: 12px !important;
    padding-left: 0 !important;
}

.toc ul li::before {
    content: none !important;
}

.toc ul li a {
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px dashed transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.toc ul li a:hover {
    color: var(--accent-red);
    border-bottom-color: var(--accent-red);
}

/* Lists (ul, ol) */
.post-content ul, 
.post-content ol {
    margin-bottom: 30px;
    padding-left: 20px;
}

.post-content ul {
    list-style-type: none;
}

.post-content ul li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
}

.post-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 8px;
    height: 8px;
    background-color: var(--accent-red);
    border-radius: 50%;
}

.post-content ol li {
    margin-bottom: 12px;
    padding-left: 10px;
}

.post-content ol li::marker {
    color: var(--accent-red);
    font-weight: 700;
}

/* Tables */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 40px 0;
    background-color: var(--white);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border-radius: 8px;
    overflow: hidden;
}

.post-content th, 
.post-content td {
    padding: 18px 20px;
    border: 1px solid var(--border-color);
    text-align: left;
    font-size: 1rem;
}

.post-content th {
    background-color: var(--ticker-bg);
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.post-content tr:nth-child(even) {
    background-color: #fcfcfc;
}

/* Forms (Comments / Contact) */
.form-section {
    background-color: var(--white);
    padding: 40px;
    border-radius: 8px;
    margin-bottom: 60px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border-top: 5px solid var(--accent-red);
}

.form-title {
    font-size: 1.6rem;
    margin-bottom: 30px;
    color: var(--text-main);
}

.custom-form .form-row {
    display: flex;
    gap: 25px;
    margin-bottom: 25px;
}

.custom-form .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 25px;
}

.custom-form .form-row .form-group {
    margin-bottom: 0;
}

.custom-form .form-label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-main);
}

.custom-form .form-control {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
    width: 100%;
}

.custom-form .form-control:focus {
    outline: none;
    border-color: var(--accent-red);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(239, 141, 141, 0.2);
}

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

.custom-form .btn-submit {
    background-color: var(--accent-red);
    color: var(--white);
    border: none;
    padding: 15px 35px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block;
}

.custom-form .btn-submit:hover {
    background-color: #e57474;
}

/* Related Posts Section */
.related-posts-section {
    margin-top: 20px;
}

/* Responsive Design for Internal Page */
@media (max-width: 992px) {
    .post-header h1 {
        font-size: 2.3rem;
    }
}

@media (max-width: 768px) {
    .post-header h1 {
        font-size: 1.8rem;
    }
    .post-content {
        font-size: 1.05rem;
    }
    .custom-form .form-row {
        flex-direction: column;
        gap: 0;
    }
    .custom-form .form-row .form-group {
        margin-bottom: 25px;
    }
    .form-section {
        padding: 25px;
    }
    .toc {
        padding: 20px;
    }
    .post-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
