/* =============================================
   LokaTours Blog Styles
   Extends css/style.css — load both
   ============================================= */

/* --- Blog Index Hero --- */
.blog-hero {
    padding: 96px 0 72px;
    background: var(--color-forest);
    color: var(--color-white);
    text-align: center;
}

.blog-hero .section-kicker {
    color: rgba(255,255,255,0.65);
}

.blog-hero h1 {
    margin: 0 0 18px;
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 6vw, 4.8rem);
    line-height: 1.04;
    letter-spacing: -0.03em;
    color: var(--color-white);
}

.blog-hero p {
    margin: 0 auto;
    max-width: 560px;
    color: rgba(255,255,255,0.74);
    font-size: 1.08rem;
}

/* --- Blog Grid --- */
.blog-section {
    padding: 72px 0 96px;
    background: var(--color-paper);
}

/* Indian Travellers — destination guides strip (blog index) */
.blog-section--indian {
    background: #fff8f6;
    padding: 3rem 0 1rem;
}

.blog-indian-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.blog-indian-title {
    margin: 0.5rem 0 0.75rem;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 5vw, 2rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--color-ink);
}

.blog-indian-sub {
    color: #666;
    max-width: 640px;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.55;
    padding: 0 4px;
}

@media (max-width: 600px) {
    .blog-section--indian {
        padding: 2rem 0 1rem;
    }

    .blog-indian-header {
        margin-bottom: 1.75rem;
    }

    .blog-indian-sub {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

@media (max-width: 960px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .blog-grid { grid-template-columns: 1fr; }
}

/* --- Blog Card --- */
.blog-card {
    background: var(--color-white);
    border-radius: var(--radius-medium);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(20,16,10,0.07);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(20,16,10,0.14);
}

.blog-card-image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 420ms ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-rank {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--color-accent);
    color: var(--color-white);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 4px 11px;
    border-radius: 999px;
}

.blog-card-content {
    padding: 24px 26px 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-tag {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--color-accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.blog-card-title {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    line-height: 1.22;
    color: var(--color-ink);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.blog-card-title a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.blog-card-excerpt {
    margin: 0 0 18px;
    color: var(--color-ink-soft);
    font-size: 0.93rem;
    line-height: 1.6;
    flex: 1;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--color-ink-soft);
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
}

.blog-card-read {
    color: var(--color-accent);
    font-weight: 700;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap var(--transition);
}

.blog-card:hover .blog-card-read {
    gap: 10px;
}

/* =============================================
   Individual Blog Post Styles
   ============================================= */

/* --- Post Breadcrumb --- */
.post-breadcrumb {
    padding: 18px 0;
    background: var(--color-sand);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.87rem;
    color: var(--color-ink-soft);
}

.post-breadcrumb ol {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.post-breadcrumb li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-breadcrumb li::after {
    content: "›";
    color: var(--color-ink-soft);
    opacity: 0.5;
}

.post-breadcrumb li:last-child::after { display: none; }

.post-breadcrumb a {
    color: var(--color-ink-soft);
    transition: color var(--transition);
}

.post-breadcrumb a:hover { color: var(--color-accent); }

.post-breadcrumb li:last-child {
    color: var(--color-ink);
    font-weight: 500;
}

/* --- Post Hero --- */
.post-hero {
    position: relative;
    height: min(540px, 55vw);
    min-height: 320px;
    overflow: hidden;
}

.post-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20,16,10,0.78) 0%, rgba(20,16,10,0.18) 60%, transparent 100%);
}

.post-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 0;
}

.post-hero-content .container {
    max-width: min(860px, calc(100vw - 48px));
}

.post-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    background: var(--color-accent);
    color: var(--color-white);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 999px;
}

.post-hero h1 {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 4.5vw, 3.4rem);
    line-height: 1.1;
    color: var(--color-white);
}

.post-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    color: rgba(255,255,255,0.75);
    font-size: 0.88rem;
}

.post-hero-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- Post Layout --- */
.post-layout {
    padding: 60px 0 80px;
    background: var(--color-paper);
}

.post-layout .container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 52px;
    align-items: start;
    max-width: min(1120px, calc(100vw - 32px));
    margin: 0 auto;
}

@media (max-width: 900px) {
    .post-layout .container {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .post-sidebar {
        /* Let natural DOM order place sidebar AFTER the article on mobile,
           so users reach article content immediately after the hero.
           position: static also disables the desktop sticky behaviour which
           previously caused the sidebar to overlap the article while scrolling. */
        position: static;
    }
}

/* Tablet (601–900px): show sidebar cards side-by-side so they don't
   consume excessive vertical space above the article */
@media (min-width: 601px) and (max-width: 900px) {
    .post-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }
    .post-sidebar .quick-facts,
    .post-sidebar .post-toc {
        flex: 1 1 calc(50% - 8px);
        min-width: 220px;
    }
    .post-sidebar .sidebar-cta {
        flex: 1 1 100%;
    }
    /* Lay out Quick Facts as label+value rows */
    .quick-facts dl {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 0 16px;
    }
    .quick-facts dt {
        padding-top: 10px;
        border-top: 1px solid var(--color-border);
        margin-bottom: 0;
    }
    .quick-facts dd {
        padding-bottom: 0;
        padding-top: 10px;
        border-bottom: none;
        border-top: 1px solid var(--color-border);
        margin: 0;
    }
    .quick-facts dt:first-of-type,
    .quick-facts dt:first-of-type + dd {
        border-top: none;
        padding-top: 0;
    }
}

/* --- Post Content --- */
.post-content {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-content h2 {
    margin: 52px 0 18px;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    line-height: 1.18;
    color: var(--color-ink);
}

.post-content h2:first-child { margin-top: 0; }

.post-content h3 {
    margin: 32px 0 12px;
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--color-ink);
}

.post-content p {
    margin: 0 0 20px;
    color: var(--color-ink-soft);
    font-size: 1.02rem;
    line-height: 1.72;
}

.post-content ul,
.post-content ol {
    margin: 0 0 20px;
    padding-left: 22px;
    color: var(--color-ink-soft);
    font-size: 1.02rem;
    line-height: 1.72;
}

.post-content li { margin-bottom: 6px; }

.post-content strong { color: var(--color-ink); font-weight: 700; }

.post-content a {
    color: var(--color-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.post-content a:hover { color: var(--color-accent-dark); }

/* Override for CTA buttons embedded inside post-content — prevents
   .post-content a (specificity 0-1-1) from overriding button text colour */
.post-content a.cta-button {
    color: var(--color-white);
    text-decoration: none;
}

.post-content a.cta-button:hover {
    color: var(--color-white);
}

/* --- Inline Post Image --- */
.post-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-small);
    margin: 8px 0 28px;
}

/* --- Highlight Box --- */
.post-highlight {
    padding: 22px 26px;
    background: var(--color-sand);
    border-left: 4px solid var(--color-accent);
    border-radius: 0 var(--radius-small) var(--radius-small) 0;
    margin: 8px 0 28px;
}

.post-highlight p {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.64;
    color: var(--color-ink);
}

/* --- Post Sidebar --- */
.post-sidebar {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Quick Facts */
.quick-facts {
    background: var(--color-white);
    border-radius: var(--radius-medium);
    padding: 26px 24px;
    box-shadow: 0 4px 24px rgba(20,16,10,0.07);
    border: 1px solid var(--color-border);
}

.quick-facts h2 {
    margin: 0 0 18px;
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--color-ink);
}

.quick-facts dl {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-facts dt {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 2px;
}

.quick-facts dd {
    margin: 0;
    font-size: 0.93rem;
    color: var(--color-ink);
    line-height: 1.5;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

.quick-facts dd:last-child { border-bottom: none; padding-bottom: 0; }

/* TOC */
.post-toc {
    background: var(--color-white);
    border-radius: var(--radius-medium);
    padding: 22px 24px;
    box-shadow: 0 4px 24px rgba(20,16,10,0.07);
    border: 1px solid var(--color-border);
}

.post-toc h2 {
    margin: 0 0 14px;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-ink-soft);
}

.post-toc ol {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-toc li { font-size: 0.9rem; }

.post-toc a {
    color: var(--color-ink);
    transition: color var(--transition);
    text-decoration: none;
}

.post-toc a:hover { color: var(--color-accent); }

/* Sidebar CTA */
.sidebar-cta {
    background: var(--color-forest);
    border-radius: var(--radius-medium);
    padding: 26px 24px;
    text-align: center;
    color: var(--color-white);
}

.sidebar-cta h2 {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: 1.12rem;
    line-height: 1.3;
}

.sidebar-cta p {
    margin: 0 0 18px;
    color: rgba(255,255,255,0.72);
    font-size: 0.88rem;
    line-height: 1.5;
}

.sidebar-cta .cta-button {
    width: 100%;
}

/* =============================================
   FAQ Section
   ============================================= */
.faq-section {
    margin-top: 56px;
    padding-top: 48px;
    border-top: 1px solid var(--color-border);
}

.faq-section > h2 {
    margin: 0 0 30px;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--color-ink);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    overflow: hidden;
}

.faq-item {
    border-bottom: 1px solid var(--color-border);
}

.faq-item:last-child { border-bottom: none; }

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 20px 24px;
    background: var(--color-white);
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-ink);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.faq-question:hover { background: var(--color-sand); }

.faq-question[aria-expanded="true"] {
    background: var(--color-sand);
    color: var(--color-accent);
}

.faq-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 400;
    transition: transform var(--transition), border-color var(--transition);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
    border-color: var(--color-accent);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 320ms ease, padding 220ms ease;
}

.faq-answer.is-open {
    max-height: 600px;
}

.faq-answer-inner {
    padding: 0 24px 22px;
    background: var(--color-sand);
    color: var(--color-ink-soft);
    font-size: 0.97rem;
    line-height: 1.68;
}

.faq-answer-inner p { margin: 0; }

/* =============================================
   Related Posts
   ============================================= */
.related-section {
    padding: 64px 0 80px;
    background: var(--color-sand);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 36px;
}

@media (max-width: 840px) {
    .related-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 540px) {
    .related-grid { grid-template-columns: 1fr; }
}

/* =============================================
   Blog Preview Section (on index.html)
   ============================================= */
.blog-preview-section {
    padding: 80px 0;
    background: var(--color-sand);
}

.blog-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
}

@media (max-width: 960px) {
    .blog-preview-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 600px) {
    .blog-preview-grid { grid-template-columns: 1fr; }
}

.blog-preview-footer {
    margin-top: 40px;
    text-align: center;
}

/* =============================================
   Tablet & small phones (≤768px) — cards + article body
   ============================================= */
@media (max-width: 768px) {
    .blog-card-content {
        padding: 20px 20px 24px;
    }

    .blog-card-meta {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .blog-card-meta > span {
        min-width: 0;
        line-height: 1.45;
    }

    .blog-card-read {
        align-self: flex-start;
        padding: 8px 0;
        min-height: 44px;
        align-items: center;
    }

    .post-content p,
    .post-content ul,
    .post-content ol {
        font-size: 1rem;
        line-height: 1.72;
    }

    /* Wide budget / weather tables: horizontal scroll, readable cells */
    .post-content table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .post-content th,
    .post-content td {
        font-size: 0.9rem;
        line-height: 1.45;
        padding: 0.5rem 0.6rem;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

/* =============================================
   Responsive overrides — mobile (≤600px)
   ============================================= */
@media (max-width: 600px) {
    /* Blog index */
    .blog-hero { padding: 60px 0 48px; }

    .blog-card-content {
        padding: 18px 18px 22px;
    }

    /* Post hero */
    .post-hero { height: 260px; min-height: 0; }
    .post-hero h1 { font-size: clamp(1.35rem, 5.5vw, 1.85rem); }
    .post-hero-content { padding: 20px 0; }
    .post-rank-badge { font-size: 0.74rem; padding: 4px 10px; }
    .post-hero-meta { gap: 12px; font-size: 0.82rem; }

    /* Post layout */
    .post-layout { padding: 24px 0 40px; }
    .post-layout .container { gap: 20px; }

    /* Sidebar cards */
    .quick-facts, .post-toc, .sidebar-cta { padding: 16px; }

    /* Compact Quick Facts on small screens */
    .quick-facts h2 { font-size: 1rem; margin-bottom: 12px; }
    .quick-facts dl { gap: 6px; }
    .quick-facts dt { font-size: 0.72rem; }
    .quick-facts dd { font-size: 0.88rem; padding-bottom: 8px; }

    /* Limit TOC height so it doesn't eat the whole screen */
    .post-toc ol {
        max-height: 180px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .post-toc li { font-size: 0.86rem; }

    /* Article content */
    .post-content h2 {
        margin: 36px 0 14px;
        font-size: clamp(1.25rem, 5vw, 1.65rem);
    }
    .post-content h3 { margin: 24px 0 10px; font-size: 1.04rem; }
    .post-content p,
    .post-content ul,
    .post-content ol { font-size: 1rem; line-height: 1.72; }

    /* Tables — scroll on narrow viewports (inherits cell sizing from ≤768px rules) */
    .post-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Highlight box */
    .post-highlight { padding: 16px 18px; }

    /* FAQ touch targets */
    .faq-question { padding: 16px 18px; min-height: 48px; font-size: 0.95rem; }
    .faq-answer-inner { padding: 0 18px 18px; font-size: 0.93rem; }

    /* Related section */
    .related-section { padding: 44px 0 56px; }
}
