/* ==========================================================================
   AmbienteTech — Main Stylesheet
   Based on blogxo design with custom adaptations.
   ========================================================================== */

/* ---------- Custom Fonts ---------- */
@font-face {
    font-family: 'HomeVideo';
    src: url('../webfonts/HomeVideo-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'HomeVideo';
    src: url('../webfonts/HomeVideo-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'VT323';
    src: url('../fonts/vt323/VT323-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ---------- CSS Variables ---------- */
:root {
    --at-primary: #2563eb;
    --at-primary-dark: #1d4ed8;
    --at-text: #1a1a2e;
    --at-text-light: #555;
    --at-bg: #fafafa;
    --at-bg-alt: #f8f9fa;
    --at-border: #008bef;
    --at-card-bg: #ffffff;
    --at-box-radius: 15px;
    --at-radius: 8px;
    --at-radius-lg: 12px;
    --at-font-heading: 'Heebo', sans-serif;
    --at-font-body: 'Nunito', sans-serif;
    --at-transition: 0.3s ease;
}

/* ---------- Container Overrides ---------- */
@media (min-width: 576px) {
    .container-sm, .container { max-width: 540px; }
}
@media (min-width: 768px) {
    .container-md, .container-sm, .container { max-width: 720px; }
}
@media (min-width: 992px) {
    .container-lg, .container-md, .container-sm, .container { max-width: 960px; }
}
@media (min-width: 1200px) {
    .container-xl, .container-lg, .container-md, .container-sm, .container { max-width: 1270px; }
}
@media (min-width: 1400px) {
    .container-xxl, .container-xl, .container-lg, .container-md, .container-sm, .container { max-width: 1586px; }
}

/* ---------- Reset / Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

#page {
    overflow-x: hidden;
}

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
    font-family: var(--at-font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--at-text);
}

a {
    color: var(--at-primary);
    text-decoration: none;
    transition: color var(--at-transition);
}

a:hover {
    color: var(--at-primary-dark);
}

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

.img-fluid {
    border-radius: var(--at-radius);
}

/* ---------- Accessibility ---------- */
.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 9999;
    padding: 8px 16px;
    background: var(--at-primary);
    color: #fff;
}

.skip-link:focus {
    left: 10px;
    top: 10px;
}

a:focus-visible {
    outline: 2px solid var(--at-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

/* Top Bar (Breaking News) — background inherited from .at-header */
.at-topbar {
    color: #fff;
    padding: 6px 0;
    font-size: 0.85rem;
}

.at-breaking-news {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.at-breaking-title {
    background: var(--at-primary);
    color: #fff;
    padding: 2px 14px;
    border-radius: 4px;
    font-weight: 700;
    white-space: nowrap;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.at-breaking-slider {
    overflow: hidden;
    white-space: nowrap;
    flex: 1;
}

.at-breaking-slider a {
    color: #fff;
    margin-right: 40px;
    font-size: 0.85rem;
}

.at-breaking-slider a:hover {
    color: var(--at-primary);
}

.at-breaking-slider a i {
    margin-right: 6px;
    font-size: 0.7rem;
}

.at-topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

/* Header — 3 horizontal sections */
.at-header {
    background: var(--at-hf-bg);
    color: var(--at-hf-text);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Section 1: Social Icons */
.at-header-social {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.at-header-social .at-social-icons {
    justify-content: flex-start;
}

/* Section 2: Brand (search + name/desc + dark toggle) */
.at-header-brand {
    padding: 30px 0;
}

.at-header-brand-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    min-height: 70px;
}

.at-header-left,
.at-header-right {
    flex: 0 0 auto;
    z-index: 1;
}

.at-brand-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.at-brand-center .custom-logo-link {
    display: inline-block;
    margin-bottom: 4px;
}

.at-brand-center .custom-logo {
    max-height: 50px;
    width: auto;
}

/* Section 3: Menu */
.at-header-menu {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid var(--at-border);
}

.at-header-menu .navbar {
    padding: 0;
}

.at-header-menu .navbar-collapse {
    justify-content: center;
}

.site-title {
    margin: 0;
    font-size: 80px;
    font-weight: normal;
    font-family: 'VT323', var(--at-font-heading);
    line-height: 1.2;
    letter-spacing: 3px;
}

.site-title a {
    color: var(--at-hf-text);
}

.site-title a:hover {
    color: var(--at-primary);
}

/* Typing effect cursor */
.at-typing-cursor {
    font-weight: 100;
    color: var(--at-primary);
    animation: at-blink 0.7s step-end infinite;
}

@keyframes at-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.site-description {
    margin: 0;
    font-size: 1.15rem;
    font-family: 'VT323', var(--at-font-body);
    color: var(--at-hf-muted);
}

.navbar-nav .nav-link {
    font-family: 'VT323', var(--at-font-body);
    font-weight: 600;
    color: var(--at-hf-text);
    padding: 8px 16px !important;
    font-size: 1.50rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: color var(--at-transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-item.active > .nav-link {
    color: var(--at-primary);
}

.navbar-nav .dropdown-menu {
    border: none;
    box-shadow: var(--at-shadow);
    border-radius: var(--at-radius);
    padding: 8px 0;
}

.navbar-nav .dropdown-item {
    font-size: 0.9rem;
    padding: 6px 20px;
}

.navbar-nav .dropdown-item:hover {
    background: var(--at-bg-alt);
    color: var(--at-primary);
}

/* Animated hamburger → X toggler (based on blogxo/blogarise) */
.navbar-toggler.x {
    border: none;
    padding: 5px;
}

.navbar-toggler.x:focus {
    outline: none;
    box-shadow: none;
}

.navbar-toggler.x .icon-bar {
    width: 22px;
    display: block;
    height: 2px;
    background-color: var(--at-hf-text);
    transition: all 0.2s;
}

.navbar-toggler.x .icon-bar + .icon-bar {
    margin-top: 4px;
}

/* Closed state (3 lines) */
.navbar-toggler.x .icon-bar:nth-of-type(1) {
    transform: rotate(0);
}

.navbar-toggler.x .icon-bar:nth-of-type(2) {
    opacity: 1;
}

.navbar-toggler.x .icon-bar:nth-of-type(3) {
    transform: rotate(0);
}

/* Open state (X) */
.navbar-toggler.x[aria-expanded="true"] .icon-bar:nth-of-type(1) {
    transform: rotate(45deg);
    transform-origin: 10% 10%;
}

.navbar-toggler.x[aria-expanded="true"] .icon-bar:nth-of-type(2) {
    opacity: 0;
}

.navbar-toggler.x[aria-expanded="true"] .icon-bar:nth-of-type(3) {
    transform: rotate(-45deg);
    transform-origin: 10% 90%;
}

.at-search-toggle {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--at-hf-text);
    cursor: pointer;
    padding: 4px 8px;
    transition: color var(--at-transition);
}

.at-search-toggle:hover {
    color: var(--at-primary);
}

/* ---------- Social Icons ---------- */
.at-social-icons {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.at-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    transition: transform var(--at-transition), filter var(--at-transition);
}

.at-social-icon svg {
    width: 30px;
    height: 30px;
    border-radius: 6px;
}

.at-social-icon:hover {
    transform: scale(1.15);
    filter: brightness(1.15);
}

/* Dark mode toggle */
.at-dark-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.at-dark-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.at-toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    transition: var(--at-transition);
}

.at-toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: var(--at-transition);
}

.at-dark-toggle input:checked + .at-toggle-slider {
    background: var(--at-primary);
}

.at-dark-toggle input:checked + .at-toggle-slider::before {
    transform: translateX(20px);
}

/* ==========================================================================
   FEATURED AREA — CAROUSEL
   ========================================================================== */

.at-featured-area {
    padding: 40px 0 20px;
}

.at-carousel {
    border-radius: var(--at-radius-lg);
    overflow: hidden;
}

.at-slide {
    position: relative;
    height: 420px;
    background-size: cover;
    background-position: center;
    background-color: var(--at-bg-alt);
    display: flex;
    align-items: flex-end;
    border-radius: var(--at-radius-lg);
    overflow: hidden;
}

.at-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.75));
    pointer-events: none;
}

.at-slide-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.at-slide-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    width: 100%;
    color: #fff;
}

.at-slide-title {
    font-size: 1.6rem;
    margin: 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.at-slide-title a {
    color: #fff;
}

.at-slide-title a:hover {
    text-decoration: underline;
}

.at-slide-meta,
.at-slide-meta a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.at-slide-meta .at-post-author {
    margin-right: 12px;
}

/* Swiper nav */
.at-carousel .swiper-button-next,
.at-carousel .swiper-button-prev {
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background var(--at-transition);
}

.at-carousel .swiper-button-next:hover,
.at-carousel .swiper-button-prev:hover {
    background: var(--at-primary);
}

.at-carousel .swiper-button-next::after,
.at-carousel .swiper-button-prev::after {
    font-size: 16px;
}

.at-carousel .swiper-pagination-bullet-active {
    background: var(--at-primary);
}

/* ==========================================================================
   FEATURED AREA — GRID (3 posts magazine layout)
   ========================================================================== */

.at-featured-area .at-featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    height: 480px;
}

.at-featured-area .at-grid-main {
    display: flex;
}

.at-featured-area .at-grid-side {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.at-featured-area .at-grid-item {
    position: relative;
    background-size: cover;
    background-position: center;
    background-color: #374151;
    border-radius: var(--at-radius-lg);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.at-featured-area .at-grid-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.7));
    pointer-events: none;
}

.at-featured-area .at-grid-large {
    width: 100%;
    height: 100%;
}

.at-featured-area .at-grid-small {
    flex: 1;
}

.at-featured-area .at-grid-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.at-featured-area .at-grid-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    color: #fff;
    width: 100%;
}

.at-featured-area .at-grid-title {
    font-family: "Noto Serif", "Space Grotesk", serif;
    font-weight: 700;
    font-size: 26px;
    font-size: 1.8rem;
    line-height: 1.2;
    margin: 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.at-featured-area .at-grid-large .at-grid-title {
    font-size: 29px;
    font-size: 2.4rem;
    -webkit-line-clamp: 3;
}

.at-featured-area .at-grid-title a {
    color: #fff;
}

.at-featured-area .at-grid-title a:hover {
    text-decoration: underline;
}

.at-featured-area .at-grid-meta,
.at-featured-area .at-grid-meta a,
.at-featured-area .at-grid-meta time {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
}

.at-featured-area .at-grid-meta .at-post-author {
    margin-right: 10px;
}

.at-featured-area .at-grid-content .at-post-categories {
    margin-bottom: 4px;
}

/* ==========================================================================
   TRENDING POSTS — circular thumbnails grid
   ========================================================================== */

.at-trending-area {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-column-gap: 14px;
    padding-top: 40px;
    margin-bottom: 10px;
}

.at-trending-inner {
    display: flex;
    align-items: center;
}

/* Circular thumbnail */
.at-trending-img {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    position: relative;
    margin-right: 12px;
}

.at-trending-img img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    transition: all 0.3s ease;
    box-shadow: 3px 3px 0 0 var(--at-primary);
}

.at-trending-item:hover .at-trending-img img {
    box-shadow: 5px 5px 0 0 var(--at-primary);
    transform: scale(1.04);
}

/* Placeholder when no thumbnail */
.at-trending-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--at-bg-alt);
}

/* Numbered badge */
.at-trending-count {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    z-index: 1;
    text-align: center;
    border: 3px solid var(--at-primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--at-bg);
    color: var(--at-text);
}

/* Text body */
.at-trending-body {
    flex: 1;
    min-width: 0;
}

.at-trending-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.at-trending-title a {
    color: var(--at-text);
}

.at-trending-title a:hover {
    color: var(--at-primary);
}

.at-trending-body .at-post-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--at-text-light);
}

/* ==========================================================================
   BLOG POSTS — Cards
   ========================================================================== */

.at-main {
    padding: 40px 0 50px;
    font-family: 'VT323', var(--at-font-body);
}

/* Grid spacing to match blogxo's column-gap: 2rem */
.at-main .row.at-grid {
    --bs-gutter-x: 2rem;
}

.at-main .at-post-list,
.at-main .row.at-grid {
    padding: 0;
}

/* List layout card */
.at-post-list-item {
    background: var(--at-card-bg, var(--at-bg));
    border: var(--at-box-border);
    border-radius: var(--at-box-radius);
    box-shadow: var(--at-shadow);
    overflow: hidden;
    margin-bottom: 20px;
    padding: 20px;
    transition: box-shadow var(--at-transition);
}

.at-post-list-item:hover {
    box-shadow: var(--at-shadow-hover);
}

.at-post-list-item .at-post-thumb {
    display: block;
    height: 100%;
}

.at-post-list-item .at-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.at-post-card-body {
    padding: 20px;
}

/* Grid layout card */
.at-post-grid-item {
    background: var(--at-card-bg, var(--at-bg));
    border: var(--at-box-border);
    border-radius: var(--at-box-radius);
    box-shadow: var(--at-shadow);
    overflow: hidden;
    margin-bottom: 24px;
    padding: 0;
    transition: box-shadow var(--at-transition);
    height: calc(100% - 24px);
    display: flex;
    flex-direction: column;
}

.at-post-grid-item:hover {
    box-shadow: var(--at-shadow-hover);
}

.at-post-grid-item .at-post-thumb {
    display: block;
    overflow: hidden;
}

.at-post-grid-item .at-post-thumb img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 0;
    transition: transform var(--at-transition);
}

.at-post-grid-item:hover .at-post-thumb img {
    transform: scale(1.03);
}

.at-post-grid-item .at-post-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.at-post-grid-item .at-post-excerpt {
    margin-top: auto;
}

/* Post elements */
.at-post-title {
    font-family: "Noto Serif", "Space Grotesk", serif;
    font-weight: 700;
    font-size: 27px;
    font-size: 1.9rem;
    line-height: 1.2;
    margin: 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.at-post-title a:hover {
    color: var(--at-primary);
}

.at-post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}

.at-category-badge {
    display: inline-block;
    background: var(--at-primary);
    color: #fff !important;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.at-category-badge:hover {
    background: var(--at-primary-dark);
    color: #fff !important;
}

.at-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--at-text-light);
}

.at-post-meta a {
    color: var(--at-text-light);
}

.at-post-meta a:hover {
    color: var(--at-primary);
}

.at-post-author .at-author-avatar img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.at-post-excerpt {
    margin-top: 8px;
    color: var(--at-text-light);
    font-size: 1.25rem;
}

.at-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.at-tag {
    display: inline-block;
    background: var(--at-bg-alt);
    color: var(--at-text-light);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.at-tag:hover {
    background: var(--at-primary);
    color: #fff;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.at-pagination {
    margin-top: 30px;
    text-align: center;
}

.at-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.at-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--at-border);
    border-radius: var(--at-radius);
    color: var(--at-text);
    font-weight: 600;
    transition: all var(--at-transition);
}

.at-pagination .page-numbers.current,
.at-pagination .page-numbers:hover {
    background: var(--at-primary);
    color: #fff;
    border-color: var(--at-primary);
}

/* ==========================================================================
   SINGLE POST
   ========================================================================== */

.at-article-single {
    background: var(--at-card-bg, var(--at-bg));
    border: var(--at-box-border);
    border-radius: var(--at-box-radius);
    box-shadow: var(--at-shadow);
    padding: 20px;
    overflow: hidden;
}

.at-article-header {
    margin-bottom: 24px;
}

.at-article-title {
    font-family: "Noto Serif", "Space Grotesk", serif;
    font-weight: 700;
    font-size: 2rem;
    line-height: 1.25;
    margin: 8px 0 12px;
}

.at-article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--at-text-light);
    font-size: 0.9rem;
}

.at-article-meta .at-author-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 6px;
}

.at-article-thumb {
    margin-bottom: 24px;
}

.at-article-thumb img {
    border-radius: var(--at-radius-lg);
    width: 100%;
}

.at-thumb-caption {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: var(--at-text-light);
    margin-top: 6px;
}

.at-article-content {
    font-size: 1.45rem;
    line-height: 1.8;
    margin-bottom: 24px;
}

.at-article-content p {
    margin-bottom: 1.2em;
}

.at-article-content img {
    border-radius: var(--at-radius);
}

.at-article-content a {
    text-decoration: underline;
}

.at-article-content h2,
.at-article-content h3,
.at-article-content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

/* Post Navigation */
.at-post-nav {
    margin: 30px 0;
    border-top: 1px solid var(--at-border);
    border-bottom: 1px solid var(--at-border);
    padding: 20px 0;
}

.at-post-nav .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.at-post-nav .nav-previous,
.at-post-nav .nav-next {
    flex: 1;
}

.at-post-nav .nav-next {
    text-align: right;
}

.at-nav-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--at-text-light);
    margin-bottom: 4px;
}

.at-nav-title {
    font-weight: 600;
    color: var(--at-text);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Author Box */
.at-author-box {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: var(--at-bg-alt);
    border-radius: var(--at-radius-lg);
    margin-top: 3%;
    margin-bottom: 30px;
}

.at-author-box .at-author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.at-author-name {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.at-author-name a {
    color: var(--at-text);
}

.at-author-bio {
    color: var(--at-text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* Related Posts */
.at-related-posts {
    margin-bottom: 30px;
}

.at-section-title {
    font-size: 1.3rem;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--at-primary);
    display: inline-block;
}

.at-related-item {
    margin-bottom: 16px;
}

.at-related-item .at-post-thumb img {
    border-radius: var(--at-radius);
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.at-related-title {
    font-size: 0.95rem;
    margin: 8px 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.at-related-title a {
    color: var(--at-text);
}

.at-related-title a:hover {
    color: var(--at-primary);
}

/* ==========================================================================
   BREADCRUMB
   ========================================================================== */

.at-breadcrumb {
    background: var(--at-bg-alt);
    padding: 12px 0;
    font-size: 0.85rem;
    color: var(--at-text-light);
    border-bottom: 1px solid var(--at-border);
}

.at-breadcrumb a {
    color: var(--at-text-light);
}

.at-breadcrumb a:hover {
    color: var(--at-primary);
}

.at-breadcrumb .sep {
    margin: 0 8px;
    color: var(--at-border);
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */

.at-sidebar-inner {
    position: sticky;
    top: 80px;
}

.at-widget {
    background: var(--at-bg);
    border: 1px solid var(--at-border);
    border-radius: var(--at-radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.at-widget-title {
    font-size: 1rem;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--at-primary);
}

.at-sidebar-left {
    padding-right: 20px;
}

.at-sidebar-right {
    padding-left: 20px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

/* Footer — background set via Customizer inline CSS */
.at-footer {
    background: var(--at-hf-bg);
    color: rgba(255, 255, 255, 0.8);
    margin-top: 40px;
}

.at-footer-widgets {
    padding: 40px 0 20px;
}

.at-footer .at-widget {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
}

.at-footer .at-widget-title {
    color: #fff;
    border-bottom-color: var(--at-primary);
}

.at-footer .at-widget a {
    color: rgba(255, 255, 255, 0.7);
}

.at-footer .at-widget a:hover {
    color: #fff;
}

/* Footer branding area (logo + title + social) */
.at-footer-branding {
    padding: 30px 0 20px;
}

.at-footer-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.at-footer-logo .custom-logo-link img {
    max-height: 50px;
    width: auto;
}

.at-footer-title {
    margin: 0;
    line-height: 1.3;
}

.at-footer-title a {
    font-size: 28px;
    font-family: 'VT323', var(--at-font-heading);
    font-weight: 700;
    color: #fff;
}

.at-footer-title a:hover {
    color: var(--at-primary);
}

.at-footer-description {
    margin: 2px 0 0;
    font-family: 'VT323', var(--at-font-body);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Footer social icons */
.at-social-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Footer social icons use brand colors from SVG files directly */

/* Divide line + copyright */
.at-divide-line {
    height: 1px;
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    margin-bottom: 16px;
}

.at-footer-bottom {
    padding: 0 0 16px;
    font-size: 0.85rem;
}

.at-copyright {
    font-family: 'VT323', var(--at-font-body);
    color: rgba(255, 255, 255, 0.6);
}

.at-footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
    justify-content: flex-end;
}

.at-footer-menu a {
    color: rgba(255, 255, 255, 0.6);
}

.at-footer-menu a:hover {
    color: #fff;
}

/* ==========================================================================
   SCROLL TO TOP
   ========================================================================== */

.at-scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--at-primary);
    color: #fff;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--at-transition);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--at-shadow);
}

.at-scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.at-scroll-top:hover {
    background: var(--at-primary-dark);
    transform: translateY(-3px);
}

/* ==========================================================================
   SEARCH MODAL
   ========================================================================== */

#atSearchModal .modal-content {
    border: none;
    border-radius: var(--at-radius-lg);
}

#atSearchModal .search-form {
    display: flex;
    gap: 8px;
}

#atSearchModal .search-field {
    flex: 1;
    border: 2px solid var(--at-border);
    border-radius: var(--at-radius);
    padding: 12px 16px;
    font-size: 1rem;
    outline: none;
    transition: border-color var(--at-transition);
}

#atSearchModal .search-field:focus {
    border-color: var(--at-primary);
}

#atSearchModal .search-submit {
    background: var(--at-primary);
    color: #fff;
    border: none;
    border-radius: var(--at-radius);
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--at-transition);
}

#atSearchModal .search-submit:hover {
    background: var(--at-primary-dark);
}

/* ==========================================================================
   404 & NO RESULTS
   ========================================================================== */

.at-404 {
    padding: 80px 20px;
}

.at-404-title {
    font-size: 6rem;
    font-weight: 900;
    color: var(--at-primary);
    line-height: 1;
    margin-bottom: 10px;
}

.at-no-results {
    padding: 40px 0;
    text-align: center;
}

.at-btn {
    display: inline-block;
    background: var(--at-primary);
    color: #fff;
    padding: 10px 24px;
    border-radius: var(--at-radius);
    font-weight: 600;
    transition: background var(--at-transition);
}

.at-btn:hover {
    background: var(--at-primary-dark);
    color: #fff;
}

/* ==========================================================================
   ARCHIVE
   ========================================================================== */

.at-archive-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--at-border);
}

.at-archive-title {
    font-size: 1.6rem;
    margin: 0;
}

.at-archive-desc {
    color: var(--at-text-light);
    margin-top: 6px;
}

/* ==========================================================================
   COMMENTS
   ========================================================================== */

.at-comments {
    margin-top: 30px;
}

.at-comments-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.at-comment-list {
    list-style: none;
    padding: 0;
}

.at-comment-list .comment {
    padding: 16px 0;
    border-bottom: 1px solid var(--at-border);
}

.at-comment-list .comment-body {
    display: flex;
    gap: 16px;
}

.at-comment-list .comment-author img {
    border-radius: 50%;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 991.98px) {
    /* =========================================================
       TABLET/MOBILE HEADER LAYOUT
       Section 1: Social icons — hidden below 768px (d-none d-md-block)
       Section 2: Brand — always visible, reduced font sizes
       Section 3: Menu — collapses to hamburger below 992px
       ========================================================= */

    /* --- Section 2: Brand adjustments --- */
    .at-header-brand {
        padding: 20px 0;
    }

    .at-header-brand-inner {
        min-height: 50px;
    }

    .site-title {
        font-size: 46px;
    }

    .site-description {
        font-size: 1rem;
    }

    .at-brand-center .custom-logo {
        max-height: 40px;
    }

    /* --- Section 3: Hamburger centered, collapse full-width --- */
    .at-header-menu .container {
        justify-content: center;
    }

    .at-header-menu .navbar-collapse {
        flex-basis: 100%;
        background: var(--at-hf-bg);
        border-radius: 0 0 var(--at-radius) var(--at-radius);
        padding: 10px 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .at-header-menu .navbar-collapse .navbar-nav {
        margin-top: 0;
    }

    .at-header-menu .navbar-collapse .navbar-nav .nav-link {
        color: var(--at-hf-text) !important;
        padding: 10px 20px !important;
        font-size: 0.95rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-align: center;
    }

    .at-header-menu .navbar-collapse .navbar-nav .nav-link:hover,
    .at-header-menu .navbar-collapse .navbar-nav .nav-item.active > .nav-link {
        color: var(--at-primary) !important;
        background: rgba(255, 255, 255, 0.05);
    }

    .at-header-menu .navbar-collapse .navbar-nav .dropdown-menu {
        background: rgba(0, 0, 0, 0.2);
        box-shadow: none;
        border-radius: 0;
        padding: 0;
    }

    .at-header-menu .navbar-collapse .navbar-nav .dropdown-item {
        color: rgba(255, 255, 255, 0.85);
        padding: 8px 35px;
        font-size: 0.9rem;
        text-align: center;
    }

    .at-header-menu .navbar-collapse .navbar-nav .dropdown-item:hover {
        color: var(--at-primary);
        background: rgba(255, 255, 255, 0.05);
    }

    .at-featured-area .at-featured-grid {
        height: auto;
        grid-template-columns: 1fr;
    }

    .at-featured-area .at-grid-large {
        height: 300px;
    }

    .at-featured-area .at-grid-small {
        min-height: 200px;
    }

    .at-featured-area .at-grid-side {
        flex-direction: row;
    }

    .at-slide {
        height: 320px;
    }

    .at-slide-title {
        font-size: 1.3rem;
    }

    .at-trending-area {
        grid-template-columns: repeat(2, 1fr);
        grid-row-gap: 18px;
    }

    .at-sidebar-left,
    .at-sidebar-right {
        padding-left: 0;
        padding-right: 0;
        margin-top: 30px;
    }

    .at-sidebar-inner {
        position: static;
    }

    .at-article-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 767.98px) {
    .at-featured-area .at-featured-grid {
        grid-template-columns: 1fr;
    }

    .at-featured-area .at-grid-side {
        flex-direction: column;
    }

    .at-featured-area .at-grid-large {
        height: 250px;
    }

    .at-featured-area .at-grid-small {
        min-height: 180px;
    }

    .at-slide {
        height: 280px;
    }

    .at-slide-title {
        font-size: 1.1rem;
    }

    .at-post-list-item .row {
        flex-direction: column;
    }

    .at-post-list-item .at-post-thumb img {
        height: 200px;
    }

    .at-author-box {
        flex-direction: column;
        text-align: center;
    }

    .at-post-nav .nav-links {
        flex-direction: column;
    }

    .at-post-nav .nav-next {
        text-align: left;
    }

    /* --- Footer mobile --- */
    .at-footer-logo {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 20px;
    }

    .at-social-footer {
        justify-content: center;
    }

    .at-text-center-mobile {
        text-align: center;
    }

    .at-copyright {
        margin-bottom: 6px;
    }

    .at-footer-menu {
        justify-content: center;
        margin-top: 10px;
    }
}

@media (max-width: 575.98px) {
    .site-title {
        font-size: 34px;
    }

    .site-description {
        font-size: 0.9rem;
    }

    .at-brand-center {
        position: static;
        transform: none;
        flex: 1;
    }

    .at-trending-area {
        grid-template-columns: 1fr;
    }

    .at-slide {
        height: 240px;
    }

    .at-slide-content {
        padding: 16px;
    }

    .at-article-title {
        font-size: 1.3rem;
    }

    .at-404-title {
        font-size: 4rem;
    }
}
