/* Reset & base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Castoro Titling', Georgia, serif; color: #222; line-height: 1.6; background: #fafafa; }
a { color: #111; text-decoration: none; }
header, footer { text-align: center; padding: 1em; background: #fff; border-bottom: 1px solid #ddd; }
footer { border-top: 1px solid #ddd; font-size: 0.9em; }

/* Header */
header h1 { font-size: 3em; margin-bottom: 0.2em; }
nav { margin-bottom: 0.5em; }
nav a { margin: 0 0.8em; font-weight: bold; }
.search { display: inline-block; margin-left: 1em; }
.search input { padding: 0.3em; font-size: 1em; }
.search button { padding: 0.3em; }

/* Featured layout */
.featured-layout {
    display: grid;
    grid-template-columns: 1fr 2.6fr 1fr;
    gap: 1em;
    margin: 1em;
}

.featured-layout .hero { padding: 1em; background: #fff; border: 1px solid #ddd; border-radius: 4px; }
.featured-layout .side { display: flex; flex-direction: column; gap: 1em; }
.featured-layout .side-post { padding: 1em; background: #fff; border: 1px solid #ddd; border-radius: 4px; }
.featured-layout .hero .thumb { padding-top: 40%; }
.side-post .thumb { padding-top: 20%; }

/* Posts grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1em;
    padding: 1em;
}

.post-card {
    background: #fff;
    padding: 1em;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.post-card h2 { font-size: 1.4em; margin-bottom: 0.4em; }
.post-card h3 { font-size: 1.1em; margin: 0.5em 0; }
.post-card .category, .featured-layout .category { font-size: 0.75em; font-weight: bold; margin-bottom: 0.3em; color: #555; }
.post-card .meta { font-size: 0.85em; color: #555; margin-bottom: 0.6em; }
.read-more { font-weight: bold; color: #0077cc; }
.post-card .author, .post-full .author { font-style: italic; color: #555; margin-bottom: 0.5em; }

/* Thumbnail */
.post-card .thumb {
    width: 100%;
    padding-top: 60%;
    position: relative;
    overflow: hidden;
    margin-bottom: 0.5em;
}
.post-card .thumb img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: auto;
    height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    object-position: var(--pos-x, 50%) var(--pos-y, 50%);
}

/* Full post view */
.post-full {
    max-width: 800px;
    margin: 2em auto;
    background: #fff;
    padding: 1.5em;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.post-full h2 { margin-bottom: 0.5em; }
.post-full .meta { font-size: 0.9em; color: #555; margin-bottom: 1em; }
.post-full .content { white-space: pre-wrap; }
.post-full img {
    display: block;
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    margin: 1em auto;
}

/* Admin */
.admin-wrap { max-width: 800px; margin: 2em auto; }
.admin-wrap h1 { margin-bottom: 1em; }
.admin-wrap table { width: 100%; border-collapse: collapse; margin-bottom: 1em; }
.admin-wrap th, .admin-wrap td { border: 1px solid #ddd; padding: 0.5em; text-align: left; }
.admin-wrap th { background: #f4f4f4; }
.admin-wrap a.button {
    display: inline-block;
    padding: 0.4em 0.8em;
    margin: 0.2em;
    background: #0077cc;
    color: #fff;
    border-radius: 3px;
}
.admin-wrap form input[type="text"],
.admin-wrap form textarea,
.admin-wrap form select {
    width: 100%;
    padding: 0.5em;
    margin-bottom: 0.8em;
    border: 1px solid #ccc;
    border-radius: 3px;
}
.admin-wrap form button {
    padding: 0.6em 1em;
    background: #0077cc;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .featured-layout {
        grid-template-columns: 1fr;
    }
    .posts-grid {
        grid-template-columns: 1fr;
    }
    .featured-layout .hero,
    .featured-layout .side-post,
    .post-card {
        width: 100%;
    }
    .featured-layout .hero {
        order: -1;
    }
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1em;
    padding: 1em;
}
.gallery-item img {
    width: 100%;
    height: auto;
}

/* Hero Section */
.hero-gallery {
    display: flex;
    gap: 1em;
    overflow-x: auto;
    padding: 1em;
}
.hero-gallery img {
    height: 200px;
    object-fit: cover;
}
.hero-video iframe {
    width: 100%;
    max-width: 800px;
    height: 450px;
    margin: 1em auto;
    display: block;
}
.hero-custom {
    padding: 1em;
    background: #eef;
    text-align: center;
    margin: 1em;
}

/* Author Profiles */
.author-profile {
    max-width: 800px;
    margin: 2em auto;
    text-align: center;
}
.author-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
}
.author-bio {
    margin-top: 1em;
    font-size: 1.1em;
    line-height: 1.4;
}
.post-list {
    list-style: none;
    padding: 0;
}
.post-list li {
    margin-bottom: 1em;
}
