/* ========================================================================
   LAYAGPH CONSOLIDATED STYLE.CSS
   Merged: theme.css + base.css
   Optimized for: Core Web Vitals, CLS, Discover, Mobile First
   ======================================================================== */

/* BASE RESET -------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #fff;
    color: #222;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ========================================================================
   TRENDING BAR
   ======================================================================== */
.trending-bar {
    background: #111;
    color: #fff;
    padding: 12px 0;
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 2px solid #f39c12;
}

.trending-title {
    font-weight: bold;
    padding-left: 20px;
    margin-right: 20px;
}

.trending-track {
    display: inline-block;
    animation: scroll-left 22s linear infinite;
}

.trending-item {
    display: inline-block;
    padding: 0 25px;
    font-size: 15px;
    color: #f1c40f;
}

@keyframes scroll-left {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ========================================================================
   CATEGORY CHIPS
   ======================================================================== */
.chip-scroll {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 12px 20px;
}

.chip-scroll::-webkit-scrollbar { display: none; }

.chip {
    padding: 8px 14px;
    background: #eee;
    border-radius: 25px;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    transition: background 0.2s;
}

.chip:hover { background: #ddd; }

/* ========================================================================
   HERO SECTION
   ======================================================================== */
.hero-section {
    margin: 20px 0 40px;
}

.hero-card {
    display: block;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
}

.hero-img {
    width: 100%;
    height: 330px;
    object-fit: cover;
    transition: transform .3s;
}

.hero-card:hover .hero-img {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 20px;
    width: 100%;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

.hero-title {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
}

/* ========================================================================
   FEED CARDS
   ======================================================================== */
.feed-card {
    display: block;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    color: #333;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .4s ease-out, transform .4s ease-out;
}

.feed-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.feed-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}

.feed-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.feed-body { padding: 12px; }

.feed-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
}

/* ========================================================================
   STICKY HEADER
   ======================================================================== */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 99;
    background: #fafafa;
    padding: 12px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 22px;
    font-weight: bold;
}

.search-box {
    width: 50%;
    padding: 6px 12px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* ========================================================================
   DARK MODE
   ======================================================================== */
body.dark {
    background: #121212;
    color: #eee;
}

body.dark a {
    color: #ddd;
}

body.dark .feed-card {
    background: #1e1e1e;
    border: 1px solid #333;
}

body.dark .chip {
    background: #333;
}

body.dark .chip:hover {
    background: #444;
}

body.dark .sticky-header,
body.dark footer {
    background: #1b1b1b;
    border-color: #333;
}

/* ========================================================================
   FOOTER
   ======================================================================== */
footer {
    background: #fafafa;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
    border-top: 1px solid #ddd;
}

/* ========================================================================
   BACK TO TOP BUTTON
   ======================================================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 25px;
    background: #f39c12; /* updated */
    color: #fff;
    padding: 10px 14px;
    border-radius: 50%;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
    z-index: 100;
    transition: background 0.2s;
}

.back-to-top:hover {
    background: #c87f0d;
}

/* Dark Mode */
body.dark .back-to-top {
    background: #f39c12;
    color: #000;
}


/* ========================================================================
   DIGITALASSETSPH SHOWCASE (OPS FOOTER BANNERS)
   ======================================================================== */
.showcase-da .da-banner {
    margin: 40px 0;
    padding: 30px;
    border-radius: 14px;
    background: linear-gradient(135deg, #000000, #2a2a2a);
    border-left: 5px solid #ffcc00;
    text-align: center;
    color: #ffcc00;
}

.showcase-da .da-banner h2 {
    font-size: 24px;
}

.showcase-da .da-banner p {
    color: #f2f2f2;
}

.showcase-da .da-banner span {
    margin-top: 5px;
    display: inline-block;
    font-weight: bold;
    color: #fff;
    text-decoration: underline;
}

.powered-by-da {
    margin-top: 25px;
    font-size: 14px;
    text-align: center;
    opacity: 0.8;
}

.powered-by-da a {
    color: #ffcc00;
    font-weight: bold;
}


/* ADDED DURING REVISION OF INDEX.PHP */

/* ========================================================================
   HOMEPAGE LAYOUT (ENGINE360 HOME) 
   ======================================================================== */

.site-main {
    max-width: 1100px;
    margin: 20px auto;
    padding: 20px;
}

/* Section headings */
.section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 10px 0 12px;
}

/* Generic post grid used by "Trending Posts" and "Latest Posts" */
.post-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

/* Static trending grid cards (PHP-rendered) */
/* ========================================================================
   GRID CARD (Trending Cards + Static Grid Cards)
   ======================================================================== */
.grid-card {
    flex: 1 1 250px;
    background: var(--card, #fff);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border, #ddd);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform .2s, box-shadow .2s;
}

.grid-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* Remove old wrapper (no longer used) */
.grid-card-body {
    padding: 0; /* optional, or delete entirely */
}


/* Anchor wrapper inside grid-card */
.grid-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Image inside trending grid */
.grid-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

/* Title text for static grid items */
.grid-title {
    margin: 8px 0 0;
    font-size: 17px;
    font-weight: 600;
    color: #000 !important;
    line-height: 1.3;
}

/* Date text for static grid items */
.grid-date,
.feed-date {
    margin: 2px 0 0;
    font-size: 10px;
    color: #999;
}

/* Divider inserted in infinite feed (banner slots) */
.feed-divider {
    width: 100%;
    margin: 30px 0;
    text-align: center;
}

.feed-divider-inner {
    padding: 10px 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    font-size: 12px;
    color: #777;
}

/* Infinite feed loader text */
.feed-loader {
    text-align: center;
    margin: 30px;
    font-size: 16px;
    color: #777;
}

/* Bottom hashtag section */
.chip-section {
    margin-bottom: 40px;
}

/* Share button (used in static grid + JS feed) */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 8px;
    font-size: 11px;
    background: #f1f1f1;
    border-radius: 20px;
    cursor: pointer;
    color: #333;
    text-decoration: none;
    border: 1px solid #ddd;
    width: fit-content;
}

.share-btn:hover {
    background: #e4e4e4;
}

/* Icon inside share button */
.share-icon {
    width: 11px;
    height: 11px;
    fill: #555;
}

/* Toast for "Link copied" on share fallback */
.share-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 18px;
    background: #333;
    color: #fff;
    border-radius: 25px;
    font-size: 13px;
    display: none;
    opacity: 0;
    transition: opacity .3s ease;
    z-index: 9999;
}

/* DARK MODE TWEAKS ----------------------------------------------------- */
body.dark .grid-date,
body.dark .feed-date {
    color: #aaa;
}

body.dark .feed-divider-inner {
    border-top-color: #333;
    border-bottom-color: #333;
    color: #bbb;
}

body.dark .share-btn {
    background: #2a2a2a;
    color: #eee;
    border-color: #444;
}

body.dark .share-btn:hover {
    background: #3a3a3a;
}

body.dark .grid-title {
    color: #000 !important;
}

body.dark .share-icon {
    fill: #ddd;
}

body.dark .share-toast {
    background: #eee;
    color: #000;
}

/* RESPONSIVE ----------------------------------------------------------- */
@media (max-width: 768px) {
    .site-main {
        padding: 16px;
        margin: 10px auto 40px;
    }

    .post-grid {
        gap: 16px;
    }

    .grid-card {
        flex: 1 1 100%;
    }

    .hero-img {
        height: 260px;
    }
}





/* AD BANNER STYLE */
.feed-divider-inner {
    padding: 10px 0;
    border-top: 2px solid #f39c12;
    border-bottom: 2px solid #f39c12;
    font-size: 12px;
    color: #777;
    margin: 8px 0;
    border-radius: 8px;
    background: rgba(243, 156, 18, 0.06); /* subtle theme glow */
}



/* Enhanced section titles */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 25px 0 15px;
    padding: 10px 14px;
    width: 100%;
    display: inline-block;
    color: #333;
    background: rgba(243, 156, 18, 0.12);
    border-left: 4px solid #f39c12;
    border-radius: 8px;
}

body.dark .section-title {
    color: #fff;
    background: rgba(243, 156, 18, 0.25);
}




/* ========================================================================
   ARTICLE PAGE
   ======================================================================== */

.article-main {
    max-width: 800px;
    margin: 30px auto 40px;
    padding: 20px;
}

.article {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    padding: 20px;
}

.article-header {
    margin-bottom: 16px;
}

.article-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.article-meta {
    margin: 4px 0 0;
    color: #999;
    font-size: 14px;
}

/* Share row above hero */
.share-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    margin-bottom: 10px;
}

.article-author-label {
    color: #999;
    font-size: 14px;
}

/* Facebook share pill */
.share-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #1877f2;
    color: #fff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.share-pill:hover {
    background: #0e5bd8;
}

.fb-icon {
    width: 12px;
    height: 12px;
    display: block;
}

/* Hero image */
.article-hero {
    margin: 15px 0 20px;
    border-radius: 8px;
    overflow: hidden;
}

.article-hero-img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

/* Article body */
.article-body {
    font-size: 18px;
    line-height: 1.6;
    color: #222;
    margin-bottom: 24px;
}

.article-body p {
    margin: 0 0 18px;
}

/* Tags / hashtags */
.article-footer {
    border-top: 1px solid #eee;
    padding-top: 12px;
}

.article-tags {
    font-size: 14px;
    color: #777;
}

/* Related posts section */
.article-related {
    margin-top: 40px;
}

/* Section title already styled — this just tweaks spacing on article page */
.article-related .section-title {
    margin-top: 0;
}

/* Dark mode adjustments */
body.dark .article {
    background: #1e1e1e;
    border-color: #333;
}

body.dark .article-body {
    color: #eee;
}

body.dark .article-meta,
body.dark .article-author-label {
    color: #aaa;
}



/* ========================================================================
   AUTHOR EXPERTISE BOX (E-E-A-T)
   ======================================================================== */
.article-author-box {
    display: flex;
    gap: 12px;
    margin: 16px 0 18px;
    padding: 12px 14px;
    background: rgba(243, 156, 18, 0.1);
    border-left: 4px solid #f39c12;
    border-radius: 8px;
    align-items: flex-start;
}

.author-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f39c12, #ffcc66);
    flex-shrink: 0;
}

.author-name {
    font-size: 15px;
    font-weight: 700;
    color: #222;
}

.author-bio {
    font-size: 13px;
    margin-top: 2px;
    color: #555;
    line-height: 1.45;
}

/* Dark mode */
body.dark .article-author-box {
    background: rgba(243,156,18,0.25);
    border-left-color: #f39c12;
}

body.dark .author-name {
    color: #fff;
}

body.dark .author-bio {
    color: #ddd;
}


/* ========================================================================
   DROP CAP STYLING FOR FIRST PARAGRAPH
   ======================================================================== */
.dropcap::first-letter {
    font-size: 3.2em;
    font-weight: 700;
    float: left;
    line-height: 0.9;
    padding-right: 6px;
    padding-top: 4px;
    color: #f39c12;
    font-family: Georgia, serif;
}

/* Dark mode */
body.dark .dropcap::first-letter {
    color: #ffcc66;
}


/* ========================================================================
   ARTICLE META ROW + SHARE (ONE LINE)
   ======================================================================== */
.article-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between; /* pushes Share to extreme right */
    margin: 6px 0 12px;
}

.article-meta {
    font-size: 14px;
    color: #999;
    display: flex;
    align-items: center;
}

/* Responsiveness: stack on small screens */
@media (max-width: 500px) {
    .article-meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}


/* ========================================================================
   ARTICLE NEXT / PREVIOUS NAVIGATION
   ======================================================================== */
.article-nav {
    margin: 25px 0 35px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.nav-btn {
    flex: 1;
    padding: 12px 14px;
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid rgba(243, 156, 18, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    display: block;
    transition: 0.15s ease;
}

.nav-btn:hover {
    background: rgba(243, 156, 18, 0.2);
}

/* Left button text aligned left, right button aligned right */
.nav-prev { text-align: left; }
.nav-next { text-align: right; }

/* Dark mode */
body.dark .nav-btn {
    background: rgba(243,156,18,0.25);
    color: #fff;
    border-color: rgba(243,156,18,0.45);
}

body.dark .nav-btn:hover {
    background: rgba(243,156,18,0.35);
}



/* ========================================================================
   STATIC INFORMATION PAGES (Terms, Privacy, OUCL)
   ======================================================================== */

.text-page {
    max-width: 900px;
    margin: 30px auto 40px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
}

.text-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
}

.text-body {
    font-size: 17px;
    line-height: 1.65;
    color: #333;
}

.text-body h2 {
    font-size: 20px;
    margin: 24px 0 12px;
}

.text-body p {
    margin-bottom: 16px;
}

.text-body ul {
    margin-bottom: 16px;
    padding-left: 20px;
}

body.dark .text-page {
    background: #1e1e1e;
    border-color: #333;
}

body.dark .text-title {
    color: #fff;
}

body.dark .text-body {
    color: #ddd;
}



/* ============================================================================
   LEGAL / STATIC PAGE FORMATTING BLOCK
   ============================================================================ */
.legal-block {
    background: #111;
    color: #ddd;
    padding: 20px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-x: auto;
    word-break: break-word;
    margin: 20px 0;
}

body.dark .legal-block {
    background: #000;
    color: #fff;
}
