/* ============================================
   TEMPLATE ARTICLE PAGE - template.php
   ============================================ */

.template-page {
    max-width: 720px;
    padding-bottom: 4rem;
}

.template-gallery {
    margin-bottom: 1.5rem;
}
.template-gallery-main {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: cover;
    border-radius: 16px;
    display: block;
}
.template-gallery-thumbs {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.75rem;
    overflow-x: auto;
}
.template-gallery-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: border-color 0.15s ease;
}
.template-gallery-thumb.is-active,
.template-gallery-thumb:hover {
    border-color: var(--primary, #00A878);
}

.template-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-dark, #0F172A);
}
.template-subtitle {
    color: var(--text-muted, #64748B);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.template-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    background: var(--gradient-primary, linear-gradient(135deg, #00A878 0%, #34D399 100%));
    color: #fff;
    font-weight: 700;
    font-size: 0.98rem;
    border-radius: 999px;
    text-decoration: none;
    margin: 0.5rem 0 1.5rem;
    box-shadow: 0 8px 20px -6px rgba(0, 168, 120, 0.4);
}

.template-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.template-tag-pill {
    padding: 0.35rem 0.85rem;
    background: var(--bg-surface, #F1F5F2);
    color: var(--primary-dark, #065F46);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.template-share-row {
    margin-bottom: 2rem;
}
.template-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    background: var(--bg-surface, #F1F5F2);
    border: none;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark, #0F172A);
    cursor: pointer;
}

/* Article content - matches what Quill's own toolbar can produce */
.template-article {
    color: var(--text-dark, #0F172A);
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 2rem;
}
.template-article h1,
.template-article h2,
.template-article h3,
.template-article h4 {
    font-weight: 800;
    margin: 1.75rem 0 0.75rem;
    color: var(--text-dark, #0F172A);
}
.template-article p {
    margin-bottom: 1.1rem;
}
.template-article ul,
.template-article ol {
    margin: 0 0 1.1rem 1.4rem;
}
.template-article li {
    margin-bottom: 0.4rem;
}
.template-article img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1rem 0;
}
.template-article blockquote {
    border-left: 4px solid var(--primary, #00A878);
    padding-left: 1rem;
    margin: 1.25rem 0;
    color: var(--text-muted, #64748B);
    font-style: italic;
}
.template-article a {
    color: var(--primary, #00A878);
    font-weight: 700;
}

.template-related {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border, #E2E8E4);
}
.template-related h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

/* ============================================
   ARTICLE CARD - WordPress-style layout
   ============================================ */
.acard {
    display: flex;
    flex-direction: column;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #E2E8E4);
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.acard:hover {
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.acard__media-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.acard__media {
    width: 100%;
    aspect-ratio: 5 / 3;
    overflow: hidden;
    background: var(--bg-surface, #F1F5F2);
}
.acard__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.acard__body {
    padding: 1rem 1.1rem 0.5rem;
}
.acard__title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-dark, #0F172A);
    margin: 0 0 0.4rem;
    line-height: 1.4;
}
.acard__desc {
    font-size: 0.85rem;
    color: var(--text-muted, #64748B);
    line-height: 1.5;
    margin: 0;
}

.acard__footer {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.1rem 1rem;
    margin-top: auto;
}
.acard__category {
    padding: 0.25rem 0.7rem;
    background: var(--primary-light, #D1FAE5);
    color: var(--primary-dark, #065F46);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}
.acard__share {
    background: none;
    border: none;
    color: var(--text-muted, #64748B);
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
}
.acard__author {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted, #64748B);
    font-weight: 600;
}
