/* Pharma News Feed — Frontend Styles */

/* ── Box card ────────────────────────────────────────────────────────────── */

.pnf-box-card {
    overflow: hidden;
}

/* Box image — fixed-height container, full-bleed against card padding */
.pnf-box-image-wrap {
    /* Pull out by the card's p-2 (0.5 rem) on left/right/top so the image
       runs edge-to-edge regardless of the uploaded image's dimensions        */
    margin: -0.5rem -0.5rem 0;
    width: calc(100% + 1rem);

    /* Fixed height — this is the only constraint the image ever hits        */
    height: 300px;

    /* Clip any overflow from scale() transitions or tall images             */
    overflow: hidden;

    /* Placeholder background shown while the image loads                   */
    background-color: #dce8f5;
    line-height: 0;
}

.pnf-box-img {
    /* Fill the wrapper completely — width AND height                        */
    width: 100%;
    height: 100%;

    /* Resize/crop to cover without distortion, keep subject centred         */
    object-fit: cover;
    object-position: center center;

    display: block;
    transition: transform 0.35s ease;
}

/* Subtle zoom on hover — clipped safely by overflow:hidden on the wrapper  */
.pnf-box-image-wrap a:hover .pnf-box-img,
.pnf-box-image-wrap:hover .pnf-box-img {
    transform: scale(1.05);
}

/* ── Mobile: title above image ───────────────────────────────────────────── */
/* Below Bootstrap's md breakpoint (single-column layout), reorder so the
   box title is the first thing the reader sees, then the image beneath it.  */
@media (max-width: 767.98px) {
    .pnf-box-card {
        display: flex;
        flex-direction: column;
    }

    /* 1 — title first */
    .pnf-box-card > h3                    { order: 1; }

    /* 2 — image second; reset negative top-margin (no longer flush to top)  */
    .pnf-box-image-wrap                   { order: 2; margin-top: 0; }

    /* 3 & 4 — description and feed list follow naturally */
    .pnf-box-card > .pnf-box-description  { order: 3; }
    .pnf-box-card > div.p-3               { order: 4; }
}

/* Box title link */
.pnf-box-title-link {
    color: inherit;
    text-decoration: none;
}

.pnf-box-title-link:hover {
    text-decoration: underline;
    color: inherit;
}

/* ── News list ───────────────────────────────────────────────────────────── */

.pharma-news-box__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pharma-news-box__item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.4;
}

.pharma-news-box__item:last-child {
    border-bottom: none;
}

.pharma-news-box__link {
    display: block;
    font-size: 13px;
    color: #1a1a2e;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 3px;
}

.pharma-news-box__link:hover {
    color: #003087;
    text-decoration: underline;
}

.pharma-news-box__excerpt {
    font-size: 12px;
    color: #666;
    margin: 2px 0 4px;
    line-height: 1.4;
}

.pharma-news-box__meta {
    font-size: 11px;
    color: #999;
}

.pharma-news-box__meta time {
    color: #666;
}

/* ── Top navigation bar ──────────────────────────────────────────────────── */

#pnf-top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    background-color: #003087 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    min-height: 50px;
}

#pnf-top-nav .navbar-brand,
.pnf-nav-home {
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    padding-right: 1.5rem;
    border-right: 1px solid rgba(255,255,255,0.2);
    margin-right: 0.5rem;
}

#pnf-top-nav .nav-link {
    color: rgba(255, 255, 255, 0.80) !important;
    font-size: 0.78rem;
    padding: 0.5rem 0.65rem !important;
    transition: color 0.15s, background-color 0.15s;
    border-radius: 4px;
    white-space: nowrap;
}

#pnf-top-nav .nav-link:hover,
#pnf-top-nav .nav-link.active {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.12);
}

#pnf-top-nav .navbar-toggler {
    border-color: rgba(255,255,255,0.4);
}

#pnf-top-nav .navbar-toggler-icon {
    filter: invert(1);
}

/* ── Inner page (box-page template) ─────────────────────────────────────── */

.pnf-generated-description {
    background: #f8f9ff;
    border-left: 4px solid #003087;
    padding: 18px 20px;
    margin-bottom: 24px;
    border-radius: 0 4px 4px 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #333;
}

.pnf-generated-description p {
    margin-bottom: 12px;
}

.pnf-generated-description p:last-child {
    margin-bottom: 0;
}

.pnf-generated-description a {
    color: #003087;
    text-decoration: underline;
}

.pnf-generated-description a:hover {
    color: #0056d6;
}

.pnf-page-count {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 16px;
}

.pnf-page-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pnf-page-item {
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}

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

.pnf-page-item__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 5px;
    line-height: 1.4;
}

.pnf-page-item__link {
    color: #1a1a2e;
    text-decoration: none;
}

.pnf-page-item__link:hover {
    color: #003087;
    text-decoration: underline;
}

.pnf-page-item__excerpt {
    font-size: 0.88rem;
    color: #555;
    margin: 4px 0 6px;
    line-height: 1.5;
}

.pnf-page-item__meta {
    font-size: 0.78rem;
    color: #999;
}

.pnf-page-item__source {
    color: #777;
}

.pnf-no-news {
    color: #888;
    font-style: italic;
}

/* ── Admin image column (loaded only on admin pages) ─────────────────────── */
/* Note: actual admin styles live in assets/css/admin.css */
